LibreOffice Module sw (master)  1
IDocumentFieldsAccess.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_SW_INC_IDOCUMENTFIELDSACCESS_HXX
21 #define INCLUDED_SW_INC_IDOCUMENTFIELDSACCESS_HXX
22 
23 #include <sal/config.h>
24 
25 #include <rtl/ustring.hxx>
26 #include <sal/types.h>
27 #include "nodeoffset.hxx"
28 
29 class SwFieldTypes;
30 class SwFieldType;
31 class SfxPoolItem;
32 struct SwPosition;
33 class SwDocUpdateField;
34 class SwCalc;
35 class SwTextField;
36 class SwField;
37 class SwMsgPoolItem;
38 class DateTime;
39 class SetGetExpField;
40 class SwNode;
41 enum class SwFieldIds : sal_uInt16;
42 template <class T> class SwHashTable;
43 struct HashStr;
44 class SwRootFrame;
46 
47 namespace com::sun::star::uno { class Any; }
48 
52  {
53  public:
54  virtual const SwFieldTypes *GetFieldTypes() const = 0;
55 
56  virtual SwFieldType *InsertFieldType(const SwFieldType &) = 0;
57 
58  virtual SwFieldType *GetSysFieldType( const SwFieldIds eWhich ) const = 0;
59 
60  virtual SwFieldType* GetFieldType(SwFieldIds nResId, const OUString& rName, bool bDbFieldMatching) const = 0;
61 
62  virtual void RemoveFieldType(size_t nField) = 0;
63 
64  virtual void UpdateFields(bool bCloseDB) = 0;
65 
66  virtual void InsDeletedFieldType(SwFieldType &) = 0;
67 
80  virtual void PutValueToField(const SwPosition & rPos, const css::uno::Any& rVal, sal_uInt16 nWhich) = 0;
81 
82  // Call update of expression fields. All expressions are re-evaluated.
83 
94  virtual bool UpdateField(SwTextField * rDstFormatField, SwField & rSrcField, SwMsgPoolItem * pMsgHint, bool bUpdateTableFields) = 0;
95 
96  virtual void UpdateRefFields() = 0;
97 
98  virtual void UpdateTableFields(SfxPoolItem* pHt) = 0;
99 
100  virtual void UpdateExpFields(SwTextField* pField, bool bUpdateRefFields) = 0;
101 
102  virtual void UpdateUsrFields() = 0;
103 
104  virtual void UpdatePageFields(SfxPoolItem*) = 0;
105 
106  virtual void LockExpFields() = 0;
107 
108  virtual void UnlockExpFields() = 0;
109 
110  virtual bool IsExpFieldsLocked() const = 0;
111 
112  virtual SwDocUpdateField& GetUpdateFields() const = 0;
113 
114  /* @@@MAINTAINABILITY-HORROR@@@
115  SwNode (see parameter pChk) is (?) part of the private
116  data structure of SwDoc and should not be exposed
117  */
118  virtual bool SetFieldsDirty(bool b, const SwNode* pChk, SwNodeOffset nLen) = 0;
119 
120  virtual void SetFixFields(const DateTime* pNewDateTime) = 0;
121 
122  // In Calculator set all SetExpression fields that are valid up to the indicated position
123  // (Node [ + css::ucb::Content]).
124  // A generated list of all fields may be passed along too
125  // (if the address != 0 and the pointer == 0 a new list will be returned).
126  virtual void FieldsToCalc(SwCalc& rCalc, SwNodeOffset nLastNd, sal_Int32 nLastCnt) = 0;
127 
128  virtual void FieldsToCalc(SwCalc& rCalc, const SetGetExpField& rToThisField, SwRootFrame const* pLayout) = 0;
129 
130  virtual void FieldsToExpand(SwHashTable<HashStr> & rTable, const SetGetExpField& rToThisField, SwRootFrame const& rLayout) = 0;
131 
132  virtual bool IsNewFieldLst() const = 0;
133 
134  virtual void SetNewFieldLst( bool bFlag) = 0;
135 
136  virtual void InsDelFieldInFieldLst(bool bIns, const SwTextField& rField) = 0;
137 
138  virtual sal_Int32 GetRecordsPerDocument() const = 0;
139 
140 protected:
142  };
143 
144 namespace sw {
146  SwTextField const& rTextField);
147 }
148 
149 #endif // INCLUDED_SW_INC_IDOCUMENTFIELDSACCESS_HXX
150 
151 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:241
Definition: calc.hxx:194
Marks a position in the document model.
Definition: pam.hxx:36
virtual void FieldsToCalc(SwCalc &rCalc, SwNodeOffset nLastNd, sal_Int32 nLastCnt)=0
virtual void UpdatePageFields(SfxPoolItem *)=0
virtual SwFieldType * GetFieldType(SwFieldIds nResId, const OUString &rName, bool bDbFieldMatching) const =0
Base class of all fields.
Definition: fldbas.hxx:291
Dialog to specify the properties of date form field.
virtual void FieldsToExpand(SwHashTable< HashStr > &rTable, const SetGetExpField &rToThisField, SwRootFrame const &rLayout)=0
The root element of a Writer document layout.
Definition: rootfrm.hxx:81
virtual bool UpdateField(SwTextField *rDstFormatField, SwField &rSrcField, SwMsgPoolItem *pMsgHint, bool bUpdateTableFields)=0
Updates a field.
virtual void LockExpFields()=0
virtual void UpdateExpFields(SwTextField *pField, bool bUpdateRefFields)=0
virtual void InsDelFieldInFieldLst(bool bIns, const SwTextField &rField)=0
virtual void UpdateTableFields(SfxPoolItem *pHt)=0
virtual bool IsExpFieldsLocked() const =0
virtual void UpdateUsrFields()=0
virtual void UpdateRefFields()=0
Document fields related interfaces.
virtual void SetNewFieldLst(bool bFlag)=0
SwFieldIds
Definition: fldbas.hxx:45
virtual void InsDeletedFieldType(SwFieldType &)=0
virtual sal_Int32 GetRecordsPerDocument() const =0
virtual bool SetFieldsDirty(bool b, const SwNode *pChk, SwNodeOffset nLen)=0
virtual const SwFieldTypes * GetFieldTypes() const =0
virtual void PutValueToField(const SwPosition &rPos, const css::uno::Any &rVal, sal_uInt16 nWhich)=0
Puts a value into a field at a certain position.
bool IsFieldDeletedInModel(IDocumentRedlineAccess const &rIDRA, SwTextField const &rTextField)
virtual SwFieldType * InsertFieldType(const SwFieldType &)=0
virtual void SetFixFields(const DateTime *pNewDateTime)=0
virtual SwDocUpdateField & GetUpdateFields() const =0
virtual SwFieldType * GetSysFieldType(const SwFieldIds eWhich) const =0
virtual void UnlockExpFields()=0
virtual void UpdateFields(bool bCloseDB)=0
virtual bool IsNewFieldLst() const =0
T should be a subclass of SwHash.
Definition: calc.hxx:153
virtual void RemoveFieldType(size_t nField)=0
Base class of the Writer document model elements.
Definition: node.hxx:81