1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
58 // --> OD 2007-08-24 #i81002#
59 // new reference format types for referencing bookmarks and set references
61 REF_NUMBER_NO_CONTEXT
,
62 REF_NUMBER_FULL_CONTEXT
,
68 /*--------------------------------------------------------------------
69 Beschreibung: Referenz holen
70 --------------------------------------------------------------------*/
72 class SwGetRefFieldType
: public SwFieldType
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 SW_DLLPUBLIC SwGetRefField
: public SwField
102 // --> OD 2007-08-24 #i81002#
103 String
MakeRefNumStr( const SwTxtNode
& rTxtNodeOfField
,
104 const SwTxtNode
& rTxtNodeOfReferencedItem
,
105 const sal_uInt32 nRefNumFormat
) const;
108 SwGetRefField( SwGetRefFieldType
*, const String
& rSetRef
,
109 USHORT nSubType
, USHORT nSeqNo
, ULONG nFmt
);
111 virtual ~SwGetRefField();
113 virtual String
GetCntnt(BOOL bName
= FALSE
) const;
114 virtual String
Expand() const;
115 virtual SwField
* Copy() const;
117 const String
& GetSetRefName() const { return sSetRefName
; }
119 // --> OD 2007-09-06 #i81002#
120 // The <SwTxtFld> instance, which represents the text attribute for the
121 // <SwGetRefField> instance, has to be passed to the method.
122 // This <SwTxtFld> instance is needed for the reference format type REF_UPDOWN
124 // Note: This instance may be NULL (field in Undo/Redo). This will cause
125 // no update for these reference format types.
126 void UpdateField( const SwTxtFld
* pFldTxtAttr
);
128 void SetExpand( const String
& rStr
) { sTxt
= rStr
; }
130 // SubType erfragen/setzen
131 virtual USHORT
GetSubType() const;
132 virtual void SetSubType( USHORT n
);
134 // --> OD 2007-11-09 #i81002#
135 bool IsRefToHeadingCrossRefBookmark() const;
136 bool IsRefToNumItemCrossRefBookmark() const;
137 const SwTxtNode
* GetReferencedTxtNode() const;
139 // --> OD 2008-01-09 #i85090#
140 String
GetExpandedTxtOfReferencedTxtNode() const;
143 // SequenceNo erfragen/setzen (nur fuer REF_SEQUENCEFLD interressant)
144 USHORT
GetSeqNo() const { return nSeqNo
; }
145 void SetSeqNo( USHORT n
) { nSeqNo
= n
; }
148 virtual const String
& GetPar1() const;
149 virtual void SetPar1(const String
& rStr
);
151 virtual String
GetPar2() const;
152 virtual BOOL
QueryValue( com::sun::star::uno::Any
& rVal
, USHORT nWhichId
) const;
153 virtual BOOL
PutValue( const com::sun::star::uno::Any
& rVal
, USHORT nWhichId
);
155 void ConvertProgrammaticToUIName();
157 virtual String
GetDescription() const;
161 #endif // _REFFLD_HXX