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_EDITENG_FONTITEM_HXX
20 : #define INCLUDED_EDITENG_FONTITEM_HXX
21 :
22 : #include <editeng/editengdllapi.h>
23 : #include <rtl/ustring.hxx>
24 : #include <svl/poolitem.hxx>
25 : #include <vcl/font.hxx>
26 :
27 : class SvXMLUnitConverter;
28 :
29 : // class SvxFontItem -----------------------------------------------------
30 :
31 : /* [Description]
32 :
33 : This item describes a Font.
34 : */
35 :
36 2582288 : class EDITENG_DLLPUBLIC SvxFontItem : public SfxPoolItem
37 : {
38 : OUString aFamilyName;
39 : OUString aStyleName;
40 : FontFamily eFamily;
41 : FontPitch ePitch;
42 : rtl_TextEncoding eTextEncoding;
43 :
44 : static bool bEnableStoreUnicodeNames;
45 :
46 : public:
47 : TYPEINFO_OVERRIDE();
48 :
49 : explicit SvxFontItem( const sal_uInt16 nId );
50 : SvxFontItem( const FontFamily eFam, const OUString& rFamilyName,
51 : const OUString& rStyleName,
52 : const FontPitch eFontPitch /*= PITCH_DONTKNOW*/,
53 : const rtl_TextEncoding eFontTextEncoding /*= RTL_TEXTENCODING_DONTKNOW*/,
54 : const sal_uInt16 nId );
55 :
56 : // "pure virtual Methods" from SfxPoolItem
57 : virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
58 : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
59 : virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const SAL_OVERRIDE;
60 : virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const SAL_OVERRIDE;
61 : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
62 : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
63 :
64 : virtual bool GetPresentation( SfxItemPresentation ePres,
65 : SfxMapUnit eCoreMetric,
66 : SfxMapUnit ePresMetric,
67 : OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE;
68 :
69 : // Access methods:
70 30504 : void SetFamilyName( const OUString& rFamilyName ) { aFamilyName = rFamilyName; }
71 1451789 : const OUString &GetFamilyName() const { return aFamilyName; }
72 :
73 30504 : void SetStyleName(const OUString &rStyleName ) { aStyleName = rStyleName; }
74 523042 : const OUString &GetStyleName() const { return aStyleName; }
75 :
76 30504 : void SetFamily( FontFamily _eFamily ) { eFamily = _eFamily; }
77 1396679 : FontFamily GetFamily() const { return eFamily; }
78 :
79 30504 : void SetPitch(FontPitch _ePitch ) { ePitch = _ePitch; }
80 1396367 : FontPitch GetPitch() const { return ePitch; }
81 :
82 31172 : void SetCharSet(rtl_TextEncoding _eEncoding) { eTextEncoding = _eEncoding; }
83 :
84 1428677 : rtl_TextEncoding GetCharSet() const { return eTextEncoding; }
85 :
86 : SvxFontItem& operator=(const SvxFontItem& rFont);
87 :
88 : static void EnableStoreUnicodeNames( bool bEnable );
89 :
90 : };
91 :
92 : EDITENG_DLLPUBLIC void GetDefaultFonts( SvxFontItem& rLatin, SvxFontItem& rAsian,
93 : SvxFontItem& rComplex );
94 :
95 : #endif // INCLUDED_EDITENG_FONTITEM_HXX
96 :
97 :
98 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|