Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_sw / reffld.hxx
blob22775d007ccd4f5e7cb1a502b245e60dcc9788ca
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: reffld.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _REFFLD_HXX
31 #define _REFFLD_HXX
33 #ifndef _FLDBAS_HXX
34 #include <fldbas.hxx>
35 #endif
36 namespace binfilter {
38 class SfxPoolItem;
39 class SwDoc;
40 class SwTxtAttr;
41 class SwTxtNode;
43 enum REFERENCESUBTYPE
45 REF_SETREFATTR = 0,
46 REF_SEQUENCEFLD,
47 REF_BOOKMARK,
48 REF_OUTLINE,
49 REF_FOOTNOTE,
50 REF_ENDNOTE
53 enum REFERENCEMARK
55 REF_BEGIN,
56 REF_PAGE = REF_BEGIN,
57 REF_CHAPTER,
58 REF_CONTENT,
59 REF_UPDOWN,
60 REF_PAGE_PGDESC,
61 REF_ONLYNUMBER,
62 REF_ONLYCAPTION,
63 REF_ONLYSEQNO,
64 REF_END
68 /*--------------------------------------------------------------------
69 Beschreibung: Referenz holen
70 --------------------------------------------------------------------*/
72 class SwGetRefFieldType : public SwFieldType
74 SwDoc* pDoc;
75 public:
76 SwGetRefFieldType(SwDoc* pDoc );
77 virtual SwFieldType* Copy() const;
79 SwDoc* GetDoc() const { return pDoc; }
80 // ueberlagert, um alle Ref-Felder zu updaten
81 virtual void Modify( SfxPoolItem *, SfxPoolItem * );
83 void MergeWithOtherDoc( SwDoc& rDestDoc );
85 static SwTxtNode* FindAnchor( SwDoc* pDoc, const String& rRefMark,
86 USHORT nSubType, USHORT nSeqNo,
87 USHORT* pStt, USHORT* pEnd = 0 );
90 /*--------------------------------------------------------------------
91 Beschreibung: Referenzfeld
92 --------------------------------------------------------------------*/
94 class SwGetRefField : public SwField
96 String sSetRefName;
97 String sTxt;
98 USHORT nSubType;
99 USHORT nSeqNo;
100 public:
101 SwGetRefField( SwGetRefFieldType*, const String& rSetRef,
102 USHORT nSubType, USHORT nSeqNo, ULONG nFmt );
104 virtual String GetCntnt(BOOL bName = FALSE) const;
105 virtual String Expand() const;
106 virtual SwField* Copy() const;
108 const String& GetSetRefName() const { return sSetRefName; }
110 void UpdateField();
111 void SetExpand( const String& rStr ) { sTxt = rStr; }
113 // SubType erfragen/setzen
114 virtual USHORT GetSubType() const;
115 virtual void SetSubType( USHORT n );
117 // SequenceNo erfragen/setzen (nur fuer REF_SEQUENCEFLD interressant)
118 USHORT GetSeqNo() const { return nSeqNo; }
119 void SetSeqNo( USHORT n ) { nSeqNo = n; }
121 // Name der Referenz
122 virtual const String& GetPar1() const;
123 virtual void SetPar1(const String& rStr);
125 virtual String GetPar2() const;
126 virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const;
127 virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId );
129 void ConvertProgrammaticToUIName();
133 } //namespace binfilter
134 #endif // _REFFLD_HXX