Line data Source code
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 <svl/poolitem.hxx>
23 : #include <svx/svxdllapi.h>
24 :
25 :
26 : enum SvxNumType
27 : {
28 : SVX_CHARS_UPPER_LETTER,
29 : SVX_CHARS_LOWER_LETTER,
30 : SVX_ROMAN_UPPER,
31 : SVX_ROMAN_LOWER,
32 : SVX_ARABIC,
33 : SVX_NUMBER_NONE,
34 : SVX_CHAR_SPECIAL,
35 : SVX_PAGEDESC
36 : };
37 :
38 : /*--------------------------------------------------------------------
39 : usage of the page
40 : --------------------------------------------------------------------*/
41 :
42 : enum SvxPageUsage
43 : {
44 : SVX_PAGE_LEFT = 0x0001,
45 : SVX_PAGE_RIGHT = 0x0002,
46 : SVX_PAGE_ALL = 0x0003,
47 : SVX_PAGE_MIRROR = 0x0007,
48 : SVX_PAGE_HEADERSHARE = 0x0040,
49 : SVX_PAGE_FOOTERSHARE = 0x0080
50 : };
51 :
52 : /*--------------------------------------------------------------------
53 : parts of the page description
54 : --------------------------------------------------------------------*/
55 :
56 : /*
57 : This item describes a page attribute (name of the template, enumeration,
58 : portrait or landscape, layout)
59 : */
60 :
61 134486 : class SVX_DLLPUBLIC SvxPageItem: public SfxPoolItem
62 : {
63 : private:
64 : OUString aDescName; // name of the template
65 : SvxNumType eNumType; // enumeration
66 : bool bLandscape; // Portrait / Landscape
67 : sal_uInt16 eUse; // Layout
68 :
69 : public:
70 :
71 : TYPEINFO_OVERRIDE();
72 : SvxPageItem( const sal_uInt16 nId );
73 : SvxPageItem( const SvxPageItem& rItem );
74 :
75 : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
76 : virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
77 :
78 : virtual bool GetPresentation( SfxItemPresentation ePres,
79 : SfxMapUnit eCoreMetric,
80 : SfxMapUnit ePresMetric,
81 : OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE;
82 :
83 : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
84 : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
85 : virtual SfxPoolItem* Create( SvStream&, sal_uInt16 ) const SAL_OVERRIDE;
86 : virtual SvStream& Store( SvStream& , sal_uInt16 nItemVersion ) const SAL_OVERRIDE;
87 :
88 : // orientation
89 8446 : sal_uInt16 GetPageUsage() const { return eUse; }
90 19433 : void SetPageUsage(sal_uInt16 eU) { eUse= eU; }
91 :
92 11308 : bool IsLandscape() const { return bLandscape; }
93 21346 : void SetLandscape(bool bL) { bLandscape = bL; }
94 :
95 : // enumeration
96 7772 : SvxNumType GetNumType() const { return eNumType; }
97 19433 : void SetNumType(SvxNumType eNum) { eNumType = eNum; }
98 :
99 : // name of the descriptor
100 : const OUString& GetDescName() const { return aDescName; }
101 19433 : void SetDescName(const OUString& rStr) { aDescName = rStr; }
102 : };
103 :
104 :
105 :
106 : /*--------------------------------------------------------------------
107 : container for header/footer attributes
108 : --------------------------------------------------------------------*/
109 :
110 117802 : class SVX_DLLPUBLIC SvxSetItem: public SfxSetItem
111 : {
112 : public:
113 : SvxSetItem( const sal_uInt16 nId, const SfxItemSet& rSet );
114 : SvxSetItem( const SvxSetItem& rItem );
115 : SvxSetItem( const sal_uInt16 nId, SfxItemSet* pSet );
116 :
117 : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
118 :
119 : virtual bool GetPresentation( SfxItemPresentation ePres,
120 : SfxMapUnit eCoreMetric,
121 : SfxMapUnit ePresMetric,
122 : OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE;
123 :
124 : virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nVersion ) const SAL_OVERRIDE;
125 : virtual SvStream& Store( SvStream&, sal_uInt16 nItemVersion ) const SAL_OVERRIDE;
126 : };
127 :
128 :
129 :
130 :
131 : #endif
132 :
133 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|