1*5fdc4257SSteve Yin /*************************************************************************
2*5fdc4257SSteve Yin  *
3*5fdc4257SSteve Yin  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*5fdc4257SSteve Yin  *
5*5fdc4257SSteve Yin  * Copyright IBM Corporation 2010.
6*5fdc4257SSteve Yin  * Copyright 2000, 2010 Oracle and/or its affiliates.
7*5fdc4257SSteve Yin  *
8*5fdc4257SSteve Yin  * OpenOffice.org - a multi-platform office productivity suite
9*5fdc4257SSteve Yin  *
10*5fdc4257SSteve Yin  * This file is part of OpenOffice.org.
11*5fdc4257SSteve Yin  *
12*5fdc4257SSteve Yin  * OpenOffice.org is free software: you can redistribute it and/or modify
13*5fdc4257SSteve Yin  * it under the terms of the GNU Lesser General Public License version 3
14*5fdc4257SSteve Yin  * only, as published by the Free Software Foundation.
15*5fdc4257SSteve Yin  *
16*5fdc4257SSteve Yin  * OpenOffice.org is distributed in the hope that it will be useful,
17*5fdc4257SSteve Yin  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18*5fdc4257SSteve Yin  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19*5fdc4257SSteve Yin  * GNU Lesser General Public License version 3 for more details
20*5fdc4257SSteve Yin  * (a copy is included in the LICENSE file that accompanied this code).
21*5fdc4257SSteve Yin  *
22*5fdc4257SSteve Yin  * You should have received a copy of the GNU Lesser General Public License
23*5fdc4257SSteve Yin  * version 3 along with OpenOffice.org.  If not, see
24*5fdc4257SSteve Yin  * <http://www.openoffice.org/license.html>
25*5fdc4257SSteve Yin  * for a copy of the LGPLv3 License.
26*5fdc4257SSteve Yin  *
27*5fdc4257SSteve Yin  ************************************************************************/
28*5fdc4257SSteve Yin 
29*5fdc4257SSteve Yin #include "AccResource.hxx"
30*5fdc4257SSteve Yin 
31*5fdc4257SSteve Yin #include <tools/simplerm.hxx>
32*5fdc4257SSteve Yin 
33*5fdc4257SSteve Yin // ---- needed as long as we have no contexts for components ---
34*5fdc4257SSteve Yin #include <vcl/svapp.hxx>
35*5fdc4257SSteve Yin 
36*5fdc4257SSteve Yin //2009.04. Comment the following code because the acc resource is not necessary now. Can open them if necessary
37*5fdc4257SSteve Yin //#ifndef _TOOLS_INTN_HXX
38*5fdc4257SSteve Yin //#include <tools/intn.hxx>
39*5fdc4257SSteve Yin //#endif
40*5fdc4257SSteve Yin //#ifndef _SOLAR_HRC
41*5fdc4257SSteve Yin //#include <svtools/solar.hrc>
42*5fdc4257SSteve Yin //#endif
43*5fdc4257SSteve Yin 
44*5fdc4257SSteve Yin //.........................................................................
45*5fdc4257SSteve Yin 
46*5fdc4257SSteve Yin //==================================================================
47*5fdc4257SSteve Yin //= ResourceManager
48*5fdc4257SSteve Yin //==================================================================
49*5fdc4257SSteve Yin SimpleResMgr* ResourceManager::m_pImpl = NULL;
50*5fdc4257SSteve Yin 
51*5fdc4257SSteve Yin //------------------------------------------------------------------
52*5fdc4257SSteve Yin ResourceManager::EnsureDelete::~EnsureDelete()
53*5fdc4257SSteve Yin {
54*5fdc4257SSteve Yin     delete ResourceManager::m_pImpl;
55*5fdc4257SSteve Yin }
56*5fdc4257SSteve Yin 
57*5fdc4257SSteve Yin //------------------------------------------------------------------
58*5fdc4257SSteve Yin void ResourceManager::ensureImplExists()
59*5fdc4257SSteve Yin {
60*5fdc4257SSteve Yin 	//Comment the following code because the acc resource is not necessary now. Can open them if necessary
61*5fdc4257SSteve Yin 	/*
62*5fdc4257SSteve Yin     if (m_pImpl)
63*5fdc4257SSteve Yin         return;
64*5fdc4257SSteve Yin 
65*5fdc4257SSteve Yin     LanguageType nType = Application::GetSettings().GetUILanguage();
66*5fdc4257SSteve Yin 
67*5fdc4257SSteve Yin     ByteString sFileName("winaccessibility");
68*5fdc4257SSteve Yin     sFileName += ByteString::CreateFromInt32( (sal_Int32)SOLARUPD );
69*5fdc4257SSteve Yin 
70*5fdc4257SSteve Yin     m_pImpl = SimpleResMgr::Create(sFileName.GetBuffer(), nType);
71*5fdc4257SSteve Yin 
72*5fdc4257SSteve Yin     if (m_pImpl)
73*5fdc4257SSteve Yin     {
74*5fdc4257SSteve Yin         // no that we have a impl class make sure it's deleted on unloading the library
75*5fdc4257SSteve Yin         static ResourceManager::EnsureDelete	s_aDeleteTheImplClas;
76*5fdc4257SSteve Yin     }
77*5fdc4257SSteve Yin   */
78*5fdc4257SSteve Yin }
79*5fdc4257SSteve Yin 
80*5fdc4257SSteve Yin //------------------------------------------------------------------
81*5fdc4257SSteve Yin ::rtl::OUString ResourceManager::loadString(sal_uInt16 _nResId)
82*5fdc4257SSteve Yin {
83*5fdc4257SSteve Yin     ::rtl::OUString sReturn;
84*5fdc4257SSteve Yin 
85*5fdc4257SSteve Yin     ensureImplExists();
86*5fdc4257SSteve Yin     if (m_pImpl)
87*5fdc4257SSteve Yin         sReturn = m_pImpl->ReadString(_nResId);
88*5fdc4257SSteve Yin 
89*5fdc4257SSteve Yin     return sReturn;
90*5fdc4257SSteve Yin }
91*5fdc4257SSteve Yin 
92*5fdc4257SSteve Yin 
93