update dev300-m58
[ooovba.git] / sw / inc / IDocumentFieldsAccess.hxx
blobe303ab32244a091d041f764540c775850a80c5c8
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: IDocumentFieldsAccess.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 ************************************************************************/
31 #ifndef IDOCUMENTFIELDSACCESS_HXX_INCLUDED
32 #define IDOCUMENTFIELDSACCESS_HXX_INCLUDED
34 #include <sal/types.h>
35 #include <tools/solar.h>
37 class SwFldTypes;
38 class SwFieldType;
39 class SfxPoolItem;
40 struct SwPosition;
41 class SwDocUpdtFld;
42 class SwCalc;
43 class SwTxtFld;
44 class SwField;
45 class SwMsgPoolItem;
46 class DateTime;
47 class _SetGetExpFld;
48 struct SwHash;
49 class String;
50 class SwNode;
52 namespace com { namespace sun { namespace star { namespace uno { class Any; } } } }
54 /** Document fields related interfaces
56 class IDocumentFieldsAccess
58 public:
59 /**
61 virtual const SwFldTypes *GetFldTypes() const = 0;
63 /**
65 virtual SwFieldType *InsertFldType(const SwFieldType &) = 0;
67 /**
69 virtual SwFieldType *GetSysFldType( const sal_uInt16 eWhich ) const = 0;
71 /**
73 virtual SwFieldType* GetFldType(sal_uInt16 nResId, const String& rName, bool bDbFieldMatching) const = 0;
75 /**
77 virtual void RemoveFldType(sal_uInt16 nFld) = 0;
79 /**
81 virtual void UpdateFlds( SfxPoolItem* pNewHt, bool bCloseDB) = 0;
83 /**
85 virtual void InsDeletedFldType(SwFieldType &) = 0;
87 // #111840#
88 /**
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
94 @param rVal the value
95 @param nMId
97 @retval TRUE putting of value was successful
98 @retval FALSE else
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
103 // neu berechnet.
104 // #111840#
106 /** Updates a field.
108 @param rDstFmtFld field to update
109 @param rSrcFld field containing the new values
110 @param pMsgHnt
111 @param bUpdateTblFlds TRUE: update table fields, too.
113 @retval TRUE update was successful
114 @retval FALSE else
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
167 // Liste returnt.)
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;
190 protected:
191 virtual ~IDocumentFieldsAccess() {};
194 #endif // IDOCUMENTLINKSADMINISTRATION_HXX_INCLUDED