1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_ESCAPEMENTITEM_HXX
20 #define INCLUDED_EDITENG_ESCAPEMENTITEM_HXX
22 #include <svl/cenumitm.hxx>
23 #include <editeng/svxenum.hxx>
24 #include <editeng/editengdllapi.h>
26 // class SvxEscapementItem -----------------------------------------------
28 #define DFLT_ESC_SUPER 33 // 1/3
29 #define DFLT_ESC_SUB -33 // also 1/3 previously 8/100
30 #define DFLT_ESC_PROP 58
31 #define DFLT_ESC_AUTO_SUPER 101
32 #define DFLT_ESC_AUTO_SUB -101
36 This item describes the writing position.
39 class EDITENG_DLLPUBLIC SvxEscapementItem
: public SfxEnumItemInterface
44 static SfxPoolItem
* CreateDefault();
46 explicit SvxEscapementItem( const sal_uInt16 nId
);
47 SvxEscapementItem( const SvxEscapement eEscape
,
48 const sal_uInt16 nId
);
49 SvxEscapementItem( const short nEsc
, const sal_uInt8 nProp
,
50 const sal_uInt16 nId
);
52 // "pure virtual Methods" from SfxPoolItem
53 virtual bool operator==( const SfxPoolItem
& ) const override
;
54 virtual bool GetPresentation( SfxItemPresentation ePres
,
57 OUString
&rText
, const IntlWrapper
& ) const override
;
59 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const override
;
60 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt8 nMemberId
) override
;
62 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
64 void SetEscapement( const SvxEscapement eNew
)
66 if( SvxEscapement::Off
== eNew
)
72 if( SvxEscapement::Superscript
== eNew
)
74 nEsc
= DFLT_ESC_SUPER
;
75 nProp
= DFLT_ESC_PROP
;
80 nProp
= DFLT_ESC_PROP
;
83 SvxEscapement
GetEscapement() const { return static_cast< SvxEscapement
>( GetEnumValue() ); }
85 short &GetEsc() { return nEsc
; }
86 short GetEsc() const { return nEsc
; }
88 sal_uInt8
&GetProportionalHeight() { return nProp
; }
89 sal_uInt8
GetProportionalHeight() const { return nProp
; }
91 virtual sal_uInt16
GetValueCount() const override
;
92 static OUString
GetValueTextByPos( sal_uInt16 nPos
);
93 virtual sal_uInt16
GetEnumValue() const override
;
94 virtual void SetEnumValue( sal_uInt16 nNewVal
) override
;
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */