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#pragma once
21
22#include <sal/config.h>
23
24#include <rtl/ustring.hxx>
25#include <sal/types.h>
26#include "swtypes.hxx"
27#include "nodeoffset.hxx"
28
29class SwFieldTypes;
30class SwFieldType;
31class SfxPoolItem;
32struct SwPosition;
34class SwCalc;
35class SwTextField;
36class SwField;
37class SwMsgPoolItem;
38class DateTime;
39class SetGetExpField;
40class SwNode;
41class SwTable;
42enum class SwFieldIds : sal_uInt16;
43template <class T> class SwHashTable;
44struct HashStr;
45class SwRootFrame;
47
48namespace com::sun::star::uno { class Any; }
49
53 {
54 public:
55 virtual const SwFieldTypes *GetFieldTypes() const = 0;
56
58
59 virtual SwFieldType *GetSysFieldType( const SwFieldIds eWhich ) const = 0;
60
61 virtual SwFieldType* GetFieldType(SwFieldIds nResId, const OUString& rName, bool bDbFieldMatching) const = 0;
62
63 virtual void RemoveFieldType(size_t nField) = 0;
64
65 virtual void UpdateFields(bool bCloseDB) = 0;
66
67 virtual void InsDeletedFieldType(SwFieldType &) = 0;
68
81 virtual void PutValueToField(const SwPosition & rPos, const css::uno::Any& rVal, sal_uInt16 nWhich) = 0;
82
83 // Call update of expression fields. All expressions are re-evaluated.
84
95 virtual bool UpdateField(SwTextField * rDstFormatField, SwField & rSrcField, bool bUpdateTableFields) = 0;
96
97 virtual void UpdateRefFields() = 0;
98
99 virtual void UpdateTableFields(const SwTable* pTable) = 0;
100
101 virtual void UpdateExpFields(SwTextField* pField, bool bUpdateRefFields) = 0;
102
103 virtual void UpdateUsrFields() = 0;
104
105 virtual void UpdatePageFields(const SwTwips) = 0;
106
107 virtual void LockExpFields() = 0;
108
109 virtual void UnlockExpFields() = 0;
110
111 virtual bool IsExpFieldsLocked() const = 0;
112
113 virtual SwDocUpdateField& GetUpdateFields() const = 0;
114
115 /* @@@MAINTAINABILITY-HORROR@@@
116 SwNode (see parameter pChk) is (?) part of the private
117 data structure of SwDoc and should not be exposed
118 */
119 virtual bool SetFieldsDirty(bool b, const SwNode* pChk, SwNodeOffset nLen) = 0;
120
121 virtual void SetFixFields(const DateTime* pNewDateTime) = 0;
122
123 // In Calculator set all SetExpression fields that are valid up to the indicated position
124 // (Node [ + css::ucb::Content]).
125 // A generated list of all fields may be passed along too
126 // (if the address != 0 and the pointer == 0 a new list will be returned).
127 virtual void FieldsToCalc(SwCalc& rCalc, SwNodeOffset nLastNd, sal_Int32 nLastCnt) = 0;
128
129 virtual void FieldsToCalc(SwCalc& rCalc, const SetGetExpField& rToThisField, SwRootFrame const* pLayout) = 0;
130
131 virtual void FieldsToExpand(SwHashTable<HashStr> & rTable, const SetGetExpField& rToThisField, SwRootFrame const& rLayout) = 0;
132
133 virtual bool IsNewFieldLst() const = 0;
134
135 virtual void SetNewFieldLst( bool bFlag) = 0;
136
137 virtual void InsDelFieldInFieldLst(bool bIns, const SwTextField& rField) = 0;
138
139 virtual sal_Int32 GetRecordsPerDocument() const = 0;
140
141protected:
143 };
144
145namespace sw {
147 SwTextField const& rTextField);
148}
149
150/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Document fields related interfaces.
virtual void SetNewFieldLst(bool bFlag)=0
virtual bool SetFieldsDirty(bool b, const SwNode *pChk, SwNodeOffset nLen)=0
virtual void UpdateTableFields(const SwTable *pTable)=0
virtual void InsDeletedFieldType(SwFieldType &)=0
virtual void FieldsToCalc(SwCalc &rCalc, const SetGetExpField &rToThisField, SwRootFrame const *pLayout)=0
virtual void InsDelFieldInFieldLst(bool bIns, const SwTextField &rField)=0
virtual SwFieldType * GetSysFieldType(const SwFieldIds eWhich) const =0
virtual void FieldsToExpand(SwHashTable< HashStr > &rTable, const SetGetExpField &rToThisField, SwRootFrame const &rLayout)=0
virtual SwFieldType * GetFieldType(SwFieldIds nResId, const OUString &rName, bool bDbFieldMatching) const =0
virtual void UpdateRefFields()=0
virtual bool IsNewFieldLst() const =0
virtual void UpdateUsrFields()=0
virtual SwFieldType * InsertFieldType(const SwFieldType &)=0
virtual const SwFieldTypes * GetFieldTypes() const =0
virtual void UpdatePageFields(const SwTwips)=0
virtual SwDocUpdateField & GetUpdateFields() const =0
virtual void LockExpFields()=0
virtual void SetFixFields(const DateTime *pNewDateTime)=0
virtual void UpdateFields(bool bCloseDB)=0
virtual void RemoveFieldType(size_t nField)=0
virtual sal_Int32 GetRecordsPerDocument() 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.
virtual bool IsExpFieldsLocked() const =0
virtual bool UpdateField(SwTextField *rDstFormatField, SwField &rSrcField, bool bUpdateTableFields)=0
Updates a field.
virtual void UpdateExpFields(SwTextField *pField, bool bUpdateRefFields)=0
virtual void FieldsToCalc(SwCalc &rCalc, SwNodeOffset nLastNd, sal_Int32 nLastCnt)=0
virtual void UnlockExpFields()=0
Definition: calc.hxx:200
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:247
Base class of all fields.
Definition: fldbas.hxx:296
T should be a subclass of SwHash.
Definition: calc.hxx:155
Base class of the Writer document model elements.
Definition: node.hxx:98
The root element of a Writer document layout.
Definition: rootfrm.hxx:85
SwTable is one table in the document model, containing rows (which contain cells).
Definition: swtable.hxx:113
SwFieldIds
Definition: fldbas.hxx:49
Dialog to specify the properties of date form field.
bool IsFieldDeletedInModel(IDocumentRedlineAccess const &rIDRA, SwTextField const &rTextField)
Marks a position in the document model.
Definition: pam.hxx:38
tools::Long SwTwips
Definition: swtypes.hxx:51