xref: /aoo41x/main/svx/inc/svx/algitem.hxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir #ifndef _SVX_ALGITEM_HXX
28*cdf0e10cSrcweir #define _SVX_ALGITEM_HXX
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir // include ---------------------------------------------------------------
31*cdf0e10cSrcweir 
32*cdf0e10cSrcweir #include <svx/svxids.hrc>
33*cdf0e10cSrcweir #include <svl/poolitem.hxx>
34*cdf0e10cSrcweir #include <svl/eitem.hxx>
35*cdf0e10cSrcweir #include <editeng/svxenum.hxx>
36*cdf0e10cSrcweir #include "svx/svxdllapi.h"
37*cdf0e10cSrcweir 
38*cdf0e10cSrcweir class SvStream;
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir //------------------------------------------------------------------------
41*cdf0e10cSrcweir 
42*cdf0e10cSrcweir 
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir class SVX_DLLPUBLIC SvxHorJustifyItem: public SfxEnumItem
45*cdf0e10cSrcweir {
46*cdf0e10cSrcweir public:
47*cdf0e10cSrcweir 	TYPEINFO();
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir     SvxHorJustifyItem( const sal_uInt16 nId );
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir     SvxHorJustifyItem(
52*cdf0e10cSrcweir         const SvxCellHorJustify eJustify /*= SVX_HOR_JUSTIFY_STANDARD*/,
53*cdf0e10cSrcweir         const sal_uInt16 nId );
54*cdf0e10cSrcweir 
55*cdf0e10cSrcweir 	virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
56*cdf0e10cSrcweir 									SfxMapUnit eCoreMetric,
57*cdf0e10cSrcweir 									SfxMapUnit ePresMetric,
58*cdf0e10cSrcweir                                     String &rText, const IntlWrapper * = 0 ) const;
59*cdf0e10cSrcweir 
60*cdf0e10cSrcweir 	virtual	sal_Bool        	 QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
61*cdf0e10cSrcweir 	virtual	sal_Bool			 PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir 	virtual sal_uInt16          GetValueCount() const;
64*cdf0e10cSrcweir 	virtual String          GetValueText( sal_uInt16 nVal ) const;
65*cdf0e10cSrcweir 	virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const;
66*cdf0e10cSrcweir 	virtual SfxPoolItem*    Create( SvStream& rStream, sal_uInt16 nVer ) const;
67*cdf0e10cSrcweir 
68*cdf0e10cSrcweir 	inline  SvxHorJustifyItem& operator=(const SvxHorJustifyItem& rHorJustify)
69*cdf0e10cSrcweir 			{
70*cdf0e10cSrcweir 				SetValue( rHorJustify.GetValue() );
71*cdf0e10cSrcweir 				return *this;
72*cdf0e10cSrcweir 			}
73*cdf0e10cSrcweir };
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir //------------------------------------------------------------------------
77*cdf0e10cSrcweir 
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir class SVX_DLLPUBLIC SvxVerJustifyItem: public SfxEnumItem
80*cdf0e10cSrcweir {
81*cdf0e10cSrcweir public:
82*cdf0e10cSrcweir 	TYPEINFO();
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir     SvxVerJustifyItem( const sal_uInt16 nId  );
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir     SvxVerJustifyItem(
87*cdf0e10cSrcweir         const SvxCellVerJustify eJustify /*= SVX_VER_JUSTIFY_STANDARD*/,
88*cdf0e10cSrcweir         const sal_uInt16 nId  );
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir 	virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
91*cdf0e10cSrcweir 									SfxMapUnit eCoreMetric,
92*cdf0e10cSrcweir 									SfxMapUnit ePresMetric,
93*cdf0e10cSrcweir                                     String &rText, const IntlWrapper * = 0 ) const;
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir 	virtual	sal_Bool        	 QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
96*cdf0e10cSrcweir 	virtual	sal_Bool			 PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
97*cdf0e10cSrcweir 
98*cdf0e10cSrcweir 	virtual sal_uInt16          GetValueCount() const;
99*cdf0e10cSrcweir 	virtual String          GetValueText( sal_uInt16 nVal ) const;
100*cdf0e10cSrcweir 	virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const;
101*cdf0e10cSrcweir 	virtual SfxPoolItem*    Create( SvStream& rStream, sal_uInt16 nVer ) const;
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir 	inline  SvxVerJustifyItem& operator=(const SvxVerJustifyItem& rVerJustify)
104*cdf0e10cSrcweir 			{
105*cdf0e10cSrcweir 				SetValue( rVerJustify.GetValue() );
106*cdf0e10cSrcweir 				return *this;
107*cdf0e10cSrcweir 			}
108*cdf0e10cSrcweir };
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir 
111*cdf0e10cSrcweir //------------------------------------------------------------------------
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir class SVX_DLLPUBLIC SvxOrientationItem: public SfxEnumItem
114*cdf0e10cSrcweir {
115*cdf0e10cSrcweir public:
116*cdf0e10cSrcweir 	TYPEINFO();
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir 	SvxOrientationItem(
119*cdf0e10cSrcweir         const SvxCellOrientation eOrientation /*= SVX_ORIENTATION_STANDARD*/,
120*cdf0e10cSrcweir         const sal_uInt16 nId );
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir     SvxOrientationItem(
123*cdf0e10cSrcweir         sal_Int32 nRotation, sal_Bool bStacked,
124*cdf0e10cSrcweir         const sal_uInt16 nId );
125*cdf0e10cSrcweir 
126*cdf0e10cSrcweir 	virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
127*cdf0e10cSrcweir 									SfxMapUnit eCoreMetric,
128*cdf0e10cSrcweir 									SfxMapUnit ePresMetric,
129*cdf0e10cSrcweir                                     String &rText, const IntlWrapper * = 0 ) const;
130*cdf0e10cSrcweir 
131*cdf0e10cSrcweir 	virtual	sal_Bool        	 QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
132*cdf0e10cSrcweir 	virtual	sal_Bool			 PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir 	virtual sal_uInt16          GetValueCount() const;
135*cdf0e10cSrcweir 	virtual String          GetValueText( sal_uInt16 nVal ) const;
136*cdf0e10cSrcweir 	virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const;
137*cdf0e10cSrcweir 	virtual SfxPoolItem*    Create( SvStream& rStream, sal_uInt16 nVer ) const;
138*cdf0e10cSrcweir 
139*cdf0e10cSrcweir 	inline  SvxOrientationItem& operator=(const SvxOrientationItem& rOrientation)
140*cdf0e10cSrcweir 			{
141*cdf0e10cSrcweir 				SetValue( rOrientation.GetValue() );
142*cdf0e10cSrcweir 				return *this;
143*cdf0e10cSrcweir 			}
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir     /** Returns sal_True, if the item represents STACKED state. */
146*cdf0e10cSrcweir     sal_Bool                    IsStacked() const;
147*cdf0e10cSrcweir     /** Returns the rotation this item represents (returns nStdAngle for STANDARD and STACKED state). */
148*cdf0e10cSrcweir     sal_Int32                   GetRotation( sal_Int32 nStdAngle = 0 ) const;
149*cdf0e10cSrcweir     /** Fills this item according to passed item values. */
150*cdf0e10cSrcweir     void                    SetFromRotation( sal_Int32 nRotation, sal_Bool bStacked );
151*cdf0e10cSrcweir };
152*cdf0e10cSrcweir 
153*cdf0e10cSrcweir //------------------------------------------------------------------------
154*cdf0e10cSrcweir 
155*cdf0e10cSrcweir class SVX_DLLPUBLIC SvxMarginItem: public SfxPoolItem
156*cdf0e10cSrcweir {
157*cdf0e10cSrcweir 	sal_Int16       nLeftMargin;
158*cdf0e10cSrcweir 	sal_Int16       nTopMargin;
159*cdf0e10cSrcweir 	sal_Int16       nRightMargin;
160*cdf0e10cSrcweir 	sal_Int16       nBottomMargin;
161*cdf0e10cSrcweir public:
162*cdf0e10cSrcweir 	TYPEINFO();
163*cdf0e10cSrcweir     SvxMarginItem( const sal_uInt16 nId  );
164*cdf0e10cSrcweir     SvxMarginItem( sal_Int16 nLeft, sal_Int16 nTop /*= 0*/,
165*cdf0e10cSrcweir                    sal_Int16 nRight /*= 0*/, sal_Int16 nBottom /*= 0*/,
166*cdf0e10cSrcweir                    const sal_uInt16 nId  );
167*cdf0e10cSrcweir 	SvxMarginItem( const SvxMarginItem& );
168*cdf0e10cSrcweir 
169*cdf0e10cSrcweir 	virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
170*cdf0e10cSrcweir 									SfxMapUnit eCoreMetric,
171*cdf0e10cSrcweir 									SfxMapUnit ePresMetric,
172*cdf0e10cSrcweir                                     String &rText, const IntlWrapper * = 0 ) const;
173*cdf0e10cSrcweir 
174*cdf0e10cSrcweir 	virtual int              operator==( const SfxPoolItem& ) const;
175*cdf0e10cSrcweir 	virtual SfxPoolItem*     Clone( SfxItemPool *pPool = 0 ) const;
176*cdf0e10cSrcweir 	virtual SfxPoolItem*     Create( SvStream& rStream, sal_uInt16 nVer ) const;
177*cdf0e10cSrcweir 	virtual SvStream&		 Store( SvStream&, sal_uInt16 nItemVersion ) const;
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir 	virtual	sal_Bool        	 QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
180*cdf0e10cSrcweir 	virtual	sal_Bool			 PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
181*cdf0e10cSrcweir 
182*cdf0e10cSrcweir 			sal_Int16           GetLeftMargin() const {return nLeftMargin; }
183*cdf0e10cSrcweir 			sal_Bool            SetLeftMargin(sal_Int16 nLeft);
184*cdf0e10cSrcweir 			sal_Int16           GetTopMargin() const {return nTopMargin; }
185*cdf0e10cSrcweir 			sal_Bool            SetTopMargin(sal_Int16 nTop);
186*cdf0e10cSrcweir 			sal_Int16           GetRightMargin() const {return nRightMargin; }
187*cdf0e10cSrcweir 			sal_Bool            SetRightMargin(sal_Int16 nRight);
188*cdf0e10cSrcweir 			sal_Int16           GetBottomMargin() const {return nBottomMargin; }
189*cdf0e10cSrcweir 			sal_Bool            SetBottomMargin(sal_Int16 nBottom);
190*cdf0e10cSrcweir 
191*cdf0e10cSrcweir 	inline  SvxMarginItem& operator=(const SvxMarginItem& rMargin)
192*cdf0e10cSrcweir 			{
193*cdf0e10cSrcweir 				nLeftMargin = rMargin.nLeftMargin;
194*cdf0e10cSrcweir 				nTopMargin = rMargin.nTopMargin;
195*cdf0e10cSrcweir 				nRightMargin = rMargin.nRightMargin;
196*cdf0e10cSrcweir 				nBottomMargin = rMargin.nBottomMargin;
197*cdf0e10cSrcweir 				return *this;
198*cdf0e10cSrcweir 			}
199*cdf0e10cSrcweir };
200*cdf0e10cSrcweir 
201*cdf0e10cSrcweir #endif
202*cdf0e10cSrcweir 
203