/src/libreoffice/include/svx/pageitem.hxx
Line | Count | Source |
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 | | |
50 | | class SVX_DLLPUBLIC SvxPageItem final : public SfxPoolItem |
51 | | { |
52 | | private: |
53 | | OUString m_aDescName; // name of the template |
54 | | SvxNumType m_eNumType; |
55 | | bool m_bLandscape; // Portrait / Landscape |
56 | | SvxPageUsage m_eUse; // Layout |
57 | | |
58 | | public: |
59 | | |
60 | | static SfxPoolItem* CreateDefault(); |
61 | | DECLARE_ITEM_TYPE_FUNCTION(SvxPageItem) |
62 | | SvxPageItem( const TypedWhichId<SvxPageItem> nId ); |
63 | | SvxPageItem( const SvxPageItem& rItem ); |
64 | | |
65 | | virtual ~SvxPageItem() override; |
66 | | |
67 | | virtual SvxPageItem* Clone( SfxItemPool *pPool = nullptr ) const override; |
68 | | virtual bool operator==( const SfxPoolItem& ) const override; |
69 | | |
70 | | virtual bool GetPresentation( SfxItemPresentation ePres, |
71 | | MapUnit eCoreMetric, |
72 | | MapUnit ePresMetric, |
73 | | OUString &rText, const IntlWrapper& ) const override; |
74 | | |
75 | | virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; |
76 | | virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; |
77 | | |
78 | | // orientation |
79 | 143k | SvxPageUsage GetPageUsage() const { return m_eUse; } |
80 | 213k | void SetPageUsage(SvxPageUsage eU) { m_eUse= eU; } |
81 | | |
82 | 143k | bool IsLandscape() const { return m_bLandscape; } |
83 | 316k | void SetLandscape(bool bL) { m_bLandscape = bL; } |
84 | | |
85 | | // enumeration |
86 | 143k | SvxNumType GetNumType() const { return m_eNumType; } |
87 | 213k | void SetNumType(SvxNumType eNum) { m_eNumType = eNum; } |
88 | | |
89 | | // name of the descriptor |
90 | 213k | void SetDescName(const OUString& rStr) { m_aDescName = rStr; } |
91 | | }; |
92 | | |
93 | | |
94 | | /*-------------------------------------------------------------------- |
95 | | container for header/footer attributes |
96 | | --------------------------------------------------------------------*/ |
97 | | |
98 | | class SVX_DLLPUBLIC SvxSetItem final : public SfxSetItem |
99 | | { |
100 | | public: |
101 | | DECLARE_ITEM_TYPE_FUNCTION(SvxSetItem) |
102 | | SvxSetItem( const TypedWhichId<SvxSetItem> nId, const SfxItemSet& rSet ); |
103 | | SvxSetItem( const SvxSetItem& rItem, SfxItemPool* pPool = nullptr ); |
104 | | SvxSetItem( const TypedWhichId<SvxSetItem> nId, 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: */ |