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_ALGITEM_HXX
20 #define _SVX_ALGITEM_HXX
22 #include <svx/svxids.hrc>
23 #include <svl/poolitem.hxx>
24 #include <svl/eitem.hxx>
25 #include <editeng/svxenum.hxx>
26 #include "svx/svxdllapi.h"
30 //------------------------------------------------------------------------
32 class SVX_DLLPUBLIC SvxOrientationItem
: public SfxEnumItem
38 const SvxCellOrientation eOrientation
/*= SVX_ORIENTATION_STANDARD*/,
39 const sal_uInt16 nId
);
42 sal_Int32 nRotation
, sal_Bool bStacked
,
43 const sal_uInt16 nId
);
45 virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
46 SfxMapUnit eCoreMetric
,
47 SfxMapUnit ePresMetric
,
48 OUString
&rText
, const IntlWrapper
* = 0 ) const;
50 virtual bool QueryValue( com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const;
51 virtual bool PutValue( const com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 );
53 virtual sal_uInt16
GetValueCount() const;
54 virtual String
GetValueText( sal_uInt16 nVal
) const;
55 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
56 virtual SfxPoolItem
* Create( SvStream
& rStream
, sal_uInt16 nVer
) const;
58 inline SvxOrientationItem
& operator=(const SvxOrientationItem
& rOrientation
)
60 SetValue( rOrientation
.GetValue() );
64 /** Returns sal_True, if the item represents STACKED state. */
65 sal_Bool
IsStacked() const;
66 /** Returns the rotation this item represents (returns nStdAngle for STANDARD and STACKED state). */
67 sal_Int32
GetRotation( sal_Int32 nStdAngle
= 0 ) const;
68 /** Fills this item according to passed item values. */
69 void SetFromRotation( sal_Int32 nRotation
, sal_Bool bStacked
);
72 //------------------------------------------------------------------------
74 class SVX_DLLPUBLIC SvxMarginItem
: public SfxPoolItem
76 sal_Int16 nLeftMargin
;
78 sal_Int16 nRightMargin
;
79 sal_Int16 nBottomMargin
;
82 SvxMarginItem( const sal_uInt16 nId
);
83 SvxMarginItem( sal_Int16 nLeft
, sal_Int16 nTop
/*= 0*/,
84 sal_Int16 nRight
/*= 0*/, sal_Int16 nBottom
/*= 0*/,
85 const sal_uInt16 nId
);
86 SvxMarginItem( const SvxMarginItem
& );
88 virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
89 SfxMapUnit eCoreMetric
,
90 SfxMapUnit ePresMetric
,
91 OUString
&rText
, const IntlWrapper
* = 0 ) const;
93 virtual int operator==( const SfxPoolItem
& ) const;
94 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
95 virtual SfxPoolItem
* Create( SvStream
& rStream
, sal_uInt16 nVer
) const;
96 virtual SvStream
& Store( SvStream
&, sal_uInt16 nItemVersion
) const;
98 virtual bool QueryValue( com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const;
99 virtual bool PutValue( const com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 );
101 sal_Int16
GetLeftMargin() const {return nLeftMargin
; }
102 sal_Bool
SetLeftMargin(sal_Int16 nLeft
);
103 sal_Int16
GetTopMargin() const {return nTopMargin
; }
104 sal_Bool
SetTopMargin(sal_Int16 nTop
);
105 sal_Int16
GetRightMargin() const {return nRightMargin
; }
106 sal_Bool
SetRightMargin(sal_Int16 nRight
);
107 sal_Int16
GetBottomMargin() const {return nBottomMargin
; }
108 sal_Bool
SetBottomMargin(sal_Int16 nBottom
);
110 inline SvxMarginItem
& operator=(const SvxMarginItem
& rMargin
)
112 nLeftMargin
= rMargin
.nLeftMargin
;
113 nTopMargin
= rMargin
.nTopMargin
;
114 nRightMargin
= rMargin
.nRightMargin
;
115 nBottomMargin
= rMargin
.nBottomMargin
;
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */