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  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_Int32 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 endFastElement())
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 SAL_CALL endFastElement(sal_Int32 nElement) 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_Int32 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 
393  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
394  sal_Int32 nElement,
395  const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
396 };
397 
403 {
404 public:
405 
406 
408  SvXMLImport& rImport,
409  XMLTextImportHelper& rHlp,
410  sal_Int32 nElement,
411  const css::uno::Reference< css::xml::sax::XFastAttributeList> & xAttrList,
412  enum VarType eVarType);
413 
415  static bool FindFieldMaster(css::uno::Reference<css::beans::XPropertySet> & xMaster,
416  SvXMLImport& rImport,
417  XMLTextImportHelper& rHelper,
418  const OUString& sVarName,
419  enum VarType eVarType);
420 };
421 
422 
425 {
427 
429 
430 public:
431 
433  SvXMLImport& rImport,
434  XMLTextImportHelper& rHlp,
435  sal_uInt16 nPrfx,
436  const OUString& rLocalName);
437 
438 private:
439 
441  virtual void ProcessAttribute( sal_Int32 nAttrToken,
442  const OUString& sAttrValue ) override;
443 
445  virtual void PrepareField(
446  const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override;
447 };
448 
449 
452 {
454 
455  OUString sColumnName;
456  bool bColumnOK;
457 
458  bool bDisplay;
460 
461 public:
462 
463 
465  SvXMLImport& rImport,
466  XMLTextImportHelper& rHlp,
467  sal_uInt16 nPrfx,
468  const OUString& rLocalName);
469 
470 private:
471 
473  virtual void ProcessAttribute( sal_Int32 nAttrToken,
474  const OUString& sAttrValue ) override;
475 
477  virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
478 };
479 
480 #endif
481 
482 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool FindFieldMaster(css::uno::Reference< css::beans::XPropertySet > &xMaster)
find appropriate field master
Definition: txtvfldi.cxx:316
double fValue
string value (only valid if bStringValueOK)
Definition: txtvfldi.hxx:39
XMLValueImportHelper aValueHelper
Definition: txtvfldi.hxx:426
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:332
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:81
virtual void PrepareField(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet) override
element name w/o prefix
Definition: txtvfldi.cxx:552
enum VarType eVarDeclsContextType
Definition: txtvfldi.hxx:380
const bool bSetFormula
should PrepareField set NumberFormat?
Definition: txtvfldi.hxx:53
superclass for database fields: handle database and table names
Definition: txtfldi.hxx:326
virtual void PrepareField(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet) override
element name w/o prefix
Definition: txtvfldi.cxx:580
sal_Int32 nFormatKey
double value (only valid if bFloatValueOK)
Definition: txtvfldi.hxx:40
variable input fields ()
Definition: txtvfldi.hxx:293
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:969
virtual void ProcessAttribute(sal_Int32 nAttrToken, const OUString &sAttrValue) override
element name w/o prefix
Definition: txtvfldi.cxx:936
XMLVariableInputFieldImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, sal_uInt16 nPrfx, const OUString &rLocalName)
Definition: txtvfldi.cxx:428
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:372
VarType
variable type (for XMLSetVarFieldImportContext)
Definition: txtimp.hxx:341
virtual void PrepareField(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet) override
element name w/o prefix
Definition: txtvfldi.cxx:495
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
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:481
virtual void PrepareField(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet) override
element name w/o prefix
Definition: txtvfldi.cxx:522
void PrepareField(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet)
prepare XTextField for insertion into document
Definition: txtvfldi.cxx:1227
virtual void ProcessAttribute(sal_Int32 nAttrToken, const OUString &sAttrValue) override
element name w/o prefix
Definition: txtvfldi.cxx:604
bool IsStringValue() const
Definition: txtvfldi.hxx:168
XMLTextInputFieldImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, sal_uInt16 nPrfx, const OUString &sLocalName)
Definition: txtvfldi.cxx:565
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:453
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:175
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
element name w/o prefix
Definition: txtvfldi.cxx:412
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:248
virtual void ProcessAttribute(sal_Int32 nAttrToken, const OUString &sAttrValue) override
element name w/o prefix
Definition: txtvfldi.cxx:349
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:508
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:424
bool bStringType
format (of nFormatKey) has system language?
Definition: txtvfldi.hxx:45
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:397
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:801
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:443
import database display fields ()
Definition: txtvfldi.hxx:451
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:462
XMLVariableDeclImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, enum VarType eVarType)
Definition: txtvfldi.cxx:704
XMLTableFormulaImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, sal_uInt16 nPrfx, const OUString &rLocalName)
Definition: txtvfldi.cxx:592
XMLExpressionFieldImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, sal_uInt16 nPrfx, const OUString &sLocalName)
Definition: txtvfldi.cxx:536
void ProcessAttribute(sal_Int32 nAttrToken, const OUString &sAttrValue)
process formula (Prep.F.)
Definition: txtvfldi.cxx:1102
variable field declarations (variable-decl, user-field-decl, sequence-decl)
Definition: txtvfldi.hxx:402
bool bHintOK
sHelp was set
Definition: txtvfldi.hxx:121
bool bFormulaOK
have we read a string-value attr.?
Definition: txtvfldi.hxx:48
virtual void ProcessAttribute(sal_Int32 nAttrToken, const OUString &sAttrValue) override
set presentation from elem. content
Definition: txtvfldi.cxx:110
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:662
XMLVariableDeclsImportContext(SvXMLImport &rImport, XMLTextImportHelper &rHlp, sal_uInt16 nPrfx, const OUString &rLocalName, enum VarType eVarType)
Definition: txtvfldi.cxx:653
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:924
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
see XMLTextFieldImportContext
Definition: txtvfldi.cxx:264
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:629
XMLValueImportHelper(SvXMLImport &rImprt, XMLTextImportHelper &rHlp, bool bType, bool bStyle, bool bValue, bool bFormula)
should PrepareField set Formula?
Definition: txtvfldi.cxx:1078