/src/libreoffice/include/svx/algitem.hxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
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/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
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 . |
18 | | */ |
19 | | #ifndef INCLUDED_SVX_ALGITEM_HXX |
20 | | #define INCLUDED_SVX_ALGITEM_HXX |
21 | | |
22 | | #include <editeng/svxenum.hxx> |
23 | | #include <rtl/ustring.hxx> |
24 | | #include <sal/types.h> |
25 | | #include <svl/poolitem.hxx> |
26 | | #include <svl/eitem.hxx> |
27 | | #include <svx/svxdllapi.h> |
28 | | #include <tools/degree.hxx> |
29 | | |
30 | | class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxOrientationItem final : public SfxEnumItem<SvxCellOrientation> |
31 | | { |
32 | | public: |
33 | | DECLARE_ITEM_TYPE_FUNCTION(SvxOrientationItem) |
34 | | SvxOrientationItem( |
35 | | const SvxCellOrientation eOrientation, |
36 | | const TypedWhichId<SvxOrientationItem> nId ); |
37 | | |
38 | | SvxOrientationItem( |
39 | | Degree100 nRotation, bool bStacked, |
40 | | const TypedWhichId<SvxOrientationItem> nId ); |
41 | | |
42 | | virtual bool GetPresentation( SfxItemPresentation ePres, |
43 | | MapUnit eCoreMetric, |
44 | | MapUnit ePresMetric, |
45 | | OUString &rText, const IntlWrapper& ) const override; |
46 | | |
47 | | virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; |
48 | | virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; |
49 | | |
50 | | static OUString GetValueText( SvxCellOrientation nVal ); |
51 | | virtual SvxOrientationItem* Clone( SfxItemPool *pPool = nullptr ) const override; |
52 | | |
53 | | /** Returns sal_True, if the item represents STACKED state. */ |
54 | | bool IsStacked() const; |
55 | | /** Returns the rotation this item represents (returns nStdAngle for STANDARD and STACKED state). */ |
56 | | Degree100 GetRotation( Degree100 nStdAngle ) const; |
57 | | }; |
58 | | |
59 | | class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxMarginItem final : public SfxPoolItem |
60 | | { |
61 | | sal_Int16 nLeftMargin; |
62 | | sal_Int16 nTopMargin; |
63 | | sal_Int16 nRightMargin; |
64 | | sal_Int16 nBottomMargin; |
65 | | public: |
66 | | static SfxPoolItem* CreateDefault(); |
67 | | DECLARE_ITEM_TYPE_FUNCTION(SvxMarginItem) |
68 | | SvxMarginItem( const TypedWhichId<SvxMarginItem> nId ); |
69 | | SvxMarginItem( sal_Int16 nLeft, sal_Int16 nTop /*= 0*/, |
70 | | sal_Int16 nRight /*= 0*/, sal_Int16 nBottom /*= 0*/, |
71 | | const TypedWhichId<SvxMarginItem> nId ); |
72 | | |
73 | | virtual bool GetPresentation( SfxItemPresentation ePres, |
74 | | MapUnit eCoreMetric, |
75 | | MapUnit ePresMetric, |
76 | | OUString &rText, const IntlWrapper& ) const override; |
77 | | |
78 | | virtual bool operator==( const SfxPoolItem& ) const override; |
79 | | virtual SvxMarginItem* Clone( SfxItemPool *pPool = nullptr ) const override; |
80 | | |
81 | | virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; |
82 | | virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; |
83 | | |
84 | 57.0k | sal_Int16 GetLeftMargin() const {return nLeftMargin; } |
85 | | void SetLeftMargin(sal_Int16 nLeft); |
86 | 3.51M | sal_Int16 GetTopMargin() const {return nTopMargin; } |
87 | | void SetTopMargin(sal_Int16 nTop); |
88 | 57.0k | sal_Int16 GetRightMargin() const {return nRightMargin; } |
89 | | void SetRightMargin(sal_Int16 nRight); |
90 | 3.51M | sal_Int16 GetBottomMargin() const {return nBottomMargin; } |
91 | | void SetBottomMargin(sal_Int16 nBottom); |
92 | | }; |
93 | | |
94 | | #endif |
95 | | |
96 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |