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