LibreOffice Module svx (master)  1
algitem.hxx
Go to the documentation of this file.
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 
29 class IntlWrapper;
30 class SfxItemPool;
31 
32 class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxOrientationItem final : public SfxEnumItem<SvxCellOrientation>
33 {
34 public:
36  const SvxCellOrientation eOrientation,
37  const sal_uInt16 nId );
38 
40  sal_Int32 nRotation, bool bStacked,
41  const sal_uInt16 nId );
42 
43  virtual bool GetPresentation( SfxItemPresentation ePres,
44  MapUnit eCoreMetric,
45  MapUnit ePresMetric,
46  OUString &rText, const IntlWrapper& ) const override;
47 
48  virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
49  virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
50 
51  virtual sal_uInt16 GetValueCount() const override;
52  static OUString GetValueText( SvxCellOrientation nVal );
53  virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
54 
56  bool IsStacked() const;
58  sal_Int32 GetRotation( sal_Int32 nStdAngle ) const;
59 };
60 
62 {
63  sal_Int16 nLeftMargin;
64  sal_Int16 nTopMargin;
65  sal_Int16 nRightMargin;
66  sal_Int16 nBottomMargin;
67 public:
68  static SfxPoolItem* CreateDefault();
69  SvxMarginItem( const sal_uInt16 nId );
70  SvxMarginItem( sal_Int16 nLeft, sal_Int16 nTop /*= 0*/,
71  sal_Int16 nRight /*= 0*/, sal_Int16 nBottom /*= 0*/,
72  const sal_uInt16 nId );
73 
74  virtual bool GetPresentation( SfxItemPresentation ePres,
75  MapUnit eCoreMetric,
76  MapUnit ePresMetric,
77  OUString &rText, const IntlWrapper& ) const override;
78 
79  virtual bool operator==( const SfxPoolItem& ) const override;
80  virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
81 
82  virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
83  virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
84 
85  sal_Int16 GetLeftMargin() const {return nLeftMargin; }
86  void SetLeftMargin(sal_Int16 nLeft);
87  sal_Int16 GetTopMargin() const {return nTopMargin; }
88  void SetTopMargin(sal_Int16 nTop);
89  sal_Int16 GetRightMargin() const {return nRightMargin; }
90  void SetRightMargin(sal_Int16 nRight);
91  sal_Int16 GetBottomMargin() const {return nBottomMargin; }
92  void SetBottomMargin(sal_Int16 nBottom);
93 };
94 
95 #endif
96 
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int16 nBottomMargin
Definition: algitem.hxx:66
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8) override
virtual bool operator==(const SfxPoolItem &) const =0
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
sal_Int16 nId
sal_Int16 GetRightMargin() const
Definition: algitem.hxx:89
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
SfxItemPresentation
virtual bool GetPresentation(SfxItemPresentation, MapUnit, MapUnit, OUString &rText, const IntlWrapper &) const override
sal_Int16 GetBottomMargin() const
Definition: algitem.hxx:91
#define SAL_WARN_UNUSED
sal_Int16 nLeftMargin
Definition: algitem.hxx:63
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8=0) const override
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit eCoreMetric, MapUnit ePresentationMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const
unsigned char sal_uInt8
sal_Int16 nTopMargin
Definition: algitem.hxx:64
sal_Int16 GetLeftMargin() const
Definition: algitem.hxx:85
virtual sal_uInt16 GetValueCount() const =0
MapUnit
sal_Int16 nRightMargin
Definition: algitem.hxx:65
SvxCellOrientation
sal_Int16 GetTopMargin() const
Definition: algitem.hxx:87