Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef INCLUDED_SW_SOURCE_CORE_INC_SWFNTCCH_HXX
20 : #define INCLUDED_SW_SOURCE_CORE_INC_SWFNTCCH_HXX
21 :
22 : #include <tools/mempool.hxx>
23 :
24 : #define NUM_DEFAULT_VALUES 39
25 :
26 : #include "swcache.hxx"
27 : #include "swfont.hxx"
28 :
29 : class SwViewShell;
30 : class SfxPoolItem;
31 :
32 59 : class SwFontCache : public SwCache
33 : {
34 : public:
35 :
36 59 : inline SwFontCache() : SwCache(50
37 : #ifdef DBG_UTIL
38 : , "Global AttributSet/Font-Cache pSwFontCache"
39 : #endif
40 59 : ) {}
41 :
42 : };
43 :
44 : // AttributSet/Font-Cache, globale Variable, in FontCache.Cxx angelegt
45 : extern SwFontCache *pSwFontCache;
46 :
47 : class SwFontObj : public SwCacheObj
48 : {
49 : friend class SwFontAccess;
50 :
51 : private:
52 : SwFont aSwFont;
53 : const SfxPoolItem* pDefaultArray[ NUM_DEFAULT_VALUES ];
54 :
55 : public:
56 9308 : DECL_FIXEDMEMPOOL_NEWDEL(SwFontObj)
57 :
58 : SwFontObj( const void* pOwner, SwViewShell *pSh );
59 :
60 : virtual ~SwFontObj();
61 :
62 216676 : inline SwFont& GetFont() { return aSwFont; }
63 : inline const SwFont& GetFont() const { return aSwFont; }
64 185270 : inline const SfxPoolItem** GetDefault() { return pDefaultArray; }
65 : };
66 :
67 216676 : class SwFontAccess : public SwCacheAccess
68 : {
69 : SwViewShell *pShell;
70 : protected:
71 : virtual SwCacheObj *NewObj( ) SAL_OVERRIDE;
72 :
73 : public:
74 : SwFontAccess( const void *pOwner, SwViewShell *pSh );
75 : SwFontObj *Get();
76 : };
77 :
78 : #endif
79 :
80 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|