xref: /AOO42X/main/editeng/inc/editeng/fontitem.hxx (revision 9bce9b0d387299c68bd81d539e1478357a103de5)
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 _SVX_FONTITEM_HXX
24 #define _SVX_FONTITEM_HXX
25 
26 // include ---------------------------------------------------------------
27 
28 #include <svl/poolitem.hxx>
29 #include <tools/string.hxx>
30 #include <vcl/font.hxx>
31 #include "editeng/editengdllapi.h"
32 
33 class SvXMLUnitConverter;
34 namespace rtl
35 {
36     class OUString;
37 }
38 
39 // class SvxFontItem -----------------------------------------------------
40 
41 /*
42     [Beschreibung]
43     Dieses Item beschreibt einen Font.
44 */
45 
46 class EDITENG_DLLPUBLIC SvxFontItem : public SfxPoolItem
47 {
48     String  aFamilyName;
49     String  aStyleName;
50     FontFamily  eFamily;
51     FontPitch ePitch;
52     rtl_TextEncoding eTextEncoding;
53 
54     static sal_Bool bEnableStoreUnicodeNames;
55 
56 public:
57     TYPEINFO();
58 
59     SvxFontItem( const sal_uInt16 nId  );
60     SvxFontItem( const FontFamily eFam, const String& rFamilyName,
61         const String& rStyleName,
62         const FontPitch eFontPitch /*= PITCH_DONTKNOW*/,
63         const rtl_TextEncoding eFontTextEncoding /*= RTL_TEXTENCODING_DONTKNOW*/,
64         const sal_uInt16 nId  );
65 
66     // "pure virtual Methoden" vom SfxPoolItem
67     virtual int              operator==( const SfxPoolItem& ) const;
68     virtual SfxPoolItem*     Clone( SfxItemPool *pPool = 0 ) const;
69     virtual SfxPoolItem*     Create(SvStream &, sal_uInt16) const;
70     virtual SvStream&        Store(SvStream &, sal_uInt16 nItemVersion) const;
71     virtual sal_Bool             QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
72     virtual sal_Bool             PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
73 
74     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
75                                     SfxMapUnit eCoreMetric,
76                                     SfxMapUnit ePresMetric,
77                                     String &rText, const IntlWrapper * = 0 ) const;
78 
79     // ZugriffsMethoden:
SetFamilyName(const String & rFamilyName)80     void SetFamilyName( const String& rFamilyName ) { aFamilyName = rFamilyName; }
GetFamilyName() const81     inline const String &GetFamilyName() const { return aFamilyName; }
82 
SetStyleName(const String & rStyleName)83     void SetStyleName(const String &rStyleName ) { aStyleName = rStyleName; }
GetStyleName() const84     inline const String &GetStyleName() const { return aStyleName; }
85 
SetFamily(FontFamily _eFamily)86     void SetFamily( FontFamily _eFamily ) { eFamily = _eFamily; }
GetFamily() const87     inline FontFamily GetFamily() const { return eFamily; }
88 
SetPitch(FontPitch _ePitch)89     void SetPitch(FontPitch _ePitch ) { ePitch = _ePitch; }
GetPitch() const90     inline FontPitch GetPitch() const { return ePitch; }
91 
SetCharSet(rtl_TextEncoding _eEncoding)92     void SetCharSet(rtl_TextEncoding _eEncoding) { eTextEncoding = _eEncoding; }
93 
GetCharSet() const94     inline rtl_TextEncoding GetCharSet() const { return eTextEncoding; }
95 
96     SvxFontItem& operator=(const SvxFontItem& rFont);
97 
98     static void EnableStoreUnicodeNames( sal_Bool bEnable );
99 
100 };
101 
102 EDITENG_DLLPUBLIC void GetDefaultFonts( SvxFontItem& rLatin, SvxFontItem& rAsian,
103                         SvxFontItem& rComplex );
104 
105 #endif // #ifndef _SVX_FONTITEM_HXX
106