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 #ifndef _ACCRESOURCE_HXX 23 #define _ACCRESOURCE_HXX 24 25 #ifndef _RTL_USTRING_HXX_ 26 #include <rtl/ustring.hxx> 27 #endif 28 29 class SimpleResMgr; 30 31 #define ACC_RES_STRING(id) ResourceManager::loadString(id) 32 33 //================================================================== 34 //= ResourceManager 35 //= handling ressources within the FormLayer library 36 //================================================================== 37 class ResourceManager 38 { 39 static SimpleResMgr* m_pImpl; 40 41 private: 42 // no instantiation allowed ResourceManager()43 ResourceManager() 44 { } ~ResourceManager()45 ~ResourceManager() 46 { } 47 48 // we'll instantiate one static member of the following class, which, in it's dtor, 49 // ensures that m_pImpl will be deleted 50 class EnsureDelete 51 { 52 public: EnsureDelete()53 EnsureDelete() 54 { } 55 ~EnsureDelete(); 56 }; 57 friend class EnsureDelete; 58 59 protected: 60 static void ensureImplExists(); 61 62 public: 63 /** loads the string with the specified resource id from the FormLayer resource file 64 */ 65 static ::rtl::OUString loadString(sal_uInt16 _nResId); 66 }; 67 68 69 #endif 70