xref: /trunk/main/sw/inc/IDocumentFieldsAccess.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef IDOCUMENTFIELDSACCESS_HXX_INCLUDED
29*cdf0e10cSrcweir #define IDOCUMENTFIELDSACCESS_HXX_INCLUDED
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <sal/types.h>
32*cdf0e10cSrcweir #include <tools/solar.h>
33*cdf0e10cSrcweir 
34*cdf0e10cSrcweir class SwFldTypes;
35*cdf0e10cSrcweir class SwFieldType;
36*cdf0e10cSrcweir class SfxPoolItem;
37*cdf0e10cSrcweir struct SwPosition;
38*cdf0e10cSrcweir class SwDocUpdtFld;
39*cdf0e10cSrcweir class SwCalc;
40*cdf0e10cSrcweir class SwTxtFld;
41*cdf0e10cSrcweir class SwField;
42*cdf0e10cSrcweir class SwMsgPoolItem;
43*cdf0e10cSrcweir class DateTime;
44*cdf0e10cSrcweir class _SetGetExpFld;
45*cdf0e10cSrcweir struct SwHash;
46*cdf0e10cSrcweir class String;
47*cdf0e10cSrcweir class SwNode;
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace uno { class Any; } } } }
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir  /** Document fields related interfaces
52*cdf0e10cSrcweir  */
53*cdf0e10cSrcweir  class IDocumentFieldsAccess
54*cdf0e10cSrcweir  {
55*cdf0e10cSrcweir  public:
56*cdf0e10cSrcweir     /**
57*cdf0e10cSrcweir     */
58*cdf0e10cSrcweir     virtual const SwFldTypes *GetFldTypes() const = 0;
59*cdf0e10cSrcweir 
60*cdf0e10cSrcweir     /**
61*cdf0e10cSrcweir     */
62*cdf0e10cSrcweir     virtual SwFieldType *InsertFldType(const SwFieldType &) = 0;
63*cdf0e10cSrcweir 
64*cdf0e10cSrcweir     /**
65*cdf0e10cSrcweir     */
66*cdf0e10cSrcweir     virtual SwFieldType *GetSysFldType( const sal_uInt16 eWhich ) const = 0;
67*cdf0e10cSrcweir 
68*cdf0e10cSrcweir     /**
69*cdf0e10cSrcweir     */
70*cdf0e10cSrcweir     virtual SwFieldType* GetFldType(sal_uInt16 nResId, const String& rName, bool bDbFieldMatching) const = 0;
71*cdf0e10cSrcweir 
72*cdf0e10cSrcweir     /**
73*cdf0e10cSrcweir     */
74*cdf0e10cSrcweir     virtual void RemoveFldType(sal_uInt16 nFld) = 0;
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir     /**
77*cdf0e10cSrcweir     */
78*cdf0e10cSrcweir     virtual void UpdateFlds( SfxPoolItem* pNewHt, bool bCloseDB) = 0;
79*cdf0e10cSrcweir 
80*cdf0e10cSrcweir     /**
81*cdf0e10cSrcweir     */
82*cdf0e10cSrcweir     virtual void InsDeletedFldType(SwFieldType &) = 0;
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir     // #111840#
85*cdf0e10cSrcweir     /**
86*cdf0e10cSrcweir        Puts a value into a field at a certain position.
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir        A missing field at the given position leads to a failure.
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir        @param rPosition        position of the field
91*cdf0e10cSrcweir        @param rVal             the value
92*cdf0e10cSrcweir        @param nMId
93*cdf0e10cSrcweir 
94*cdf0e10cSrcweir        @retval sal_True            putting of value was successful
95*cdf0e10cSrcweir        @retval sal_False           else
96*cdf0e10cSrcweir     */
97*cdf0e10cSrcweir     virtual bool PutValueToField(const SwPosition & rPos, const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich) = 0;
98*cdf0e10cSrcweir 
99*cdf0e10cSrcweir     // rufe das Update der Expression Felder auf; alle Ausdruecke werden
100*cdf0e10cSrcweir     // neu berechnet.
101*cdf0e10cSrcweir     // #111840#
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir     /** Updates a field.
104*cdf0e10cSrcweir 
105*cdf0e10cSrcweir         @param rDstFmtFld field to update
106*cdf0e10cSrcweir         @param rSrcFld field containing the new values
107*cdf0e10cSrcweir         @param pMsgHnt
108*cdf0e10cSrcweir         @param bUpdateTblFlds TRUE: update table fields, too.
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir         @retval sal_True             update was successful
111*cdf0e10cSrcweir         @retval sal_False            else
112*cdf0e10cSrcweir     */
113*cdf0e10cSrcweir     virtual bool UpdateFld(SwTxtFld * rDstFmtFld, SwField & rSrcFld, SwMsgPoolItem * pMsgHnt, bool bUpdateTblFlds) = 0;
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir     /**
116*cdf0e10cSrcweir     */
117*cdf0e10cSrcweir     virtual void UpdateRefFlds(SfxPoolItem* pHt) = 0;
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir     /**
120*cdf0e10cSrcweir     */
121*cdf0e10cSrcweir     virtual void UpdateTblFlds(SfxPoolItem* pHt) = 0;
122*cdf0e10cSrcweir 
123*cdf0e10cSrcweir     /**
124*cdf0e10cSrcweir     */
125*cdf0e10cSrcweir     virtual void UpdateExpFlds(SwTxtFld* pFld, bool bUpdateRefFlds) = 0;
126*cdf0e10cSrcweir 
127*cdf0e10cSrcweir     /**
128*cdf0e10cSrcweir     */
129*cdf0e10cSrcweir     virtual void UpdateUsrFlds() = 0;
130*cdf0e10cSrcweir 
131*cdf0e10cSrcweir     /**
132*cdf0e10cSrcweir     */
133*cdf0e10cSrcweir     virtual void UpdatePageFlds(SfxPoolItem*) = 0;
134*cdf0e10cSrcweir 
135*cdf0e10cSrcweir     /**
136*cdf0e10cSrcweir     */
137*cdf0e10cSrcweir     virtual void LockExpFlds() = 0;
138*cdf0e10cSrcweir 
139*cdf0e10cSrcweir     /**
140*cdf0e10cSrcweir     */
141*cdf0e10cSrcweir     virtual void UnlockExpFlds() = 0;
142*cdf0e10cSrcweir 
143*cdf0e10cSrcweir     /**
144*cdf0e10cSrcweir     */
145*cdf0e10cSrcweir     virtual bool IsExpFldsLocked() const = 0;
146*cdf0e10cSrcweir 
147*cdf0e10cSrcweir 
148*cdf0e10cSrcweir     virtual SwDocUpdtFld& GetUpdtFlds() const = 0;
149*cdf0e10cSrcweir 
150*cdf0e10cSrcweir     /*  @@@MAINTAINABILITY-HORROR@@@
151*cdf0e10cSrcweir         SwNode (see parameter pChk) is (?) part of the private
152*cdf0e10cSrcweir         data structure of SwDoc and should not be exposed
153*cdf0e10cSrcweir     */
154*cdf0e10cSrcweir     virtual bool SetFieldsDirty(bool b, const SwNode* pChk, sal_uLong nLen) = 0;
155*cdf0e10cSrcweir 
156*cdf0e10cSrcweir     /**
157*cdf0e10cSrcweir     */
158*cdf0e10cSrcweir     virtual void SetFixFields(bool bOnlyTimeDate, const DateTime* pNewDateTime) = 0;
159*cdf0e10cSrcweir 
160*cdf0e10cSrcweir     // Setze im Calculator alle SetExpresion Felder, die bis zur
161*cdf0e10cSrcweir     // angegebenen Position (Node [ + ::com::sun::star::ucb::Content]) gueltig sind. Es kann
162*cdf0e10cSrcweir     // eine erzeugte Liste aller Felder mit uebergegeben werden.
163*cdf0e10cSrcweir     // (ist die Adresse != 0, und der Pointer == 0 wird eine neue
164*cdf0e10cSrcweir     // Liste returnt.)
165*cdf0e10cSrcweir     virtual void FldsToCalc(SwCalc& rCalc, sal_uLong nLastNd, sal_uInt16 nLastCnt) = 0;
166*cdf0e10cSrcweir 
167*cdf0e10cSrcweir     /**
168*cdf0e10cSrcweir     */
169*cdf0e10cSrcweir     virtual void FldsToCalc(SwCalc& rCalc, const _SetGetExpFld& rToThisFld) = 0;
170*cdf0e10cSrcweir 
171*cdf0e10cSrcweir     /**
172*cdf0e10cSrcweir     */
173*cdf0e10cSrcweir     virtual void FldsToExpand(SwHash**& ppTbl, sal_uInt16& rTblSize, const _SetGetExpFld& rToThisFld) = 0;
174*cdf0e10cSrcweir 
175*cdf0e10cSrcweir     /**
176*cdf0e10cSrcweir     */
177*cdf0e10cSrcweir     virtual bool IsNewFldLst() const = 0;
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir     /**
180*cdf0e10cSrcweir     */
181*cdf0e10cSrcweir     virtual void SetNewFldLst( bool bFlag) = 0;
182*cdf0e10cSrcweir 
183*cdf0e10cSrcweir     /**
184*cdf0e10cSrcweir     */
185*cdf0e10cSrcweir     virtual void InsDelFldInFldLst(bool bIns, const SwTxtFld& rFld) = 0;
186*cdf0e10cSrcweir 
187*cdf0e10cSrcweir protected:
188*cdf0e10cSrcweir     virtual ~IDocumentFieldsAccess() {};
189*cdf0e10cSrcweir  };
190*cdf0e10cSrcweir 
191*cdf0e10cSrcweir  #endif // IDOCUMENTLINKSADMINISTRATION_HXX_INCLUDED
192