xref: /AOO41X/main/sw/inc/fmtpdsc.hxx (revision 1d2dbeb0b7301723c6d13094e87a8714ef81a328)
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 _FMTPDSC_HXX
24 #define _FMTPDSC_HXX
25 
26 
27 #include <svl/poolitem.hxx>
28 #include "swdllapi.h"
29 #include <hintids.hxx>
30 #include <format.hxx>
31 #include <calbck.hxx>
32 
33 class SwPageDesc;
34 class SwHistory;
35 class SwPaM;
36 class IntlWrapper;
37 class SwEndNoteInfo;
38 
39 //Pagedescriptor
40 //Client vom SwPageDesc der durch das Attribut "beschrieben" wird.
41 
42 #define IVER_FMTPAGEDESC_NOAUTO ((sal_uInt16)0x0001)
43 #define IVER_FMTPAGEDESC_LONGPAGE   ((sal_uInt16)0x0002)
44 
45 class SW_DLLPUBLIC SwFmtPageDesc : public SfxPoolItem, public SwClient
46 {
47     // diese "Doc"-Funktion ist friend, um nach dem kopieren das
48     // Auto-Flag setzen zu koennen !!
49     friend sal_Bool InsAttr( SwDoc*, const SwPaM &, const SfxItemSet&, sal_uInt16,
50                         SwHistory* );
51     sal_uInt16 nNumOffset;          // Seitennummer Offset
52     sal_uInt16 nDescNameIdx;        // SW3-Reader: Stringpool-Index des Vorlagennamens
53     SwModify* pDefinedIn;       // Verweis auf das Objekt, in dem das
54                                 // Attribut gesetzt wurde (CntntNode/Format)
55 protected:
56     virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
57     virtual void SwClientNotify( const SwModify&, const SfxHint& rHint );
58 
59 public:
60     SwFmtPageDesc( const SwPageDesc *pDesc = 0 );
61     SwFmtPageDesc( const SwFmtPageDesc &rCpy );
62     SwFmtPageDesc &operator=( const SwFmtPageDesc &rCpy );
63     ~SwFmtPageDesc();
64 
65     TYPEINFO();
66 
67     // "pure virtual Methoden" vom SfxPoolItem
68     virtual int             operator==( const SfxPoolItem& ) const;
69     virtual SfxPoolItem*    Clone( SfxItemPool* pPool = 0 ) const;
70     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
71                                     SfxMapUnit eCoreMetric,
72                                     SfxMapUnit ePresMetric,
73                                     String &rText,
74                                     const IntlWrapper*    pIntl = 0 ) const;
75     virtual sal_Bool             QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
76     virtual sal_Bool             PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
77 
GetPageDesc()78           SwPageDesc *GetPageDesc() { return (SwPageDesc*)GetRegisteredIn(); }
GetPageDesc() const79     const SwPageDesc *GetPageDesc() const { return (SwPageDesc*)GetRegisteredIn(); }
80 
GetNumOffset() const81     sal_uInt16  GetNumOffset() const        { return nNumOffset; }
SetNumOffset(sal_uInt16 nNum)82     void    SetNumOffset( sal_uInt16 nNum ) { nNumOffset = nNum; }
83 
84     // erfrage/setze, wo drin das Attribut verankert ist
GetDefinedIn() const85     inline const SwModify* GetDefinedIn() const { return pDefinedIn; }
ChgDefinedIn(const SwModify * pNew)86     void ChgDefinedIn( const SwModify* pNew ) { pDefinedIn = (SwModify*)pNew; }
87     void RegisterToEndNotInfo( SwEndNoteInfo& );
88     void RegisterToPageDesc( SwPageDesc& );
89     bool KnowsPageDesc() const;
90 };
91 
92 
GetPageDesc(sal_Bool bInP) const93 inline const SwFmtPageDesc &SwAttrSet::GetPageDesc(sal_Bool bInP) const
94     { return (const SwFmtPageDesc&)Get( RES_PAGEDESC,bInP); }
95 
GetPageDesc(sal_Bool bInP) const96 inline const SwFmtPageDesc &SwFmt::GetPageDesc(sal_Bool bInP) const
97     { return aSet.GetPageDesc(bInP); }
98 
99 #endif
100 
101