1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _SVL_SVLDATA_HXX 25 #define _SVL_SVLDATA_HXX 26 27 #include <tools/simplerm.hxx> 28 29 class SfxItemPool; 30 31 //============================================================================ 32 class ImpSvlData 33 { 34 public: 35 const SfxItemPool * pStoringPool; 36 void* m_pThreadsafeRMs; 37 // one SimpleResMgr for each language for which a resource was requested 38 // (When using the 'non-simple' resmgr, the first request for any language wins, any 39 // further request for any other language supply the resmgr of the first call. 40 // For the simple resmgr we have a mgr for each language ever requested). 41 42 private: ImpSvlData()43 ImpSvlData(): 44 pStoringPool(0), m_pThreadsafeRMs(NULL) 45 {} 46 47 ~ImpSvlData(); 48 49 public: 50 SimpleResMgr * GetSimpleRM(const ::com::sun::star::lang::Locale& rLocale); 51 static ImpSvlData & GetSvlData(); 52 }; 53 54 //============================================================================ 55 class SvtSimpleResId 56 { 57 String m_sValue; 58 59 public: SvtSimpleResId(sal_uInt16 nId,const::com::sun::star::lang::Locale aLocale)60 SvtSimpleResId(sal_uInt16 nId, const ::com::sun::star::lang::Locale aLocale) : m_sValue(ImpSvlData::GetSvlData().GetSimpleRM(aLocale)->ReadString(nId)) { }; 61 operator String() const62 operator String () const { return m_sValue; } 63 }; 64 65 66 67 #endif // _SVL_SVLDATA_HXX 68 69