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 _SVX_LSPCITEM_HXX
20 #define _SVX_LSPCITEM_HXX
22 #include <svl/eitem.hxx>
23 #include <editeng/svxenum.hxx>
24 #include <editeng/editengdllapi.h>
26 class SvXMLUnitConverter
;
28 // class SvxLineSpacingItem ----------------------------------------------
31 This item describes the distance between the lines.
34 #define LINE_SPACE_DEFAULT_HEIGHT 200
35 class EDITENG_DLLPUBLIC SvxLineSpacingItem
: public SfxEnumItemInterface
37 friend SvStream
& operator<<( SvStream
&, SvxLineSpacingItem
& ); //$ ostream
39 short nInterLineSpace
;
40 sal_uInt16 nLineHeight
;
41 sal_uInt8 nPropLineSpace
;
42 SvxLineSpace eLineSpace
;
43 SvxInterLineSpace eInterLineSpace
;
48 // The writer relies on a default height of 200! Actually, I would
49 // initialize all values to 0, but who can ignore the consequences in
50 // writer? => Rather have a crooked vales as the default, but the
51 // programmer sees that there's something special happening.
53 SvxLineSpacingItem( sal_uInt16 nHeight
/*= LINE_SPACE_DEFAULT_HEIGHT*/, const sal_uInt16 nId
);
55 // "pure virtual Methods" from SfxPoolItem
56 virtual int operator==( const SfxPoolItem
& ) const;
57 virtual bool QueryValue( com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const;
58 virtual bool PutValue( const com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 );
60 virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
61 SfxMapUnit eCoreMetric
,
62 SfxMapUnit ePresMetric
,
63 OUString
&rText
, const IntlWrapper
* = 0 ) const;
65 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
66 virtual SfxPoolItem
* Create(SvStream
&, sal_uInt16
) const;
67 virtual SvStream
& Store(SvStream
&, sal_uInt16 nItemVersion
) const;
69 // Methods to query and edit. InterlineSpace is added to the height.
70 inline short GetInterLineSpace() const { return nInterLineSpace
; }
71 inline void SetInterLineSpace( const short nSpace
)
73 nInterLineSpace
= nSpace
;
74 eInterLineSpace
= SVX_INTER_LINE_SPACE_FIX
;
77 // Determines the absolute or minimum row height.
78 inline sal_uInt16
GetLineHeight() const { return nLineHeight
; }
79 inline void SetLineHeight( const sal_uInt16 nHeight
)
81 nLineHeight
= nHeight
;
82 eLineSpace
= SVX_LINE_SPACE_MIN
;
85 // To increase or decrease the row height.
86 sal_uInt8
GetPropLineSpace() const { return nPropLineSpace
; }
87 inline void SetPropLineSpace( const sal_uInt8 nProp
)
89 nPropLineSpace
= nProp
;
90 eInterLineSpace
= SVX_INTER_LINE_SPACE_PROP
;
93 inline SvxLineSpace
&GetLineSpaceRule() { return eLineSpace
; }
94 inline SvxLineSpace
GetLineSpaceRule() const { return eLineSpace
; }
96 inline SvxInterLineSpace
&GetInterLineSpaceRule() { return eInterLineSpace
; }
97 inline SvxInterLineSpace
GetInterLineSpaceRule() const { return eInterLineSpace
; }
99 virtual sal_uInt16
GetValueCount() const;
100 virtual OUString
GetValueTextByPos( sal_uInt16 nPos
) const;
101 virtual sal_uInt16
GetEnumValue() const;
102 virtual void SetEnumValue( sal_uInt16 nNewVal
);
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */