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