android: Update app-specific/MIME type icons
[LibreOffice.git] / sw / inc / IDocumentFieldsAccess.hxx
blob4664ae3bc84639f83b5b08ff68093fdad6f9fa49
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include <sal/config.h>
24 #include <rtl/ustring.hxx>
25 #include <sal/types.h>
26 #include "swtypes.hxx"
27 #include "nodeoffset.hxx"
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 class SwTable;
42 enum class SwFieldIds : sal_uInt16;
43 template <class T> class SwHashTable;
44 struct HashStr;
45 class SwRootFrame;
46 class IDocumentRedlineAccess;
48 namespace com::sun::star::uno { class Any; }
50 /** Document fields related interfaces
52 class IDocumentFieldsAccess
54 public:
55 virtual const SwFieldTypes *GetFieldTypes() const = 0;
57 virtual SwFieldType *InsertFieldType(const SwFieldType &) = 0;
59 virtual SwFieldType *GetSysFieldType( const SwFieldIds eWhich ) const = 0;
61 virtual SwFieldType* GetFieldType(SwFieldIds nResId, const OUString& rName, bool bDbFieldMatching) const = 0;
63 virtual void RemoveFieldType(size_t nField) = 0;
65 virtual void UpdateFields(bool bCloseDB) = 0;
67 virtual void InsDeletedFieldType(SwFieldType &) = 0;
69 /**
70 Puts a value into a field at a certain position.
72 A missing field at the given position leads to a failure.
74 @param rPosition position of the field
75 @param rVal the value
76 @param nMId
78 @retval true putting of value was successful
79 @retval false else
81 virtual void PutValueToField(const SwPosition & rPos, const css::uno::Any& rVal, sal_uInt16 nWhich) = 0;
83 // Call update of expression fields. All expressions are re-evaluated.
85 /** Updates a field.
87 @param rDstFormatField field to update
88 @param rSrcField field containing the new values
89 @param pMsgHint
90 @param bUpdateTableFields TRUE: update table fields, too.
92 @retval true update was successful
93 @retval false else
95 virtual bool UpdateField(SwTextField * rDstFormatField, SwField & rSrcField, bool bUpdateTableFields) = 0;
97 virtual void UpdateRefFields() = 0;
99 virtual void UpdateTableFields(const SwTable* pTable) = 0;
101 virtual void UpdateExpFields(SwTextField* pField, bool bUpdateRefFields) = 0;
103 virtual void UpdateUsrFields() = 0;
105 virtual void UpdatePageFields(const SwTwips) = 0;
107 virtual void LockExpFields() = 0;
109 virtual void UnlockExpFields() = 0;
111 virtual bool IsExpFieldsLocked() const = 0;
113 virtual SwDocUpdateField& GetUpdateFields() const = 0;
115 /* @@@MAINTAINABILITY-HORROR@@@
116 SwNode (see parameter pChk) is (?) part of the private
117 data structure of SwDoc and should not be exposed
119 virtual bool SetFieldsDirty(bool b, const SwNode* pChk, SwNodeOffset nLen) = 0;
121 virtual void SetFixFields(const DateTime* pNewDateTime) = 0;
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;
129 virtual void FieldsToCalc(SwCalc& rCalc, const SetGetExpField& rToThisField, SwRootFrame const* pLayout) = 0;
131 virtual void FieldsToExpand(SwHashTable<HashStr> & rTable, const SetGetExpField& rToThisField, SwRootFrame const& rLayout) = 0;
133 virtual bool IsNewFieldLst() const = 0;
135 virtual void SetNewFieldLst( bool bFlag) = 0;
137 virtual void InsDelFieldInFieldLst(bool bIns, const SwTextField& rField) = 0;
139 virtual sal_Int32 GetRecordsPerDocument() const = 0;
141 protected:
142 virtual ~IDocumentFieldsAccess() {};
145 namespace sw {
146 bool IsFieldDeletedInModel(IDocumentRedlineAccess const& rIDRA,
147 SwTextField const& rTextField);
150 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */