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 INCLUDED_SVX_ALGITEM_HXX
20 #define INCLUDED_SVX_ALGITEM_HXX
22 #include <com/sun/star/uno/Any.hxx>
23 #include <editeng/svxenum.hxx>
24 #include <rtl/ustring.hxx>
25 #include <sal/types.h>
26 #include <svl/poolitem.hxx>
27 #include <svl/eitem.hxx>
28 #include <svx/svxdllapi.h>
34 class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxOrientationItem
: public SfxEnumItem
<SvxCellOrientation
>
38 const SvxCellOrientation eOrientation
/*= SVX_ORIENTATION_STANDARD*/,
39 const sal_uInt16 nId
);
42 sal_Int32 nRotation
, bool bStacked
,
43 const sal_uInt16 nId
);
45 virtual bool GetPresentation( SfxItemPresentation ePres
,
48 OUString
&rText
, const IntlWrapper
* = nullptr ) const override
;
50 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const override
;
51 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt8 nMemberId
) override
;
53 virtual sal_uInt16
GetValueCount() const override
;
54 static OUString
GetValueText( sal_uInt16 nVal
);
55 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
56 virtual SfxPoolItem
* Create( SvStream
& rStream
, sal_uInt16 nVer
) const override
;
58 SvxOrientationItem
& operator=(const SvxOrientationItem
& rOrientation
)
60 SetValue( rOrientation
.GetValue() );
64 /** Returns sal_True, if the item represents STACKED state. */
65 bool IsStacked() const;
66 /** Returns the rotation this item represents (returns nStdAngle for STANDARD and STACKED state). */
67 sal_Int32
GetRotation( sal_Int32 nStdAngle
) const;
70 class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxMarginItem
: public SfxPoolItem
72 sal_Int16 nLeftMargin
;
74 sal_Int16 nRightMargin
;
75 sal_Int16 nBottomMargin
;
77 static SfxPoolItem
* CreateDefault();
78 SvxMarginItem( const sal_uInt16 nId
);
79 SvxMarginItem( sal_Int16 nLeft
, sal_Int16 nTop
/*= 0*/,
80 sal_Int16 nRight
/*= 0*/, sal_Int16 nBottom
/*= 0*/,
81 const sal_uInt16 nId
);
82 SvxMarginItem( const SvxMarginItem
& );
84 virtual bool GetPresentation( SfxItemPresentation ePres
,
87 OUString
&rText
, const IntlWrapper
* = nullptr ) const override
;
89 virtual bool operator==( const SfxPoolItem
& ) const override
;
90 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
91 virtual SfxPoolItem
* Create( SvStream
& rStream
, sal_uInt16 nVer
) const override
;
92 virtual SvStream
& Store( SvStream
&, sal_uInt16 nItemVersion
) const override
;
94 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const override
;
95 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt8 nMemberId
) override
;
97 sal_Int16
GetLeftMargin() const {return nLeftMargin
; }
98 void SetLeftMargin(sal_Int16 nLeft
);
99 sal_Int16
GetTopMargin() const {return nTopMargin
; }
100 void SetTopMargin(sal_Int16 nTop
);
101 sal_Int16
GetRightMargin() const {return nRightMargin
; }
102 void SetRightMargin(sal_Int16 nRight
);
103 sal_Int16
GetBottomMargin() const {return nBottomMargin
; }
104 void SetBottomMargin(sal_Int16 nBottom
);
106 SvxMarginItem
& operator=(const SvxMarginItem
& rMargin
)
108 nLeftMargin
= rMargin
.nLeftMargin
;
109 nTopMargin
= rMargin
.nTopMargin
;
110 nRightMargin
= rMargin
.nRightMargin
;
111 nBottomMargin
= rMargin
.nBottomMargin
;
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */