xref: /trunk/main/svx/inc/svx/pageitem.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _SVX_PAGEITEM_HXX
24 #define _SVX_PAGEITEM_HXX
25 
26 // include ---------------------------------------------------------------
27 
28 #include <svl/poolitem.hxx>
29 #include <tools/string.hxx>
30 #include "svx/svxdllapi.h"
31 
32 
33 /*--------------------------------------------------------------------
34     Beschreibung:   SvxNumType
35  --------------------------------------------------------------------*/
36 
37 enum SvxNumType
38 {
39     SVX_CHARS_UPPER_LETTER,
40     SVX_CHARS_LOWER_LETTER,
41     SVX_ROMAN_UPPER,
42     SVX_ROMAN_LOWER,
43     SVX_ARABIC,
44     SVX_NUMBER_NONE,
45     SVX_CHAR_SPECIAL,
46     SVX_PAGEDESC
47 };
48 
49 /*--------------------------------------------------------------------
50     Beschreibung:   Benutzung der Seite
51  --------------------------------------------------------------------*/
52 
53 enum SvxPageUsage
54 {
55     SVX_PAGE_LEFT           = 0x0001,
56     SVX_PAGE_RIGHT          = 0x0002,
57     SVX_PAGE_ALL            = 0x0003,
58     SVX_PAGE_MIRROR         = 0x0007,
59     SVX_PAGE_HEADERSHARE    = 0x0040,
60     SVX_PAGE_FOOTERSHARE    = 0x0080
61 };
62 
63 /*--------------------------------------------------------------------
64     Beschreibung:   Teile der Seitenbeschreibung
65  --------------------------------------------------------------------*/
66 
67 
68 
69 /*
70 [Beschreibung]
71 Dieses Item beschreibt ein Seiten-Attribut (Name der Vorlage, Numerierung,
72 Portrait oder Landscape, Layout).
73 */
74 
75 class SVX_DLLPUBLIC SvxPageItem: public SfxPoolItem
76 {
77 private:
78     String          aDescName;          // Name der Vorlage
79     SvxNumType      eNumType;           // Numerierung
80     sal_Bool            bLandscape;         // Portrait / Landscape
81     sal_uInt16          eUse;               // Layout
82 
83 public:
84 
85     TYPEINFO();
86     SvxPageItem( const sal_uInt16 nId );
87     SvxPageItem( const SvxPageItem& rItem );
88 
89     virtual SfxPoolItem*     Clone( SfxItemPool *pPool = 0 ) const;
90     virtual int              operator==( const SfxPoolItem& ) const;
91 
92     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
93                                     SfxMapUnit eCoreMetric,
94                                     SfxMapUnit ePresMetric,
95                                     String &rText, const IntlWrapper * = 0 ) const;
96 
97     virtual sal_Bool             QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
98     virtual sal_Bool             PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
99     virtual SfxPoolItem*     Create( SvStream&, sal_uInt16 ) const;
100     virtual SvStream&        Store( SvStream& , sal_uInt16 nItemVersion ) const;
101 
102     // Ausrichtung
GetPageUsage() const103     sal_uInt16          GetPageUsage() const                { return eUse;       }
SetPageUsage(sal_uInt16 eU)104     void            SetPageUsage(sal_uInt16 eU)             { eUse= eU;          }
105 
IsLandscape() const106     sal_Bool            IsLandscape() const                 { return bLandscape; }
SetLandscape(sal_Bool bL)107     void            SetLandscape(sal_Bool bL)               { bLandscape = bL;   }
108 
109     // Numerierung
GetNumType() const110     SvxNumType      GetNumType() const                  { return eNumType;   }
SetNumType(SvxNumType eNum)111     void            SetNumType(SvxNumType eNum)         { eNumType = eNum;   }
112 
113     // Name des Descriptors
GetDescName() const114     const String&   GetDescName() const                 { return aDescName;  }
SetDescName(const String & rStr)115     void            SetDescName(const String& rStr)     { aDescName = rStr;  }
116 };
117 
118 
119 
120 /*--------------------------------------------------------------------
121     Beschreibung:   Container fuer Header/Footer-Attribute
122  --------------------------------------------------------------------*/
123 
124 
125 
126 /*
127 [Beschreibung]
128 Dieses Item dient als Container fuer Header- und Footer-Attribute.
129 */
130 
131 class SVX_DLLPUBLIC SvxSetItem: public SfxSetItem
132 {
133 public:
134     SvxSetItem( const sal_uInt16 nId, const SfxItemSet& rSet );
135     SvxSetItem( const SvxSetItem& rItem );
136     SvxSetItem( const sal_uInt16 nId, SfxItemSet* pSet );
137 
138     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const;
139 
140     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
141                                     SfxMapUnit eCoreMetric,
142                                     SfxMapUnit ePresMetric,
143                                     String &rText, const IntlWrapper * = 0 ) const;
144 
145     virtual SfxPoolItem*    Create( SvStream&, sal_uInt16 nVersion ) const;
146     virtual SvStream&       Store( SvStream&, sal_uInt16 nItemVersion ) const;
147 };
148 
149 
150 
151 
152 #endif
153