Line data Source code
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 <svx/svxids.hrc>
23 : #include <svl/poolitem.hxx>
24 : #include <svl/eitem.hxx>
25 : #include <editeng/svxenum.hxx>
26 : #include <svx/svxdllapi.h>
27 :
28 : class SvStream;
29 :
30 2130 : class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxOrientationItem: public SfxEnumItem
31 : {
32 : public:
33 : TYPEINFO_OVERRIDE();
34 :
35 : SvxOrientationItem(
36 : const SvxCellOrientation eOrientation /*= SVX_ORIENTATION_STANDARD*/,
37 : const sal_uInt16 nId );
38 :
39 : SvxOrientationItem(
40 : sal_Int32 nRotation, bool bStacked,
41 : const sal_uInt16 nId );
42 :
43 : virtual bool GetPresentation( SfxItemPresentation ePres,
44 : SfxMapUnit eCoreMetric,
45 : SfxMapUnit ePresMetric,
46 : OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE;
47 :
48 : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
49 : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
50 :
51 : virtual sal_uInt16 GetValueCount() const SAL_OVERRIDE;
52 : static OUString GetValueText( sal_uInt16 nVal );
53 : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
54 : virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nVer ) const SAL_OVERRIDE;
55 :
56 512 : inline SvxOrientationItem& operator=(const SvxOrientationItem& rOrientation)
57 : {
58 512 : SetValue( rOrientation.GetValue() );
59 512 : return *this;
60 : }
61 :
62 : /** Returns sal_True, if the item represents STACKED state. */
63 : bool IsStacked() const;
64 : /** Returns the rotation this item represents (returns nStdAngle for STANDARD and STACKED state). */
65 : sal_Int32 GetRotation( sal_Int32 nStdAngle = 0 ) const;
66 : /** Fills this item according to passed item values. */
67 : void SetFromRotation( sal_Int32 nRotation, bool bStacked );
68 : };
69 :
70 12100 : class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxMarginItem: public SfxPoolItem
71 : {
72 : sal_Int16 nLeftMargin;
73 : sal_Int16 nTopMargin;
74 : sal_Int16 nRightMargin;
75 : sal_Int16 nBottomMargin;
76 : public:
77 : TYPEINFO_OVERRIDE();
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& );
83 :
84 : virtual bool GetPresentation( SfxItemPresentation ePres,
85 : SfxMapUnit eCoreMetric,
86 : SfxMapUnit ePresMetric,
87 : OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE;
88 :
89 : virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
90 : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
91 : virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nVer ) const SAL_OVERRIDE;
92 : virtual SvStream& Store( SvStream&, sal_uInt16 nItemVersion ) const SAL_OVERRIDE;
93 :
94 : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
95 : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
96 :
97 40066 : sal_Int16 GetLeftMargin() const {return nLeftMargin; }
98 : void SetLeftMargin(sal_Int16 nLeft);
99 754626 : sal_Int16 GetTopMargin() const {return nTopMargin; }
100 : void SetTopMargin(sal_Int16 nTop);
101 46140 : sal_Int16 GetRightMargin() const {return nRightMargin; }
102 : void SetRightMargin(sal_Int16 nRight);
103 779020 : sal_Int16 GetBottomMargin() const {return nBottomMargin; }
104 : void SetBottomMargin(sal_Int16 nBottom);
105 :
106 520 : inline SvxMarginItem& operator=(const SvxMarginItem& rMargin)
107 : {
108 520 : nLeftMargin = rMargin.nLeftMargin;
109 520 : nTopMargin = rMargin.nTopMargin;
110 520 : nRightMargin = rMargin.nRightMargin;
111 520 : nBottomMargin = rMargin.nBottomMargin;
112 520 : return *this;
113 : }
114 : };
115 :
116 : #endif
117 :
118 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|