1*3a700b0aSSteve Yin /************************************************************** 2*3a700b0aSSteve Yin * 3*3a700b0aSSteve Yin * Licensed to the Apache Software Foundation (ASF) under one 4*3a700b0aSSteve Yin * or more contributor license agreements. See the NOTICE file 5*3a700b0aSSteve Yin * distributed with this work for additional information 6*3a700b0aSSteve Yin * regarding copyright ownership. The ASF licenses this file 7*3a700b0aSSteve Yin * to you under the Apache License, Version 2.0 (the 8*3a700b0aSSteve Yin * "License"); you may not use this file except in compliance 9*3a700b0aSSteve Yin * with the License. You may obtain a copy of the License at 10*3a700b0aSSteve Yin * 11*3a700b0aSSteve Yin * http://www.apache.org/licenses/LICENSE-2.0 12*3a700b0aSSteve Yin * 13*3a700b0aSSteve Yin * Unless required by applicable law or agreed to in writing, 14*3a700b0aSSteve Yin * software distributed under the License is distributed on an 15*3a700b0aSSteve Yin * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*3a700b0aSSteve Yin * KIND, either express or implied. See the License for the 17*3a700b0aSSteve Yin * specific language governing permissions and limitations 18*3a700b0aSSteve Yin * under the License. 19*3a700b0aSSteve Yin * 20*3a700b0aSSteve Yin *************************************************************/ 215fdc4257SSteve Yin 225fdc4257SSteve Yin #include "AccResource.hxx" 235fdc4257SSteve Yin 245fdc4257SSteve Yin #include <tools/simplerm.hxx> 255fdc4257SSteve Yin 265fdc4257SSteve Yin // ---- needed as long as we have no contexts for components --- 275fdc4257SSteve Yin #include <vcl/svapp.hxx> 285fdc4257SSteve Yin 295fdc4257SSteve Yin //2009.04. Comment the following code because the acc resource is not necessary now. Can open them if necessary 305fdc4257SSteve Yin //#ifndef _TOOLS_INTN_HXX 315fdc4257SSteve Yin //#include <tools/intn.hxx> 325fdc4257SSteve Yin //#endif 335fdc4257SSteve Yin //#ifndef _SOLAR_HRC 345fdc4257SSteve Yin //#include <svtools/solar.hrc> 355fdc4257SSteve Yin //#endif 365fdc4257SSteve Yin 375fdc4257SSteve Yin //......................................................................... 385fdc4257SSteve Yin 395fdc4257SSteve Yin //================================================================== 405fdc4257SSteve Yin //= ResourceManager 415fdc4257SSteve Yin //================================================================== 425fdc4257SSteve Yin SimpleResMgr* ResourceManager::m_pImpl = NULL; 435fdc4257SSteve Yin 445fdc4257SSteve Yin //------------------------------------------------------------------ ~EnsureDelete()455fdc4257SSteve YinResourceManager::EnsureDelete::~EnsureDelete() 465fdc4257SSteve Yin { 475fdc4257SSteve Yin delete ResourceManager::m_pImpl; 485fdc4257SSteve Yin } 495fdc4257SSteve Yin 505fdc4257SSteve Yin //------------------------------------------------------------------ ensureImplExists()515fdc4257SSteve Yinvoid ResourceManager::ensureImplExists() 525fdc4257SSteve Yin { 535fdc4257SSteve Yin //Comment the following code because the acc resource is not necessary now. Can open them if necessary 545fdc4257SSteve Yin /* 555fdc4257SSteve Yin if (m_pImpl) 565fdc4257SSteve Yin return; 575fdc4257SSteve Yin 585fdc4257SSteve Yin LanguageType nType = Application::GetSettings().GetUILanguage(); 595fdc4257SSteve Yin 605fdc4257SSteve Yin ByteString sFileName("winaccessibility"); 615fdc4257SSteve Yin sFileName += ByteString::CreateFromInt32( (sal_Int32)SOLARUPD ); 625fdc4257SSteve Yin 635fdc4257SSteve Yin m_pImpl = SimpleResMgr::Create(sFileName.GetBuffer(), nType); 645fdc4257SSteve Yin 655fdc4257SSteve Yin if (m_pImpl) 665fdc4257SSteve Yin { 675fdc4257SSteve Yin // no that we have a impl class make sure it's deleted on unloading the library 685fdc4257SSteve Yin static ResourceManager::EnsureDelete s_aDeleteTheImplClas; 695fdc4257SSteve Yin } 705fdc4257SSteve Yin */ 715fdc4257SSteve Yin } 725fdc4257SSteve Yin 735fdc4257SSteve Yin //------------------------------------------------------------------ loadString(sal_uInt16 _nResId)745fdc4257SSteve Yin::rtl::OUString ResourceManager::loadString(sal_uInt16 _nResId) 755fdc4257SSteve Yin { 765fdc4257SSteve Yin ::rtl::OUString sReturn; 775fdc4257SSteve Yin 785fdc4257SSteve Yin ensureImplExists(); 795fdc4257SSteve Yin if (m_pImpl) 805fdc4257SSteve Yin sReturn = m_pImpl->ReadString(_nResId); 815fdc4257SSteve Yin 825fdc4257SSteve Yin return sReturn; 835fdc4257SSteve Yin } 845fdc4257SSteve Yin 855fdc4257SSteve Yin 86