Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / svx / pageitem.hxx
blob0a322a6a08d0b4c7605d95c1611c7a0501439747
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SVX_PAGEITEM_HXX
20 #define INCLUDED_SVX_PAGEITEM_HXX
22 #include <svl/poolitem.hxx>
23 #include <svx/svxdllapi.h>
24 #include <editeng/svxenum.hxx>
26 /*--------------------------------------------------------------------
27 usage of the page
28 --------------------------------------------------------------------*/
30 enum class SvxPageUsage
32 NONE = 0,
33 Left = 1,
34 Right = 2,
35 All = 3,
36 Mirror = 7
39 /*--------------------------------------------------------------------
40 parts of the page description
41 --------------------------------------------------------------------*/
44 This item describes a page attribute (name of the template, enumeration,
45 portrait or landscape, layout)
48 class SVX_DLLPUBLIC SvxPageItem: public SfxPoolItem
50 private:
51 OUString aDescName; // name of the template
52 SvxNumType eNumType;
53 bool bLandscape; // Portrait / Landscape
54 SvxPageUsage eUse; // Layout
56 public:
58 static SfxPoolItem* CreateDefault();
59 SvxPageItem( const sal_uInt16 nId );
60 SvxPageItem( const SvxPageItem& rItem );
62 virtual ~SvxPageItem() override;
64 virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
65 virtual bool operator==( const SfxPoolItem& ) const override;
67 virtual bool GetPresentation( SfxItemPresentation ePres,
68 MapUnit eCoreMetric,
69 MapUnit ePresMetric,
70 OUString &rText, const IntlWrapper * = nullptr ) const override;
72 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
73 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
74 virtual SfxPoolItem* Create( SvStream&, sal_uInt16 ) const override;
75 virtual SvStream& Store( SvStream& , sal_uInt16 nItemVersion ) const override;
77 // orientation
78 SvxPageUsage GetPageUsage() const { return eUse; }
79 void SetPageUsage(SvxPageUsage eU) { eUse= eU; }
81 bool IsLandscape() const { return bLandscape; }
82 void SetLandscape(bool bL) { bLandscape = bL; }
84 // enumeration
85 SvxNumType GetNumType() const { return eNumType; }
86 void SetNumType(SvxNumType eNum) { eNumType = eNum; }
88 // name of the descriptor
89 void SetDescName(const OUString& rStr) { aDescName = rStr; }
93 /*--------------------------------------------------------------------
94 container for header/footer attributes
95 --------------------------------------------------------------------*/
97 class SVX_DLLPUBLIC SvxSetItem: public SfxSetItem
99 public:
100 SvxSetItem( const sal_uInt16 nId, const SfxItemSet& rSet );
101 SvxSetItem( const SvxSetItem& rItem );
102 SvxSetItem( const sal_uInt16 nId, SfxItemSet* pSet );
104 virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
106 virtual bool GetPresentation( SfxItemPresentation ePres,
107 MapUnit eCoreMetric,
108 MapUnit ePresMetric,
109 OUString &rText, const IntlWrapper * = nullptr ) const override;
111 virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nVersion ) const override;
112 virtual SvStream& Store( SvStream&, sal_uInt16 nItemVersion ) const override;
116 #endif
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */