LCOV - code coverage report
Current view: top level - sw/inc - docufld.hxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 37 62 59.7 %
Date: 2014-04-11 Functions: 58 91 63.7 %
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             : #ifndef INCLUDED_SW_INC_DOCUFLD_HXX
      20             : #define INCLUDED_SW_INC_DOCUFLD_HXX
      21             : 
      22             : #include <tools/date.hxx>
      23             : #include <tools/datetime.hxx>
      24             : 
      25             : #include <svl/macitem.hxx>
      26             : 
      27             : #include "fldbas.hxx"
      28             : #include "numrule.hxx"
      29             : 
      30             : class _SetGetExpFlds;
      31             : class SwTxtFld;
      32             : class SwFrm;
      33             : class OutlinerParaObject;
      34             : class SwTextAPIObject;
      35             : class SwFmtFld;
      36             : 
      37             : enum SwAuthorFormat
      38             : {
      39             :     AF_BEGIN,
      40             :     AF_NAME = AF_BEGIN,
      41             :     AF_SHORTCUT,
      42             :     AF_END,
      43             :     AF_FIXED = 0x8000
      44             : };
      45             : 
      46             : /*--------------------------------------------------------------------
      47             :     Subtype of document statistics.
      48             :  --------------------------------------------------------------------*/
      49             : 
      50             : enum SwDocStatSubType
      51             : {
      52             :     DS_BEGIN,
      53             :     DS_PAGE = DS_BEGIN,
      54             :     DS_PARA,
      55             :     DS_WORD,
      56             :     DS_CHAR,
      57             :     DS_TBL,
      58             :     DS_GRF,
      59             :     DS_OLE,
      60             :     DS_END
      61             : };
      62             : 
      63             : typedef sal_uInt16  SwDocInfoSubType;
      64             : namespace nsSwDocInfoSubType
      65             : {
      66             :     /** NB: these must denote consecutive integers!
      67             :      NB2: these are extended by 4 DI_INFO values for backward compatibility
      68             :           in filter/html/htmlfld.cxx, so make sure that DI_SUBTYPE_END
      69             :           really is the end, and is at least 4 less than DI_SUB_*! */
      70             :     const SwDocInfoSubType DI_SUBTYPE_BEGIN =  0;
      71             :     const SwDocInfoSubType DI_TITEL         =  DI_SUBTYPE_BEGIN;
      72             :     const SwDocInfoSubType DI_THEMA         =  1;
      73             :     const SwDocInfoSubType DI_KEYS          =  2;
      74             :     const SwDocInfoSubType DI_COMMENT       =  3;
      75             :     const SwDocInfoSubType DI_CREATE        =  4;
      76             :     const SwDocInfoSubType DI_CHANGE        =  5;
      77             :     const SwDocInfoSubType DI_PRINT         =  6;
      78             :     const SwDocInfoSubType DI_DOCNO         =  7;
      79             :     const SwDocInfoSubType DI_EDIT          =  8;
      80             :     const SwDocInfoSubType DI_CUSTOM        =  9;
      81             :     const SwDocInfoSubType DI_SUBTYPE_END   = 10;
      82             : 
      83             :     const SwDocInfoSubType DI_SUB_AUTHOR    = 0x0100;
      84             :     const SwDocInfoSubType DI_SUB_TIME      = 0x0200;
      85             :     const SwDocInfoSubType DI_SUB_DATE      = 0x0300;
      86             :     const SwDocInfoSubType DI_SUB_FIXED     = 0x1000;
      87             :     const SwDocInfoSubType DI_SUB_MASK      = 0xff00;
      88             : }
      89             : 
      90             : enum RegInfoFormat  ///< Only for loading of old documents!!!
      91             : {
      92             :     RF_AUTHOR,
      93             :     RF_TIME,
      94             :     RF_DATE,
      95             :     RF_ALL
      96             : };
      97             : 
      98             : enum SwPageNumSubType
      99             : {
     100             :     PG_RANDOM,
     101             :     PG_NEXT,
     102             :     PG_PREV
     103             : };
     104             : 
     105             : enum SwExtUserSubType
     106             : {
     107             :     EU_COMPANY,
     108             :     EU_FIRSTNAME,
     109             :     EU_NAME,
     110             :     EU_SHORTCUT,
     111             :     EU_STREET,
     112             :     EU_COUNTRY,
     113             :     EU_ZIP,
     114             :     EU_CITY,
     115             :     EU_TITLE,
     116             :     EU_POSITION,
     117             :     EU_PHONE_PRIVATE,
     118             :     EU_PHONE_COMPANY,
     119             :     EU_FAX,
     120             :     EU_EMAIL,
     121             :     EU_STATE,
     122             :     EU_FATHERSNAME,
     123             :     EU_APARTMENT
     124             : };
     125             : 
     126             : enum SwJumpEditFormat
     127             : {
     128             :     JE_FMT_TEXT,
     129             :     JE_FMT_TABLE,
     130             :     JE_FMT_FRAME,
     131             :     JE_FMT_GRAPHIC,
     132             :     JE_FMT_OLE
     133             : };
     134             : 
     135             : /*--------------------------------------------------------------------
     136             :     Page number.
     137             :  --------------------------------------------------------------------*/
     138             : 
     139        3696 : class SwPageNumberFieldType : public SwFieldType
     140             : {
     141             :     sal_Int16   nNumberingType;
     142             :     bool            bVirtuell;
     143             : 
     144             : public:
     145             :     SwPageNumberFieldType();
     146             : 
     147             :     OUString Expand( sal_uInt32 nFmt, short nOff, sal_uInt16 const nPageNumber,
     148             :                      sal_uInt16 const nMaxPage, const OUString& ) const;
     149             :     void ChangeExpansion( SwDoc* pDoc,
     150             :                             sal_Bool bVirtPageNum, const sal_Int16* pNumFmt = 0 );
     151             :     virtual SwFieldType* Copy() const SAL_OVERRIDE;
     152             : };
     153             : 
     154             : /*--------------------------------------------------------------------
     155             :     Page numbering.
     156             :  --------------------------------------------------------------------*/
     157             : 
     158        6576 : class SW_DLLPUBLIC SwPageNumberField : public SwField
     159             : {
     160             :     OUString sUserStr;
     161             :     sal_uInt16  nSubType;
     162             :     short   nOffset;
     163             :     // fdo#58074 store page number in SwField, not SwFieldType
     164             :     sal_uInt16 m_nPageNumber;
     165             :     sal_uInt16 m_nMaxPage;
     166             : 
     167             : public:
     168             :     SwPageNumberField(SwPageNumberFieldType*, sal_uInt16 nSub = PG_RANDOM,
     169             :                       sal_uInt32 nFmt = 0, short nOff = 0,
     170             :                       sal_uInt16 const nPageNumber = 0,
     171             :                       sal_uInt16 const nMaxPage = 0);
     172             : 
     173             :     void ChangeExpansion(sal_uInt16 const nPageNumber,
     174             :             sal_uInt16 const nMaxPage);
     175             : 
     176             :     virtual OUString    Expand() const SAL_OVERRIDE;
     177             :     virtual SwField*    Copy() const SAL_OVERRIDE;
     178             : 
     179             :     virtual OUString GetPar2() const SAL_OVERRIDE;
     180             :     virtual void        SetPar2(const OUString& rStr) SAL_OVERRIDE;
     181             : 
     182             :     virtual sal_uInt16  GetSubType() const SAL_OVERRIDE;
     183             :     virtual bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
     184             :     virtual bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
     185             : 
     186           0 :     OUString GetUserString() const            { return sUserStr; }
     187        3050 :     void SetUserString( const OUString& rS )  { sUserStr = rS; }
     188             : };
     189             : 
     190             : /*--------------------------------------------------------------------
     191             :     Authors.
     192             :  --------------------------------------------------------------------*/
     193             : 
     194        3696 : class SwAuthorFieldType : public SwFieldType
     195             : {
     196             : public:
     197             :     SwAuthorFieldType();
     198             : 
     199             :     OUString                Expand(sal_uLong) const;
     200             :     virtual SwFieldType*    Copy() const SAL_OVERRIDE;
     201             : };
     202             : 
     203             : /*--------------------------------------------------------------------
     204             :     Author field.
     205             :  --------------------------------------------------------------------*/
     206             : 
     207         268 : class SwAuthorField : public SwField
     208             : {
     209             :     OUString aContent;
     210             : 
     211             : public:
     212             :     SwAuthorField(SwAuthorFieldType*, sal_uInt32 nFmt = 0);
     213             : 
     214             :     virtual OUString    Expand() const SAL_OVERRIDE;
     215             :     virtual SwField*    Copy() const SAL_OVERRIDE;
     216             : 
     217         134 :     inline void         SetExpansion(const OUString& rStr) { aContent = rStr; }
     218          20 :     inline OUString     GetContent() const { return aContent; }
     219             : 
     220             :     virtual bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
     221             :     virtual bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
     222             : };
     223             : 
     224             : /*--------------------------------------------------------------------
     225             :     Filename
     226             :  --------------------------------------------------------------------*/
     227             : 
     228        3697 : class SwFileNameFieldType : public SwFieldType
     229             : {
     230             :     SwDoc *pDoc;
     231             : public:
     232             :     SwFileNameFieldType(SwDoc*);
     233             : 
     234             :     OUString                Expand(sal_uLong) const;
     235             :     virtual SwFieldType*    Copy() const SAL_OVERRIDE;
     236             : };
     237             : 
     238             : /*--------------------------------------------------------------------
     239             :     FileNameField
     240             :  --------------------------------------------------------------------*/
     241             : 
     242         218 : class SW_DLLPUBLIC SwFileNameField : public SwField
     243             : {
     244             :     OUString aContent;
     245             : 
     246             : public:
     247             :     SwFileNameField(SwFileNameFieldType*, sal_uInt32 nFmt = 0);
     248             : 
     249             :     virtual OUString    Expand() const SAL_OVERRIDE;
     250             :     virtual SwField*    Copy() const SAL_OVERRIDE;
     251             : 
     252         109 :     inline void         SetExpansion(const OUString& rStr) { aContent = rStr; }
     253           0 :     inline OUString     GetContent() const { return aContent; }
     254             : 
     255             :     virtual bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
     256             :     virtual bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
     257             : };
     258             : 
     259             : /*--------------------------------------------------------------------
     260             :     TemplName
     261             :  --------------------------------------------------------------------*/
     262             : 
     263        7392 : class SwTemplNameFieldType : public SwFieldType
     264             : {
     265             :     SwDoc *pDoc;
     266             : public:
     267             :     SwTemplNameFieldType(SwDoc*);
     268             : 
     269             :     OUString                Expand(sal_uLong) const;
     270             :     virtual SwFieldType*    Copy() const SAL_OVERRIDE;
     271             : };
     272             : 
     273             : /*--------------------------------------------------------------------
     274             :     TemplNameField
     275             :  --------------------------------------------------------------------*/
     276             : 
     277           0 : class SW_DLLPUBLIC SwTemplNameField : public SwField
     278             : {
     279             : public:
     280             :     SwTemplNameField(SwTemplNameFieldType*, sal_uInt32 nFmt = 0);
     281             : 
     282             :     virtual OUString    Expand() const SAL_OVERRIDE;
     283             :     virtual SwField*    Copy() const SAL_OVERRIDE;
     284             :     virtual bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
     285             :     virtual bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
     286             : };
     287             : 
     288             : /*--------------------------------------------------------------------
     289             :     Document statistics
     290             :  --------------------------------------------------------------------*/
     291             : 
     292        3696 : class SwDocStatFieldType : public SwFieldType
     293             : {
     294             :     SwDoc*          pDoc;
     295             :     sal_Int16       nNumberingType; ///< com::sun::star::style::NumberingType
     296             : 
     297             : public:
     298             :     SwDocStatFieldType(SwDoc*);
     299             :     OUString                Expand(sal_uInt16 nSubType, sal_uInt32 nFmt) const;
     300             :     virtual SwFieldType*    Copy() const SAL_OVERRIDE;
     301             : 
     302         102 :     inline void             SetNumFormat( sal_Int16 eFmt )  { nNumberingType = eFmt; }
     303             : };
     304             : 
     305             : /*--------------------------------------------------------------------
     306             :     DocStatField
     307             :  --------------------------------------------------------------------*/
     308             : 
     309         336 : class SW_DLLPUBLIC SwDocStatField : public SwField
     310             : {
     311             :     sal_uInt16 nSubType;
     312             : 
     313             : public:
     314             :     SwDocStatField( SwDocStatFieldType*,
     315             :                     sal_uInt16 nSubType = 0, sal_uInt32 nFmt = 0);
     316             : 
     317             :     void ChangeExpansion( const SwFrm* pFrm );
     318             : 
     319             :     virtual OUString    Expand() const SAL_OVERRIDE;
     320             :     virtual SwField*    Copy() const SAL_OVERRIDE;
     321             : 
     322             :     virtual sal_uInt16      GetSubType() const SAL_OVERRIDE;
     323             :     virtual void        SetSubType(sal_uInt16 nSub) SAL_OVERRIDE;
     324             :     virtual bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
     325             :     virtual bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
     326             : };
     327             : 
     328             : /*--------------------------------------------------------------------
     329             :     Hidden text.
     330             :  --------------------------------------------------------------------*/
     331             : 
     332        3696 : class SwHiddenTxtFieldType : public SwFieldType
     333             : {
     334             :     sal_Bool bHidden;
     335             : public:
     336             :     SwHiddenTxtFieldType(sal_Bool bSetHidden = sal_True);
     337             : 
     338             :     virtual SwFieldType*    Copy() const SAL_OVERRIDE;
     339             : 
     340             :     void                    SetHiddenFlag( sal_Bool bSetHidden = sal_True );
     341           0 :     inline sal_Bool             GetHiddenFlag() const { return bHidden; }
     342             : };
     343             : 
     344             : /*--------------------------------------------------------------------
     345             :     HiddenTxtField
     346             :  --------------------------------------------------------------------*/
     347             : 
     348           0 : class SwHiddenTxtField : public SwField
     349             : {
     350             :     OUString aTRUETxt;         ///< Text if condition sal_True.
     351             :     OUString aFALSETxt;        ///< If condition false.
     352             :     OUString aContent;         ///< Evaluated DB-text.
     353             : 
     354             :     OUString aCond;            ///< Condition.
     355             :     sal_uInt16  nSubType;
     356             : 
     357             :     sal_Bool    bCanToggle : 1;     ///< Can field be toggled alone?
     358             :     sal_Bool    bIsHidden  : 1;     ///< Is it not visible?
     359             :     sal_Bool    bValid     : 1;     ///< Is DB-field evaluated?
     360             : 
     361             :     virtual OUString    Expand() const SAL_OVERRIDE;
     362             :     virtual SwField*    Copy() const SAL_OVERRIDE;
     363             : 
     364             : public:
     365             :     SwHiddenTxtField( SwHiddenTxtFieldType*,
     366             :                      sal_Bool   bConditional,
     367             :                      const OUString& rCond,
     368             :                      const OUString& rTxt,
     369             :                      sal_Bool   bHidden  = sal_False,
     370             :                      sal_uInt16 nSubType = TYP_HIDDENTXTFLD);
     371             : 
     372             :     SwHiddenTxtField( SwHiddenTxtFieldType*,
     373             :                       const OUString& rCond,
     374             :                       const OUString& rTrue,
     375             :                       const OUString& rFalse,
     376             :                       sal_uInt16 nSubType = TYP_HIDDENTXTFLD);
     377             : 
     378             :     virtual OUString    GetFieldName() const SAL_OVERRIDE;
     379             : 
     380             :     void                Evaluate(SwDoc*);
     381             : 
     382           0 :     inline void         SetValue(sal_Bool bHidden)  { bIsHidden = bHidden; }
     383             :     OUString            GetColumnName(const OUString& rName);
     384             :     OUString            GetDBName(const OUString& rName, SwDoc *pDoc);
     385             : 
     386             :     /// Condition
     387             :     virtual void        SetPar1(const OUString& rStr) SAL_OVERRIDE;
     388             :     virtual OUString    GetPar1() const SAL_OVERRIDE;
     389             : 
     390             :     /// True/False - String
     391             :     virtual void        SetPar2(const OUString& rStr) SAL_OVERRIDE;
     392             :     virtual OUString GetPar2() const SAL_OVERRIDE;
     393             : 
     394             :     virtual sal_uInt16      GetSubType() const SAL_OVERRIDE;
     395             : 
     396             :     virtual bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
     397             :     virtual bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
     398             : };
     399             : 
     400             : /*--------------------------------------------------------------------
     401             :     Field that expands to an empty line (without height).
     402             :  --------------------------------------------------------------------*/
     403             : 
     404        3696 : class SwHiddenParaFieldType : public SwFieldType
     405             : {
     406             : public:
     407             :     SwHiddenParaFieldType();
     408             : 
     409             :     virtual SwFieldType*    Copy() const SAL_OVERRIDE;
     410             : };
     411             : 
     412             : /*--------------------------------------------------------------------
     413             :     Hidded paragraph.
     414             :  --------------------------------------------------------------------*/
     415             : 
     416           0 : class SwHiddenParaField : public SwField
     417             : {
     418             :     OUString           aCond;
     419             :     sal_Bool                bIsHidden:1;
     420             : public:
     421             :     /// Direct input, delete old value.
     422             :     SwHiddenParaField(SwHiddenParaFieldType*, const OUString& rCond);
     423             : 
     424             :     virtual OUString    Expand() const SAL_OVERRIDE;
     425             :     virtual SwField*    Copy() const SAL_OVERRIDE;
     426             : 
     427           0 :     void                SetHidden(sal_Bool bHidden)     { bIsHidden = bHidden; }
     428           0 :     sal_Bool                IsHidden() const            { return bIsHidden;    }
     429             : 
     430             :     /// Query, set condition.
     431             :     virtual OUString    GetPar1() const SAL_OVERRIDE;
     432             :     virtual void        SetPar1(const OUString& rStr) SAL_OVERRIDE;
     433             :     virtual bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
     434             :     virtual bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
     435             : };
     436             : 
     437             : /*--------------------------------------------------------------------
     438             :     Run Macro.
     439             :  --------------------------------------------------------------------*/
     440             : 
     441        3696 : class SwMacroFieldType : public SwFieldType
     442             : {
     443             :     SwDoc* pDoc;
     444             : 
     445             : public:
     446             :     SwMacroFieldType(SwDoc*);
     447             : 
     448             :     virtual SwFieldType*    Copy() const SAL_OVERRIDE;
     449             : };
     450             : 
     451             : /*--------------------------------------------------------------------
     452             :     MacroField.
     453             :  --------------------------------------------------------------------*/
     454             : 
     455          36 : class SW_DLLPUBLIC SwMacroField : public SwField
     456             : {
     457             :     OUString aMacro;
     458             :     OUString aText;
     459             :     sal_Bool      bIsScriptURL;
     460             : 
     461             :     virtual OUString Expand() const SAL_OVERRIDE;
     462             :     virtual SwField* Copy() const SAL_OVERRIDE;
     463             : 
     464             : public:
     465             :     /// Direct input, delete old value.
     466             :     SwMacroField( SwMacroFieldType*, const OUString& rLibAndName,
     467             :                   const OUString& rTxt);
     468             : 
     469           0 :     inline OUString  GetMacro() const { return aMacro; }
     470             :     OUString         GetLibName() const;
     471             :     OUString         GetMacroName() const;
     472             :     SvxMacro         GetSvxMacro() const;
     473             : 
     474             :     virtual OUString GetFieldName() const SAL_OVERRIDE;
     475             : 
     476             :     /// Library and FileName
     477             :     virtual OUString GetPar1() const SAL_OVERRIDE;
     478             :     virtual void     SetPar1(const OUString& rStr) SAL_OVERRIDE;
     479             : 
     480             :     /// Macrotext
     481             :     virtual OUString  GetPar2() const SAL_OVERRIDE;
     482             :     virtual void    SetPar2(const OUString& rStr) SAL_OVERRIDE;
     483             :     virtual bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
     484             :     virtual bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
     485             : 
     486             :     static void CreateMacroString( OUString& rMacro,
     487             :                                    const OUString& rMacroName,
     488             :                                    const OUString& rLibraryName );
     489             : 
     490             :     static sal_Bool isScriptURL( const OUString& str );
     491             : };
     492             : 
     493             : /*--------------------------------------------------------------------
     494             :     PostIts
     495             :  --------------------------------------------------------------------*/
     496             : 
     497        3696 : class SwPostItFieldType : public SwFieldType
     498             : {
     499             : private:
     500             :     SwDoc* mpDoc;
     501             : public:
     502             :     SwPostItFieldType(SwDoc* pDoc);
     503             : 
     504             :     virtual SwFieldType* Copy() const SAL_OVERRIDE;
     505             : 
     506         392 :     SwDoc* GetDoc() const
     507             :     {
     508         392 :         return mpDoc;
     509             :     };
     510             : };
     511             : 
     512             : /*--------------------------------------------------------------------
     513             :     PostItField
     514             :  --------------------------------------------------------------------*/
     515             : 
     516             : class SW_DLLPUBLIC SwPostItField : public SwField
     517             : {
     518             :     OUString sTxt;
     519             :     OUString sAuthor;
     520             :     OUString sInitials; ///< Initials of the author.
     521             :     OUString sName;     ///< Name of the comment.
     522             :     DateTime    aDateTime;
     523             :     OutlinerParaObject* mpText;
     524             :     SwTextAPIObject* m_pTextObject;
     525             : 
     526             : public:
     527             :     SwPostItField( SwPostItFieldType*,
     528             :                    const OUString& rAuthor,
     529             :                    const OUString& rTxt,
     530             :                    const OUString& rInitials,
     531             :                    const OUString& rName,
     532             :                    const DateTime& rDate);
     533             :     virtual ~SwPostItField();
     534             : 
     535             :     virtual OUString        Expand() const SAL_OVERRIDE;
     536             :     virtual SwField*        Copy() const SAL_OVERRIDE;
     537             : 
     538           9 :     inline const DateTime   GetDateTime() const             { return aDateTime; }
     539          53 :     inline const Date       GetDate() const                 { return aDateTime.GetDate(); }
     540          94 :     inline const Time       GetTime() const                 { return aDateTime.GetTime(); }
     541             : 
     542             :     /// Author
     543             :     virtual OUString        GetPar1() const SAL_OVERRIDE;
     544             :     virtual void            SetPar1(const OUString& rStr) SAL_OVERRIDE;
     545             : 
     546             :     /// Text
     547             :     virtual OUString   GetPar2() const SAL_OVERRIDE;
     548             :     virtual void            SetPar2(const OUString& rStr) SAL_OVERRIDE;
     549           4 :     OUString                GetTxt() const { return sTxt; }
     550             :     OUString                GetInitials() const;
     551             :     void                    SetName(const OUString& rStr);
     552             :     OUString                GetName() const;
     553             : 
     554             :     const OutlinerParaObject* GetTextObject() const;
     555             :     void SetTextObject( OutlinerParaObject* pText );
     556             : 
     557             :     sal_Int32 GetNumberOfParagraphs() const;
     558             : 
     559             :     virtual bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
     560             :     virtual bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
     561             :     virtual OUString    GetDescription() const SAL_OVERRIDE;
     562             : };
     563             : 
     564             : /*--------------------------------------------------------------------
     565             :     DocumentInfo
     566             :  --------------------------------------------------------------------*/
     567             : 
     568        3696 : class SwDocInfoFieldType : public SwValueFieldType
     569             : {
     570             : public:
     571             :     SwDocInfoFieldType(SwDoc* pDc);
     572             : 
     573             :     OUString                Expand(sal_uInt16 nSubType, sal_uInt32 nFormat, sal_uInt16 nLang, const OUString& rName) const;
     574             :     virtual SwFieldType*    Copy() const SAL_OVERRIDE;
     575             : };
     576             : 
     577         113 : class SW_DLLPUBLIC SwDocInfoField : public SwValueField
     578             : {
     579             :     sal_uInt16  nSubType;
     580             :     OUString  aContent;
     581             :     OUString  aName;
     582             : 
     583             :     virtual OUString        Expand() const SAL_OVERRIDE;
     584             :     virtual SwField*        Copy() const SAL_OVERRIDE;
     585             : 
     586             : public:
     587             :     SwDocInfoField(SwDocInfoFieldType*, sal_uInt16 nSub, const OUString& rName, sal_uInt32 nFmt=0);
     588             :     SwDocInfoField(SwDocInfoFieldType*, sal_uInt16 nSub, const OUString& rName, const OUString& rValue, sal_uInt32 nFmt=0);
     589             : 
     590             :     virtual void            SetSubType(sal_uInt16) SAL_OVERRIDE;
     591             :     virtual sal_uInt16          GetSubType() const SAL_OVERRIDE;
     592             :     virtual void            SetLanguage(sal_uInt16 nLng) SAL_OVERRIDE;
     593             :     virtual OUString        GetFieldName() const SAL_OVERRIDE;
     594           0 :     OUString                GetName() const { return aName; }
     595           0 :     void                    SetName( const OUString& rName ) { aName = rName; }
     596           6 :     inline void             SetExpansion(const OUString& rStr) { aContent = rStr; }
     597             :     virtual bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
     598             :     virtual bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
     599             : };
     600             : 
     601             : /*--------------------------------------------------------------------
     602             :     Extended User settings.
     603             :  --------------------------------------------------------------------*/
     604             : 
     605        3696 : class SwExtUserFieldType : public SwFieldType
     606             : {
     607             :     OUString aData;
     608             : public:
     609             :     SwExtUserFieldType();
     610             : 
     611             :     inline void             SetData(const OUString& rStr)     { aData = rStr; }
     612             : 
     613             :     OUString                Expand(sal_uInt16 nSubType, sal_uInt32 nFormat) const;
     614             :     virtual SwFieldType*    Copy() const SAL_OVERRIDE;
     615             : };
     616             : 
     617           0 : class SwExtUserField : public SwField
     618             : {
     619             :     OUString aContent;
     620             :     sal_uInt16  nType;
     621             : 
     622             : public:
     623             :     SwExtUserField(SwExtUserFieldType*, sal_uInt16 nSub, sal_uInt32 nFmt=0);
     624             : 
     625             :     virtual OUString    Expand() const SAL_OVERRIDE;
     626             :     virtual SwField*    Copy() const SAL_OVERRIDE;
     627             : 
     628             :     virtual sal_uInt16      GetSubType() const SAL_OVERRIDE;
     629             :     virtual void        SetSubType(sal_uInt16 nSub) SAL_OVERRIDE;
     630             : 
     631           0 :     inline void         SetExpansion(const OUString& rStr) { aContent = rStr; }
     632             : 
     633             :     virtual bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
     634             :     virtual bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
     635             : };
     636             : 
     637             : /*--------------------------------------------------------------------
     638             :     Relative page numbers - field.
     639             :  --------------------------------------------------------------------*/
     640             : 
     641        3696 : class SwRefPageSetFieldType : public SwFieldType
     642             : {
     643             : public:
     644             :     SwRefPageSetFieldType();
     645             : 
     646             :     virtual SwFieldType*    Copy() const SAL_OVERRIDE;
     647             : 
     648             : protected:
     649             :    /// Overlay, because there is nothing to update!
     650             :    virtual void Modify( const SfxPoolItem*, const SfxPoolItem * ) SAL_OVERRIDE;
     651             : };
     652             : 
     653             : /*--------------------------------------------------------------------
     654             :     Relative page numbering.
     655             :  --------------------------------------------------------------------*/
     656             : 
     657           0 : class SwRefPageSetField : public SwField
     658             : {
     659             :     short   nOffset;
     660             :     sal_Bool    bOn;
     661             : 
     662             : public:
     663             :     SwRefPageSetField( SwRefPageSetFieldType*, short nOff = 0,
     664             :                         sal_Bool bOn = sal_True );
     665             : 
     666             :     virtual OUString    Expand() const SAL_OVERRIDE;
     667             :     virtual SwField*    Copy() const SAL_OVERRIDE;
     668             : 
     669             :     virtual OUString  GetPar2() const SAL_OVERRIDE;
     670             :     virtual void    SetPar2(const OUString& rStr) SAL_OVERRIDE;
     671             : 
     672           0 :     sal_Bool IsOn() const               { return bOn; }
     673             : 
     674           0 :     short GetOffset() const         { return nOffset; }
     675           0 :     void SetOffset( short nOff )    { nOffset = nOff; }
     676             :     virtual bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
     677             :     virtual bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
     678             : };
     679             : 
     680             : /*--------------------------------------------------------------------
     681             :     Relative page numbers - query field.
     682             :  --------------------------------------------------------------------*/
     683             : 
     684        3696 : class SwRefPageGetFieldType : public SwFieldType
     685             : {
     686             :     SwDoc*          pDoc;
     687             :     sal_Int16       nNumberingType;
     688             : 
     689             :     void UpdateField( SwTxtFld* pTxtFld, _SetGetExpFlds& rSetList );
     690             : protected:
     691             :     /// overwritten to update all RefPageGet fields
     692             :    virtual void Modify( const SfxPoolItem*, const SfxPoolItem * ) SAL_OVERRIDE;
     693             : public:
     694             :     SwRefPageGetFieldType( SwDoc* pDoc );
     695             :     virtual SwFieldType*    Copy() const SAL_OVERRIDE;
     696             :     sal_uInt16 MakeSetList( _SetGetExpFlds& rTmpLst );
     697           0 :     SwDoc*  GetDoc() const                  { return pDoc; }
     698             : };
     699             : 
     700             : /*--------------------------------------------------------------------
     701             :     Query relative page numbering.
     702             :  --------------------------------------------------------------------*/
     703             : 
     704           0 : class SwRefPageGetField : public SwField
     705             : {
     706             :     OUString sTxt;
     707             : public:
     708             :     SwRefPageGetField( SwRefPageGetFieldType*, sal_uInt32 nFmt );
     709             : 
     710             :     virtual OUString    Expand() const SAL_OVERRIDE;
     711             :     virtual SwField*    Copy() const SAL_OVERRIDE;
     712             : 
     713           0 :     void SetText( const OUString& rTxt )      { sTxt = rTxt; }
     714             : 
     715             :     void ChangeExpansion( const SwFrm* pFrm, const SwTxtFld* pFld );
     716             :     virtual bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
     717             :     virtual bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
     718             : };
     719             : 
     720             : /*--------------------------------------------------------------------
     721             :     Field to jump to and edit.
     722             :  --------------------------------------------------------------------*/
     723             : 
     724        3696 : class SwJumpEditFieldType : public SwFieldType
     725             : {
     726             :     SwDoc* pDoc;
     727             :     SwDepend aDep;
     728             : 
     729             : public:
     730             :     SwJumpEditFieldType( SwDoc* pDoc );
     731             :     virtual SwFieldType*    Copy() const SAL_OVERRIDE;
     732             : 
     733             :     SwCharFmt* GetCharFmt();
     734             : };
     735             : 
     736          74 : class SwJumpEditField : public SwField
     737             : {
     738             :     OUString sTxt, sHelp;
     739             : public:
     740             :     SwJumpEditField( SwJumpEditFieldType*, sal_uInt32 nFormat,
     741             :                      const OUString& sText, const OUString& sHelp );
     742             : 
     743             :     virtual OUString    Expand() const SAL_OVERRIDE;
     744             :     virtual SwField*    Copy() const SAL_OVERRIDE;
     745             : 
     746             :     /// Placeholder-Text
     747             :     virtual OUString GetPar1() const SAL_OVERRIDE;
     748             :     virtual void    SetPar1(const OUString& rStr) SAL_OVERRIDE;
     749             : 
     750             :     /// Hint-Text
     751             :     virtual OUString  GetPar2() const SAL_OVERRIDE;
     752             :     virtual void    SetPar2(const OUString& rStr) SAL_OVERRIDE;
     753             : 
     754           1 :     SwCharFmt* GetCharFmt() const
     755           1 :         { return ((SwJumpEditFieldType*)GetTyp())->GetCharFmt(); }
     756             :     virtual bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
     757             :     virtual bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
     758             : };
     759             : 
     760             : /*--------------------------------------------------------------------
     761             :     Script Fieldtype.
     762             :  --------------------------------------------------------------------*/
     763             : 
     764        3696 : class SwScriptFieldType : public SwFieldType
     765             : {
     766             :     SwDoc* pDoc;
     767             : public:
     768             :     SwScriptFieldType( SwDoc* pDoc );
     769             : 
     770             :     virtual SwFieldType*    Copy() const SAL_OVERRIDE;
     771             : };
     772             : 
     773             : /*--------------------------------------------------------------------
     774             :     ScriptField.
     775             :  --------------------------------------------------------------------*/
     776             : 
     777           0 : class SwScriptField : public SwField
     778             : {
     779             :     OUString sType;  ///< Type of Code (Java/VBScript/...)
     780             :     OUString sCode;  /**< Code as text.
     781             :                           Code as JavaCode ? */
     782             : 
     783             :     sal_Bool    bCodeURL; ///< Code contains URL of a script.
     784             : 
     785             : public:
     786             :     SwScriptField( SwScriptFieldType*, const OUString& rType,
     787             :                    const OUString& rCode, sal_Bool bURL=sal_False );
     788             : 
     789             :     virtual OUString        GetDescription() const SAL_OVERRIDE;
     790             : 
     791             :     virtual OUString        Expand() const SAL_OVERRIDE;
     792             :     virtual SwField*        Copy() const SAL_OVERRIDE;
     793             : 
     794             :     /// Type
     795             :     virtual OUString        GetPar1() const SAL_OVERRIDE;
     796             :     virtual void            SetPar1(const OUString& rStr) SAL_OVERRIDE;
     797             :     /// Text
     798             :     virtual OUString   GetPar2() const SAL_OVERRIDE;
     799             :     virtual void            SetPar2(const OUString& rStr) SAL_OVERRIDE;
     800             : 
     801           0 :     sal_Bool                    IsCodeURL() const { return bCodeURL; }
     802           0 :     void                    SetCodeURL( sal_Bool bURL ) { bCodeURL = bURL; }
     803             :     virtual bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
     804             :     virtual bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
     805             : };
     806             : 
     807             : /*--------------------------------------------------------------------
     808             :     Combined Character Fieldtype
     809             :  --------------------------------------------------------------------*/
     810             : 
     811        3696 : class SwCombinedCharFieldType : public SwFieldType
     812             : {
     813             : public:
     814             :     SwCombinedCharFieldType();
     815             : 
     816             :     virtual SwFieldType*    Copy() const SAL_OVERRIDE;
     817             : };
     818             : 
     819             : /*--------------------------------------------------------------------
     820             :     ScriptField
     821             :  --------------------------------------------------------------------*/
     822             : 
     823             : #define MAX_COMBINED_CHARACTERS     6
     824             : 
     825           0 : class SW_DLLPUBLIC SwCombinedCharField : public SwField
     826             : {
     827             :     OUString sCharacters;    ///< combine these characters
     828             : 
     829             : public:
     830             :     SwCombinedCharField( SwCombinedCharFieldType*, const OUString& rChars );
     831             : 
     832             :     virtual OUString        Expand() const SAL_OVERRIDE;
     833             :     virtual SwField*        Copy() const SAL_OVERRIDE;
     834             : 
     835             :     /// Characters
     836             :     virtual OUString    GetPar1() const SAL_OVERRIDE;
     837             :     virtual void        SetPar1(const OUString& rStr) SAL_OVERRIDE;
     838             : 
     839             :     virtual bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
     840             :     virtual bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
     841             : };
     842             : 
     843             : #endif // INCLUDED_SW_INC_DOCUFLD_HXX
     844             : 
     845             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10