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_uInt16 nAttrToken,
66  const OUString& 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 char* pServiceName,
141  sal_uInt16 nPrfx,
142  const OUString& rLocalName,
143  // config variables for PrepareField behavior:
144  bool bFormula,
145  bool bFormulaDefault,
146  bool bDescription,
147  bool bHelp,
148  bool bHint,
149  bool bVisible,
150  bool bDisplayFormula,
151  bool bType,
152  bool bStyle,
153  bool bValue,
154  bool bPresentation);
155 
156 protected:
158  virtual void ProcessAttribute( sal_uInt16 nAttrToken,
159  const OUString& sAttrValue ) override;
160 
162  virtual void PrepareField(
163  const css::uno::Reference<
164  css::beans::XPropertySet> & xPropertySet) override;
165 
166  // various accessor methods:
167  const OUString& GetName() const { return sName; }
168  bool IsStringValue() const { return aValueHelper.IsStringValue();}
169 };
170 
171 
174 {
175 public:
176 
177 
179  SvXMLImport& rImport,
180  XMLTextImportHelper& rHlp,
181  sal_uInt16 nPrfx,
182  const OUString& rLocalName);
183 
184 
185 private:
187  virtual void PrepareField(
188  const css::uno::Reference<
189  css::beans::XPropertySet> & xPropertySet) override;
190 };
191 
192 
195 {
196 public:
197 
199  SvXMLImport& rImport,
200  XMLTextImportHelper& rHlp,
201  sal_uInt16 nPrfx,
202  const OUString& sLocalName);
203 
204 private:
205  virtual void PrepareField(
206  const css::uno::Reference<
207  css::beans::XPropertySet> & xPropertySet) override;
208 };
209 
210 /*** import text input fields (<text:text-input>) */
212 {
213 public:
214 
216  SvXMLImport& rImport,
217  XMLTextImportHelper& rHlp,
218  sal_uInt16 nPrfx,
219  const OUString& sLocalName);
220 
221 private:
222  virtual void PrepareField(
223  const css::uno::Reference<
224  css::beans::XPropertySet> & xPropertySet) override;
225 };
226 
227 
233 {
235 
236 public:
237 
238 
240  // for XMLTextFieldImportContext:
241  SvXMLImport& rImport,
242  XMLTextImportHelper& rHlp,
243  const char* pServiceName,
244  sal_uInt16 nPrfx,
245  const OUString& rLocalName,
246  // for finding appropriate field master (see EndElement())
247  VarType eVarType,
248  // config variables:
249  bool bFormula,
250  bool bFormulaDefault,
251  bool bDescription,
252  bool bHelp,
253  bool bHint,
254  bool bVisible,
255  bool bDisplayFormula,
256  bool bType,
257  bool bStyle,
258  bool bValue,
259  bool bPresentation);
260 
261 protected:
262 
265  virtual void EndElement() override;
266 
268  bool FindFieldMaster(
269  css::uno::Reference<
270  css::beans::XPropertySet> & xMaster);
271 };
272 
273 
276 {
277 public:
278 
280  SvXMLImport& rImport,
281  XMLTextImportHelper& rHlp,
282  sal_uInt16 nPrfx,
283  const OUString& rLocalName);
284 
285 private:
287  virtual void PrepareField(
288  const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override;
289 };
290 
291 
294 {
295 public:
296 
297 
299  SvXMLImport& rImport,
300  XMLTextImportHelper& rHlp,
301  sal_uInt16 nPrfx,
302  const OUString& rLocalName);
303 
304 private:
305 
307  virtual void PrepareField(
308  const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override;
309 };
310 
311 
314 {
315 
316 public:
317 
318 
320  SvXMLImport& rImport,
321  XMLTextImportHelper& rHlp,
322  sal_uInt16 nPrfx,
323  const OUString& rLocalName);
324 };
325 
328 {
329 
330 public:
331 
332 
334  SvXMLImport& rImport,
335  XMLTextImportHelper& rHlp,
336  sal_uInt16 nPrfx,
337  const OUString& rLocalName);
338 
339  virtual void PrepareField(
340  const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override;
341 };
342 
343 
346 {
347  OUString sNumFormat;
348  OUString sNumFormatSync;
349  OUString sRefName;
350 
352 
353 public:
354 
355 
357  SvXMLImport& rImport,
358  XMLTextImportHelper& rHlp,
359  sal_uInt16 nPrfx,
360  const OUString& rLocalName);
361 
362 private:
363 
365  virtual void ProcessAttribute( sal_uInt16 nAttrToken,
366  const OUString& sAttrValue ) override;
367 
369  virtual void PrepareField(
370  const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override;
371 };
372 
373 
379 {
382 
383 public:
384 
385 
387  SvXMLImport& rImport,
388  XMLTextImportHelper& rHlp,
389  sal_uInt16 nPrfx,
390  const OUString& rLocalName,
391  enum VarType eVarType);
392 
394  sal_uInt16 nPrefix,
395  const OUString& rLocalName,
396  const css::uno::Reference<css::xml::sax::XAttributeList> & xAttrList ) override;
397 };
398 
404 {
405 public:
406 
407 
409  SvXMLImport& rImport,
410  XMLTextImportHelper& rHlp,
411  sal_uInt16 nPrfx,
412  const OUString& rLocalName,
413  const css::uno::Reference< css::xml::sax::XAttributeList> & xAttrList,
414  enum VarType eVarType);
415 
417  static bool FindFieldMaster(css::uno::Reference<css::beans::XPropertySet> & xMaster,
418  SvXMLImport& rImport,
419  XMLTextImportHelper& rHelper,
420  const OUString& sVarName,
421  enum VarType eVarType);
422 };
423 
424 
427 {
429 
431 
432 public:
433 
435  SvXMLImport& rImport,
436  XMLTextImportHelper& rHlp,
437  sal_uInt16 nPrfx,
438  const OUString& rLocalName);
439 
440 private:
441 
443  virtual void ProcessAttribute( sal_uInt16 nAttrToken,
444  const OUString& sAttrValue ) override;
445 
447  virtual void PrepareField(
448  const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override;
449 };
450 
451 
454 {
456 
457  OUString sColumnName;
458  bool bColumnOK;
459 
460  bool bDisplay;
462 
463 public:
464 
465 
467  SvXMLImport& rImport,
468  XMLTextImportHelper& rHlp,
469  sal_uInt16 nPrfx,
470  const OUString& rLocalName);
471 
472 private:
473 
475  virtual void ProcessAttribute( sal_uInt16 nAttrToken,
476  const OUString& sAttrValue ) override;
477 
479  virtual void EndElement() override;
480 };
481 
482 #endif
483 
484 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool FindFieldMaster(css::uno::Reference< css::beans::XPropertySet > &xMaster)
find appropriate field master
Definition: txtvfldi.cxx:315
double fValue
string value (only valid if bStringValueOK)
Definition: txtvfldi.hxx:39
XMLValueImportHelper aValueHelper
Definition: txtvfldi.hxx:428
XMLValueImportHelper aValueHelper
hint
Definition: txtvfldi.hxx:114
void SetDefault(const OUString &sStr)
Definition: txtvfldi.hxx:78
bool bSetDisplayFormula
set IsVisible
Definition: txtvfldi.hxx:130
XMLSequenceFieldImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, sal_uInt16 nPrfx, const OUString &rLocalName)
Definition: txtvfldi.cxx:331
const bool bSetType
have we read the formula attribute?
Definition: txtvfldi.hxx:50
XMLVarFieldImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, const char *pServiceName, sal_uInt16 nPrfx, const OUString &rLocalName, 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:80
virtual void PrepareField(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet) override
element name w/o prefix
Definition: txtvfldi.cxx:551
enum VarType eVarDeclsContextType
Definition: txtvfldi.hxx:380
virtual void ProcessAttribute(sal_uInt16 nAttrToken, const OUString &sAttrValue) override
set presentation from elem. content
Definition: txtvfldi.cxx:109
const bool bSetFormula
should PrepareField set NumberFormat?
Definition: txtvfldi.hxx:53
superclass for database fields: handle database and table names
Definition: txtfldi.hxx:386
virtual void PrepareField(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet) override
element name w/o prefix
Definition: txtvfldi.cxx:579
virtual void ProcessAttribute(sal_uInt16 nAttrToken, const OUString &sAttrValue) override
element name w/o prefix
Definition: txtvfldi.cxx:603
sal_Int32 nFormatKey
double value (only valid if bFloatValueOK)
Definition: txtvfldi.hxx:40
variable input fields ()
Definition: txtvfldi.hxx:293
virtual SvXMLImportContextRef CreateChildContext(sal_uInt16 nPrefix, const OUString &rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
variable type
Definition: txtvfldi.cxx:660
bool bDescriptionOK
sFormula was set
Definition: txtvfldi.hxx:119
abstract class for text field import
Definition: txtfldi.hxx:110
OUString sHint
help text
Definition: txtvfldi.hxx:113
XMLVariableInputFieldImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, sal_uInt16 nPrfx, const OUString &rLocalName)
Definition: txtvfldi.cxx:427
virtual void EndElement() override
see XMLTextFieldImportContext
Definition: txtvfldi.cxx:263
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:232
virtual void PrepareField(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet) override
prepare XTextField for insertion into document
Definition: txtvfldi.cxx:371
VarType
variable type (for XMLSetVarFieldImportContext)
Definition: txtimp.hxx:351
virtual void PrepareField(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet) override
element name w/o prefix
Definition: txtvfldi.cxx:494
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
void ProcessAttribute(sal_uInt16 nAttrToken, const OUString &sAttrValue)
process formula (Prep.F.)
Definition: txtvfldi.cxx:1111
bool IsFormatOK() const
has format been read?
Definition: txtvfldi.hxx:76
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:378
user input fields ()
Definition: txtvfldi.hxx:327
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:194
XMLUserFieldInputImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, sal_uInt16 nPrfx, const OUString &rLocalName)
Definition: txtvfldi.cxx:480
virtual void PrepareField(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet) override
element name w/o prefix
Definition: txtvfldi.cxx:521
void PrepareField(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet)
prepare XTextField for insertion into document
Definition: txtvfldi.cxx:1229
bool IsStringValue() const
Definition: txtvfldi.hxx:168
XMLTextInputFieldImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, sal_uInt16 nPrfx, const OUString &sLocalName)
Definition: txtvfldi.cxx:564
OUString sHelp
description
Definition: txtvfldi.hxx:112
import variable set fields ()
Definition: txtvfldi.hxx:275
XMLTextImportHelper & rImportHelper
Definition: txtvfldi.hxx:381
bool bDisplayNone
display formula?(rather than value)
Definition: txtvfldi.hxx:116
XMLValueImportHelper aValueHelper
Definition: txtvfldi.hxx:455
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
virtual void ProcessAttribute(sal_uInt16 nAttrToken, const OUString &sAttrValue) override
element name w/o prefix
Definition: txtvfldi.cxx:945
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 EndElement() override
create, prepare and insert database field master and database field
Definition: txtvfldi.cxx:978
virtual void PrepareField(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet) override
element name w/o prefix
Definition: txtvfldi.cxx:411
import variable get fields ()
Definition: txtvfldi.hxx:173
bool bFormatOK
is this a string (or a float) type?
Definition: txtvfldi.hxx:46
XMLSetVarFieldImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, const char *pServiceName, sal_uInt16 nPrfx, const OUString &rLocalName, 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
const bool bSetValue
should PrepareField set the SetExp subtype?
Definition: txtvfldi.hxx:51
const OUString & GetName() const
Definition: txtvfldi.hxx:167
bool bHelpOK
sDescription was set
Definition: txtvfldi.hxx:120
bool bIsDefaultLanguage
default (see bStringDefault/bFormulaDef.)
Definition: txtvfldi.hxx:43
XMLVariableGetFieldImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, sal_uInt16 nPrfx, const OUString &rLocalName)
Definition: txtvfldi.cxx:507
This class deliberately does not support XWeak, to improve performance when loading large documents...
Definition: xmlictxt.hxx:44
import table formula fields (deprecated; for Writer 2.0 compatibility)
Definition: txtvfldi.hxx:426
bool bStringType
format (of nFormatKey) has system language?
Definition: txtvfldi.hxx:45
virtual void ProcessAttribute(sal_uInt16 nAttrToken, const OUString &sAttrValue) override
element name w/o prefix
Definition: txtvfldi.cxx:348
bool bSetHelp
set sDescription with Hint-property
Definition: txtvfldi.hxx:127
XMLVariableSetFieldImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, sal_uInt16 nPrfx, const OUString &rLocalName)
Definition: txtvfldi.cxx:396
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:810
sequence fields ()
Definition: txtvfldi.hxx:345
virtual void PrepareField(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet) override
element name w/o prefix
Definition: txtvfldi.cxx:442
import database display fields ()
Definition: txtvfldi.hxx:453
const bool bSetStyle
should PrepareField set content/value?
Definition: txtvfldi.hxx:52
XMLUserFieldImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, sal_uInt16 nPrfx, const OUString &rLocalName)
Definition: txtvfldi.cxx:461
XMLTableFormulaImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, sal_uInt16 nPrfx, const OUString &rLocalName)
Definition: txtvfldi.cxx:591
XMLExpressionFieldImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, sal_uInt16 nPrfx, const OUString &sLocalName)
Definition: txtvfldi.cxx:535
variable field declarations (variable-decl, user-field-decl, sequence-decl)
Definition: txtvfldi.hxx:403
bool bHintOK
sHelp was set
Definition: txtvfldi.hxx:121
bool bFormulaOK
have we read a string-value attr.?
Definition: txtvfldi.hxx:48
XMLVariableDeclsImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, sal_uInt16 nPrfx, const OUString &rLocalName, enum VarType eVarType)
Definition: txtvfldi.cxx:651
OUString sDefault
formula string
Definition: txtvfldi.hxx:42
SvXMLImport & rImport
Definition: txtvfldi.hxx:35
XMLDatabaseDisplayImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, sal_uInt16 nPrfx, const OUString &rLocalName)
Definition: txtvfldi.cxx:933
XMLVariableDeclImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, sal_uInt16 nPrfx, const OUString &rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList, enum VarType eVarType)
Definition: txtvfldi.cxx:702
bool bStringValueOK
have we read a style:data-style-name attr.?
Definition: txtvfldi.hxx:47
bool bFormulaOK
hide field?
Definition: txtvfldi.hxx:118
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:627
XMLValueImportHelper(SvXMLImport &rImprt, XMLTextImportHelper &rHlp, bool bType, bool bStyle, bool bValue, bool bFormula)
should PrepareField set Formula?
Definition: txtvfldi.cxx:1087