LibreOffice Module editeng (master) 1
lspcitem.hxx
Go to the documentation of this file.
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_LSPCITEM_HXX
20#define INCLUDED_EDITENG_LSPCITEM_HXX
21
22#include <svl/cenumitm.hxx>
23#include <tools/mapunit.hxx>
24#include <editeng/svxenum.hxx>
26
27// class SvxLineSpacingItem ----------------------------------------------
28
29/* [Description]
30 This item describes the distance between the lines.
31*/
32
33#define LINE_SPACE_DEFAULT_HEIGHT 200
35{
37 sal_uInt16 nLineHeight;
38 sal_uInt16 nPropLineSpace;
41
42public:
43 static SfxPoolItem* CreateDefault();
44
45 // The writer relies on a default height of 200! Actually, I would
46 // initialize all values to 0, but who can ignore the consequences in
47 // writer? => Rather have a crooked vales as the default, but the
48 // programmer sees that there's something special happening.
49
50 SvxLineSpacingItem( sal_uInt16 nLineHeight /*= LINE_SPACE_DEFAULT_HEIGHT*/, const sal_uInt16 nId );
51
52 // "pure virtual Methods" from SfxPoolItem
53 virtual bool operator==( const SfxPoolItem& ) const override;
54 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
55 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
56
57 virtual bool GetPresentation( SfxItemPresentation ePres,
58 MapUnit eCoreMetric,
59 MapUnit ePresMetric,
60 OUString &rText, const IntlWrapper& ) const override;
61
62 virtual SvxLineSpacingItem* Clone( SfxItemPool *pPool = nullptr ) const override;
63
64 // Methods to query and edit. InterlineSpace is added to the height.
65 short GetInterLineSpace() const { return nInterLineSpace; }
66 void SetInterLineSpace( const short nSpace )
67 {
68 nInterLineSpace = nSpace;
69 eInterLineSpaceRule = SvxInterLineSpaceRule::Fix;
70 }
71
72 // Determines the absolute or minimum row height.
73 sal_uInt16 GetLineHeight() const { return nLineHeight; }
74 void SetLineHeight( const sal_uInt16 nHeight )
75 {
76 nLineHeight = nHeight;
77 eLineSpaceRule = SvxLineSpaceRule::Min;
78 }
79
80 // To increase or decrease the row height.
81 sal_uInt16 GetPropLineSpace() const { return nPropLineSpace; }
82 void SetPropLineSpace( const sal_uInt16 nProp )
83 {
84 nPropLineSpace = nProp;
85 eInterLineSpaceRule = SvxInterLineSpaceRule::Prop;
86 }
87
88 void SetLineSpaceRule(SvxLineSpaceRule e) { eLineSpaceRule = e; }
89 SvxLineSpaceRule GetLineSpaceRule() const { return eLineSpaceRule; }
90
91 void SetInterLineSpaceRule(SvxInterLineSpaceRule e) { eInterLineSpaceRule = e; }
92 SvxInterLineSpaceRule GetInterLineSpaceRule() const { return eInterLineSpaceRule; }
93
94 virtual sal_uInt16 GetValueCount() const override;
95 virtual sal_uInt16 GetEnumValue() const override;
96 virtual void SetEnumValue( sal_uInt16 nNewVal ) override;
97};
98
99#endif
100
101/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual sal_uInt16 GetValueCount() const=0
virtual sal_uInt16 GetEnumValue() const=0
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8) override
virtual bool operator==(const SfxPoolItem &rItem) const override
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8=0) const override
virtual bool GetPresentation(SfxItemPresentation, MapUnit, MapUnit, OUString &rText, const IntlWrapper &) const override
virtual void SetEnumValue(sal_uInt16 nValue)=0
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
void SetPropLineSpace(const sal_uInt16 nProp)
Definition: lspcitem.hxx:82
sal_uInt16 nLineHeight
Definition: lspcitem.hxx:37
void SetInterLineSpaceRule(SvxInterLineSpaceRule e)
Definition: lspcitem.hxx:91
SvxInterLineSpaceRule eInterLineSpaceRule
Definition: lspcitem.hxx:40
sal_uInt16 nPropLineSpace
Definition: lspcitem.hxx:38
sal_uInt16 GetPropLineSpace() const
Definition: lspcitem.hxx:81
SvxInterLineSpaceRule GetInterLineSpaceRule() const
Definition: lspcitem.hxx:92
SvxLineSpaceRule GetLineSpaceRule() const
Definition: lspcitem.hxx:89
SvxLineSpaceRule eLineSpaceRule
Definition: lspcitem.hxx:39
sal_uInt16 GetLineHeight() const
Definition: lspcitem.hxx:73
void SetLineSpaceRule(SvxLineSpaceRule e)
Definition: lspcitem.hxx:88
void SetLineHeight(const sal_uInt16 nHeight)
Definition: lspcitem.hxx:74
short GetInterLineSpace() const
Definition: lspcitem.hxx:65
void SetInterLineSpace(const short nSpace)
Definition: lspcitem.hxx:66
#define EDITENG_DLLPUBLIC
Definition: editengdllapi.h:28
MapUnit
SfxItemPresentation
SvxLineSpaceRule
Definition: svxenum.hxx:63
SvxInterLineSpaceRule
Definition: svxenum.hxx:70
unsigned char sal_uInt8