Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_svx / lspcitem.hxx
blob9eecde758d782d85b00bd99be8a71b8a14b2302c
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: lspcitem.hxx,v $
10 * $Revision: 1.8 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SVX_LSPCITEM_HXX
31 #define _SVX_LSPCITEM_HXX
33 // include ---------------------------------------------------------------
35 #ifndef _SFXENUMITEM_HXX //autogen
36 #include <bf_svtools/eitem.hxx>
37 #endif
38 #ifndef _SVX_SVXENUM_HXX
39 #include <bf_svx/svxenum.hxx>
40 #endif
42 #ifndef _SVX_SVXIDS_HRC
43 #include <bf_svx/svxids.hrc>
44 #endif
46 namespace rtl
48 class OUString;
50 namespace binfilter {
51 class SvXMLUnitConverter;
52 // class SvxLineSpacingItem ----------------------------------------------
55 [Beschreibung]
56 Dieses Item beschreibt den Abstand zwischen den Zeilen.
59 class SvxLineSpacingItem : public SfxEnumItemInterface
61 friend SvStream& operator<<( SvStream&, SvxLineSpacingItem& ); //$ ostream
63 short nInterLineSpace;
64 USHORT nLineHeight;
65 BYTE nPropLineSpace;
66 SvxLineSpace eLineSpace;
67 SvxInterLineSpace eInterLineSpace;
69 public:
70 TYPEINFO();
72 // Der Writer verlaesst sich auf eine Default-Hoehe von 200!
73 // Eigentlich wuerde ich alle Werte mit 0 initialisieren, aber wer kann
74 // die Folgen beim Writer absehen ?
75 // => lieber einen krummen Wert als Default, aber der Programmierer
76 // sieht, dass dort etwas besonderes passiert.
77 SvxLineSpacingItem( USHORT nHeight = 200, const USHORT nId = ITEMID_LINESPACING );
79 // "pure virtual Methoden" vom SfxPoolItem
80 virtual int operator==( const SfxPoolItem& ) const;
81 virtual sal_Bool QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
82 virtual sal_Bool PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
85 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
86 virtual SfxPoolItem* Create(SvStream &, USHORT) const;
87 virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const;
89 // Methoden zum Abfragen und Aendern
90 // Interlinespace wird zur Hoehe addiert.
91 inline short GetInterLineSpace() const { return nInterLineSpace; }
92 inline void SetInterLineSpace( const short nSpace )
94 nInterLineSpace = nSpace;
95 eInterLineSpace = SVX_INTER_LINE_SPACE_FIX;
98 // Bestimmt absolute oder minimale Zeilenhoehe.
99 inline USHORT GetLineHeight() const { return nLineHeight; }
100 inline void SetLineHeight( const USHORT nHeight )
102 nLineHeight = nHeight;
103 eLineSpace = SVX_LINE_SPACE_MIN;
106 // Vergroessert oder verkleinert die Zeilenhoehe.
107 const BYTE GetPropLineSpace() const { return nPropLineSpace; }
108 inline void SetPropLineSpace( const BYTE nProp )
110 nPropLineSpace = nProp;
111 eInterLineSpace = SVX_INTER_LINE_SPACE_PROP;
114 inline SvxLineSpace &GetLineSpaceRule() { return eLineSpace; }
115 inline SvxLineSpace GetLineSpaceRule() const { return eLineSpace; }
117 inline SvxInterLineSpace &GetInterLineSpaceRule() { return eInterLineSpace; }
118 inline SvxInterLineSpace GetInterLineSpaceRule() const { return eInterLineSpace; }
120 virtual USHORT GetValueCount() const;
121 virtual String GetValueTextByPos( USHORT nPos ) const;
122 virtual USHORT GetEnumValue() const;
123 virtual void SetEnumValue( USHORT nNewVal );
126 }//end of namespace binfilter
127 #endif