Files
libreoffice/sw/inc/tox.hxx

731 lines
24 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
re-base on ALv2 code. Includes: Patches contributed by Oliver-Rainer Wittmann sw34bf06: #i117783# - Writer's implementation of XPagePrintable - apply print settings to new printing routines http://svn.apache.org/viewvc?view=revision&revision=1172115 sw34bf06: #o12311627# use <rtl_random> methods to create unique ids for list styles and list ids http://svn.apache.org/viewvc?view=revision&revision=1172112 sw34bf06 #i114725#,#i115828# - method <SwDoc::ClearDoc()> - clear list structures completely http://svn.apache.org/viewvc?view=revision&revision=1172122 i#118572 - remove ui string and help content regarding usage of Java Mail in Writer's Mail Merge as Java Mail is not used. http://svn.apache.org/viewvc?view=revision&revision=1197035 Patches contributed by Mathias Bauer cws mba34issues01: #i117718#: provide filter name in case storage of medium does not allow to detect one http://svn.apache.org/viewvc?view=revision&revision=1172350 cws mba34issues01: #i117721#: directly provide parameters retrieved from SfxMedium http://svn.apache.org/viewvc?view=revision&revision=1172353 gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394707 http://svn.apache.org/viewvc?view=revision&revision=1394326 http://svn.apache.org/viewvc?view=revision&revision=1396797 http://svn.apache.org/viewvc?view=revision&revision=1397315 cws mba34issues01: #i117723#: convert assertion into trace http://svn.apache.org/viewvc?view=revision&revision=1172355 cws mba34issues01: #i117699#: keep layout alive until swdoc dies http://svn.apache.org/viewvc?view=revision&revision=1172362 cws mba34issues01: #i117943#: missing color attributes in RTF clipboard http://svn.apache.org/viewvc?view=revision&revision=1172363 Patch contributed by Henning Brinkmann imported patch i#103878 http://svn.apache.org/viewvc?view=revision&revision=1172109 Patches contributed by Michael Stahl sw34bf06: #i117955#: WW8 export: disable storing of section breaks in endnotes http://svn.apache.org/viewvc?view=revision&revision=1172119 Patch contributed by imacat Fixed the Asian language work count. http://svn.apache.org/viewvc?view=revision&revision=1241345 Patch contributed by Pedro Giffuni i#20878 - Add comment with BZ issue for reference. http://svn.apache.org/viewvc?view=revision&revision=1244517 Patch contributed by Andre Fischer Do not add targets for junit tests when junit is disabled. http://svn.apache.org/viewvc?view=revision&revision=1241508 add writerperfect dependency.
2011-03-31 10:05:04 +02:00
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_SW_INC_TOX_HXX
#define INCLUDED_SW_INC_TOX_HXX
#include <cppuhelper/weakref.hxx>
#include <sal/log.hxx>
#include <i18nlangtag/lang.h>
#include <svl/poolitem.hxx>
2000-09-18 16:15:01 +00:00
#include <editeng/svxenum.hxx>
2000-09-18 16:15:01 +00:00
#include <swtypes.hxx>
#include <toxe.hxx>
#include <calbck.hxx>
#include <vector>
namespace com { namespace sun { namespace star {
namespace text { class XDocumentIndexMark; }
} } }
2000-09-18 16:15:01 +00:00
class SwTOXType;
class SwTOXMark;
class SwTextTOXMark;
2000-09-18 16:15:01 +00:00
class SwDoc;
typedef std::vector<SwTOXMark*> SwTOXMarks;
2000-09-18 16:15:01 +00:00
// Entry of content index, alphabetical index or user defined index
extern const sal_Unicode C_NUM_REPL;
extern const sal_Unicode C_END_PAGE_NUM;
extern const OUString S_PAGE_DELI;
class SW_DLLPUBLIC SwTOXMark
: public SfxPoolItem
, public SwModify
2000-09-18 16:15:01 +00:00
{
friend void _InitCore();
friend class SwTextTOXMark;
2000-09-18 16:15:01 +00:00
OUString m_aAltText; // Text of caption is different.
OUString m_aPrimaryKey;
OUString m_aSecondaryKey;
OUString m_aCitationKeyReading;
2000-09-18 16:15:01 +00:00
2002-06-06 12:16:41 +00:00
// three more strings for phonetic sorting
OUString m_aTextReading;
OUString m_aPrimaryKeyReading;
OUString m_aSecondaryKeyReading;
2002-06-06 12:16:41 +00:00
SwTextTOXMark* m_pTextAttr;
2000-09-18 16:15:01 +00:00
sal_uInt16 m_nLevel;
OUString m_aBookmarkName;
OUString m_aEntryTypeName; // stored specific entry type name for INDEX field \f
bool m_bAutoGenerated : 1; // generated using a concordance file
bool m_bMainEntry : 1; // main entry emphasized by character style
2000-09-18 16:15:01 +00:00
css::uno::WeakReference<css::text::XDocumentIndexMark> m_wXDocumentIndexMark;
2000-09-18 16:15:01 +00:00
SwTOXMark(); // to create the default attribute in _InitCore
2000-09-18 16:15:01 +00:00
protected:
// SwClient
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) override;
2000-09-18 16:15:01 +00:00
public:
// single argument ctors shall be explicit.
explicit SwTOXMark( const SwTOXType* pTyp );
2000-09-18 16:15:01 +00:00
virtual ~SwTOXMark();
SwTOXMark( const SwTOXMark& rCopy );
SwTOXMark& operator=( const SwTOXMark& rCopy );
// "pure virtual methods" of SfxPoolItem
virtual bool operator==( const SfxPoolItem& ) const override;
virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override;
2000-09-18 16:15:01 +00:00
void InvalidateTOXMark();
OUString GetText() const;
2000-09-18 16:15:01 +00:00
inline bool IsAlternativeText() const;
inline OUString GetAlternativeText() const;
2000-09-18 16:15:01 +00:00
inline void SetAlternativeText( const OUString& rAlt );
2000-09-18 16:15:01 +00:00
// content or user defined index
inline void SetLevel(sal_uInt16 nLevel);
inline sal_uInt16 GetLevel() const;
inline void SetBookmarkName( const OUString& bName);
inline OUString GetBookmarkName() const;
inline void SetEntryTypeName( const OUString& sName);
inline OUString GetEntryTypeName() const;
2000-09-18 16:15:01 +00:00
// for alphabetical index only
inline void SetPrimaryKey(const OUString& rStr );
inline void SetSecondaryKey(const OUString& rStr);
inline void SetTextReading(const OUString& rStr);
inline void SetPrimaryKeyReading(const OUString& rStr );
inline void SetSecondaryKeyReading(const OUString& rStr);
inline void SetCitationKeyReading(const OUString& rStr);
inline OUString GetPrimaryKey() const;
inline OUString GetSecondaryKey() const;
inline OUString GetTextReading() const;
inline OUString GetPrimaryKeyReading() const;
inline OUString GetSecondaryKeyReading() const;
2000-09-18 16:15:01 +00:00
bool IsAutoGenerated() const {return m_bAutoGenerated;}
void SetAutoGenerated(bool bSet) {m_bAutoGenerated = bSet;}
2000-09-18 16:15:01 +00:00
bool IsMainEntry() const {return m_bMainEntry;}
void SetMainEntry(bool bSet) { m_bMainEntry = bSet;}
2000-09-18 16:15:01 +00:00
inline const SwTOXType* GetTOXType() const;
const SwTextTOXMark* GetTextTOXMark() const { return m_pTextAttr; }
SwTextTOXMark* GetTextTOXMark() { return m_pTextAttr; }
SAL_DLLPRIVATE css::uno::WeakReference<css::text::XDocumentIndexMark> const& GetXTOXMark() const
{ return m_wXDocumentIndexMark; }
SAL_DLLPRIVATE void SetXTOXMark(css::uno::Reference<css::text::XDocumentIndexMark> const& xMark)
{ m_wXDocumentIndexMark = xMark; }
void DeRegister() { GetRegisteredInNonConst()->Remove( this ); }
void RegisterToTOXType( SwTOXType& rMark );
static void InsertTOXMarks( SwTOXMarks& aMarks, const SwTOXType& rType );
2000-09-18 16:15:01 +00:00
};
// index types
2000-09-18 16:15:01 +00:00
class SwTOXType : public SwModify
{
public:
SwTOXType(TOXTypes eTyp, const OUString& aName);
// @@@ public copy ctor, but no copy assignment?
2000-09-18 16:15:01 +00:00
SwTOXType(const SwTOXType& rCopy);
inline OUString GetTypeName() const;
2000-09-18 16:15:01 +00:00
inline TOXTypes GetType() const;
private:
OUString m_aName;
TOXTypes m_eType;
// @@@ public copy ctor, but no copy assignment?
SwTOXType & operator= (const SwTOXType &) = delete;
2000-09-18 16:15:01 +00:00
};
// Structure of the index lines
2000-09-18 16:15:01 +00:00
#define FORM_TITLE 0
#define FORM_ALPHA_DELIMITTER 1
#define FORM_PRIMARY_KEY 2
#define FORM_SECONDARY_KEY 3
#define FORM_ENTRY 4
/*
Pattern structure
<E#> - entry number <E# CharStyleName,PoolId>
<ET> - entry text <ET CharStyleName,PoolId>
<E> - entry text and number <E CharStyleName,PoolId>
<T> - tab stop <T,,Position,Adjust>
<C> - chapter info n = {0, 1, 2, 3, 4 } values of SwChapterFormat <C CharStyleName,PoolId>
<TX> - text token <X CharStyleName,PoolId, TOX_STYLE_DELIMITERTextContentTOX_STYLE_DELIMITER>
<#> - Page number <# CharStyleName,PoolId>
<LS> - Link start <LS>
<LE> - Link end <LE>
<A00> - Authority entry field <A02 CharStyleName, PoolId>
*/
// These enum values are stored and must not be changed!
2000-09-18 16:15:01 +00:00
enum FormTokenType
{
TOKEN_ENTRY_NO,
TOKEN_ENTRY_TEXT,
TOKEN_ENTRY,
TOKEN_TAB_STOP,
TOKEN_TEXT,
TOKEN_PAGE_NUMS,
TOKEN_CHAPTER_INFO,
TOKEN_LINK_START,
TOKEN_LINK_END,
TOKEN_AUTHORITY,
TOKEN_END
};
struct SW_DLLPUBLIC SwFormToken
2000-09-18 16:15:01 +00:00
{
OUString sText;
OUString sCharStyleName;
2000-09-18 16:15:01 +00:00
SwTwips nTabStopPosition;
FormTokenType eTokenType;
sal_uInt16 nPoolId;
SvxTabAdjust eTabAlign;
sal_uInt16 nChapterFormat; //SwChapterFormat;
sal_uInt16 nOutlineLevel;//the maximum permitted outline level in numbering
sal_uInt16 nAuthorityField; //enum ToxAuthorityField
2000-09-18 16:15:01 +00:00
sal_Unicode cTabFillChar;
bool bWithTab; // true: do generate tab
// character only the tab stop
// #i21237#
2000-09-18 16:15:01 +00:00
SwFormToken(FormTokenType eType ) :
nTabStopPosition(0),
eTokenType(eType),
2000-09-18 16:15:01 +00:00
nPoolId(USHRT_MAX),
eTabAlign( SVX_TAB_ADJUST_LEFT ),
2000-09-18 16:15:01 +00:00
nChapterFormat(0 /*CF_NUMBER*/),
nOutlineLevel(MAXLEVEL), //default to maximum outline level
nAuthorityField(0 /*AUTH_FIELD_IDENTIFIER*/),
cTabFillChar(' '),
bWithTab(true) // #i21237#
{}
2000-09-18 16:15:01 +00:00
OUString GetString() const;
2000-09-18 16:15:01 +00:00
};
struct SwFormTokenEqualToFormTokenType
{
FormTokenType eType;
SwFormTokenEqualToFormTokenType(FormTokenType _eType) : eType(_eType) {}
bool operator()(const SwFormToken & rToken)
{
return rToken.eTokenType == eType;
}
};
/// Vector of tokens.
typedef std::vector<SwFormToken> SwFormTokens;
/**
Helper class that converts vectors of tokens to strings and vice
versa.
*/
class SW_DLLPUBLIC SwFormTokensHelper
2000-09-18 16:15:01 +00:00
{
/// the tokens
SwFormTokens m_Tokens;
2000-09-18 16:15:01 +00:00
public:
/**
constructor
@param rTokens vector of tokens
*/
SwFormTokensHelper(const SwFormTokens & rTokens) : m_Tokens(rTokens) {}
/**
constructor
@param rStr string representation of the tokens
*/
SwFormTokensHelper(const OUString & rStr);
/**
Returns vector of tokens.
@return vector of tokens
*/
const SwFormTokens & GetTokens() const { return m_Tokens; }
2000-09-18 16:15:01 +00:00
};
class SW_DLLPUBLIC SwForm
2000-09-18 16:15:01 +00:00
{
SwFormTokens m_aPattern[ AUTH_TYPE_END + 1 ]; // #i21237#
OUString m_aTemplate[ AUTH_TYPE_END + 1 ];
TOXTypes m_eType;
sal_uInt16 m_nFormMaxLevel;
bool m_bGenerateTabPos : 1;
bool m_bIsRelTabPos : 1;
bool m_bCommaSeparated : 1;
2000-09-18 16:15:01 +00:00
public:
SwForm( TOXTypes eTOXType = TOX_CONTENT );
2000-09-18 16:15:01 +00:00
SwForm( const SwForm& rForm );
SwForm& operator=( const SwForm& rForm );
inline void SetTemplate(sal_uInt16 nLevel, const OUString& rName);
inline OUString GetTemplate(sal_uInt16 nLevel) const;
2000-09-18 16:15:01 +00:00
// #i21237#
void SetPattern(sal_uInt16 nLevel, const SwFormTokens& rName);
void SetPattern(sal_uInt16 nLevel, const OUString& rStr);
const SwFormTokens& GetPattern(sal_uInt16 nLevel) const;
2000-09-18 16:15:01 +00:00
// fill tab stop positions from template to pattern- #i21237#
void AdjustTabStops( SwDoc& rDoc );
2000-09-18 16:15:01 +00:00
inline TOXTypes GetTOXType() const;
inline sal_uInt16 GetFormMax() const;
2000-09-18 16:15:01 +00:00
bool IsRelTabPos() const { return m_bIsRelTabPos; }
void SetRelTabPos( bool b ) { m_bIsRelTabPos = b; }
2000-09-18 16:15:01 +00:00
bool IsCommaSeparated() const { return m_bCommaSeparated;}
void SetCommaSeparated( bool b) { m_bCommaSeparated = b;}
2000-09-18 16:15:01 +00:00
static sal_uInt16 GetFormMaxLevel( TOXTypes eType );
2000-09-18 16:15:01 +00:00
static OUString GetFormEntry();
static OUString GetFormTab();
static OUString GetFormPageNums();
static OUString GetFormLinkStt();
static OUString GetFormLinkEnd();
static OUString GetFormEntryNum();
static OUString GetFormEntryText();
static OUString GetFormChapterMark();
static OUString GetFormText();
static OUString GetFormAuth();
2000-09-18 16:15:01 +00:00
};
// Content to create indexes of
typedef sal_uInt16 SwTOXElement;
namespace nsSwTOXElement
2000-09-18 16:15:01 +00:00
{
const SwTOXElement TOX_MARK = 1;
const SwTOXElement TOX_OUTLINELEVEL = 2;
const SwTOXElement TOX_TEMPLATE = 4;
const SwTOXElement TOX_OLE = 8;
const SwTOXElement TOX_TABLE = 16;
const SwTOXElement TOX_GRAPHIC = 32;
const SwTOXElement TOX_FRAME = 64;
const SwTOXElement TOX_SEQUENCE = 128;
const SwTOXElement TOX_TABLEADER = 256;
const SwTOXElement TOX_TAB_IN_TOC = 512;
const SwTOXElement TOX_BOOKMARK = 1024;
const SwTOXElement TOX_NEWLINE = 2048;
const SwTOXElement TOX_PARAGRAPH_OUTLINE_LEVEL = 4096;
const SwTOXElement TOX_INDEX_ENTRY_TYPE = 8192;
}
2000-09-18 16:15:01 +00:00
typedef sal_uInt16 SwTOIOptions;
namespace nsSwTOIOptions
2000-09-18 16:15:01 +00:00
{
const SwTOIOptions TOI_SAME_ENTRY = 1;
const SwTOIOptions TOI_FF = 2;
const SwTOIOptions TOI_CASE_SENSITIVE = 4;
const SwTOIOptions TOI_KEY_AS_ENTRY = 8;
const SwTOIOptions TOI_ALPHA_DELIMITTER = 16;
const SwTOIOptions TOI_DASH = 32;
const SwTOIOptions TOI_INITIAL_CAPS = 64;
}
2000-09-18 16:15:01 +00:00
//which part of the caption is to be displayed
enum SwCaptionDisplay
{
CAPTION_COMPLETE,
CAPTION_NUMBER,
CAPTION_TEXT
};
typedef sal_uInt16 SwTOOElements;
namespace nsSwTOOElements
2000-09-18 16:15:01 +00:00
{
const SwTOOElements TOO_MATH = 0x01;
const SwTOOElements TOO_CHART = 0x02;
const SwTOOElements TOO_CALC = 0x08;
const SwTOOElements TOO_DRAW_IMPRESS = 0x10;
const SwTOOElements TOO_OTHER = 0x80;
}
2000-09-18 16:15:01 +00:00
#define TOX_STYLE_DELIMITER ((sal_Unicode)0x01)
2000-09-18 16:15:01 +00:00
// Class for all indexes
class SW_DLLPUBLIC SwTOXBase : public SwClient
2000-09-18 16:15:01 +00:00
{
SwForm m_aForm; // description of the lines
OUString m_aName; // unique name
OUString m_aTitle; // title
OUString m_aBookmarkName; //Bookmark Name
OUString m_aEntryTypeName; // Type name
2000-09-18 16:15:01 +00:00
OUString m_sMainEntryCharStyle; // name of the character style applied to main index entries
2000-09-18 16:15:01 +00:00
OUString m_aStyleNames[MAXLEVEL]; // (additional) style names TOX_CONTENT, TOX_USER
OUString m_sSequenceName; // FieldTypeName of a caption sequence
2000-09-18 16:15:01 +00:00
LanguageType m_eLanguage;
OUString m_sSortAlgorithm;
2000-09-18 16:15:01 +00:00
union {
sal_uInt16 nLevel; // consider outline levels
sal_uInt16 nOptions; // options of alphabetical index
} m_aData;
sal_uInt16 m_nCreateType; // sources to create the index from
sal_uInt16 m_nOLEOptions; // OLE sources
SwCaptionDisplay m_eCaptionDisplay;
bool m_bProtected : 1; // index protected ?
bool m_bFromChapter : 1; // create from chapter or document
bool m_bFromObjectNames : 1; // create a table or object index
2000-09-18 16:15:01 +00:00
// from the names rather than the caption
bool m_bLevelFromChapter : 1; // User index: get the level from the source chapter
protected:
// Add a data member, for record the TOC field expression of MS Word binary format
// For keeping fidality and may giving a better exporting performance
OUString maMSTOCExpression;
bool mbKeepExpression;
2000-09-18 16:15:01 +00:00
public:
SwTOXBase( const SwTOXType* pTyp, const SwForm& rForm,
sal_uInt16 nCreaType, const OUString& rTitle );
SwTOXBase( const SwTOXBase& rCopy, SwDoc* pDoc = nullptr );
2000-09-18 16:15:01 +00:00
virtual ~SwTOXBase();
virtual bool GetInfo( SfxPoolItem& rInfo ) const override;
2000-09-18 16:15:01 +00:00
// a kind of CopyCtor - check if the TOXBase is at TOXType of the doc.
// If not, so create it an copy all other used things. The return is this
SwTOXBase& CopyTOXBase( SwDoc*, const SwTOXBase& );
const SwTOXType* GetTOXType() const;
2000-09-18 16:15:01 +00:00
sal_uInt16 GetCreateType() const; // creation types
2000-09-18 16:15:01 +00:00
OUString GetTOXName() const {return m_aName;}
void SetTOXName(const OUString& rSet) {m_aName = rSet;}
2000-09-18 16:15:01 +00:00
// for record the TOC field expression of MS Word binary format
const OUString& GetMSTOCExpression() const{return maMSTOCExpression;}
void SetMSTOCExpression(const OUString& rExp) {maMSTOCExpression = rExp;}
void EnableKeepExpression() {mbKeepExpression = true;}
void DisableKeepExpression() {mbKeepExpression = false;}
OUString GetTitle() const; // Title
OUString GetBookmarkName() const;
OUString GetTypeName() const; // Name
const SwForm& GetTOXForm() const; // description of the lines
2000-09-18 16:15:01 +00:00
void SetCreate(sal_uInt16);
void SetTitle(const OUString& rTitle);
2000-09-18 16:15:01 +00:00
void SetTOXForm(const SwForm& rForm);
void SetBookmarkName(const OUString& bName);
2000-09-18 16:15:01 +00:00
TOXTypes GetType() const;
OUString GetMainEntryCharStyle() const {return m_sMainEntryCharStyle;}
void SetMainEntryCharStyle(const OUString& rSet) {m_sMainEntryCharStyle = rSet;}
2000-09-18 16:15:01 +00:00
// for record the Index field expression of MS Word
OUString GetEntryTypeName() const;
void SetEntryTypeName(const OUString& sName);
// content index only
inline void SetLevel(sal_uInt16); // consider outline level
inline sal_uInt16 GetLevel() const;
2000-09-18 16:15:01 +00:00
// alphabetical index only
inline sal_uInt16 GetOptions() const; // alphabetical index options
inline void SetOptions(sal_uInt16 nOpt);
2000-09-18 16:15:01 +00:00
// index of objects
sal_uInt16 GetOLEOptions() const {return m_nOLEOptions;}
void SetOLEOptions(sal_uInt16 nOpt) {m_nOLEOptions = nOpt;}
2000-09-18 16:15:01 +00:00
// index of objects
OUString GetStyleNames(sal_uInt16 nLevel) const
2000-09-18 16:15:01 +00:00
{
SAL_WARN_IF( nLevel >= MAXLEVEL, "sw", "Which level?");
return m_aStyleNames[nLevel];
2000-09-18 16:15:01 +00:00
}
void SetStyleNames(const OUString& rSet, sal_uInt16 nLevel)
2000-09-18 16:15:01 +00:00
{
SAL_WARN_IF( nLevel >= MAXLEVEL, "sw", "Which level?");
m_aStyleNames[nLevel] = rSet;
2000-09-18 16:15:01 +00:00
}
bool IsFromChapter() const { return m_bFromChapter;}
void SetFromChapter(bool bSet) { m_bFromChapter = bSet;}
2000-09-18 16:15:01 +00:00
bool IsFromObjectNames() const {return m_bFromObjectNames;}
void SetFromObjectNames(bool bSet) {m_bFromObjectNames = bSet;}
2000-09-18 16:15:01 +00:00
bool IsLevelFromChapter() const {return m_bLevelFromChapter;}
void SetLevelFromChapter(bool bSet) {m_bLevelFromChapter = bSet;}
2000-09-18 16:15:01 +00:00
bool IsProtected() const { return m_bProtected; }
void SetProtected(bool bSet) { m_bProtected = bSet; }
2000-09-18 16:15:01 +00:00
OUString GetSequenceName() const {return m_sSequenceName;}
void SetSequenceName(const OUString& rSet) {m_sSequenceName = rSet;}
2000-09-18 16:15:01 +00:00
SwCaptionDisplay GetCaptionDisplay() const { return m_eCaptionDisplay;}
void SetCaptionDisplay(SwCaptionDisplay eSet) {m_eCaptionDisplay = eSet;}
2000-09-18 16:15:01 +00:00
bool IsTOXBaseInReadonly() const;
2000-09-18 16:15:01 +00:00
const SfxItemSet* GetAttrSet() const;
void SetAttrSet( const SfxItemSet& );
LanguageType GetLanguage() const {return m_eLanguage;}
void SetLanguage(LanguageType nLang) {m_eLanguage = nLang;}
OUString GetSortAlgorithm()const {return m_sSortAlgorithm;}
void SetSortAlgorithm(const OUString& rSet) {m_sSortAlgorithm = rSet;}
// #i21237#
void AdjustTabStops( SwDoc & rDoc )
{
m_aForm.AdjustTabStops( rDoc );
}
SwTOXBase& operator=(const SwTOXBase& rSource);
void RegisterToTOXType( SwTOXType& rMark );
2000-09-18 16:15:01 +00:00
};
//SwTOXMark
inline OUString SwTOXMark::GetAlternativeText() const
{ return m_aAltText; }
2000-09-18 16:15:01 +00:00
inline OUString SwTOXMark::GetBookmarkName() const
{ return m_aBookmarkName; }
inline OUString SwTOXMark::GetEntryTypeName() const
{ return m_aEntryTypeName; }
2000-09-18 16:15:01 +00:00
inline const SwTOXType* SwTOXMark::GetTOXType() const
{ return static_cast<const SwTOXType*>(GetRegisteredIn()); }
2000-09-18 16:15:01 +00:00
inline bool SwTOXMark::IsAlternativeText() const
{ return !m_aAltText.isEmpty(); }
2000-09-18 16:15:01 +00:00
inline void SwTOXMark::SetAlternativeText(const OUString& rAlt)
2000-09-18 16:15:01 +00:00
{
m_aAltText = rAlt;
2000-09-18 16:15:01 +00:00
}
inline void SwTOXMark::SetBookmarkName(const OUString& bName)
{
m_aBookmarkName = bName;
}
inline void SwTOXMark::SetEntryTypeName(const OUString& sName)
{
m_aEntryTypeName = sName;
}
inline void SwTOXMark::SetLevel( sal_uInt16 nLvl )
2000-09-18 16:15:01 +00:00
{
SAL_WARN_IF( GetTOXType() && GetTOXType()->GetType() == TOX_INDEX, "sw", "Wrong type");
m_nLevel = nLvl;
2000-09-18 16:15:01 +00:00
}
inline void SwTOXMark::SetPrimaryKey( const OUString& rKey )
2000-09-18 16:15:01 +00:00
{
SAL_WARN_IF( GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
m_aPrimaryKey = rKey;
2000-09-18 16:15:01 +00:00
}
inline void SwTOXMark::SetSecondaryKey( const OUString& rKey )
2000-09-18 16:15:01 +00:00
{
SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
m_aSecondaryKey = rKey;
2000-09-18 16:15:01 +00:00
}
inline void SwTOXMark::SetTextReading( const OUString& rText )
2002-06-06 12:16:41 +00:00
{
SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
m_aTextReading = rText;
2002-06-06 12:16:41 +00:00
}
inline void SwTOXMark::SetPrimaryKeyReading( const OUString& rKey )
2002-06-06 12:16:41 +00:00
{
SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
m_aPrimaryKeyReading = rKey;
2002-06-06 12:16:41 +00:00
}
inline void SwTOXMark::SetCitationKeyReading( const OUString& rKey )
{
SAL_WARN_IF(GetTOXType()->GetType() != TOX_CITATION, "sw", "Wrong type");
m_aCitationKeyReading = rKey;
}
inline void SwTOXMark::SetSecondaryKeyReading( const OUString& rKey )
2002-06-06 12:16:41 +00:00
{
SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
m_aSecondaryKeyReading = rKey;
2002-06-06 12:16:41 +00:00
}
inline sal_uInt16 SwTOXMark::GetLevel() const
2000-09-18 16:15:01 +00:00
{
SAL_WARN_IF( GetTOXType() && GetTOXType()->GetType() == TOX_INDEX, "sw", "Wrong type");
return m_nLevel;
2000-09-18 16:15:01 +00:00
}
inline OUString SwTOXMark::GetPrimaryKey() const
2000-09-18 16:15:01 +00:00
{
SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
return m_aPrimaryKey;
2000-09-18 16:15:01 +00:00
}
inline OUString SwTOXMark::GetSecondaryKey() const
2000-09-18 16:15:01 +00:00
{
SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
return m_aSecondaryKey;
2000-09-18 16:15:01 +00:00
}
inline OUString SwTOXMark::GetTextReading() const
2002-06-06 12:16:41 +00:00
{
SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
return m_aTextReading;
2002-06-06 12:16:41 +00:00
}
inline OUString SwTOXMark::GetPrimaryKeyReading() const
2002-06-06 12:16:41 +00:00
{
SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
return m_aPrimaryKeyReading;
2002-06-06 12:16:41 +00:00
}
inline OUString SwTOXMark::GetSecondaryKeyReading() const
2002-06-06 12:16:41 +00:00
{
SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
return m_aSecondaryKeyReading;
2002-06-06 12:16:41 +00:00
}
2000-09-18 16:15:01 +00:00
//SwForm
inline void SwForm::SetTemplate(sal_uInt16 nLevel, const OUString& rTemplate)
2000-09-18 16:15:01 +00:00
{
SAL_WARN_IF(nLevel >= GetFormMax(), "sw", "Index >= GetFormMax()");
m_aTemplate[nLevel] = rTemplate;
2000-09-18 16:15:01 +00:00
}
inline OUString SwForm::GetTemplate(sal_uInt16 nLevel) const
2000-09-18 16:15:01 +00:00
{
SAL_WARN_IF(nLevel >= GetFormMax(), "sw", "Index >= GetFormMax()");
return m_aTemplate[nLevel];
2000-09-18 16:15:01 +00:00
}
inline TOXTypes SwForm::GetTOXType() const
2000-09-18 16:15:01 +00:00
{
return m_eType;
2000-09-18 16:15:01 +00:00
}
inline sal_uInt16 SwForm::GetFormMax() const
2000-09-18 16:15:01 +00:00
{
return m_nFormMaxLevel;
2000-09-18 16:15:01 +00:00
}
//SwTOXType
inline OUString SwTOXType::GetTypeName() const
{ return m_aName; }
2000-09-18 16:15:01 +00:00
inline TOXTypes SwTOXType::GetType() const
{ return m_eType; }
2000-09-18 16:15:01 +00:00
// SwTOXBase
2000-09-18 16:15:01 +00:00
inline const SwTOXType* SwTOXBase::GetTOXType() const
{ return static_cast<const SwTOXType*>(GetRegisteredIn()); }
2000-09-18 16:15:01 +00:00
inline sal_uInt16 SwTOXBase::GetCreateType() const
{ return m_nCreateType; }
2000-09-18 16:15:01 +00:00
inline OUString SwTOXBase::GetTitle() const
{ return m_aTitle; }
2000-09-18 16:15:01 +00:00
inline OUString SwTOXBase::GetBookmarkName() const
{ return m_aBookmarkName; }
inline OUString SwTOXBase::GetEntryTypeName() const
{ return m_aEntryTypeName; }
inline OUString SwTOXBase::GetTypeName() const
2000-09-18 16:15:01 +00:00
{ return GetTOXType()->GetTypeName(); }
inline const SwForm& SwTOXBase::GetTOXForm() const
{ return m_aForm; }
2000-09-18 16:15:01 +00:00
inline void SwTOXBase::SetCreate(sal_uInt16 nCreate)
{ m_nCreateType = nCreate; }
2000-09-18 16:15:01 +00:00
inline void SwTOXBase::SetTOXForm(const SwForm& rForm)
{ m_aForm = rForm; }
2000-09-18 16:15:01 +00:00
inline TOXTypes SwTOXBase::GetType() const
{ return GetTOXType()->GetType(); }
inline void SwTOXBase::SetLevel(sal_uInt16 nLev)
2000-09-18 16:15:01 +00:00
{
SAL_WARN_IF(GetTOXType()->GetType() == TOX_INDEX, "sw", "Wrong type");
m_aData.nLevel = nLev;
2000-09-18 16:15:01 +00:00
}
inline sal_uInt16 SwTOXBase::GetLevel() const
2000-09-18 16:15:01 +00:00
{
SAL_WARN_IF(GetTOXType()->GetType() == TOX_INDEX, "sw", "Wrong type");
return m_aData.nLevel;
2000-09-18 16:15:01 +00:00
}
inline sal_uInt16 SwTOXBase::GetOptions() const
2000-09-18 16:15:01 +00:00
{
SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
return m_aData.nOptions;
2000-09-18 16:15:01 +00:00
}
inline void SwTOXBase::SetOptions(sal_uInt16 nOpt)
2000-09-18 16:15:01 +00:00
{
SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
m_aData.nOptions = nOpt;
2000-09-18 16:15:01 +00:00
}
#endif // INCLUDED_SW_INC_TOX_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */