Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _SVX_FONTITEM_HXX
29 : : #define _SVX_FONTITEM_HXX
30 : :
31 : : #include <svl/poolitem.hxx>
32 : : #include <tools/string.hxx>
33 : : #include <vcl/font.hxx>
34 : : #include "editeng/editengdllapi.h"
35 : :
36 : : class SvXMLUnitConverter;
37 : : namespace rtl
38 : : {
39 : : class OUString;
40 : : }
41 : :
42 : : // class SvxFontItem -----------------------------------------------------
43 : :
44 : : /* [Description]
45 : :
46 : : This item describes a Font.
47 : : */
48 : :
49 [ + - ][ + - ]: 1390436 : class EDITENG_DLLPUBLIC SvxFontItem : public SfxPoolItem
[ - + ][ + - ]
[ + - ]
50 : : {
51 : : String aFamilyName;
52 : : String aStyleName;
53 : : FontFamily eFamily;
54 : : FontPitch ePitch;
55 : : rtl_TextEncoding eTextEncoding;
56 : :
57 : : static sal_Bool bEnableStoreUnicodeNames;
58 : :
59 : : public:
60 : : TYPEINFO();
61 : :
62 : : SvxFontItem( const sal_uInt16 nId );
63 : : SvxFontItem( const FontFamily eFam, const String& rFamilyName,
64 : : const String& rStyleName,
65 : : const FontPitch eFontPitch /*= PITCH_DONTKNOW*/,
66 : : const rtl_TextEncoding eFontTextEncoding /*= RTL_TEXTENCODING_DONTKNOW*/,
67 : : const sal_uInt16 nId );
68 : :
69 : : // "pure virtual Methods" from SfxPoolItem
70 : : virtual int operator==( const SfxPoolItem& ) const;
71 : : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
72 : : virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
73 : : virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
74 : : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
75 : : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
76 : :
77 : : virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
78 : : SfxMapUnit eCoreMetric,
79 : : SfxMapUnit ePresMetric,
80 : : String &rText, const IntlWrapper * = 0 ) const;
81 : :
82 : : // Access methods:
83 : 13614 : void SetFamilyName( const String& rFamilyName ) { aFamilyName = rFamilyName; }
84 : 648861 : inline const String &GetFamilyName() const { return aFamilyName; }
85 : :
86 : 13614 : void SetStyleName(const String &rStyleName ) { aStyleName = rStyleName; }
87 : 75562 : inline const String &GetStyleName() const { return aStyleName; }
88 : :
89 : 13614 : void SetFamily( FontFamily _eFamily ) { eFamily = _eFamily; }
90 : 627541 : inline FontFamily GetFamily() const { return eFamily; }
91 : :
92 : 13614 : void SetPitch(FontPitch _ePitch ) { ePitch = _ePitch; }
93 : 627541 : inline FontPitch GetPitch() const { return ePitch; }
94 : :
95 : 13936 : void SetCharSet(rtl_TextEncoding _eEncoding) { eTextEncoding = _eEncoding; }
96 : :
97 : 629430 : inline rtl_TextEncoding GetCharSet() const { return eTextEncoding; }
98 : :
99 : : SvxFontItem& operator=(const SvxFontItem& rFont);
100 : :
101 : : static void EnableStoreUnicodeNames( sal_Bool bEnable );
102 : :
103 : : };
104 : :
105 : : EDITENG_DLLPUBLIC void GetDefaultFonts( SvxFontItem& rLatin, SvxFontItem& rAsian,
106 : : SvxFontItem& rComplex );
107 : :
108 : : #endif // #ifndef _SVX_FONTITEM_HXX
109 : :
110 : :
111 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|