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