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