xref: /trunk/main/sw/source/core/inc/swfntcch.hxx (revision 1d2dbeb0)
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 _SWFNTCCH_HXX
24 #define _SWFNTCCH_HXX
25 
26 #include <tools/mempool.hxx>
27 
28 #define NUM_DEFAULT_VALUES 36
29 
30 #include "swcache.hxx"
31 #include "swfont.hxx"
32 
33 class ViewShell;
34 class SfxPoolItem;
35 
36 /*************************************************************************
37  *                      class SwFontCache
38  *************************************************************************/
39 
40 class SwFontCache : public SwCache
41 {
42 public:
43 
SwFontCache()44 	inline SwFontCache() : SwCache(50,50
45 #ifdef DBG_UTIL
46 	, "Globaler AttributSet/Font-Cache pSwFontCache"
47 #endif
48 	) {}
49 
50 };
51 
52 // AttributSet/Font-Cache, globale Variable, in FontCache.Cxx angelegt
53 extern SwFontCache *pSwFontCache;
54 
55 /*************************************************************************
56  *                      class SwFontObj
57  *************************************************************************/
58 
59 class SwFontObj : public SwCacheObj
60 {
61 	friend class SwFontAccess;
62 
63 private:
64 	SwFont aSwFont;
65     const SfxPoolItem* pDefaultArray[ NUM_DEFAULT_VALUES ];
66 
67 public:
68 	DECL_FIXEDMEMPOOL_NEWDEL(SwFontObj)
69 
70 	SwFontObj( const void* pOwner, ViewShell *pSh );
71 
72 	virtual ~SwFontObj();
73 
GetFont()74 	inline 		 SwFont *GetFont()		{ return &aSwFont; }
GetFont() const75 	inline const SwFont *GetFont() const  { return &aSwFont; }
GetDefault()76     inline const SfxPoolItem** GetDefault() { return pDefaultArray; }
77 };
78 
79 /*************************************************************************
80  *                      class SwFontAccess
81  *************************************************************************/
82 
83 
84 class SwFontAccess : public SwCacheAccess
85 {
86 	ViewShell *pShell;
87 protected:
88 	virtual SwCacheObj *NewObj( );
89 
90 public:
91 	SwFontAccess( const void *pOwner, ViewShell *pSh );
92 	SwFontObj *Get();
93 };
94 
95 #endif
96