LibreOffice Module svx (master)  1
pageitem.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_PAGEITEM_HXX
20 #define INCLUDED_SVX_PAGEITEM_HXX
21 
22 #include <sal/config.h>
23 
24 #include <svl/setitem.hxx>
25 #include <svx/svxdllapi.h>
26 #include <editeng/svxenum.hxx>
27 
28 /*--------------------------------------------------------------------
29  usage of the page
30  --------------------------------------------------------------------*/
31 
32 enum class SvxPageUsage
33 {
34  NONE = 0,
35  Left = 1,
36  Right = 2,
37  All = 3,
38  Mirror = 7
39 };
40 
41 /*--------------------------------------------------------------------
42  parts of the page description
43  --------------------------------------------------------------------*/
44 
45 /*
46 This item describes a page attribute (name of the template, enumeration,
47 portrait or landscape, layout)
48 */
49 
51 {
52 private:
53  OUString aDescName; // name of the template
55  bool bLandscape; // Portrait / Landscape
56  SvxPageUsage eUse; // Layout
57 
58 public:
59 
60  static SfxPoolItem* CreateDefault();
62  SvxPageItem( const SvxPageItem& rItem );
63 
64  virtual ~SvxPageItem() override;
65 
66  virtual SvxPageItem* Clone( SfxItemPool *pPool = nullptr ) const override;
67  virtual bool operator==( const SfxPoolItem& ) const override;
68 
69  virtual bool GetPresentation( SfxItemPresentation ePres,
70  MapUnit eCoreMetric,
71  MapUnit ePresMetric,
72  OUString &rText, const IntlWrapper& ) const override;
73 
74  virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
75  virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
76 
77  // orientation
78  SvxPageUsage GetPageUsage() const { return eUse; }
79  void SetPageUsage(SvxPageUsage eU) { eUse= eU; }
80 
81  bool IsLandscape() const { return bLandscape; }
82  void SetLandscape(bool bL) { bLandscape = bL; }
83 
84  // enumeration
85  SvxNumType GetNumType() const { return eNumType; }
86  void SetNumType(SvxNumType eNum) { eNumType = eNum; }
87 
88  // name of the descriptor
89  void SetDescName(const OUString& rStr) { aDescName = rStr; }
90 };
91 
92 
93 /*--------------------------------------------------------------------
94  container for header/footer attributes
95  --------------------------------------------------------------------*/
96 
97 class SVX_DLLPUBLIC SvxSetItem final : public SfxSetItem
98 {
99 public:
100  SvxSetItem( const TypedWhichId<SvxSetItem> nId, const SfxItemSet& rSet );
101  SvxSetItem( const SvxSetItem& rItem );
102  SvxSetItem( const TypedWhichId<SvxSetItem> nId, SfxItemSet&& pSet );
103 
104  virtual SvxSetItem* Clone( SfxItemPool *pPool = nullptr ) const override;
105 
106  virtual bool GetPresentation( SfxItemPresentation ePres,
107  MapUnit eCoreMetric,
108  MapUnit ePresMetric,
109  OUString &rText, const IntlWrapper& ) const override;
110 };
111 
112 
113 #endif
114 
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsLandscape() const
Definition: pageitem.hxx:81
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
void SetPageUsage(SvxPageUsage eU)
Definition: pageitem.hxx:79
virtual bool operator==(const SfxPoolItem &) const =0
OUString aDescName
Definition: pageitem.hxx:53
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
void SetLandscape(bool bL)
Definition: pageitem.hxx:82
sal_Int16 nId
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
SvxNumType
SvxNumType GetNumType() const
Definition: pageitem.hxx:85
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
void SetNumType(SvxNumType eNum)
Definition: pageitem.hxx:86
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
bool bLandscape
Definition: pageitem.hxx:55
SfxItemPresentation
virtual SfxSetItem * Clone(SfxItemPool *pPool=nullptr) const override=0
SvxPageUsage
Definition: pageitem.hxx:32
SvxPageUsage GetPageUsage() const
Definition: pageitem.hxx:78
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit eCoreMetric, MapUnit ePresentationMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const
unsigned char sal_uInt8
SvxNumType eNumType
Definition: pageitem.hxx:54
MapUnit
SvxPageUsage eUse
Definition: pageitem.hxx:56
void SetDescName(const OUString &rStr)
Definition: pageitem.hxx:89