Branch libreoffice-5-0-4
[LibreOffice.git] / sw / inc / docufld.hxx
blobf7d8cf46dd949bef01a4d2da8ca88518b37a28ca
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SW_INC_DOCUFLD_HXX
20 #define INCLUDED_SW_INC_DOCUFLD_HXX
22 #include <tools/date.hxx>
23 #include <tools/datetime.hxx>
25 #include <svl/macitem.hxx>
27 #include "fldbas.hxx"
28 #include "numrule.hxx"
30 class _SetGetExpFields;
31 class SwTextField;
32 class SwFrm;
33 class OutlinerParaObject;
34 class SwTextAPIObject;
35 class SwFormatField;
37 enum SwAuthorFormat
39 AF_BEGIN,
40 AF_NAME = AF_BEGIN,
41 AF_SHORTCUT,
42 AF_END,
43 AF_FIXED = 0x8000
46 // Subtype of document statistics.
47 enum SwDocStatSubType
49 DS_BEGIN,
50 DS_PAGE = DS_BEGIN,
51 DS_PARA,
52 DS_WORD,
53 DS_CHAR,
54 DS_TBL,
55 DS_GRF,
56 DS_OLE,
57 DS_END
60 typedef sal_uInt16 SwDocInfoSubType;
61 namespace nsSwDocInfoSubType
63 /** NB: these must denote consecutive integers!
64 NB2: these are extended by 4 DI_INFO values for backward compatibility
65 in filter/html/htmlfld.cxx, so make sure that DI_SUBTYPE_END
66 really is the end, and is at least 4 less than DI_SUB_*! */
67 const SwDocInfoSubType DI_SUBTYPE_BEGIN = 0;
68 const SwDocInfoSubType DI_TITEL = DI_SUBTYPE_BEGIN;
69 const SwDocInfoSubType DI_THEMA = 1;
70 const SwDocInfoSubType DI_KEYS = 2;
71 const SwDocInfoSubType DI_COMMENT = 3;
72 const SwDocInfoSubType DI_CREATE = 4;
73 const SwDocInfoSubType DI_CHANGE = 5;
74 const SwDocInfoSubType DI_PRINT = 6;
75 const SwDocInfoSubType DI_DOCNO = 7;
76 const SwDocInfoSubType DI_EDIT = 8;
77 const SwDocInfoSubType DI_CUSTOM = 9;
78 const SwDocInfoSubType DI_SUBTYPE_END = 10;
80 const SwDocInfoSubType DI_SUB_AUTHOR = 0x0100;
81 const SwDocInfoSubType DI_SUB_TIME = 0x0200;
82 const SwDocInfoSubType DI_SUB_DATE = 0x0300;
83 const SwDocInfoSubType DI_SUB_FIXED = 0x1000;
84 const SwDocInfoSubType DI_SUB_MASK = 0xff00;
87 enum RegInfoFormat ///< Only for loading of old documents!!!
89 RF_AUTHOR,
90 RF_TIME,
91 RF_DATE,
92 RF_ALL
95 enum SwPageNumSubType
97 PG_RANDOM,
98 PG_NEXT,
99 PG_PREV
102 enum SwExtUserSubType
104 EU_COMPANY,
105 EU_FIRSTNAME,
106 EU_NAME,
107 EU_SHORTCUT,
108 EU_STREET,
109 EU_COUNTRY,
110 EU_ZIP,
111 EU_CITY,
112 EU_TITLE,
113 EU_POSITION,
114 EU_PHONE_PRIVATE,
115 EU_PHONE_COMPANY,
116 EU_FAX,
117 EU_EMAIL,
118 EU_STATE,
119 EU_FATHERSNAME,
120 EU_APARTMENT
123 enum SwJumpEditFormat
125 JE_FMT_TEXT,
126 JE_FMT_TABLE,
127 JE_FMT_FRAME,
128 JE_FMT_GRAPHIC,
129 JE_FMT_OLE
132 class SwPageNumberFieldType : public SwFieldType
134 sal_Int16 nNumberingType;
135 bool bVirtuell;
137 public:
138 SwPageNumberFieldType();
140 OUString Expand( sal_uInt32 nFormat, short nOff, sal_uInt16 const nPageNumber,
141 sal_uInt16 const nMaxPage, const OUString& ) const;
142 void ChangeExpansion( SwDoc* pDoc,
143 bool bVirtPageNum, const sal_Int16* pNumFormat = 0 );
144 virtual SwFieldType* Copy() const SAL_OVERRIDE;
147 // Page numbering.
148 class SW_DLLPUBLIC SwPageNumberField : public SwField
150 OUString sUserStr;
151 sal_uInt16 nSubType;
152 short nOffset;
153 // fdo#58074 store page number in SwField, not SwFieldType
154 sal_uInt16 m_nPageNumber;
155 sal_uInt16 m_nMaxPage;
157 public:
158 SwPageNumberField(SwPageNumberFieldType*, sal_uInt16 nSub = PG_RANDOM,
159 sal_uInt32 nFormat = 0, short nOff = 0,
160 sal_uInt16 const nPageNumber = 0,
161 sal_uInt16 const nMaxPage = 0);
163 void ChangeExpansion(sal_uInt16 const nPageNumber,
164 sal_uInt16 const nMaxPage);
166 virtual OUString Expand() const SAL_OVERRIDE;
167 virtual SwField* Copy() const SAL_OVERRIDE;
169 virtual OUString GetPar2() const SAL_OVERRIDE;
170 virtual void SetPar2(const OUString& rStr) SAL_OVERRIDE;
172 virtual sal_uInt16 GetSubType() const SAL_OVERRIDE;
173 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
174 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
176 OUString GetUserString() const { return sUserStr; }
177 void SetUserString( const OUString& rS ) { sUserStr = rS; }
180 class SwAuthorFieldType : public SwFieldType
182 public:
183 SwAuthorFieldType();
185 static OUString Expand(sal_uLong);
186 virtual SwFieldType* Copy() const SAL_OVERRIDE;
189 class SwAuthorField : public SwField
191 OUString aContent;
193 public:
194 SwAuthorField(SwAuthorFieldType*, sal_uInt32 nFormat = 0);
196 virtual OUString Expand() const SAL_OVERRIDE;
197 virtual SwField* Copy() const SAL_OVERRIDE;
199 inline void SetExpansion(const OUString& rStr) { aContent = rStr; }
200 inline OUString GetContent() const { return aContent; }
202 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
203 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
206 class SwFileNameFieldType : public SwFieldType
208 SwDoc *pDoc;
209 public:
210 SwFileNameFieldType(SwDoc*);
212 OUString Expand(sal_uLong) const;
213 virtual SwFieldType* Copy() const SAL_OVERRIDE;
216 class SW_DLLPUBLIC SwFileNameField : public SwField
218 OUString aContent;
220 public:
221 SwFileNameField(SwFileNameFieldType*, sal_uInt32 nFormat = 0);
223 virtual OUString Expand() const SAL_OVERRIDE;
224 virtual SwField* Copy() const SAL_OVERRIDE;
226 inline void SetExpansion(const OUString& rStr) { aContent = rStr; }
227 inline OUString GetContent() const { return aContent; }
229 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
230 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
233 class SwTemplNameFieldType : public SwFieldType
235 SwDoc *pDoc;
236 public:
237 SwTemplNameFieldType(SwDoc*);
239 OUString Expand(sal_uLong) const;
240 virtual SwFieldType* Copy() const SAL_OVERRIDE;
243 class SW_DLLPUBLIC SwTemplNameField : public SwField
245 public:
246 SwTemplNameField(SwTemplNameFieldType*, sal_uInt32 nFormat = 0);
248 virtual OUString Expand() const SAL_OVERRIDE;
249 virtual SwField* Copy() const SAL_OVERRIDE;
250 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
251 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
254 // Document statistics
255 class SwDocStatFieldType : public SwFieldType
257 SwDoc* pDoc;
258 sal_Int16 nNumberingType; ///< com::sun::star::style::NumberingType
260 public:
261 SwDocStatFieldType(SwDoc*);
262 OUString Expand(sal_uInt16 nSubType, sal_uInt32 nFormat) const;
263 virtual SwFieldType* Copy() const SAL_OVERRIDE;
265 inline void SetNumFormat( sal_Int16 eFormat ) { nNumberingType = eFormat; }
268 class SW_DLLPUBLIC SwDocStatField : public SwField
270 sal_uInt16 nSubType;
272 public:
273 SwDocStatField( SwDocStatFieldType*,
274 sal_uInt16 nSubType = 0, sal_uInt32 nFormat = 0);
276 void ChangeExpansion( const SwFrm* pFrm );
278 virtual OUString Expand() const SAL_OVERRIDE;
279 virtual SwField* Copy() const SAL_OVERRIDE;
281 virtual sal_uInt16 GetSubType() const SAL_OVERRIDE;
282 virtual void SetSubType(sal_uInt16 nSub) SAL_OVERRIDE;
283 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
284 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
287 class SwHiddenTextFieldType : public SwFieldType
289 bool bHidden;
290 public:
291 SwHiddenTextFieldType(bool bSetHidden = true);
293 virtual SwFieldType* Copy() const SAL_OVERRIDE;
295 void SetHiddenFlag( bool bSetHidden = true );
296 inline bool GetHiddenFlag() const { return bHidden; }
299 class SwHiddenTextField : public SwField
301 OUString aTRUEText; ///< Text if condition true.
302 OUString aFALSEText; ///< If condition false.
303 OUString aContent; ///< Evaluated DB-text.
305 OUString aCond; ///< Condition.
306 sal_uInt16 nSubType;
308 bool bCanToggle : 1; ///< Can field be toggled alone?
309 bool bIsHidden : 1; ///< Is it not visible?
310 bool bValid : 1; ///< Is DB-field evaluated?
312 virtual OUString Expand() const SAL_OVERRIDE;
313 virtual SwField* Copy() const SAL_OVERRIDE;
315 public:
316 SwHiddenTextField( SwHiddenTextFieldType*,
317 bool bConditional,
318 const OUString& rCond,
319 const OUString& rText,
320 bool bHidden = false,
321 sal_uInt16 nSubType = TYP_HIDDENTXTFLD);
323 SwHiddenTextField( SwHiddenTextFieldType*,
324 const OUString& rCond,
325 const OUString& rTrue,
326 const OUString& rFalse,
327 sal_uInt16 nSubType = TYP_HIDDENTXTFLD);
329 virtual OUString GetFieldName() const SAL_OVERRIDE;
331 void Evaluate(SwDoc*);
333 inline void SetValue(bool bHidden) { bIsHidden = bHidden; }
334 static OUString GetColumnName(const OUString& rName);
335 static OUString GetDBName(const OUString& rName, SwDoc *pDoc);
337 /// Condition
338 virtual void SetPar1(const OUString& rStr) SAL_OVERRIDE;
339 virtual OUString GetPar1() const SAL_OVERRIDE;
341 /// True/False - String
342 virtual void SetPar2(const OUString& rStr) SAL_OVERRIDE;
343 virtual OUString GetPar2() const SAL_OVERRIDE;
345 virtual sal_uInt16 GetSubType() const SAL_OVERRIDE;
347 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
348 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
351 // Field that expands to an empty line (without height).
352 class SwHiddenParaFieldType : public SwFieldType
354 public:
355 SwHiddenParaFieldType();
357 virtual SwFieldType* Copy() const SAL_OVERRIDE;
360 class SwHiddenParaField : public SwField
362 OUString aCond;
363 bool bIsHidden:1;
364 public:
365 /// Direct input, delete old value.
366 SwHiddenParaField(SwHiddenParaFieldType*, const OUString& rCond);
368 virtual OUString Expand() const SAL_OVERRIDE;
369 virtual SwField* Copy() const SAL_OVERRIDE;
371 void SetHidden(bool bHidden) { bIsHidden = bHidden; }
372 bool IsHidden() const { return bIsHidden; }
374 /// Query, set condition.
375 virtual OUString GetPar1() const SAL_OVERRIDE;
376 virtual void SetPar1(const OUString& rStr) SAL_OVERRIDE;
377 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
378 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
381 class SwMacroFieldType : public SwFieldType
383 SwDoc* pDoc;
385 public:
386 SwMacroFieldType(SwDoc*);
388 virtual SwFieldType* Copy() const SAL_OVERRIDE;
391 class SW_DLLPUBLIC SwMacroField : public SwField
393 OUString aMacro;
394 OUString aText;
395 bool bIsScriptURL;
397 virtual OUString Expand() const SAL_OVERRIDE;
398 virtual SwField* Copy() const SAL_OVERRIDE;
400 public:
401 /// Direct input, delete old value.
402 SwMacroField( SwMacroFieldType*, const OUString& rLibAndName,
403 const OUString& rText);
405 inline OUString GetMacro() const { return aMacro; }
406 OUString GetLibName() const;
407 OUString GetMacroName() const;
408 SvxMacro GetSvxMacro() const;
410 virtual OUString GetFieldName() const SAL_OVERRIDE;
412 /// Library and FileName
413 virtual OUString GetPar1() const SAL_OVERRIDE;
414 virtual void SetPar1(const OUString& rStr) SAL_OVERRIDE;
416 /// Macrotext
417 virtual OUString GetPar2() const SAL_OVERRIDE;
418 virtual void SetPar2(const OUString& rStr) SAL_OVERRIDE;
419 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
420 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
422 static void CreateMacroString( OUString& rMacro,
423 const OUString& rMacroName,
424 const OUString& rLibraryName );
426 static bool isScriptURL( const OUString& str );
429 class SwPostItFieldType : public SwFieldType
431 private:
432 SwDoc* mpDoc;
433 public:
434 SwPostItFieldType(SwDoc* pDoc);
436 virtual SwFieldType* Copy() const SAL_OVERRIDE;
438 SwDoc* GetDoc() const
440 return mpDoc;
444 class SW_DLLPUBLIC SwPostItField : public SwField
446 OUString sText;
447 OUString sAuthor;
448 OUString sInitials; ///< Initials of the author.
449 OUString sName; ///< Name of the comment.
450 DateTime aDateTime;
451 OutlinerParaObject* mpText;
452 SwTextAPIObject* m_pTextObject;
454 public:
455 SwPostItField( SwPostItFieldType*,
456 const OUString& rAuthor,
457 const OUString& rText,
458 const OUString& rInitials,
459 const OUString& rName,
460 const DateTime& rDate);
461 virtual ~SwPostItField();
463 virtual OUString Expand() const SAL_OVERRIDE;
464 virtual SwField* Copy() const SAL_OVERRIDE;
466 inline const DateTime GetDateTime() const { return aDateTime; }
467 inline const Date GetDate() const { return aDateTime.GetDate(); }
468 inline const tools::Time GetTime() const { return aDateTime.GetTime(); }
470 /// Author
471 virtual OUString GetPar1() const SAL_OVERRIDE;
472 virtual void SetPar1(const OUString& rStr) SAL_OVERRIDE;
474 /// Text
475 virtual OUString GetPar2() const SAL_OVERRIDE;
476 virtual void SetPar2(const OUString& rStr) SAL_OVERRIDE;
477 const OUString& GetText() const { return sText; }
478 const OUString& GetInitials() const { return sInitials;}
479 void SetName(const OUString& rStr);
480 const OUString& GetName() const { return sName;}
482 const OutlinerParaObject* GetTextObject() const { return mpText;}
483 void SetTextObject( OutlinerParaObject* pText );
485 sal_Int32 GetNumberOfParagraphs() const;
487 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
488 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
489 virtual OUString GetDescription() const SAL_OVERRIDE;
492 class SwDocInfoFieldType : public SwValueFieldType
494 public:
495 SwDocInfoFieldType(SwDoc* pDc);
497 OUString Expand(sal_uInt16 nSubType, sal_uInt32 nFormat, sal_uInt16 nLang, const OUString& rName) const;
498 virtual SwFieldType* Copy() const SAL_OVERRIDE;
501 class SW_DLLPUBLIC SwDocInfoField : public SwValueField
503 sal_uInt16 nSubType;
504 OUString aContent;
505 OUString aName;
507 virtual OUString Expand() const SAL_OVERRIDE;
508 virtual SwField* Copy() const SAL_OVERRIDE;
510 public:
511 SwDocInfoField(SwDocInfoFieldType*, sal_uInt16 nSub, const OUString& rName, sal_uInt32 nFormat=0);
512 SwDocInfoField(SwDocInfoFieldType*, sal_uInt16 nSub, const OUString& rName, const OUString& rValue, sal_uInt32 nFormat=0);
514 virtual void SetSubType(sal_uInt16) SAL_OVERRIDE;
515 virtual sal_uInt16 GetSubType() const SAL_OVERRIDE;
516 virtual void SetLanguage(sal_uInt16 nLng) SAL_OVERRIDE;
517 virtual OUString GetFieldName() const SAL_OVERRIDE;
518 OUString GetName() const { return aName; }
519 void SetName( const OUString& rName ) { aName = rName; }
520 inline void SetExpansion(const OUString& rStr) { aContent = rStr; }
521 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
522 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
525 // Extended User settings.
526 class SwExtUserFieldType : public SwFieldType
528 OUString aData;
529 public:
530 SwExtUserFieldType();
532 inline void SetData(const OUString& rStr) { aData = rStr; }
534 static OUString Expand(sal_uInt16 nSubType, sal_uInt32 nFormat);
535 virtual SwFieldType* Copy() const SAL_OVERRIDE;
538 class SwExtUserField : public SwField
540 OUString aContent;
541 sal_uInt16 nType;
543 public:
544 SwExtUserField(SwExtUserFieldType*, sal_uInt16 nSub, sal_uInt32 nFormat=0);
546 virtual OUString Expand() const SAL_OVERRIDE;
547 virtual SwField* Copy() const SAL_OVERRIDE;
549 virtual sal_uInt16 GetSubType() const SAL_OVERRIDE;
550 virtual void SetSubType(sal_uInt16 nSub) SAL_OVERRIDE;
552 inline void SetExpansion(const OUString& rStr) { aContent = rStr; }
554 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
555 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
558 // Relative page numbers - field.
559 class SwRefPageSetFieldType : public SwFieldType
561 public:
562 SwRefPageSetFieldType();
564 virtual SwFieldType* Copy() const SAL_OVERRIDE;
566 protected:
567 /// Overlay, because there is nothing to update!
568 virtual void Modify( const SfxPoolItem*, const SfxPoolItem * ) SAL_OVERRIDE;
571 // Relative page numbering.
572 class SwRefPageSetField : public SwField
574 short nOffset;
575 bool bOn;
577 public:
578 SwRefPageSetField( SwRefPageSetFieldType*, short nOff = 0,
579 bool bOn = true );
581 virtual OUString Expand() const SAL_OVERRIDE;
582 virtual SwField* Copy() const SAL_OVERRIDE;
584 virtual OUString GetPar2() const SAL_OVERRIDE;
585 virtual void SetPar2(const OUString& rStr) SAL_OVERRIDE;
587 bool IsOn() const { return bOn; }
589 short GetOffset() const { return nOffset; }
590 void SetOffset( short nOff ) { nOffset = nOff; }
591 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
592 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
595 // Relative page numbers - query field.
596 class SwRefPageGetFieldType : public SwFieldType
598 SwDoc* pDoc;
599 sal_Int16 nNumberingType;
601 void UpdateField( SwTextField* pTextField, _SetGetExpFields& rSetList );
602 protected:
603 /// overwritten to update all RefPageGet fields
604 virtual void Modify( const SfxPoolItem*, const SfxPoolItem * ) SAL_OVERRIDE;
605 public:
606 SwRefPageGetFieldType( SwDoc* pDoc );
607 virtual SwFieldType* Copy() const SAL_OVERRIDE;
608 bool MakeSetList( _SetGetExpFields& rTmpLst );
609 SwDoc* GetDoc() const { return pDoc; }
612 // Query relative page numbering.
613 class SwRefPageGetField : public SwField
615 OUString sText;
616 public:
617 SwRefPageGetField( SwRefPageGetFieldType*, sal_uInt32 nFormat );
619 virtual OUString Expand() const SAL_OVERRIDE;
620 virtual SwField* Copy() const SAL_OVERRIDE;
622 void SetText( const OUString& rText ) { sText = rText; }
624 void ChangeExpansion( const SwFrm* pFrm, const SwTextField* pField );
625 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
626 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
629 // Field to jump to and edit.
630 class SwJumpEditFieldType : public SwFieldType
632 SwDoc* pDoc;
633 SwDepend aDep;
635 public:
636 SwJumpEditFieldType( SwDoc* pDoc );
637 virtual SwFieldType* Copy() const SAL_OVERRIDE;
639 SwCharFormat* GetCharFormat();
642 class SwJumpEditField : public SwField
644 OUString sText, sHelp;
645 public:
646 SwJumpEditField( SwJumpEditFieldType*, sal_uInt32 nFormat,
647 const OUString& sText, const OUString& sHelp );
649 virtual OUString Expand() const SAL_OVERRIDE;
650 virtual SwField* Copy() const SAL_OVERRIDE;
652 /// Placeholder-Text
653 virtual OUString GetPar1() const SAL_OVERRIDE;
654 virtual void SetPar1(const OUString& rStr) SAL_OVERRIDE;
656 /// Hint-Text
657 virtual OUString GetPar2() const SAL_OVERRIDE;
658 virtual void SetPar2(const OUString& rStr) SAL_OVERRIDE;
660 SwCharFormat* GetCharFormat() const
661 { return static_cast<SwJumpEditFieldType*>(GetTyp())->GetCharFormat(); }
662 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
663 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
666 class SwScriptFieldType : public SwFieldType
668 SwDoc* pDoc;
669 public:
670 SwScriptFieldType( SwDoc* pDoc );
672 virtual SwFieldType* Copy() const SAL_OVERRIDE;
675 class SwScriptField : public SwField
677 OUString sType; ///< Type of Code (Java/VBScript/...)
678 OUString sCode; /**< Code as text.
679 Code as JavaCode ? */
681 bool bCodeURL; ///< Code contains URL of a script.
683 public:
684 SwScriptField( SwScriptFieldType*, const OUString& rType,
685 const OUString& rCode, bool bURL=false );
687 virtual OUString GetDescription() const SAL_OVERRIDE;
689 virtual OUString Expand() const SAL_OVERRIDE;
690 virtual SwField* Copy() const SAL_OVERRIDE;
692 /// Type
693 virtual OUString GetPar1() const SAL_OVERRIDE;
694 virtual void SetPar1(const OUString& rStr) SAL_OVERRIDE;
695 /// Text
696 virtual OUString GetPar2() const SAL_OVERRIDE;
697 virtual void SetPar2(const OUString& rStr) SAL_OVERRIDE;
699 bool IsCodeURL() const { return bCodeURL; }
700 void SetCodeURL( bool bURL ) { bCodeURL = bURL; }
701 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
702 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
705 // Combined Character Fieldtype
706 class SwCombinedCharFieldType : public SwFieldType
708 public:
709 SwCombinedCharFieldType();
711 virtual SwFieldType* Copy() const SAL_OVERRIDE;
714 // ScriptField
715 #define MAX_COMBINED_CHARACTERS 6
717 class SW_DLLPUBLIC SwCombinedCharField : public SwField
719 OUString sCharacters; ///< combine these characters
721 public:
722 SwCombinedCharField( SwCombinedCharFieldType*, const OUString& rChars );
724 virtual OUString Expand() const SAL_OVERRIDE;
725 virtual SwField* Copy() const SAL_OVERRIDE;
727 /// Characters
728 virtual OUString GetPar1() const SAL_OVERRIDE;
729 virtual void SetPar1(const OUString& rStr) SAL_OVERRIDE;
731 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
732 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
735 #endif // INCLUDED_SW_INC_DOCUFLD_HXX
737 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */