1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: IDocumentFieldsAccess.hxx,v $
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 ************************************************************************/
31 #ifndef IDOCUMENTFIELDSACCESS_HXX_INCLUDED
32 #define IDOCUMENTFIELDSACCESS_HXX_INCLUDED
34 #include <sal/types.h>
35 #include <tools/solar.h>
52 namespace com
{ namespace sun
{ namespace star
{ namespace uno
{ class Any
; } } } }
54 /** Document fields related interfaces
56 class IDocumentFieldsAccess
61 virtual const SwFldTypes
*GetFldTypes() const = 0;
65 virtual SwFieldType
*InsertFldType(const SwFieldType
&) = 0;
69 virtual SwFieldType
*GetSysFldType( const sal_uInt16 eWhich
) const = 0;
73 virtual SwFieldType
* GetFldType(sal_uInt16 nResId
, const String
& rName
, bool bDbFieldMatching
) const = 0;
77 virtual void RemoveFldType(sal_uInt16 nFld
) = 0;
81 virtual void UpdateFlds( SfxPoolItem
* pNewHt
, bool bCloseDB
) = 0;
85 virtual void InsDeletedFldType(SwFieldType
&) = 0;
89 Puts a value into a field at a certain position.
91 A missing field at the given position leads to a failure.
93 @param rPosition position of the field
97 @retval TRUE putting of value was successful
100 virtual bool PutValueToField(const SwPosition
& rPos
, const com::sun::star::uno::Any
& rVal
, USHORT nWhich
) = 0;
102 // rufe das Update der Expression Felder auf; alle Ausdruecke werden
108 @param rDstFmtFld field to update
109 @param rSrcFld field containing the new values
111 @param bUpdateTblFlds TRUE: update table fields, too.
113 @retval TRUE update was successful
116 virtual bool UpdateFld(SwTxtFld
* rDstFmtFld
, SwField
& rSrcFld
, SwMsgPoolItem
* pMsgHnt
, bool bUpdateTblFlds
) = 0;
120 virtual void UpdateRefFlds(SfxPoolItem
* pHt
) = 0;
124 virtual void UpdateTblFlds(SfxPoolItem
* pHt
) = 0;
128 virtual void UpdateExpFlds(SwTxtFld
* pFld
, bool bUpdateRefFlds
) = 0;
132 virtual void UpdateUsrFlds() = 0;
136 virtual void UpdatePageFlds(SfxPoolItem
*) = 0;
140 virtual void LockExpFlds() = 0;
144 virtual void UnlockExpFlds() = 0;
148 virtual bool IsExpFldsLocked() const = 0;
151 virtual SwDocUpdtFld
& GetUpdtFlds() const = 0;
153 /* @@@MAINTAINABILITY-HORROR@@@
154 SwNode (see parameter pChk) is (?) part of the private
155 data structure of SwDoc and should not be exposed
157 virtual bool SetFieldsDirty(bool b
, const SwNode
* pChk
, ULONG nLen
) = 0;
161 virtual void SetFixFields(bool bOnlyTimeDate
, const DateTime
* pNewDateTime
) = 0;
163 // Setze im Calculator alle SetExpresion Felder, die bis zur
164 // angegebenen Position (Node [ + ::com::sun::star::ucb::Content]) gueltig sind. Es kann
165 // eine erzeugte Liste aller Felder mit uebergegeben werden.
166 // (ist die Adresse != 0, und der Pointer == 0 wird eine neue
168 virtual void FldsToCalc(SwCalc
& rCalc
, ULONG nLastNd
, sal_uInt16 nLastCnt
) = 0;
172 virtual void FldsToCalc(SwCalc
& rCalc
, const _SetGetExpFld
& rToThisFld
) = 0;
176 virtual void FldsToExpand(SwHash
**& ppTbl
, sal_uInt16
& rTblSize
, const _SetGetExpFld
& rToThisFld
) = 0;
180 virtual bool IsNewFldLst() const = 0;
184 virtual void SetNewFldLst( bool bFlag
) = 0;
188 virtual void InsDelFldInFldLst(bool bIns
, const SwTxtFld
& rFld
) = 0;
191 virtual ~IDocumentFieldsAccess() {};
194 #endif // IDOCUMENTLINKSADMINISTRATION_HXX_INCLUDED