Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef IDOCUMENTFIELDSACCESS_HXX_INCLUDED
30 : : #define IDOCUMENTFIELDSACCESS_HXX_INCLUDED
31 : :
32 : : #include <sal/types.h>
33 : : #include <tools/solar.h>
34 : :
35 : : class SwFldTypes;
36 : : class SwFieldType;
37 : : class SfxPoolItem;
38 : : struct SwPosition;
39 : : class SwDocUpdtFld;
40 : : class SwCalc;
41 : : class SwTxtFld;
42 : : class SwField;
43 : : class SwMsgPoolItem;
44 : : class DateTime;
45 : : class _SetGetExpFld;
46 : : struct SwHash;
47 : : class String;
48 : : class SwNode;
49 : :
50 : : namespace com { namespace sun { namespace star { namespace uno { class Any; } } } }
51 : :
52 : : /** Document fields related interfaces
53 : : */
54 : 1549 : class IDocumentFieldsAccess
55 : : {
56 : : public:
57 : : virtual const SwFldTypes *GetFldTypes() const = 0;
58 : :
59 : : virtual SwFieldType *InsertFldType(const SwFieldType &) = 0;
60 : :
61 : : virtual SwFieldType *GetSysFldType( const sal_uInt16 eWhich ) const = 0;
62 : :
63 : : virtual SwFieldType* GetFldType(sal_uInt16 nResId, const String& rName, bool bDbFieldMatching) const = 0;
64 : :
65 : : virtual void RemoveFldType(sal_uInt16 nFld) = 0;
66 : :
67 : : virtual void UpdateFlds( SfxPoolItem* pNewHt, bool bCloseDB) = 0;
68 : :
69 : : virtual void InsDeletedFldType(SwFieldType &) = 0;
70 : :
71 : : /**
72 : : Puts a value into a field at a certain position.
73 : :
74 : : A missing field at the given position leads to a failure.
75 : :
76 : : @param rPosition position of the field
77 : : @param rVal the value
78 : : @param nMId
79 : :
80 : : @retval sal_True putting of value was successful
81 : : @retval sal_False else
82 : : */
83 : : virtual bool PutValueToField(const SwPosition & rPos, const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich) = 0;
84 : :
85 : : // Call update of expression fields. All expressions are re-evaluated.
86 : :
87 : : /** Updates a field.
88 : :
89 : : @param rDstFmtFld field to update
90 : : @param rSrcFld field containing the new values
91 : : @param pMsgHnt
92 : : @param bUpdateTblFlds TRUE: update table fields, too.
93 : :
94 : : @retval sal_True update was successful
95 : : @retval sal_False else
96 : : */
97 : : virtual bool UpdateFld(SwTxtFld * rDstFmtFld, SwField & rSrcFld, SwMsgPoolItem * pMsgHnt, bool bUpdateTblFlds) = 0;
98 : :
99 : : virtual void UpdateRefFlds(SfxPoolItem* pHt) = 0;
100 : :
101 : : virtual void UpdateTblFlds(SfxPoolItem* pHt) = 0;
102 : :
103 : : virtual void UpdateExpFlds(SwTxtFld* pFld, bool bUpdateRefFlds) = 0;
104 : :
105 : : virtual void UpdateUsrFlds() = 0;
106 : :
107 : : virtual void UpdatePageFlds(SfxPoolItem*) = 0;
108 : :
109 : : virtual void LockExpFlds() = 0;
110 : :
111 : : virtual void UnlockExpFlds() = 0;
112 : :
113 : : virtual bool IsExpFldsLocked() const = 0;
114 : :
115 : : virtual SwDocUpdtFld& GetUpdtFlds() const = 0;
116 : :
117 : : /* @@@MAINTAINABILITY-HORROR@@@
118 : : SwNode (see parameter pChk) is (?) part of the private
119 : : data structure of SwDoc and should not be exposed
120 : : */
121 : : virtual bool SetFieldsDirty(bool b, const SwNode* pChk, sal_uLong nLen) = 0;
122 : :
123 : : virtual void SetFixFields(bool bOnlyTimeDate, const DateTime* pNewDateTime) = 0;
124 : :
125 : :
126 : : // In Calculator set all SetExpression fields that are valid up to the indicated position
127 : : // (Node [ + ::com::sun::star::ucb::Content]).
128 : : // A generated list of all fields may be passed along too
129 : : // (if the addreess != 0 and the pointer == 0 a new list will be returned).
130 : : virtual void FldsToCalc(SwCalc& rCalc, sal_uLong nLastNd, sal_uInt16 nLastCnt) = 0;
131 : :
132 : : virtual void FldsToCalc(SwCalc& rCalc, const _SetGetExpFld& rToThisFld) = 0;
133 : :
134 : : virtual void FldsToExpand(SwHash**& ppTbl, sal_uInt16& rTblSize, const _SetGetExpFld& rToThisFld) = 0;
135 : :
136 : : virtual bool IsNewFldLst() const = 0;
137 : :
138 : : virtual void SetNewFldLst( bool bFlag) = 0;
139 : :
140 : : virtual void InsDelFldInFldLst(bool bIns, const SwTxtFld& rFld) = 0;
141 : :
142 : : protected:
143 [ - + ]: 1458 : virtual ~IDocumentFieldsAccess() {};
144 : : };
145 : :
146 : : #endif // IDOCUMENTLINKSADMINISTRATION_HXX_INCLUDED
147 : :
148 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|