xref: /aoo41x/main/sfx2/inc/resmgr.hxx (revision 353d8f4d)
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 _SFX_RESMGR_HXX
24 #define _SFX_RESMGR_HXX
25 
26 #include <sfx2/minarray.hxx>
27 
28 class SfxMessageDescription;
29 class SfxMessageTable;
30 class Bitmap;
31 class ResMgr;
32 
33 DECL_PTRARRAY(SfxResMgrArr, ResMgr *, 1, 1);
34 
35 // INCLUDE ---------------------------------------------------------------
36 
37 class SfxResourceManager
38 {
39 	SfxResMgrArr 				aResMgrArr;
40 	SfxResMgrArr 				aResMgrBmpArr;
41 	sal_uInt16		 				nEnterCount;
42 	SfxMessageTable*			pMessageTable;
43 
44 private:
45 	void						ClearMsgTable_Impl();
46 	SfxMessageDescription*		MakeDesc_Impl(sal_uInt16);
47 
48 public:
49 								SfxResourceManager();
50 								~SfxResourceManager();
51 
52 	sal_uInt16						RegisterResource( const	char *pFileName);
53 	void						ReleaseResource( sal_uInt16	nRegisterId	);
54 
55 	sal_uInt16						RegisterBitmap(const char *pMono, const char *pColor);
56 
57 	sal_uInt16						RegisterBitmap(	const char *pSingleFile	);
58 	void						ReleaseBitmap( sal_uInt16 nRegisterId );
59 
60 	Bitmap						GetAllBitmap( sal_uInt16 nBmpsPerRow );
61 
62 	void						Enter();
63 	void						Leave();
64 	SfxMessageDescription*		CreateDescription( sal_uInt16 nId );
65 };
66 
67 
68 #define SFX_RESMANAGER() SFX_APP()->GetResourceManager()
69 
70 #endif
71 
72