nss: upgrade to release 3.73
[LibreOffice.git] / include / editeng / fhgtitem.hxx
blobf5b8ac3f9672f497485bce689558c8172d8e6760
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_FHGTITEM_HXX
20 #define INCLUDED_EDITENG_FHGTITEM_HXX
22 #include <svl/poolitem.hxx>
23 #include <tools/debug.hxx>
24 #include <tools/solar.h>
25 #include <editeng/editengdllapi.h>
27 // class SvxFontHeightItem -----------------------------------------------
29 // Warning: twips values
31 /* [Description]
33 This item describes the font height
36 constexpr sal_uInt16 FONTHEIGHT_16_VERSION = 0x0001;
37 constexpr sal_uInt16 FONTHEIGHT_UNIT_VERSION = 0x0002;
39 class EDITENG_DLLPUBLIC SvxFontHeightItem final : public SfxPoolItem
41 sal_uInt32 nHeight;
42 sal_uInt16 nProp; // default 100%
43 MapUnit ePropUnit; // Percent, Twip, ...
45 private:
46 friend void Create_legacy_direct_set(SvxFontHeightItem& rItem, sal_uInt32 nH, sal_uInt16 nP, MapUnit eP);
47 void legacy_direct_set(sal_uInt32 nH, sal_uInt16 nP, MapUnit eP) { nHeight = nH; nProp = nP; ePropUnit = eP; }
49 public:
50 static SfxPoolItem* CreateDefault();
52 SvxFontHeightItem( const sal_uLong nSz /*= 240*/, const sal_uInt16 nPropHeight /*= 100*/,
53 const sal_uInt16 nId );
55 // "pure virtual Methods" from SfxPoolItem
56 virtual bool operator==( const SfxPoolItem& ) const override;
57 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
58 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
60 virtual bool GetPresentation( SfxItemPresentation ePres,
61 MapUnit eCoreMetric,
62 MapUnit ePresMetric,
63 OUString &rText, const IntlWrapper& ) const override;
65 virtual SvxFontHeightItem* Clone( SfxItemPool *pPool = nullptr ) const override;
66 virtual void ScaleMetrics( tools::Long nMult, tools::Long nDiv ) override;
67 virtual bool HasMetrics() const override;
69 void SetHeight( sal_uInt32 nNewHeight, const sal_uInt16 nNewProp = 100,
70 MapUnit eUnit = MapUnit::MapRelative );
72 void SetHeight( sal_uInt32 nNewHeight, sal_uInt16 nNewProp,
73 MapUnit eUnit, MapUnit eCoreUnit );
75 sal_uInt32 GetHeight() const { return nHeight; }
77 void SetProp( sal_uInt16 nNewProp, MapUnit eUnit )
79 DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" );
80 nProp = nNewProp;
81 ePropUnit = eUnit;
84 sal_uInt16 GetProp() const { return nProp; }
86 MapUnit GetPropUnit() const { return ePropUnit; } // Percent, Twip, ...
88 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
91 #endif
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */