LibreOffice Module xmloff (master) 1
txtvfldi.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
25#pragma once
26
27#include "txtfldi.hxx"
28#include <com/sun/star/beans/XPropertySet.hpp>
29
30
33{
34 SvXMLImport& rImport;
36
37 OUString sValue;
38 double fValue;
39 sal_Int32 nFormatKey;
40 OUString sFormula;
41 OUString sDefault;
43
45 bool bFormatOK;
48
49 const bool bSetType;
50 const bool bSetValue;
51 const bool bSetStyle;
52 const bool bSetFormula;
53
54public:
56 SvXMLImport& rImprt,
58 bool bType,
59 bool bStyle,
60 bool bValue,
61 bool bFormula);
62
64 void ProcessAttribute( sal_Int32 nAttrToken,
65 std::string_view sAttrValue );
66
68 void PrepareField(
69 const css::uno::Reference<css::beans::XPropertySet> & xPropertySet);
70
72 bool IsStringValue() const { return bStringType; }
73
75 bool IsFormatOK() const { return bFormatOK; }
76
77 void SetDefault(const OUString& sStr) { sDefault = sStr; }
78};
79
80
106{
107private:
108 OUString sName;
109 OUString sFormula;
110 OUString sDescription;
111 OUString sHelp;
112 OUString sHint;
116
119 bool bHelpOK;
120 bool bHintOK;
122
131
132public:
133
134
136 // for XMLTextFieldImportContext:
137 SvXMLImport& rImport,
138 XMLTextImportHelper& rHlp,
139 const OUString& pServiceName,
140 // config variables for PrepareField behavior:
141 bool bFormula,
142 bool bFormulaDefault,
143 bool bDescription,
144 bool bHelp,
145 bool bHint,
146 bool bVisible,
147 bool bDisplayFormula,
148 bool bType,
149 bool bStyle,
150 bool bValue,
151 bool bPresentation);
152
153protected:
155 virtual void ProcessAttribute( sal_Int32 nAttrToken,
156 std::string_view sAttrValue ) override;
157
159 virtual void PrepareField(
160 const css::uno::Reference<
161 css::beans::XPropertySet> & xPropertySet) override;
162
163 // various accessor methods:
164 const OUString& GetName() const { return sName; }
165 bool IsStringValue() const { return aValueHelper.IsStringValue();}
166};
167
168
171{
172public:
173
174
176 SvXMLImport& rImport,
177 XMLTextImportHelper& rHlp);
178
179
180private:
182 virtual void PrepareField(
183 const css::uno::Reference<
184 css::beans::XPropertySet> & xPropertySet) override;
185};
186
187
190{
191public:
192
194 SvXMLImport& rImport,
195 XMLTextImportHelper& rHlp);
196
197private:
198 virtual void PrepareField(
199 const css::uno::Reference<
200 css::beans::XPropertySet> & xPropertySet) override;
201};
202
203/*** import text input fields (<text:text-input>) */
205{
206public:
207
209 SvXMLImport& rImport,
210 XMLTextImportHelper& rHlp);
211
212private:
213 virtual void PrepareField(
214 const css::uno::Reference<
215 css::beans::XPropertySet> & xPropertySet) override;
216};
217
218
224{
226
227public:
228
229
231 // for XMLTextFieldImportContext:
232 SvXMLImport& rImport,
233 XMLTextImportHelper& rHlp,
234 const OUString& pServiceName,
235 // for finding appropriate field master (see endFastElement())
236 VarType eVarType,
237 // config variables:
238 bool bFormula,
239 bool bFormulaDefault,
240 bool bDescription,
241 bool bHelp,
242 bool bHint,
243 bool bVisible,
244 bool bDisplayFormula,
245 bool bType,
246 bool bStyle,
247 bool bValue,
248 bool bPresentation);
249
250protected:
251
254 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
255
257 bool FindFieldMaster(
258 css::uno::Reference<
259 css::beans::XPropertySet> & xMaster);
260};
261
262
265{
266public:
267
269 SvXMLImport& rImport,
270 XMLTextImportHelper& rHlp);
271\
272private:
274 virtual void PrepareField(
275 const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override;
276};
277
278
281{
282public:
283
284
286 SvXMLImport& rImport,
287 XMLTextImportHelper& rHlp);
288
289private:
290
292 virtual void PrepareField(
293 const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override;
294};
295
296
299{
300
301public:
302
303
305 SvXMLImport& rImport,
306 XMLTextImportHelper& rHlp);
307};
308
311{
312
313public:
314
315
317 SvXMLImport& rImport,
318 XMLTextImportHelper& rHlp);
319
320 virtual void PrepareField(
321 const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override;
322};
323
324
327{
328 OUString sNumFormat;
330 OUString sRefName;
331
333
334public:
335
336
338 SvXMLImport& rImport,
339 XMLTextImportHelper& rHlp);
340
341private:
342
344 virtual void ProcessAttribute( sal_Int32 nAttrToken,
345 std::string_view sAttrValue ) override;
346
348 virtual void PrepareField(
349 const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override;
350};
351
352
358{
361
362public:
363
365 SvXMLImport& rImport,
366 XMLTextImportHelper& rHlp,
367 enum VarType eVarType);
368
369 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
370 sal_Int32 nElement,
371 const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
372};
373
379{
380public:
381
382
384 SvXMLImport& rImport,
385 XMLTextImportHelper& rHlp,
386 sal_Int32 nElement,
387 const css::uno::Reference< css::xml::sax::XFastAttributeList> & xAttrList,
388 enum VarType eVarType);
389
391 static bool FindFieldMaster(css::uno::Reference<css::beans::XPropertySet> & xMaster,
392 SvXMLImport& rImport,
393 XMLTextImportHelper& rHelper,
394 const OUString& sVarName,
395 enum VarType eVarType);
396};
397
398
401{
403
405
406public:
407
409 SvXMLImport& rImport,
410 XMLTextImportHelper& rHlp);
411
412private:
413
415 virtual void ProcessAttribute( sal_Int32 nAttrToken,
416 std::string_view sAttrValue ) override;
417
419 virtual void PrepareField(
420 const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override;
421};
422
423
426{
428
429 OUString sColumnName;
431
434
435public:
436
437
439 SvXMLImport& rImport,
440 XMLTextImportHelper& rHlp);
441
442private:
443
445 virtual void ProcessAttribute( sal_Int32 nAttrToken,
446 std::string_view sAttrValue ) override;
447
449 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
450};
451
452/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class deliberately does not support XWeak, to improve performance when loading large documents.
Definition: xmlictxt.hxx:48
friend class SvXMLImport
Definition: xmlictxt.hxx:49
import database display fields (<text:database-display>)
Definition: txtvfldi.hxx:426
XMLValueImportHelper aValueHelper
Definition: txtvfldi.hxx:427
XMLDatabaseDisplayImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp)
Definition: txtvfldi.cxx:902
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
create, prepare and insert database field master and database field
Definition: txtvfldi.cxx:945
virtual void ProcessAttribute(sal_Int32 nAttrToken, std::string_view sAttrValue) override
text import helper
Definition: txtvfldi.cxx:912
superclass for database fields: handle database and table names
Definition: txtfldi.hxx:308
import expression fields (<text:expression>)
Definition: txtvfldi.hxx:190
XMLExpressionFieldImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp)
Definition: txtvfldi.cxx:525
virtual void PrepareField(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet) override
Text import helper.
Definition: txtvfldi.cxx:539
sequence fields (<text:sequence>)
Definition: txtvfldi.hxx:327
virtual void ProcessAttribute(sal_Int32 nAttrToken, std::string_view sAttrValue) override
Text import helper.
Definition: txtvfldi.cxx:345
virtual void PrepareField(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet) override
prepare XTextField for insertion into document
Definition: txtvfldi.cxx:368
XMLSequenceFieldImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp)
Definition: txtvfldi.cxx:329
upperclass for variable/user-set, var/user-input, and sequence fields inds field master of appropriat...
Definition: txtvfldi.hxx:224
bool FindFieldMaster(css::uno::Reference< css::beans::XPropertySet > &xMaster)
find appropriate field master
Definition: txtvfldi.cxx:313
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
see XMLTextFieldImportContext
Definition: txtvfldi.cxx:261
XMLSetVarFieldImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, const OUString &pServiceName, VarType eVarType, bool bFormula, bool bFormulaDefault, bool bDescription, bool bHelp, bool bHint, bool bVisible, bool bDisplayFormula, bool bType, bool bStyle, bool bValue, bool bPresentation)
Definition: txtvfldi.cxx:247
import table formula fields (deprecated; for Writer 2.0 compatibility)
Definition: txtvfldi.hxx:401
virtual void ProcessAttribute(sal_Int32 nAttrToken, std::string_view sAttrValue) override
text import helper
Definition: txtvfldi.cxx:586
virtual void PrepareField(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet) override
prepare XTextField for insertion into document
Definition: txtvfldi.cxx:611
XMLTableFormulaImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp)
Definition: txtvfldi.cxx:577
XMLValueImportHelper aValueHelper
Definition: txtvfldi.hxx:402
abstract class for text field import
Definition: txtfldi.hxx:50
virtual void PrepareField(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet) override
Text import helper.
Definition: txtvfldi.cxx:565
XMLTextInputFieldImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp)
Definition: txtvfldi.cxx:552
user fields (<text:user-field-get>)
Definition: txtvfldi.hxx:299
XMLUserFieldImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp)
Definition: txtvfldi.cxx:456
user input fields (<text:user-field-input>)
Definition: txtvfldi.hxx:311
virtual void PrepareField(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet) override
Text import helper.
Definition: txtvfldi.cxx:486
XMLUserFieldInputImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp)
Definition: txtvfldi.cxx:474
void PrepareField(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet)
prepare XTextField for insertion into document
Definition: txtvfldi.cxx:1203
const bool bSetType
have we read the formula attribute?
Definition: txtvfldi.hxx:49
bool bFormatOK
is this a string (or a float) type?
Definition: txtvfldi.hxx:45
bool bFormulaOK
have we read a string-value attr.?
Definition: txtvfldi.hxx:47
bool IsFormatOK() const
has format been read?
Definition: txtvfldi.hxx:75
bool bIsDefaultLanguage
default (see bStringDefault/bFormulaDef.)
Definition: txtvfldi.hxx:42
OUString sFormula
format key (only valid of bFormatOK)
Definition: txtvfldi.hxx:40
bool bStringType
format (of nFormatKey) has system language?
Definition: txtvfldi.hxx:44
OUString sDefault
formula string
Definition: txtvfldi.hxx:41
XMLValueImportHelper(SvXMLImport &rImprt, XMLTextImportHelper &rHlp, bool bType, bool bStyle, bool bValue, bool bFormula)
should PrepareField set Formula?
Definition: txtvfldi.cxx:1054
const bool bSetStyle
should PrepareField set content/value?
Definition: txtvfldi.hxx:51
sal_Int32 nFormatKey
double value (only valid if bFloatValueOK)
Definition: txtvfldi.hxx:39
XMLTextImportHelper & rHelper
Definition: txtvfldi.hxx:35
const bool bSetFormula
should PrepareField set NumberFormat?
Definition: txtvfldi.hxx:52
void ProcessAttribute(sal_Int32 nAttrToken, std::string_view sAttrValue)
process formula (Prep.F.)
Definition: txtvfldi.cxx:1078
SvXMLImport & rImport
Definition: txtvfldi.hxx:34
bool IsStringValue() const
is value a string (rather than double)?
Definition: txtvfldi.hxx:72
double fValue
string value (only valid if bStringValueOK)
Definition: txtvfldi.hxx:38
bool bStringValueOK
have we read a style:data-style-name attr.?
Definition: txtvfldi.hxx:46
void SetDefault(const OUString &sStr)
Definition: txtvfldi.hxx:77
const bool bSetValue
should PrepareField set the SetExp subtype?
Definition: txtvfldi.hxx:50
abstract parent class for all variable related fields
Definition: txtvfldi.hxx:106
XMLVarFieldImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, const OUString &pServiceName, bool bFormula, bool bFormulaDefault, bool bDescription, bool bHelp, bool bHint, bool bVisible, bool bDisplayFormula, bool bType, bool bStyle, bool bValue, bool bPresentation)
set presentation frm elem. content?
Definition: txtvfldi.cxx:81
const OUString & GetName() const
Definition: txtvfldi.hxx:164
OUString sFormula
name attribute
Definition: txtvfldi.hxx:109
bool bDisplayOK
sHint was set
Definition: txtvfldi.hxx:121
OUString sHelp
description
Definition: txtvfldi.hxx:111
bool bSetDisplayFormula
set IsVisible
Definition: txtvfldi.hxx:129
bool bSetDescription
use content as default for formula
Definition: txtvfldi.hxx:125
OUString sHint
help text
Definition: txtvfldi.hxx:112
bool bDisplayFormula
value, value-type, and style
Definition: txtvfldi.hxx:114
virtual void ProcessAttribute(sal_Int32 nAttrToken, std::string_view sAttrValue) override
set presentation from elem. content
Definition: txtvfldi.cxx:109
bool bSetHelp
set sDescription with Hint-property
Definition: txtvfldi.hxx:126
XMLValueImportHelper aValueHelper
hint
Definition: txtvfldi.hxx:113
OUString sDescription
formula attribute
Definition: txtvfldi.hxx:110
bool bHintOK
sHelp was set
Definition: txtvfldi.hxx:120
bool bDescriptionOK
sFormula was set
Definition: txtvfldi.hxx:118
bool bSetPresentation
set DisplayFormula (sub type???)
Definition: txtvfldi.hxx:130
bool bFormulaOK
hide field?
Definition: txtvfldi.hxx:117
bool bDisplayNone
display formula?(rather than value)
Definition: txtvfldi.hxx:115
bool bSetFormulaDefault
set Formula property
Definition: txtvfldi.hxx:124
bool bSetFormula
sDisplayFormula/-None were set
Definition: txtvfldi.hxx:123
bool IsStringValue() const
Definition: txtvfldi.hxx:165
bool bHelpOK
sDescription was set
Definition: txtvfldi.hxx:119
virtual void PrepareField(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet) override
prepare XTextField for insertion into document
Definition: txtvfldi.cxx:174
variable field declarations (variable-decl, user-field-decl, sequence-decl)
Definition: txtvfldi.hxx:379
static bool FindFieldMaster(css::uno::Reference< css::beans::XPropertySet > &xMaster, SvXMLImport &rImport, XMLTextImportHelper &rHelper, const OUString &sVarName, enum VarType eVarType)
variable type
Definition: txtvfldi.cxx:780
XMLVariableDeclImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, enum VarType eVarType)
Definition: txtvfldi.cxx:683
variable declaration container for all variable fields (variable-decls, user-field-decls,...
Definition: txtvfldi.hxx:358
enum VarType eVarDeclsContextType
Definition: txtvfldi.hxx:359
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
variable type
Definition: txtvfldi.cxx:643
XMLVariableDeclsImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, enum VarType eVarType)
Definition: txtvfldi.cxx:635
XMLTextImportHelper & rImportHelper
Definition: txtvfldi.hxx:360
import variable get fields (<text:variable-get>)
Definition: txtvfldi.hxx:171
virtual void PrepareField(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet) override
Text import helper.
Definition: txtvfldi.cxx:511
XMLVariableGetFieldImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp)
Definition: txtvfldi.cxx:499
variable input fields (<text:variable-input>)
Definition: txtvfldi.hxx:281
virtual void PrepareField(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet) override
Text import helper.
Definition: txtvfldi.cxx:437
XMLVariableInputFieldImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp)
Definition: txtvfldi.cxx:423
import variable set fields (<text:variable-set>)
Definition: txtvfldi.hxx:265
virtual void PrepareField(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet) override
Text import helper.
Definition: txtvfldi.cxx:407
XMLVariableSetFieldImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp)
Definition: txtvfldi.cxx:393
VarType
variable type (for XMLSetVarFieldImportContext)
Definition: txtimp.hxx:82