LCOV - code coverage report
Current view: top level - xmloff/inc - txtfldi.hxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 17 43 39.5 %
Date: 2014-04-11 Functions: 32 83 38.6 %
Legend: Lines: hit not hit

          Line data    Source code
       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             : 
      20             : /** @#file
      21             :  *
      22             :  *  import of all text fields
      23             :  *  (except variable related + database display field: see txtvfldi.hxx)
      24             :  */
      25             : 
      26             : #ifndef INCLUDED_XMLOFF_INC_TXTFLDI_HXX
      27             : #define INCLUDED_XMLOFF_INC_TXTFLDI_HXX
      28             : 
      29             : #include <com/sun/star/uno/Reference.h>
      30             : #include <com/sun/star/text/PageNumberType.hpp>
      31             : #include <com/sun/star/util/DateTime.hpp>
      32             : #include <com/sun/star/util/Date.hpp>
      33             : #include <xmloff/xmlictxt.hxx>
      34             : #include <xmloff/txtimp.hxx>
      35             : #include <rtl/ustrbuf.hxx>
      36             : 
      37             : namespace com { namespace sun { namespace star {
      38             :     namespace xml { namespace sax { class XAttributeList; } }
      39             :     namespace text { class XTextField; }
      40             :     namespace beans { class XPropertySet; struct PropertyValue; }
      41             : } } }
      42             : 
      43             : class SvXMLImport;
      44             : class XMLTextImportHelper;
      45             : class SvXMLTokenMap;
      46             : 
      47             : enum XMLTextFieldAttrTokens
      48             : {
      49             :     XML_TOK_TEXTFIELD_FIXED = 0,
      50             :     XML_TOK_TEXTFIELD_DESCRIPTION,
      51             :     XML_TOK_TEXTFIELD_HELP,
      52             :     XML_TOK_TEXTFIELD_HINT,
      53             :     XML_TOK_TEXTFIELD_PLACEHOLDER_TYPE,
      54             :     XML_TOK_TEXTFIELD_TIME_ADJUST,
      55             :     XML_TOK_TEXTFIELD_DATE_ADJUST,
      56             :     XML_TOK_TEXTFIELD_PAGE_ADJUST,
      57             :     XML_TOK_TEXTFIELD_SELECT_PAGE,
      58             :     XML_TOK_TEXTFIELD_ACTIVE,
      59             : 
      60             :     XML_TOK_TEXTFIELD_NAME,
      61             :     XML_TOK_TEXTFIELD_FORMULA,
      62             :     XML_TOK_TEXTFIELD_NUM_FORMAT,
      63             :     XML_TOK_TEXTFIELD_NUM_LETTER_SYNC,
      64             :     XML_TOK_TEXTFIELD_DISPLAY_FORMULA,
      65             :     XML_TOK_TEXTFIELD_NUMBERING_LEVEL,
      66             :     XML_TOK_TEXTFIELD_NUMBERING_SEPARATOR,
      67             :     XML_TOK_TEXTFIELD_DISPLAY,
      68             :     XML_TOK_TEXTFIELD_OUTLINE_LEVEL,
      69             : 
      70             :     XML_TOK_TEXTFIELD_VALUE_TYPE,
      71             :     XML_TOK_TEXTFIELD_VALUE,
      72             :     XML_TOK_TEXTFIELD_STRING_VALUE,
      73             :     XML_TOK_TEXTFIELD_DATE_VALUE,
      74             :     XML_TOK_TEXTFIELD_TIME_VALUE,
      75             :     XML_TOK_TEXTFIELD_BOOL_VALUE,
      76             :     XML_TOK_TEXTFIELD_CURRENCY,
      77             :     XML_TOK_TEXTFIELD_DATA_STYLE_NAME,
      78             : 
      79             :     XML_TOK_TEXTFIELD_DATABASE_NAME,
      80             :     XML_TOK_TEXTFIELD_TABLE_NAME,
      81             :     XML_TOK_TEXTFIELD_COLUMN_NAME,
      82             :     XML_TOK_TEXTFIELD_ROW_NUMBER,
      83             :     XML_TOK_TEXTFIELD_CONDITION,
      84             :     XML_TOK_TEXTFIELD_STRING_VALUE_IF_TRUE,
      85             :     XML_TOK_TEXTFIELD_STRING_VALUE_IF_FALSE,
      86             :     XML_TOK_TEXTFIELD_REVISION,
      87             :     XML_TOK_TEXTFIELD_IS_HIDDEN,
      88             :     XML_TOK_TEXTFIELD_CURRENT_VALUE,
      89             : 
      90             :     XML_TOK_TEXTFIELD_REFERENCE_FORMAT,
      91             :     XML_TOK_TEXTFIELD_REF_NAME,
      92             :     XML_TOK_TEXTFIELD_CONNECTION_NAME,
      93             : 
      94             :     XML_TOK_TEXTFIELD_HREF,
      95             :     XML_TOK_TEXTFIELD_TARGET_FRAME,
      96             : 
      97             :     XML_TOK_TEXTFIELD_OFFICE_CREATE_DATE,
      98             :     XML_TOK_TEXTFIELD_OFFICE_AUTHOR,
      99             :     XML_TOK_TEXTFIELD_ANNOTATION,
     100             :     XML_TOK_TEXTFIELD_LANGUAGE,
     101             : 
     102             :     XML_TOK_TEXTFIELD_MEASURE_KIND,
     103             :     XML_TOK_TEXTFIELD_TABLE_TYPE,
     104             : 
     105             :     XML_TOK_TEXTFIELD_NOTE_CLASS,
     106             : 
     107             :     XML_TOK_TEXTFIELD_UNKNOWN
     108             : };
     109             : 
     110             : /// abstract class for text field import
     111             : class XMLTextFieldImportContext : public SvXMLImportContext
     112             : {
     113             :     const OUString sIsFixed;
     114             : 
     115             :     // data members
     116             :     OUStringBuffer sContentBuffer;   /// collect character data
     117             :     OUString sContent;               /// character data after collection
     118             :     OUString sServiceName;           /// service name for text field
     119             :     XMLTextImportHelper& rTextImportHelper; /// the import helper
     120             : 
     121             : protected:
     122             :     OUString sServicePrefix;
     123             : 
     124             :     // data members for use in subclasses
     125             :     sal_Bool bValid;                 /// whether this field is valid ?
     126             : 
     127             : public:
     128             :     TYPEINFO_OVERRIDE();
     129             : 
     130             :     XMLTextFieldImportContext(
     131             :         SvXMLImport& rImport,                   /// XML Import
     132             :         XMLTextImportHelper& rHlp,              /// Text import helper
     133             :         const sal_Char* pService,               /// name of SO API service
     134             :         sal_uInt16 nPrfx,                       /// namespace prefix
     135             :         const OUString& rLocalName);     /// element name w/o prefix
     136             : 
     137             :     virtual ~XMLTextFieldImportContext();
     138             : 
     139             :     /// process character data: will be collected in member sContentBuffer
     140             :     virtual void Characters( const OUString& sContent ) SAL_OVERRIDE;
     141             : 
     142             :     /// parses attributes and calls ProcessAttribute
     143             :     virtual void StartElement(
     144             :         const ::com::sun::star::uno::Reference<
     145             :         ::com::sun::star::xml::sax::XAttributeList> & xAttrList) SAL_OVERRIDE;
     146             : 
     147             :     /// create XTextField and insert into document; calls PrepareTextField
     148             :     virtual void EndElement() SAL_OVERRIDE;
     149             : 
     150             :     /// create the appropriate field context from
     151             :     /// (for use in paragraph import)
     152             :     static XMLTextFieldImportContext* CreateTextFieldImportContext(
     153             :         SvXMLImport& rImport,
     154             :         XMLTextImportHelper& rHlp,
     155             :         sal_uInt16 nPrefix,
     156             :         const OUString& rName,
     157             :         sal_uInt16 nToken);
     158             : 
     159             : protected:
     160             :     /// get helper
     161         213 :     inline XMLTextImportHelper& GetImportHelper() { return rTextImportHelper; }
     162             : 
     163        1092 :     inline OUString GetServiceName() { return sServiceName; }
     164           0 :     inline void SetServiceName(const OUString& sStr) { sServiceName = sStr; }
     165             : 
     166             :     OUString GetContent();
     167             : 
     168             :     /// process attribute values
     169             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     170             :                                    const OUString& sAttrValue ) = 0;
     171             : 
     172             :     /// prepare XTextField for insertion into document
     173             :     virtual void PrepareField(
     174             :         const ::com::sun::star::uno::Reference<
     175             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) = 0;
     176             : 
     177             :     /// create field from ServiceName
     178             :     sal_Bool CreateField(::com::sun::star::uno::Reference<
     179             :                          ::com::sun::star::beans::XPropertySet> & xField,
     180             :                          const OUString& sServiceName);
     181             : 
     182             :     /// force an update of the field's value
     183             :     /// call update on optional XUptadeable interface; (disable Fixed property)
     184             :     void ForceUpdate(
     185             :         const ::com::sun::star::uno::Reference<
     186             :             ::com::sun::star::beans::XPropertySet> & rPropertySet);
     187             : };
     188             : 
     189           0 : class XMLSenderFieldImportContext : public XMLTextFieldImportContext
     190             : {
     191             : 
     192             :     sal_Int16 nSubType;         /// API subtype for ExtUser field
     193             : 
     194             :     const OUString sEmpty;       /// empty string
     195             :     const OUString sPropertyFixed;
     196             :     const OUString sPropertyFieldSubType;
     197             :     const OUString sPropertyContent;
     198             : 
     199             : protected:
     200             :     // variables for access in subclass
     201             :     sal_Bool bFixed;
     202             :     sal_uInt16 nElementToken;   /// token for this elment field
     203             : 
     204             : public:
     205             :     TYPEINFO_OVERRIDE();
     206             : 
     207             :     XMLSenderFieldImportContext(
     208             :         SvXMLImport& rImport,                   /// XML Import
     209             :         XMLTextImportHelper& rHlp,              /// Text import helper
     210             :         sal_uInt16 nPrfx,                       /// namespace prefix
     211             :         const OUString& sLocalName,      /// element name w/o prefix
     212             :         sal_uInt16 nToken);                     /// element token
     213             : 
     214             : protected:
     215             :     /// start element
     216             :     virtual void StartElement(
     217             :         const ::com::sun::star::uno::Reference<
     218             :         ::com::sun::star::xml::sax::XAttributeList> & xAttrList) SAL_OVERRIDE;
     219             : 
     220             :     /// process attribute values
     221             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     222             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     223             : 
     224             :     /// prepare XTextField for insertion into document
     225             :     virtual void PrepareField(
     226             :         const ::com::sun::star::uno::Reference<
     227             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
     228             : };
     229             : 
     230             : /** inherit sender field because of fixed attribute in ProcessAttributes */
     231           0 : class XMLAuthorFieldImportContext : public XMLSenderFieldImportContext
     232             : {
     233             :     sal_Bool bAuthorFullName;
     234             :     const OUString sServiceAuthor;
     235             :     const OUString sPropertyAuthorFullName;
     236             :     const OUString sPropertyFixed;
     237             :     const OUString sPropertyContent;
     238             : 
     239             : public:
     240             :     TYPEINFO_OVERRIDE();
     241             : 
     242             :     XMLAuthorFieldImportContext(
     243             :         SvXMLImport& rImport,                   /// XML Import
     244             :         XMLTextImportHelper& rHlp,              /// Text import helper
     245             :         sal_uInt16 nPrfx,                       /// namespace prefix
     246             :         const OUString& sLocalName,      /// element name w/o prefix
     247             :         sal_uInt16 nToken);                     /// element token
     248             : 
     249             : protected:
     250             :     /// start element
     251             :     virtual void StartElement(
     252             :         const ::com::sun::star::uno::Reference<
     253             :         ::com::sun::star::xml::sax::XAttributeList> & xAttrList) SAL_OVERRIDE;
     254             : 
     255             :     /// prepare XTextField for insertion into document
     256             :     virtual void PrepareField(
     257             :         const ::com::sun::star::uno::Reference<
     258             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
     259             : };
     260             : 
     261          16 : class XMLPlaceholderFieldImportContext : public XMLTextFieldImportContext
     262             : {
     263             :     const OUString sEmpty;       /// empty string
     264             :     const OUString sServiceJumpEdit;
     265             :     const OUString sPropertyPlaceholderType;
     266             :     const OUString sPropertyPlaceholder;
     267             :     const OUString sPropertyHint;
     268             : 
     269             :     OUString sDescription;
     270             : 
     271             :     sal_Int16 nPlaceholderType;
     272             : 
     273             : public:
     274             :     TYPEINFO_OVERRIDE();
     275             : 
     276             :     XMLPlaceholderFieldImportContext(
     277             :         SvXMLImport& rImport,                   /// XML Import
     278             :         XMLTextImportHelper& rHlp,              /// Text import helper
     279             :         sal_uInt16 nPrfx,                       /// namespace prefix
     280             :         const OUString& sLocalName);     /// element name w/o prefix
     281             : 
     282             : protected:
     283             :     /// process attribute values
     284             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     285             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     286             : 
     287             :     /// prepare XTextField for insertion into document
     288             :     virtual void PrepareField(
     289             :         const ::com::sun::star::uno::Reference<
     290             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
     291             : };
     292             : 
     293         328 : class XMLTimeFieldImportContext : public XMLTextFieldImportContext
     294             : {
     295             : protected:
     296             :     const OUString sPropertyNumberFormat;
     297             :     const OUString sPropertyFixed;
     298             :     const OUString sPropertyDateTimeValue;
     299             :     const OUString sPropertyDateTime;
     300             :     const OUString sPropertyAdjust;
     301             :     const OUString sPropertyIsDate;
     302             :     const OUString sPropertyIsFixedLanguage;
     303             : 
     304             :     ::com::sun::star::util::DateTime aDateTimeValue;
     305             :     sal_Int32 nAdjust;
     306             :     sal_Int32 nFormatKey;
     307             :     sal_Bool bTimeOK;
     308             :     sal_Bool bFormatOK;
     309             :     sal_Bool bFixed;
     310             :     sal_Bool bIsDate;           // is this a date?
     311             :                                 // (for XMLDateFieldImportContext, really)
     312             :     bool     bIsDefaultLanguage;
     313             : 
     314             : public:
     315             :     TYPEINFO_OVERRIDE();
     316             : 
     317             :     XMLTimeFieldImportContext(
     318             :         SvXMLImport& rImport,                   /// XML Import
     319             :         XMLTextImportHelper& rHlp,              /// Text import helper
     320             :         sal_uInt16 nPrfx,                       /// namespace prefix
     321             :         const OUString& sLocalName);     /// element name w/o prefix
     322             : 
     323             :     /// process attribute values
     324             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     325             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     326             : 
     327             :     /// prepare XTextField for insertion into document
     328             :     virtual void PrepareField(
     329             :         const ::com::sun::star::uno::Reference<
     330             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
     331             : };
     332             : 
     333             : /** import date fields (<text:date>);
     334             :     inherit from TimeField to reuse implementation */
     335         228 : class XMLDateFieldImportContext : public XMLTimeFieldImportContext
     336             : {
     337             : public:
     338             :     TYPEINFO_OVERRIDE();
     339             : 
     340             :     XMLDateFieldImportContext(
     341             :         SvXMLImport& rImport,                   /// XML Import
     342             :         XMLTextImportHelper& rHlp,              /// Text import helper
     343             :         sal_uInt16 nPrfx,                       /// namespace prefix
     344             :         const OUString& sLocalName);     /// element name w/o prefix
     345             : 
     346             :     /// process attribute values
     347             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     348             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     349             : };
     350             : 
     351             : /** import page continuation fields (<text:page-continuation-string>) */
     352           0 : class XMLPageContinuationImportContext : public XMLTextFieldImportContext
     353             : {
     354             :     const OUString sPropertySubType;
     355             :     const OUString sPropertyUserText;
     356             :     const OUString sPropertyNumberingType;
     357             : 
     358             :     OUString sString;            /// continuation string
     359             :     com::sun::star::text::PageNumberType eSelectPage;   /// previous, current
     360             :                                                         /// or next page
     361             :     sal_Bool sStringOK;                 /// continuation string encountered?
     362             : 
     363             : public:
     364             :     TYPEINFO_OVERRIDE();
     365             : 
     366             :     XMLPageContinuationImportContext(
     367             :         SvXMLImport& rImport,                   /// XML Import
     368             :         XMLTextImportHelper& rHlp,              /// Text import helper
     369             :         sal_uInt16 nPrfx,                       /// namespace prefix
     370             :         const OUString& sLocalName);     /// element name w/o prefix
     371             : 
     372             :     /// process attribute values
     373             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     374             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     375             : 
     376             :     /// prepare XTextField for insertion into document
     377             :     virtual void PrepareField(
     378             :         const ::com::sun::star::uno::Reference<
     379             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
     380             : };
     381             : 
     382             : /** import page number fields (<text:page-number>) */
     383         558 : class XMLPageNumberImportContext : public XMLTextFieldImportContext
     384             : {
     385             :     const OUString sPropertySubType;
     386             :     const OUString sPropertyNumberingType;
     387             :     const OUString sPropertyOffset;
     388             : 
     389             :     OUString sNumberFormat;
     390             :     OUString sNumberSync;
     391             :     sal_Int16 nPageAdjust;
     392             :     com::sun::star::text::PageNumberType eSelectPage;   /// previous, current
     393             :                                                         /// or next page
     394             :     sal_Bool sNumberFormatOK;
     395             : 
     396             : public:
     397             :     TYPEINFO_OVERRIDE();
     398             : 
     399             :     XMLPageNumberImportContext(
     400             :         SvXMLImport& rImport,                   /// XML Import
     401             :         XMLTextImportHelper& rHlp,              /// Text import helper
     402             :         sal_uInt16 nPrfx,                       /// namespace prefix
     403             :         const OUString& sLocalName);     /// element name w/o prefix
     404             : 
     405             : 
     406             :     /// process attribute values
     407             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     408             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     409             : 
     410             :     /// prepare XTextField for insertion into document
     411             :     virtual void PrepareField(
     412             :         const ::com::sun::star::uno::Reference<
     413             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
     414             : };
     415             : 
     416             : /** superclass for database fields: handle database and table names */
     417           0 : class XMLDatabaseFieldImportContext : public XMLTextFieldImportContext
     418             : {
     419             :     const OUString sPropertyDataBaseName;
     420             :     const OUString sPropertyDataBaseURL;
     421             :     const OUString sPropertyTableName;
     422             :     const OUString sPropertyDataCommandType;
     423             :     const OUString sPropertyIsVisible;
     424             : 
     425             :     OUString sDatabaseName;
     426             :     OUString sDatabaseURL;
     427             :     OUString sTableName;
     428             : 
     429             :     sal_Int32 nCommandType;
     430             :     sal_Bool bCommandTypeOK;
     431             : 
     432             :     sal_Bool bDisplay;
     433             :     bool bDisplayOK;
     434             :     bool bUseDisplay;
     435             : 
     436             : protected:
     437             :     sal_Bool bDatabaseOK;
     438             :     sal_Bool bDatabaseNameOK;
     439             :     sal_Bool bDatabaseURLOK;
     440             :     sal_Bool bTableOK;
     441             : 
     442             :     /// protected constructor: only for subclasses
     443             :     XMLDatabaseFieldImportContext(SvXMLImport& rImport,
     444             :                                   XMLTextImportHelper& rHlp,
     445             :                                   const sal_Char* pServiceName,
     446             :                                   sal_uInt16 nPrfx,
     447             :                                   const OUString& sLocalName,
     448             :                                   bool bUseDisplay );
     449             : 
     450             : public:
     451             :     TYPEINFO_OVERRIDE();
     452             : 
     453             :     /// process attribute values
     454             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     455             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     456             : 
     457             :     /// prepare XTextField for insertion into document
     458             :     virtual void PrepareField(
     459             :         const ::com::sun::star::uno::Reference<
     460             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
     461             : 
     462             :     /// handle database-location children
     463             :     virtual SvXMLImportContext *CreateChildContext(
     464             :         sal_uInt16 nPrefix,
     465             :         const OUString& rLocalName,
     466             :         const ::com::sun::star::uno::Reference<
     467             :         ::com::sun::star::xml::sax::XAttributeList> & xAttrList ) SAL_OVERRIDE;
     468             : };
     469             : 
     470             : /** import database name fields (<text:database-name>) */
     471           0 : class XMLDatabaseNameImportContext : public XMLDatabaseFieldImportContext
     472             : {
     473             : public:
     474             :     TYPEINFO_OVERRIDE();
     475             : 
     476             :     XMLDatabaseNameImportContext(SvXMLImport& rImport,
     477             :                                  XMLTextImportHelper& rHlp,
     478             :                                  sal_uInt16 nPrfx,
     479             :                                  const OUString& sLocalName);
     480             : 
     481             :     /// process attribute values
     482             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     483             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     484             : };
     485             : 
     486             : /** import database next fields (<text:database-next>) */
     487           0 : class XMLDatabaseNextImportContext : public XMLDatabaseFieldImportContext
     488             : {
     489             :     const OUString sPropertyCondition;
     490             :     const OUString sTrue;
     491             :     OUString sCondition;
     492             :     sal_Bool bConditionOK;
     493             : 
     494             : protected:
     495             :     // for use in child classes
     496             :     XMLDatabaseNextImportContext(SvXMLImport& rImport,
     497             :                                  XMLTextImportHelper& rHlp,
     498             :                                  const sal_Char* pServiceName,
     499             :                                  sal_uInt16 nPrfx,
     500             :                                  const OUString& sLocalName);
     501             : 
     502             : public:
     503             :     TYPEINFO_OVERRIDE();
     504             : 
     505             :     XMLDatabaseNextImportContext(SvXMLImport& rImport,
     506             :                                  XMLTextImportHelper& rHlp,
     507             :                                  sal_uInt16 nPrfx,
     508             :                                  const OUString& sLocalName);
     509             : 
     510             :     /// process attribute values
     511             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     512             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     513             : 
     514             :     /// prepare XTextField for insertion into document
     515             :     virtual void PrepareField(
     516             :         const ::com::sun::star::uno::Reference<
     517             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
     518             : };
     519             : 
     520             : /** import database select fields (<text:database-select>) */
     521           0 : class XMLDatabaseSelectImportContext : public XMLDatabaseNextImportContext
     522             : {
     523             :     const OUString sPropertySetNumber;
     524             :     sal_Int32 nNumber;
     525             :     sal_Bool bNumberOK;
     526             : 
     527             : public:
     528             :     TYPEINFO_OVERRIDE();
     529             : 
     530             :     XMLDatabaseSelectImportContext(SvXMLImport& rImport,
     531             :                                    XMLTextImportHelper& rHlp,
     532             :                                    sal_uInt16 nPrfx,
     533             :                                    const OUString& sLocalName);
     534             : 
     535             :     /// process attribute values
     536             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     537             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     538             : 
     539             :     /// prepare XTextField for insertion into document
     540             :     virtual void PrepareField(
     541             :         const ::com::sun::star::uno::Reference<
     542             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
     543             : };
     544             : 
     545             : /** import database display number fields (<text:database-row-number>) */
     546           0 : class XMLDatabaseNumberImportContext : public XMLDatabaseFieldImportContext
     547             : {
     548             :     const OUString sPropertyNumberingType;
     549             :     const OUString sPropertySetNumber;
     550             :     OUString sNumberFormat;
     551             :     OUString sNumberSync;
     552             :     sal_Int32 nValue;
     553             :     sal_Bool bValueOK;
     554             : 
     555             : public:
     556             :     TYPEINFO_OVERRIDE();
     557             : 
     558             :     XMLDatabaseNumberImportContext(SvXMLImport& rImport,
     559             :                                    XMLTextImportHelper& rHlp,
     560             :                                    sal_uInt16 nPrfx,
     561             :                                    const OUString& sLocalName);
     562             : 
     563             :     /// process attribute values
     564             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     565             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     566             : 
     567             :     /// prepare XTextField for insertion into document
     568             :     virtual void PrepareField(
     569             :         const ::com::sun::star::uno::Reference<
     570             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
     571             : };
     572             : 
     573             : /** import docinfo fields with only fixed attribute */
     574         218 : class XMLSimpleDocInfoImportContext : public XMLTextFieldImportContext
     575             : {
     576             :     const OUString sPropertyFixed;
     577             :     const OUString sPropertyContent;
     578             :     const OUString sPropertyAuthor;
     579             :     const OUString sPropertyCurrentPresentation;
     580             : 
     581             : protected:
     582             :     sal_Bool bFixed;
     583             :     sal_Bool bHasAuthor;
     584             :     sal_Bool bHasContent;
     585             : 
     586             : public:
     587             :     TYPEINFO_OVERRIDE();
     588             : 
     589             :     XMLSimpleDocInfoImportContext(SvXMLImport& rImport,
     590             :                                   XMLTextImportHelper& rHlp,
     591             :                                   sal_uInt16 nPrfx,
     592             :                                   const OUString& sLocalName,
     593             :                                   sal_uInt16 nToken,
     594             :                                   sal_Bool bContent,
     595             :                                   sal_Bool bAuthor);
     596             : 
     597             : protected:
     598             :     /// process attribute values
     599             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     600             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     601             : 
     602             :     /// prepare XTextField for insertion into document
     603             :     virtual void PrepareField(
     604             :         const ::com::sun::star::uno::Reference<
     605             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
     606             : 
     607             :     static const sal_Char* MapTokenToServiceName(sal_uInt16 nToken);
     608             : };
     609             : 
     610             : /** import docinfo fields with date or time attributes and numberformats */
     611           0 : class XMLDateTimeDocInfoImportContext : public XMLSimpleDocInfoImportContext
     612             : {
     613             :     const OUString sPropertyNumberFormat;
     614             :     const OUString sPropertyIsDate;
     615             :     const OUString sPropertyIsFixedLanguage;
     616             : 
     617             :     sal_Int32 nFormat;
     618             :     sal_Bool bFormatOK;
     619             :     sal_Bool bIsDate;
     620             :     sal_Bool bHasDateTime;
     621             :     bool     bIsDefaultLanguage;
     622             : 
     623             : public:
     624             :     TYPEINFO_OVERRIDE();
     625             : 
     626             :     XMLDateTimeDocInfoImportContext(SvXMLImport& rImport,
     627             :                                     XMLTextImportHelper& rHlp,
     628             :                                     sal_uInt16 nPrfx,
     629             :                                     const OUString& sLocalName,
     630             :                                     sal_uInt16 nToken);
     631             : 
     632             : protected:
     633             :     /// process attribute values
     634             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     635             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     636             : 
     637             :     /// prepare XTextField for insertion into document
     638             :     virtual void PrepareField(
     639             :         const ::com::sun::star::uno::Reference<
     640             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
     641             : };
     642             : 
     643             : /** import revision field (<text:editing-cycles>) */
     644           0 : class XMLRevisionDocInfoImportContext : public XMLSimpleDocInfoImportContext
     645             : {
     646             :     const OUString sPropertyRevision;
     647             : 
     648             : public:
     649             :     TYPEINFO_OVERRIDE();
     650             : 
     651             :     XMLRevisionDocInfoImportContext(SvXMLImport& rImport,
     652             :                                     XMLTextImportHelper& rHlp,
     653             :                                     sal_uInt16 nPrfx,
     654             :                                     const OUString& sLocalName,
     655             :                                     sal_uInt16 nToken);
     656             : 
     657             : protected:
     658             :     /// prepare XTextField for insertion into document
     659             :     virtual void PrepareField(
     660             :         const ::com::sun::star::uno::Reference<
     661             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
     662             : };
     663             : 
     664             : /** import user docinfo field (<text:user-defined>) */
     665           0 : class XMLUserDocInfoImportContext : public XMLSimpleDocInfoImportContext
     666             : {
     667             :     OUString aName;
     668             :     const OUString sPropertyName;
     669             :     const OUString sPropertyNumberFormat;
     670             :     const OUString sPropertyIsFixedLanguage;
     671             :     sal_Int32   nFormat;
     672             :     sal_Bool    bFormatOK;
     673             :     bool        bIsDefaultLanguage;
     674             : 
     675             : public:
     676             :     TYPEINFO_OVERRIDE();
     677             : 
     678             :     XMLUserDocInfoImportContext(SvXMLImport& rImport,
     679             :                                 XMLTextImportHelper& rHlp,
     680             :                                 sal_uInt16 nPrfx,
     681             :                                 const OUString& sLocalName,
     682             :                                 sal_uInt16 nToken);
     683             : 
     684             : protected:
     685             :     /// process attribute values
     686             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     687             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     688             :     virtual void PrepareField(
     689             :         const ::com::sun::star::uno::Reference<
     690             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
     691             : };
     692             : 
     693             : /** import hidden paragraph fields (<text:hidden-paragraph>) */
     694           0 : class XMLHiddenParagraphImportContext : public XMLTextFieldImportContext
     695             : {
     696             :     const OUString sPropertyCondition;
     697             :     const OUString sPropertyIsHidden;
     698             : 
     699             :     OUString sCondition;
     700             :     sal_Bool bIsHidden;
     701             : 
     702             : public:
     703             :     TYPEINFO_OVERRIDE();
     704             : 
     705             :     XMLHiddenParagraphImportContext(SvXMLImport& rImport,
     706             :                                     XMLTextImportHelper& rHlp,
     707             :                                     sal_uInt16 nPrfx,
     708             :                                     const OUString& sLocalName);
     709             : 
     710             : protected:
     711             :     /// process attribute values
     712             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     713             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     714             : 
     715             :     /// prepare XTextField for insertion into document
     716             :     virtual void PrepareField(
     717             :         const ::com::sun::star::uno::Reference<
     718             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
     719             : };
     720             : 
     721             : /** import conditional text fields (<text:conditional-text>) */
     722           0 : class XMLConditionalTextImportContext : public XMLTextFieldImportContext
     723             : {
     724             :     const OUString sPropertyCondition;
     725             :     const OUString sPropertyTrueContent;
     726             :     const OUString sPropertyFalseContent;
     727             :     const OUString sPropertyIsConditionTrue;
     728             :     const OUString sPropertyCurrentPresentation;
     729             : 
     730             :     OUString sCondition;
     731             :     OUString sTrueContent;
     732             :     OUString sFalseContent;
     733             : 
     734             :     sal_Bool bConditionOK;
     735             :     sal_Bool bTrueOK;
     736             :     sal_Bool bFalseOK;
     737             :     sal_Bool bCurrentValue;
     738             : 
     739             : public:
     740             :     TYPEINFO_OVERRIDE();
     741             : 
     742             :     XMLConditionalTextImportContext(SvXMLImport& rImport,
     743             :                                     XMLTextImportHelper& rHlp,
     744             :                                     sal_uInt16 nPrfx,
     745             :                                     const OUString& sLocalName);
     746             : 
     747             : protected:
     748             :     /// process attribute values
     749             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     750             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     751             : 
     752             :     /// prepare XTextField for insertion into document
     753             :     virtual void PrepareField(
     754             :         const ::com::sun::star::uno::Reference<
     755             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
     756             : };
     757             : 
     758             : /** import conditional text fields (<text:hidden-text>) */
     759           0 : class XMLHiddenTextImportContext : public XMLTextFieldImportContext
     760             : {
     761             :     const OUString sPropertyCondition;
     762             :     const OUString sPropertyContent;
     763             :     const OUString sPropertyIsHidden;
     764             : 
     765             :     OUString sCondition;
     766             :     OUString sString;
     767             : 
     768             :     sal_Bool bConditionOK;
     769             :     sal_Bool bStringOK;
     770             :     sal_Bool bIsHidden;
     771             : 
     772             : public:
     773             :     TYPEINFO_OVERRIDE();
     774             : 
     775             :     XMLHiddenTextImportContext(SvXMLImport& rImport,
     776             :                                XMLTextImportHelper& rHlp,
     777             :                                sal_uInt16 nPrfx,
     778             :                                const OUString& sLocalName);
     779             : 
     780             : protected:
     781             :     /// process attribute values
     782             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     783             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     784             : 
     785             :     /// prepare XTextField for insertion into document
     786             :     virtual void PrepareField(
     787             :         const ::com::sun::star::uno::Reference<
     788             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
     789             : };
     790             : 
     791             : /** import file name fields (<text:file-name>) */
     792           8 : class XMLFileNameImportContext : public XMLTextFieldImportContext
     793             : {
     794             :     const OUString sPropertyFixed;
     795             :     const OUString sPropertyFileFormat;
     796             :     const OUString sPropertyCurrentPresentation;
     797             : 
     798             :     sal_Int16 nFormat;
     799             :     sal_Bool bFixed;
     800             : 
     801             : public:
     802             :     TYPEINFO_OVERRIDE();
     803             : 
     804             :     XMLFileNameImportContext(SvXMLImport& rImport,
     805             :                              XMLTextImportHelper& rHlp,
     806             :                              sal_uInt16 nPrfx,
     807             :                              const OUString& sLocalName);
     808             : 
     809             : protected:
     810             :     /// process attribute values
     811             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     812             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     813             : 
     814             :     /// prepare XTextField for insertion into document
     815             :     virtual void PrepareField(
     816             :         const ::com::sun::star::uno::Reference<
     817             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
     818             : };
     819             : 
     820             : /** import document template name fields (<text:template-name>) */
     821           0 : class XMLTemplateNameImportContext : public XMLTextFieldImportContext
     822             : {
     823             :     const OUString sPropertyFileFormat;
     824             : 
     825             :     sal_Int16 nFormat;
     826             : 
     827             : public:
     828             :     TYPEINFO_OVERRIDE();
     829             : 
     830             :     XMLTemplateNameImportContext(SvXMLImport& rImport,
     831             :                                  XMLTextImportHelper& rHlp,
     832             :                                  sal_uInt16 nPrfx,
     833             :                                  const OUString& sLocalName);
     834             : 
     835             : protected:
     836             :     /// process attribute values
     837             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     838             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     839             : 
     840             :     /// prepare XTextField for insertion into document
     841             :     virtual void PrepareField(
     842             :         const ::com::sun::star::uno::Reference<
     843             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
     844             : };
     845             : 
     846             : /** import chapter fields (<text:chapter>) */
     847           0 : class XMLChapterImportContext : public XMLTextFieldImportContext
     848             : {
     849             :     const OUString sPropertyChapterFormat;
     850             :     const OUString sPropertyLevel;
     851             : 
     852             :     sal_Int16 nFormat;
     853             :     sal_Int8 nLevel;
     854             : 
     855             : public:
     856             :     TYPEINFO_OVERRIDE();
     857             : 
     858             :     XMLChapterImportContext(SvXMLImport& rImport,
     859             :                             XMLTextImportHelper& rHlp,
     860             :                             sal_uInt16 nPrfx,
     861             :                             const OUString& sLocalName);
     862             : 
     863             : protected:
     864             :     /// process attribute values
     865             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     866             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     867             : 
     868             :     /// prepare XTextField for insertion into document
     869             :     virtual void PrepareField(
     870             :         const ::com::sun::star::uno::Reference<
     871             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
     872             : };
     873             : 
     874             : /** import count fields (<text:[XXX]-count>) */
     875         228 : class XMLCountFieldImportContext : public XMLTextFieldImportContext
     876             : {
     877             :     const OUString sPropertyNumberingType;
     878             : 
     879             :     OUString sNumberFormat;
     880             :     OUString sLetterSync;
     881             : 
     882             :     sal_Bool bNumberFormatOK;
     883             : 
     884             : public:
     885             :     TYPEINFO_OVERRIDE();
     886             : 
     887             :     XMLCountFieldImportContext(SvXMLImport& rImport,
     888             :                                XMLTextImportHelper& rHlp,
     889             :                                sal_uInt16 nPrfx,
     890             :                                const OUString& sLocalName,
     891             :                                sal_uInt16 nToken);
     892             : 
     893             : protected:
     894             :     /// process attribute values
     895             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     896             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     897             : 
     898             :     /// prepare XTextField for insertion into document
     899             :     virtual void PrepareField(
     900             :         const ::com::sun::star::uno::Reference<
     901             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
     902             : 
     903             :     static const sal_Char* MapTokenToServiceName(sal_uInt16 nToken);
     904             : };
     905             : 
     906             : /** import page variable fields (<text:get-page-variable>) */
     907           0 : class XMLPageVarGetFieldImportContext : public XMLTextFieldImportContext
     908             : {
     909             :     const OUString sPropertyNumberingType;
     910             : 
     911             :     OUString sNumberFormat;
     912             :     OUString sLetterSync;
     913             : 
     914             :     sal_Bool bNumberFormatOK;
     915             : 
     916             : public:
     917             :     TYPEINFO_OVERRIDE();
     918             : 
     919             :     XMLPageVarGetFieldImportContext(SvXMLImport& rImport,
     920             :                                     XMLTextImportHelper& rHlp,
     921             :                                     sal_uInt16 nPrfx,
     922             :                                     const OUString& sLocalName);
     923             : 
     924             : protected:
     925             :     /// process attribute values
     926             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     927             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     928             : 
     929             :     /// prepare XTextField for insertion into document
     930             :     virtual void PrepareField(
     931             :         const ::com::sun::star::uno::Reference<
     932             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
     933             : };
     934             : 
     935             : /** import page variable fields (<text:get-page-variable>) */
     936           0 : class XMLPageVarSetFieldImportContext : public XMLTextFieldImportContext
     937             : {
     938             :     const OUString sPropertyOn;
     939             :     const OUString sPropertyOffset;
     940             : 
     941             :     sal_Int16 nAdjust;
     942             :     sal_Bool bActive;
     943             : 
     944             : public:
     945             :     TYPEINFO_OVERRIDE();
     946             : 
     947             :     XMLPageVarSetFieldImportContext(SvXMLImport& rImport,
     948             :                                     XMLTextImportHelper& rHlp,
     949             :                                     sal_uInt16 nPrfx,
     950             :                                     const OUString& sLocalName);
     951             : 
     952             : protected:
     953             :     /// process attribute values
     954             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     955             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     956             : 
     957             :     /// prepare XTextField for insertion into document
     958             :     virtual void PrepareField(
     959             :         const ::com::sun::star::uno::Reference<
     960             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
     961             : };
     962             : 
     963             : /** import macro fields (<text:execute-macro>) */
     964           0 : class XMLMacroFieldImportContext : public XMLTextFieldImportContext
     965             : {
     966             :     const OUString sPropertyHint;
     967             :     const OUString sPropertyMacroName;
     968             :     const OUString sPropertyScriptURL;
     969             :     const OUString sPropertyLibraryName;
     970             : 
     971             :     OUString sDescription;
     972             :     SvXMLImportContextRef xEventContext;
     973             : 
     974             :     OUString sMacro; // macro for old documents (pre 638i)
     975             : 
     976             :     sal_Bool bDescriptionOK;
     977             : 
     978             : public:
     979             :     TYPEINFO_OVERRIDE();
     980             : 
     981             :     XMLMacroFieldImportContext(SvXMLImport& rImport,
     982             :                                XMLTextImportHelper& rHlp,
     983             :                                sal_uInt16 nPrfx,
     984             :                                const OUString& sLocalName);
     985             : 
     986             : protected:
     987             :     /// for <office:events> children
     988             :     virtual SvXMLImportContext *CreateChildContext(
     989             :         sal_uInt16 nPrefix,
     990             :         const OUString& rLocalName,
     991             :         const ::com::sun::star::uno::Reference<
     992             :         ::com::sun::star::xml::sax::XAttributeList> & xAttrList ) SAL_OVERRIDE;
     993             : 
     994             :     /// process attribute values
     995             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
     996             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
     997             : 
     998             :     /// prepare XTextField for insertion into document
     999             :     virtual void PrepareField(
    1000             :         const ::com::sun::star::uno::Reference<
    1001             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
    1002             : };
    1003             : 
    1004             : /** import reference fields (<text:reference-get>) */
    1005          24 : class XMLReferenceFieldImportContext : public XMLTextFieldImportContext
    1006             : {
    1007             :     const OUString sPropertyReferenceFieldPart;
    1008             :     const OUString sPropertyReferenceFieldSource;
    1009             :     const OUString sPropertySourceName;
    1010             :     const OUString sPropertyCurrentPresentation;
    1011             : 
    1012             :     OUString sName;
    1013             :     sal_uInt16 nElementToken;
    1014             :     sal_Int16 nSource;
    1015             :     sal_Int16 nType;
    1016             : 
    1017             :     sal_Bool bNameOK;
    1018             :     sal_Bool bTypeOK;
    1019             : 
    1020             : public:
    1021             :     TYPEINFO_OVERRIDE();
    1022             : 
    1023             :     XMLReferenceFieldImportContext(SvXMLImport& rImport,
    1024             :                                    XMLTextImportHelper& rHlp,
    1025             :                                    sal_uInt16 nToken,
    1026             :                                    sal_uInt16 nPrfx,
    1027             :                                    const OUString& sLocalName);
    1028             : 
    1029             : protected:
    1030             :     /// start element
    1031             :     virtual void StartElement(
    1032             :         const ::com::sun::star::uno::Reference<
    1033             :         ::com::sun::star::xml::sax::XAttributeList> & xAttrList) SAL_OVERRIDE;
    1034             : 
    1035             :     /// process attribute values
    1036             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
    1037             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
    1038             : 
    1039             :     /// prepare XTextField for insertion into document
    1040             :     virtual void PrepareField(
    1041             :         const ::com::sun::star::uno::Reference<
    1042             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
    1043             : };
    1044             : 
    1045             : /** import dde field declaration container (<text:dde-connection-decls>) */
    1046           0 : class XMLDdeFieldDeclsImportContext : public SvXMLImportContext
    1047             : {
    1048             :     SvXMLTokenMap aTokenMap;
    1049             : 
    1050             : public:
    1051             :     TYPEINFO_OVERRIDE();
    1052             : 
    1053             :     XMLDdeFieldDeclsImportContext(SvXMLImport& rImport,
    1054             :                                   sal_uInt16 nPrfx,
    1055             :                                   const OUString& sLocalName);
    1056             : 
    1057             :     virtual SvXMLImportContext *CreateChildContext(
    1058             :         sal_uInt16 nPrefix,
    1059             :         const OUString& rLocalName,
    1060             :         const ::com::sun::star::uno::Reference<
    1061             :         ::com::sun::star::xml::sax::XAttributeList> & xAttrList ) SAL_OVERRIDE;
    1062             : };
    1063             : 
    1064             : /** import dde field declaration (<text:dde-connection-decl>) */
    1065           0 : class XMLDdeFieldDeclImportContext : public SvXMLImportContext
    1066             : {
    1067             :     const OUString sPropertyIsAutomaticUpdate;
    1068             :     const OUString sPropertyName;
    1069             :     const OUString sPropertyDDECommandType;
    1070             :     const OUString sPropertyDDECommandFile;
    1071             :     const OUString sPropertyDDECommandElement;
    1072             : 
    1073             :     const SvXMLTokenMap& rTokenMap;
    1074             : 
    1075             : public:
    1076             :     TYPEINFO_OVERRIDE();
    1077             : 
    1078             :     XMLDdeFieldDeclImportContext(SvXMLImport& rImport,
    1079             :                                  sal_uInt16 nPrfx,
    1080             :                                  const OUString& sLocalName,
    1081             :                                  const SvXMLTokenMap& rMap);
    1082             : 
    1083             :     // create fieldmaster
    1084             :     virtual void StartElement(
    1085             :         const ::com::sun::star::uno::Reference<
    1086             :         ::com::sun::star::xml::sax::XAttributeList> & xAttrList) SAL_OVERRIDE;
    1087             : };
    1088             : 
    1089             : /** import dde fields (<text:dde-connection>) */
    1090           0 : class XMLDdeFieldImportContext : public XMLTextFieldImportContext
    1091             : {
    1092             :     OUString sName;
    1093             :     OUString sPropertyContent;
    1094             : 
    1095             : public:
    1096             :     TYPEINFO_OVERRIDE();
    1097             : 
    1098             :     XMLDdeFieldImportContext(SvXMLImport& rImport,
    1099             :                              XMLTextImportHelper& rHlp,
    1100             :                              sal_uInt16 nPrfx,
    1101             :                              const OUString& sLocalName);
    1102             : 
    1103             : protected:
    1104             :     /// process attribute values
    1105             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
    1106             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
    1107             : 
    1108             :     /// create textfield, attach master, and insert into document
    1109             :     virtual void EndElement() SAL_OVERRIDE;
    1110             : 
    1111             :     /// empty method
    1112             :     virtual void PrepareField(
    1113             :         const ::com::sun::star::uno::Reference<
    1114             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
    1115             : };
    1116             : 
    1117             : /** import sheet name fields (Calc) dde fields (<text:sheet-name>) */
    1118         460 : class XMLSheetNameImportContext : public XMLTextFieldImportContext
    1119             : {
    1120             : 
    1121             : public:
    1122             :     TYPEINFO_OVERRIDE();
    1123             : 
    1124             :     XMLSheetNameImportContext(SvXMLImport& rImport,
    1125             :                               XMLTextImportHelper& rHlp,
    1126             :                               sal_uInt16 nPrfx,
    1127             :                               const OUString& sLocalName);
    1128             : 
    1129             : protected:
    1130             :     /// no attributes -> empty method
    1131             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
    1132             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
    1133             : 
    1134             :     /// no attributes -> empty method
    1135             :     virtual void PrepareField(
    1136             :         const ::com::sun::star::uno::Reference<
    1137             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
    1138             : };
    1139             : 
    1140             : /** import hyperlinks as URL fields (Calc, Impress, Draw) (<office:a>) */
    1141           2 : class XMLUrlFieldImportContext : public XMLTextFieldImportContext
    1142             : {
    1143             :     const OUString sPropertyURL;
    1144             :     const OUString sPropertyTargetFrame;
    1145             :     const OUString sPropertyRepresentation;
    1146             : 
    1147             :     OUString sURL;
    1148             :     OUString sFrame;
    1149             :     sal_Bool bFrameOK;
    1150             : 
    1151             : public:
    1152             :     TYPEINFO_OVERRIDE();
    1153             : 
    1154             :     XMLUrlFieldImportContext(SvXMLImport& rImport,
    1155             :                              XMLTextImportHelper& rHlp,
    1156             :                              sal_uInt16 nPrfx,
    1157             :                              const OUString& sLocalName);
    1158             : 
    1159             : protected:
    1160             :     /// no attributes -> empty method
    1161             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
    1162             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
    1163             : 
    1164             :     /// no attributes -> empty method
    1165             :     virtual void PrepareField(
    1166             :         const ::com::sun::star::uno::Reference<
    1167             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
    1168             : };
    1169             : 
    1170             : /** import bibliography info fields (<text:bibliography-mark>) */
    1171           0 : class XMLBibliographyFieldImportContext : public XMLTextFieldImportContext
    1172             : {
    1173             :     const OUString sPropertyFields;
    1174             : 
    1175             :     ::std::vector< ::com::sun::star::beans::PropertyValue> aValues;
    1176             : 
    1177             : public:
    1178             :     TYPEINFO_OVERRIDE();
    1179             : 
    1180             :     XMLBibliographyFieldImportContext(SvXMLImport& rImport,
    1181             :                                       XMLTextImportHelper& rHlp,
    1182             :                                       sal_uInt16 nPrfx,
    1183             :                                       const OUString& sLocalName);
    1184             : 
    1185             : protected:
    1186             :     /// process attributes (fill aValues)
    1187             :     virtual void StartElement(
    1188             :         const ::com::sun::star::uno::Reference<
    1189             :         ::com::sun::star::xml::sax::XAttributeList> & xAttrList) SAL_OVERRIDE;
    1190             : 
    1191             :     /// empty method; all attributes are handled in StartElement
    1192             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
    1193             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
    1194             : 
    1195             :     /// convert aValues into sequence and set property
    1196             :     virtual void PrepareField(
    1197             :         const ::com::sun::star::uno::Reference<
    1198             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
    1199             : 
    1200             :     static const sal_Char* MapBibliographyFieldName(const OUString& sName);
    1201             : };
    1202             : 
    1203             : /** Import an annotation field (<text:annotation>) */
    1204          52 : class XMLAnnotationImportContext : public XMLTextFieldImportContext
    1205             : {
    1206             :     const OUString sPropertyAuthor;
    1207             :     const OUString sPropertyInitials;
    1208             :     const OUString sPropertyContent;
    1209             :     const OUString sPropertyDate;
    1210             :     const OUString sPropertyTextRange;
    1211             :     const OUString sPropertyName;
    1212             : 
    1213             :     OUStringBuffer aAuthorBuffer;
    1214             :     OUStringBuffer aInitialsBuffer;
    1215             :     OUString aName;
    1216             :     OUStringBuffer aTextBuffer;
    1217             :     OUStringBuffer aDateBuffer;
    1218             : 
    1219             :     com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet > mxField;
    1220             :     com::sun::star::uno::Reference < com::sun::star::text::XTextCursor >  mxCursor;
    1221             :     com::sun::star::uno::Reference < com::sun::star::text::XTextCursor >  mxOldCursor;
    1222             : 
    1223             :     sal_uInt16 m_nToken;
    1224             : 
    1225             : public:
    1226             :     TYPEINFO_OVERRIDE();
    1227             : 
    1228             :     XMLAnnotationImportContext(SvXMLImport& rImport,
    1229             :                                XMLTextImportHelper& rHlp,
    1230             :                                sal_uInt16 nToken,
    1231             :                                sal_uInt16 nPrfx,
    1232             :                                const OUString& sLocalName);
    1233             : 
    1234             : protected:
    1235             :     /// process attributes
    1236             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
    1237             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
    1238             : 
    1239             :     /// set properties
    1240             :     virtual void PrepareField(
    1241             :         const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & xPropertySet) SAL_OVERRIDE;
    1242             : 
    1243             :     virtual SvXMLImportContext *CreateChildContext(
    1244             :         sal_uInt16 nPrefix,
    1245             :         const OUString& rLocalName,
    1246             :         const ::com::sun::star::uno::Reference<
    1247             :                 ::com::sun::star::xml::sax::XAttributeList >& xAttrList ) SAL_OVERRIDE;
    1248             :     virtual void EndElement() SAL_OVERRIDE;
    1249             : };
    1250             : 
    1251             : /** Import a script field (<text:script>) */
    1252           0 : class XMLScriptImportContext : public XMLTextFieldImportContext
    1253             : {
    1254             :     const OUString sPropertyScriptType;
    1255             :     const OUString sPropertyURLContent;
    1256             :     const OUString sPropertyContent;
    1257             : 
    1258             :     OUString sContent;
    1259             :     OUString sScriptType;
    1260             : 
    1261             :     sal_Bool bContentOK;
    1262             :     sal_Bool bScriptTypeOK;
    1263             : 
    1264             : public:
    1265             :     TYPEINFO_OVERRIDE();
    1266             : 
    1267             :     XMLScriptImportContext(SvXMLImport& rImport,
    1268             :                            XMLTextImportHelper& rHlp,
    1269             :                            sal_uInt16 nPrfx,
    1270             :                            const OUString& sLocalName);
    1271             : 
    1272             : protected:
    1273             :     /// process attributes
    1274             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
    1275             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
    1276             : 
    1277             :     /// set properties
    1278             :     virtual void PrepareField(
    1279             :         const ::com::sun::star::uno::Reference<
    1280             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
    1281             : };
    1282             : 
    1283             : /** import measure fields (<text:measure>) */
    1284           8 : class XMLMeasureFieldImportContext : public XMLTextFieldImportContext
    1285             : {
    1286             :     sal_Int16 mnKind;
    1287             : 
    1288             : public:
    1289             :     TYPEINFO_OVERRIDE();
    1290             : 
    1291             :     XMLMeasureFieldImportContext(SvXMLImport& rImport,
    1292             :                                     XMLTextImportHelper& rHlp,
    1293             :                                     sal_uInt16 nPrfx,
    1294             :                                     const OUString& sLocalName);
    1295             : 
    1296             : protected:
    1297             :     /// process attribute values
    1298             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
    1299             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
    1300             : 
    1301             :     /// prepare XTextField for insertion into document
    1302             :     virtual void PrepareField(
    1303             :         const ::com::sun::star::uno::Reference<
    1304             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
    1305             : };
    1306             : 
    1307             : /** dropdown field (filter legacy) */
    1308           0 : class XMLDropDownFieldImportContext : public XMLTextFieldImportContext
    1309             : {
    1310             :     std::vector<OUString> aLabels;
    1311             :     OUString sName;
    1312             :     OUString sHelp;
    1313             :     OUString sHint;
    1314             :     sal_Int32 nSelected;
    1315             :     bool bNameOK;
    1316             :     bool bHelpOK;
    1317             :     bool bHintOK;
    1318             : 
    1319             :     const OUString sPropertyItems;
    1320             :     const OUString sPropertySelectedItem;
    1321             :     const OUString sPropertyName;
    1322             :     const OUString sPropertyHelp;
    1323             :     const OUString sPropertyToolTip;
    1324             : 
    1325             : public:
    1326             :     TYPEINFO_OVERRIDE();
    1327             : 
    1328             :     XMLDropDownFieldImportContext(SvXMLImport& rImport,
    1329             :                                     XMLTextImportHelper& rHlp,
    1330             :                                     sal_uInt16 nPrfx,
    1331             :                                     const OUString& sLocalName);
    1332             : 
    1333             :     virtual SvXMLImportContext* CreateChildContext(
    1334             :         sal_uInt16 nPrefix,
    1335             :         const OUString& rLocalName,
    1336             :         const ::com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList >& xAttrList ) SAL_OVERRIDE;
    1337             : 
    1338             : protected:
    1339             :     /// process attribute values
    1340             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
    1341             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
    1342             : 
    1343             :     /// prepare XTextField for insertion into document
    1344             :     virtual void PrepareField(
    1345             :         const ::com::sun::star::uno::Reference<
    1346             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
    1347             : };
    1348             : 
    1349             : /** import header fields (<draw:header>) */
    1350          48 : class XMLHeaderFieldImportContext : public XMLTextFieldImportContext
    1351             : {
    1352             : public:
    1353             :     TYPEINFO_OVERRIDE();
    1354             : 
    1355             :     XMLHeaderFieldImportContext(
    1356             :         SvXMLImport& rImport,                   /// XML Import
    1357             :         XMLTextImportHelper& rHlp,              /// Text import helper
    1358             :         sal_uInt16 nPrfx,                       /// namespace prefix
    1359             :         const OUString& sLocalName);     /// element name w/o prefix
    1360             : 
    1361             :     /// process attribute values
    1362             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
    1363             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
    1364             : 
    1365             :     /// prepare XTextField for insertion into document
    1366             :     virtual void PrepareField(
    1367             :         const ::com::sun::star::uno::Reference<
    1368             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
    1369             : };
    1370             : 
    1371             : /** import footer fields (<draw:footer>) */
    1372          68 : class XMLFooterFieldImportContext : public XMLTextFieldImportContext
    1373             : {
    1374             : public:
    1375             :     TYPEINFO_OVERRIDE();
    1376             : 
    1377             :     XMLFooterFieldImportContext(
    1378             :         SvXMLImport& rImport,                   /// XML Import
    1379             :         XMLTextImportHelper& rHlp,              /// Text import helper
    1380             :         sal_uInt16 nPrfx,                       /// namespace prefix
    1381             :         const OUString& sLocalName);     /// element name w/o prefix
    1382             : 
    1383             :     /// process attribute values
    1384             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
    1385             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
    1386             : 
    1387             :     /// prepare XTextField for insertion into document
    1388             :     virtual void PrepareField(
    1389             :         const ::com::sun::star::uno::Reference<
    1390             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
    1391             : };
    1392             : 
    1393             : /** import footer fields (<draw:date-and-time>) */
    1394          68 : class XMLDateTimeFieldImportContext : public XMLTextFieldImportContext
    1395             : {
    1396             : public:
    1397             :     TYPEINFO_OVERRIDE();
    1398             : 
    1399             :     XMLDateTimeFieldImportContext(
    1400             :         SvXMLImport& rImport,                   /// XML Import
    1401             :         XMLTextImportHelper& rHlp,              /// Text import helper
    1402             :         sal_uInt16 nPrfx,                       /// namespace prefix
    1403             :         const OUString& sLocalName);     /// element name w/o prefix
    1404             : 
    1405             :     /// process attribute values
    1406             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
    1407             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
    1408             : 
    1409             :     /// prepare XTextField for insertion into document
    1410             :     virtual void PrepareField(
    1411             :         const ::com::sun::star::uno::Reference<
    1412             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
    1413             : };
    1414             : 
    1415             : class XMLCustomPropertyFieldImportContext : public XMLTextFieldImportContext
    1416             : {
    1417             :     OUString sName;
    1418             :     ::com::sun::star::uno::Any aValue;
    1419             :     const OUString sPropertyName;
    1420             :     const OUString sPropertyValue;
    1421             : 
    1422             : public:
    1423             :     TYPEINFO_OVERRIDE();
    1424             : 
    1425             :     XMLCustomPropertyFieldImportContext (SvXMLImport& rImport,
    1426             :                                     XMLTextImportHelper& rHlp,
    1427             :                                     sal_uInt16 nPrfx,
    1428             :                                     const OUString& sLocalName);
    1429             : 
    1430             : protected:
    1431             :     /// process attribute values
    1432             :     virtual void ProcessAttribute( sal_uInt16 nAttrToken,
    1433             :                                    const OUString& sAttrValue ) SAL_OVERRIDE;
    1434             : 
    1435             :     /// prepare XTextField for insertion into document
    1436             :     virtual void PrepareField(
    1437             :         const ::com::sun::star::uno::Reference<
    1438             :         ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
    1439             : };
    1440             : 
    1441             : #endif
    1442             : 
    1443             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10