1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fontitem.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SVX_FONTITEM_HXX
31 #define _SVX_FONTITEM_HXX
33 // include ---------------------------------------------------------------
35 #include <svtools/poolitem.hxx>
36 #include <tools/string.hxx>
37 #ifndef _FONT_HXX //autogen
38 #include <vcl/font.hxx>
40 #include "svx/svxdllapi.h"
42 class SvXMLUnitConverter
;
48 // class SvxFontItem -----------------------------------------------------
52 Dieses Item beschreibt einen Font.
55 class SVX_DLLPUBLIC SvxFontItem
: public SfxPoolItem
61 rtl_TextEncoding eTextEncoding
;
63 static BOOL bEnableStoreUnicodeNames
;
68 SvxFontItem( const USHORT nId
);
69 SvxFontItem( const FontFamily eFam
, const String
& rFamilyName
,
70 const String
& rStyleName
,
71 const FontPitch eFontPitch
/*= PITCH_DONTKNOW*/,
72 const rtl_TextEncoding eFontTextEncoding
/*= RTL_TEXTENCODING_DONTKNOW*/,
75 // "pure virtual Methoden" vom SfxPoolItem
76 virtual int operator==( const SfxPoolItem
& ) const;
77 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
78 virtual SfxPoolItem
* Create(SvStream
&, USHORT
) const;
79 virtual SvStream
& Store(SvStream
&, USHORT nItemVersion
) const;
80 virtual sal_Bool
QueryValue( com::sun::star::uno::Any
& rVal
, BYTE nMemberId
= 0 ) const;
81 virtual sal_Bool
PutValue( const com::sun::star::uno::Any
& rVal
, BYTE nMemberId
= 0 );
83 virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
84 SfxMapUnit eCoreMetric
,
85 SfxMapUnit ePresMetric
,
86 String
&rText
, const IntlWrapper
* = 0 ) const;
89 inline String
&GetFamilyName() { return aFamilyName
; }
90 inline const String
&GetFamilyName() const { return aFamilyName
; }
92 inline String
&GetStyleName() { return aStyleName
; }
93 inline const String
&GetStyleName() const { return aStyleName
; }
95 inline FontFamily
&GetFamily() { return eFamily
; }
96 inline FontFamily
GetFamily() const { return eFamily
; }
98 inline FontPitch
&GetPitch() { return ePitch
; }
99 inline FontPitch
GetPitch() const { return ePitch
; }
101 inline rtl_TextEncoding
&GetCharSet() { return eTextEncoding
; }
102 inline rtl_TextEncoding
GetCharSet() const { return eTextEncoding
; }
104 inline SvxFontItem
& operator=(const SvxFontItem
& rFont
)
106 aFamilyName
= rFont
.GetFamilyName();
107 aStyleName
= rFont
.GetStyleName();
108 eFamily
= rFont
.GetFamily();
109 ePitch
= rFont
.GetPitch();
110 eTextEncoding
= rFont
.GetCharSet();
114 static void EnableStoreUnicodeNames( BOOL bEnable
);
118 SVX_DLLPUBLIC
void GetDefaultFonts( SvxFontItem
& rLatin
, SvxFontItem
& rAsian
,
119 SvxFontItem
& rComplex
);
121 #endif // #ifndef _SVX_FONTITEM_HXX