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