Branch libreoffice-5-0-4
[LibreOffice.git] / include / editeng / fontitem.hxx
blobf762256f65b5b71a80d33bea49e3ae471e70ba40
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_EDITENG_FONTITEM_HXX
20 #define INCLUDED_EDITENG_FONTITEM_HXX
22 #include <editeng/editengdllapi.h>
23 #include <rtl/ustring.hxx>
24 #include <svl/poolitem.hxx>
25 #include <vcl/font.hxx>
27 class SvXMLUnitConverter;
29 /** This item describes a Font.
31 class EDITENG_DLLPUBLIC SvxFontItem : public SfxPoolItem
33 OUString aFamilyName;
34 OUString aStyleName;
35 FontFamily eFamily;
36 FontPitch ePitch;
37 rtl_TextEncoding eTextEncoding;
39 static bool bEnableStoreUnicodeNames;
41 public:
42 TYPEINFO_OVERRIDE();
44 explicit SvxFontItem(const sal_uInt16 nId);
45 SvxFontItem(const FontFamily eFam, const OUString& rFamilyName,
46 const OUString& rStyleName,
47 const FontPitch eFontPitch /*= PITCH_DONTKNOW*/,
48 const rtl_TextEncoding eFontTextEncoding /*= RTL_TEXTENCODING_DONTKNOW*/,
49 const sal_uInt16 nId);
51 // "pure virtual Methods" from SfxPoolItem
52 virtual bool operator==(const SfxPoolItem& rItem) const SAL_OVERRIDE;
53 virtual SfxPoolItem* Clone(SfxItemPool *pPool = 0) const SAL_OVERRIDE;
54 virtual SfxPoolItem* Create(SvStream& rStream, sal_uInt16) const SAL_OVERRIDE;
55 virtual SvStream& Store(SvStream& rStream, sal_uInt16 nItemVersion) const SAL_OVERRIDE;
56 virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const SAL_OVERRIDE;
57 virtual bool PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId = 0) SAL_OVERRIDE;
59 virtual bool GetPresentation(SfxItemPresentation ePres,
60 SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric,
61 OUString &rText, const IntlWrapper* = 0) const SAL_OVERRIDE;
63 // Access methods:
64 void SetFamilyName(const OUString& rFamilyName)
66 aFamilyName = rFamilyName;
68 const OUString &GetFamilyName() const
70 return aFamilyName;
73 void SetStyleName(const OUString &rStyleName)
75 aStyleName = rStyleName;
77 const OUString &GetStyleName() const
79 return aStyleName;
82 void SetFamily(FontFamily _eFamily)
84 eFamily = _eFamily;
86 FontFamily GetFamily() const
88 return eFamily;
91 void SetPitch(FontPitch _ePitch)
93 ePitch = _ePitch;
95 FontPitch GetPitch() const
97 return ePitch;
100 void SetCharSet(rtl_TextEncoding _eEncoding)
102 eTextEncoding = _eEncoding;
104 rtl_TextEncoding GetCharSet() const
106 return eTextEncoding;
109 SvxFontItem& operator=(const SvxFontItem& rFont);
111 static void EnableStoreUnicodeNames(bool bEnable);
113 void dumpAsXml(struct _xmlTextWriter* pWriter) const SAL_OVERRIDE;
116 EDITENG_DLLPUBLIC void GetDefaultFonts(SvxFontItem& rLatin,
117 SvxFontItem& rAsian,
118 SvxFontItem& rComplex);
120 #endif // INCLUDED_EDITENG_FONTITEM_HXX
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */