2010-10-14 01:30:41 -05:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2000-09-18 11:15:01 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 05:48:25 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 11:15:01 -05:00
|
|
|
*
|
2010-02-12 08:01:35 -06:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-09-18 11:15:01 -05:00
|
|
|
*
|
2008-04-10 05:48:25 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 11:15:01 -05:00
|
|
|
*
|
2008-04-10 05:48:25 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 11:15:01 -05:00
|
|
|
*
|
2008-04-10 05:48:25 -05:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-09-18 11:15:01 -05:00
|
|
|
*
|
2008-04-10 05:48:25 -05:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-09-18 11:15:01 -05:00
|
|
|
*
|
2008-04-10 05:48:25 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-09-18 11:15:01 -05:00
|
|
|
*
|
|
|
|
************************************************************************/
|
2010-01-08 10:14:00 -06:00
|
|
|
#ifndef SW_TOX_HXX
|
|
|
|
#define SW_TOX_HXX
|
|
|
|
|
|
|
|
#include <cppuhelper/weakref.hxx>
|
2007-09-27 02:13:47 -05:00
|
|
|
|
2006-04-07 09:07:46 -05:00
|
|
|
#include <i18npool/lang.h>
|
2000-09-18 11:15:01 -05:00
|
|
|
#include <tools/string.hxx>
|
2010-11-25 10:08:45 -06:00
|
|
|
#include <osl/diagnose.h>
|
2000-09-18 11:15:01 -05:00
|
|
|
|
2010-01-08 11:32:51 -06:00
|
|
|
#include <editeng/svxenum.hxx>
|
2009-10-15 17:05:16 -05:00
|
|
|
#include <svl/svarray.hxx>
|
|
|
|
#include <svl/poolitem.hxx>
|
2004-08-23 02:41:10 -05:00
|
|
|
#include "swdllapi.h"
|
2000-09-18 11:15:01 -05:00
|
|
|
#include <swtypes.hxx>
|
|
|
|
#include <toxe.hxx>
|
|
|
|
#include <calbck.hxx>
|
|
|
|
|
2004-08-23 02:41:10 -05:00
|
|
|
#ifndef INCLUDED_VECTOR
|
2004-05-17 10:11:16 -05:00
|
|
|
#include <vector> // #i21237#
|
2004-08-23 02:41:10 -05:00
|
|
|
#define INCLUDED_VECTOR
|
|
|
|
#endif
|
2004-05-17 10:11:16 -05:00
|
|
|
|
2010-01-08 10:14:00 -06:00
|
|
|
|
|
|
|
namespace com { namespace sun { namespace star {
|
|
|
|
namespace text { class XDocumentIndexMark; }
|
|
|
|
} } }
|
|
|
|
|
2000-09-18 11:15:01 -05:00
|
|
|
class SwTOXType;
|
|
|
|
class SwTOXMark;
|
|
|
|
class SwTxtTOXMark;
|
|
|
|
class SwDoc;
|
|
|
|
|
|
|
|
SV_DECL_PTRARR(SwTOXMarks, SwTOXMark*, 0, 10)
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
2001-06-06 04:41:26 -05:00
|
|
|
Description: Entry of content index, alphabetical index or user defined index
|
2000-09-18 11:15:01 -05:00
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
#define IVER_TOXMARK_STRPOOL ((sal_uInt16)1)
|
|
|
|
#define IVER_TOXMARK_NEWTOX ((sal_uInt16)2)
|
2000-09-18 11:15:01 -05:00
|
|
|
|
2010-01-08 10:14:00 -06:00
|
|
|
class SW_DLLPUBLIC SwTOXMark
|
|
|
|
: public SfxPoolItem
|
|
|
|
, public SwModify
|
2000-09-18 11:15:01 -05:00
|
|
|
{
|
|
|
|
friend void _InitCore();
|
|
|
|
friend class SwTxtTOXMark;
|
|
|
|
|
2011-04-25 13:33:33 -05:00
|
|
|
String aAltText; // Text of caption is different.
|
2000-09-18 11:15:01 -05:00
|
|
|
String aPrimaryKey, aSecondaryKey;
|
|
|
|
|
2002-06-06 07:16:41 -05:00
|
|
|
// three more strings for phonetic sorting
|
|
|
|
String aTextReading;
|
|
|
|
String aPrimaryKeyReading;
|
|
|
|
String aSecondaryKeyReading;
|
|
|
|
|
2000-09-18 11:15:01 -05:00
|
|
|
SwTxtTOXMark* pTxtAttr;
|
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_uInt16 nLevel;
|
|
|
|
sal_Bool bAutoGenerated : 1; // generated using a concordance file
|
|
|
|
sal_Bool bMainEntry : 1; // main entry emphasized by character style
|
2000-09-18 11:15:01 -05:00
|
|
|
|
2010-01-08 10:14:00 -06:00
|
|
|
::com::sun::star::uno::WeakReference<
|
|
|
|
::com::sun::star::text::XDocumentIndexMark> m_wXDocumentIndexMark;
|
2000-09-18 11:15:01 -05:00
|
|
|
|
2001-06-06 04:41:26 -05:00
|
|
|
SwTOXMark(); // to create the dflt. atr. in _InitCore
|
2000-09-18 11:15:01 -05:00
|
|
|
|
2010-12-17 02:02:23 -06:00
|
|
|
protected:
|
|
|
|
// SwClient
|
|
|
|
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
|
|
|
|
|
2000-09-18 11:15:01 -05:00
|
|
|
public:
|
2001-06-06 04:41:26 -05:00
|
|
|
TYPEINFO(); // rtti
|
2000-09-18 11:15:01 -05:00
|
|
|
|
2004-08-23 02:41:10 -05:00
|
|
|
// single argument ctors shall be explicit.
|
|
|
|
explicit SwTOXMark( const SwTOXType* pTyp );
|
2000-09-18 11:15:01 -05:00
|
|
|
virtual ~SwTOXMark();
|
|
|
|
|
2004-08-23 02:41:10 -05:00
|
|
|
SwTOXMark( const SwTOXMark& rCopy );
|
|
|
|
SwTOXMark& operator=( const SwTOXMark& rCopy );
|
|
|
|
|
2001-06-06 04:41:26 -05:00
|
|
|
// "pure virtual methods" of SfxPoolItem
|
2000-09-18 11:15:01 -05:00
|
|
|
virtual int operator==( const SfxPoolItem& ) const;
|
|
|
|
virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
|
|
|
|
|
2010-01-08 10:14:00 -06:00
|
|
|
void InvalidateTOXMark();
|
|
|
|
|
2000-09-18 11:15:01 -05:00
|
|
|
String GetText() const;
|
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
inline sal_Bool IsAlternativeText() const;
|
2000-09-18 11:15:01 -05:00
|
|
|
inline const String& GetAlternativeText() const;
|
|
|
|
|
|
|
|
inline void SetAlternativeText( const String& rAlt );
|
|
|
|
|
2001-06-06 04:41:26 -05:00
|
|
|
// content or user defined index
|
2011-01-17 08:06:54 -06:00
|
|
|
inline void SetLevel(sal_uInt16 nLevel);
|
|
|
|
inline sal_uInt16 GetLevel() const;
|
2000-09-18 11:15:01 -05:00
|
|
|
|
2001-06-06 04:41:26 -05:00
|
|
|
// for alphabetical index only
|
2000-09-18 11:15:01 -05:00
|
|
|
inline void SetPrimaryKey(const String& rStr );
|
|
|
|
inline void SetSecondaryKey(const String& rStr);
|
2002-06-06 07:16:41 -05:00
|
|
|
inline void SetTextReading(const String& rStr);
|
|
|
|
inline void SetPrimaryKeyReading(const String& rStr );
|
|
|
|
inline void SetSecondaryKeyReading(const String& rStr);
|
|
|
|
|
2000-09-18 11:15:01 -05:00
|
|
|
inline const String& GetPrimaryKey() const;
|
|
|
|
inline const String& GetSecondaryKey() const;
|
2002-06-06 07:16:41 -05:00
|
|
|
inline const String& GetTextReading() const;
|
|
|
|
inline const String& GetPrimaryKeyReading() const;
|
|
|
|
inline const String& GetSecondaryKeyReading() const;
|
2000-09-18 11:15:01 -05:00
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_Bool IsAutoGenerated() const {return bAutoGenerated;}
|
|
|
|
void SetAutoGenerated(sal_Bool bSet) {bAutoGenerated = bSet;}
|
2000-09-18 11:15:01 -05:00
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_Bool IsMainEntry() const {return bMainEntry;}
|
|
|
|
void SetMainEntry(sal_Bool bSet) { bMainEntry = bSet;}
|
2000-09-18 11:15:01 -05:00
|
|
|
|
|
|
|
inline const SwTOXType* GetTOXType() const;
|
|
|
|
|
|
|
|
const SwTxtTOXMark* GetTxtTOXMark() const { return pTxtAttr; }
|
|
|
|
SwTxtTOXMark* GetTxtTOXMark() { return pTxtAttr; }
|
2010-01-08 10:14:00 -06:00
|
|
|
|
|
|
|
SW_DLLPRIVATE ::com::sun::star::uno::WeakReference<
|
|
|
|
::com::sun::star::text::XDocumentIndexMark> const& GetXTOXMark() const
|
|
|
|
{ return m_wXDocumentIndexMark; }
|
|
|
|
SW_DLLPRIVATE void SetXTOXMark(::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::text::XDocumentIndexMark> const& xMark)
|
|
|
|
{ m_wXDocumentIndexMark = xMark; }
|
2010-12-17 02:02:23 -06:00
|
|
|
void DeRegister() { GetRegisteredInNonConst()->Remove( this ); }
|
|
|
|
void RegisterToTOXType( SwTOXType& rMark );
|
|
|
|
static void InsertTOXMarks( SwTOXMarks& aMarks, const SwTOXType& rType );
|
2000-09-18 11:15:01 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
2001-06-06 04:41:26 -05:00
|
|
|
Description: index types
|
2000-09-18 11:15:01 -05:00
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
class SwTOXType : public SwModify
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SwTOXType(TOXTypes eTyp, const String& aName);
|
2004-08-23 02:41:10 -05:00
|
|
|
|
|
|
|
// @@@ public copy ctor, but no copy assignment?
|
2000-09-18 11:15:01 -05:00
|
|
|
SwTOXType(const SwTOXType& rCopy);
|
|
|
|
|
|
|
|
inline const String& GetTypeName() const;
|
|
|
|
inline TOXTypes GetType() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
String aName;
|
|
|
|
TOXTypes eType;
|
2004-08-23 02:41:10 -05:00
|
|
|
|
|
|
|
// @@@ public copy ctor, but no copy assignment?
|
|
|
|
SwTOXType & operator= (const SwTOXType &);
|
2000-09-18 11:15:01 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
2001-06-06 04:41:26 -05:00
|
|
|
Description: Structure of the index lines
|
2000-09-18 11:15:01 -05: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>
|
|
|
|
*/
|
|
|
|
|
2001-06-06 04:41:26 -05:00
|
|
|
// These enum values are stored and must not be changed!
|
2000-09-18 11:15:01 -05: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
|
|
|
|
};
|
|
|
|
|
2004-08-23 02:41:10 -05:00
|
|
|
struct SW_DLLPUBLIC SwFormToken
|
2000-09-18 11:15:01 -05:00
|
|
|
{
|
|
|
|
String sText;
|
|
|
|
String sCharStyleName;
|
|
|
|
SwTwips nTabStopPosition;
|
|
|
|
FormTokenType eTokenType;
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_uInt16 nPoolId;
|
2007-09-27 02:13:47 -05:00
|
|
|
SvxTabAdjust eTabAlign;
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_uInt16 nChapterFormat; //SwChapterFormat;
|
|
|
|
sal_uInt16 nOutlineLevel;//the maximum permitted outline level in numbering
|
|
|
|
sal_uInt16 nAuthorityField; //enum ToxAuthorityField
|
2000-09-18 11:15:01 -05:00
|
|
|
sal_Unicode cTabFillChar;
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_Bool bWithTab; // sal_True: do generate tab
|
2004-05-17 10:11:16 -05:00
|
|
|
// character only the tab stop
|
|
|
|
// #i21237#
|
2000-09-18 11:15:01 -05:00
|
|
|
|
|
|
|
SwFormToken(FormTokenType eType ) :
|
2001-03-30 04:34:00 -06:00
|
|
|
nTabStopPosition(0),
|
2002-11-18 09:54:06 -06:00
|
|
|
eTokenType(eType),
|
2000-09-18 11:15:01 -05:00
|
|
|
nPoolId(USHRT_MAX),
|
2007-09-27 02:13:47 -05:00
|
|
|
eTabAlign( SVX_TAB_ADJUST_LEFT ),
|
2000-09-18 11:15:01 -05:00
|
|
|
nChapterFormat(0 /*CF_NUMBER*/),
|
2008-03-07 04:59:00 -06:00
|
|
|
nOutlineLevel(MAXLEVEL), //default to maximum outline level
|
2002-11-18 09:54:06 -06:00
|
|
|
nAuthorityField(0 /*AUTH_FIELD_IDENTIFIER*/),
|
2004-05-17 10:11:16 -05:00
|
|
|
cTabFillChar(' '),
|
|
|
|
bWithTab(sal_True) // #i21237#
|
|
|
|
{}
|
2000-09-18 11:15:01 -05:00
|
|
|
|
|
|
|
String GetString() const;
|
|
|
|
};
|
|
|
|
|
2004-05-17 10:11:16 -05:00
|
|
|
struct SwFormTokenEqualToFormTokenType
|
|
|
|
{
|
|
|
|
FormTokenType eType;
|
|
|
|
|
|
|
|
SwFormTokenEqualToFormTokenType(FormTokenType _eType) : eType(_eType) {}
|
|
|
|
bool operator()(const SwFormToken & rToken)
|
|
|
|
{
|
|
|
|
return rToken.eTokenType == eType;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
Functor that appends the string representation of a given token to a string.
|
|
|
|
|
|
|
|
@param _rText string to append the string representation to
|
|
|
|
@param rToken token whose string representation is appended
|
|
|
|
*/
|
|
|
|
struct SwFormTokenToString
|
|
|
|
{
|
|
|
|
String & rText;
|
|
|
|
SwFormTokenToString(String & _rText) : rText(_rText) {}
|
|
|
|
void operator()(const SwFormToken & rToken) { rText += rToken.GetString(); }
|
|
|
|
};
|
|
|
|
|
|
|
|
/// Vector of tokens.
|
|
|
|
typedef std::vector<SwFormToken> SwFormTokens;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Helper class that converts vectors of tokens to strings and vice
|
|
|
|
versa.
|
|
|
|
*/
|
2004-08-23 02:41:10 -05:00
|
|
|
class SW_DLLPUBLIC SwFormTokensHelper
|
2000-09-18 11:15:01 -05:00
|
|
|
{
|
2004-05-17 10:11:16 -05:00
|
|
|
/// the tokens
|
|
|
|
SwFormTokens aTokens;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Builds a token from its string representation.
|
|
|
|
|
|
|
|
@sPattern the whole pattern
|
|
|
|
@nCurPatternPos starting position of the token
|
|
|
|
|
|
|
|
@return the token
|
|
|
|
*/
|
2004-08-23 02:41:10 -05:00
|
|
|
SW_DLLPRIVATE SwFormToken BuildToken( const String & sPattern,
|
|
|
|
xub_StrLen & nCurPatternPos ) const;
|
2004-05-17 10:11:16 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the string of a token.
|
|
|
|
|
|
|
|
@param sPattern the whole pattern
|
|
|
|
@param nStt starting position of the token
|
|
|
|
|
|
|
|
@return the string representation of the token
|
|
|
|
*/
|
2004-08-23 02:41:10 -05:00
|
|
|
SW_DLLPRIVATE String SearchNextToken( const String & sPattern,
|
|
|
|
xub_StrLen nStt ) const;
|
2004-05-17 10:11:16 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the type of a token.
|
2000-09-18 11:15:01 -05:00
|
|
|
|
2004-05-17 10:11:16 -05:00
|
|
|
@param sToken the string representation of the token
|
|
|
|
@param pTokenLen return parameter the length of the head of the token
|
|
|
|
|
|
|
|
If pTokenLen is non-NULL the length of the token's head is
|
|
|
|
written to *pTokenLen
|
|
|
|
|
|
|
|
@return the type of the token
|
|
|
|
*/
|
2004-08-23 02:41:10 -05:00
|
|
|
SW_DLLPRIVATE FormTokenType GetTokenType(const String & sToken,
|
|
|
|
xub_StrLen * pTokenLen) const;
|
2000-09-18 11:15:01 -05:00
|
|
|
|
|
|
|
public:
|
2004-05-17 10:11:16 -05:00
|
|
|
/**
|
|
|
|
contructor
|
|
|
|
|
|
|
|
@param rTokens vector of tokens
|
|
|
|
*/
|
|
|
|
SwFormTokensHelper(const SwFormTokens & rTokens) : aTokens(rTokens) {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
constructor
|
|
|
|
|
|
|
|
@param rStr string representation of the tokens
|
|
|
|
*/
|
|
|
|
SwFormTokensHelper(const String & rStr);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns vector of tokens.
|
|
|
|
|
|
|
|
@return vector of tokens
|
|
|
|
*/
|
|
|
|
const SwFormTokens & GetTokens() const { return aTokens; }
|
2000-09-18 11:15:01 -05:00
|
|
|
};
|
|
|
|
|
2004-08-23 02:41:10 -05:00
|
|
|
class SW_DLLPUBLIC SwForm
|
2000-09-18 11:15:01 -05:00
|
|
|
{
|
2004-05-17 10:11:16 -05:00
|
|
|
SwFormTokens aPattern[ AUTH_TYPE_END + 1 ]; // #i21237#
|
2000-09-18 11:15:01 -05:00
|
|
|
String aTemplate[ AUTH_TYPE_END + 1 ];
|
2004-05-17 10:11:16 -05:00
|
|
|
|
2007-09-27 02:13:47 -05:00
|
|
|
TOXTypes eType;
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_uInt16 nFormMaxLevel;
|
2007-09-27 02:13:47 -05:00
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_Bool bGenerateTabPos : 1;
|
|
|
|
sal_Bool bIsRelTabPos : 1;
|
|
|
|
sal_Bool bCommaSeparated : 1;
|
2000-09-18 11:15:01 -05:00
|
|
|
|
|
|
|
public:
|
2007-09-27 02:13:47 -05:00
|
|
|
SwForm( TOXTypes eTOXType = TOX_CONTENT );
|
2000-09-18 11:15:01 -05:00
|
|
|
SwForm( const SwForm& rForm );
|
|
|
|
|
|
|
|
SwForm& operator=( const SwForm& rForm );
|
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
inline void SetTemplate(sal_uInt16 nLevel, const String& rName);
|
|
|
|
inline const String& GetTemplate(sal_uInt16 nLevel) const;
|
2000-09-18 11:15:01 -05:00
|
|
|
|
2004-05-17 10:11:16 -05:00
|
|
|
// #i21237#
|
2011-01-17 08:06:54 -06:00
|
|
|
void SetPattern(sal_uInt16 nLevel, const SwFormTokens& rName);
|
|
|
|
void SetPattern(sal_uInt16 nLevel, const String& rStr);
|
|
|
|
const SwFormTokens& GetPattern(sal_uInt16 nLevel) const;
|
2000-09-18 11:15:01 -05:00
|
|
|
|
|
|
|
// fill tab stop positions from template to pattern
|
2004-05-17 10:11:16 -05:00
|
|
|
// #i21237#
|
|
|
|
void AdjustTabStops(SwDoc& rDoc,
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_Bool bInsertNewTabStops = sal_False);
|
2000-09-18 11:15:01 -05:00
|
|
|
|
2007-09-27 02:13:47 -05:00
|
|
|
inline TOXTypes GetTOXType() const;
|
2011-01-17 08:06:54 -06:00
|
|
|
inline sal_uInt16 GetFormMax() const;
|
2000-09-18 11:15:01 -05:00
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_Bool IsRelTabPos() const { return bIsRelTabPos; }
|
|
|
|
void SetRelTabPos( sal_Bool b ) { bIsRelTabPos = b; }
|
2000-09-18 11:15:01 -05:00
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_Bool IsCommaSeparated() const { return bCommaSeparated;}
|
|
|
|
void SetCommaSeparated( sal_Bool b) { bCommaSeparated = b;}
|
2000-09-18 11:15:01 -05:00
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
static sal_uInt16 GetFormMaxLevel( TOXTypes eType );
|
2000-09-18 11:15:01 -05:00
|
|
|
|
|
|
|
static const sal_Char* aFormEntry; // <E>
|
2011-01-17 08:06:54 -06:00
|
|
|
static sal_uInt8 nFormEntryLen; // 3 characters
|
2000-09-18 11:15:01 -05:00
|
|
|
static const sal_Char* aFormTab; // <T>
|
2011-01-17 08:06:54 -06:00
|
|
|
static sal_uInt8 nFormTabLen; // 3 characters
|
2000-09-18 11:15:01 -05:00
|
|
|
static const sal_Char* aFormPageNums; // <P>
|
2011-01-17 08:06:54 -06:00
|
|
|
static sal_uInt8 nFormPageNumsLen; // 3 characters
|
2000-09-18 11:15:01 -05:00
|
|
|
static const sal_Char* aFormLinkStt; // <LS>
|
2011-01-17 08:06:54 -06:00
|
|
|
static sal_uInt8 nFormLinkSttLen; // 4 characters
|
2000-09-18 11:15:01 -05:00
|
|
|
static const sal_Char* aFormLinkEnd; // <LE>
|
2011-01-17 08:06:54 -06:00
|
|
|
static sal_uInt8 nFormLinkEndLen; // 4 characters
|
2000-09-18 11:15:01 -05:00
|
|
|
static const sal_Char* aFormEntryNum; // <E#>
|
2011-01-17 08:06:54 -06:00
|
|
|
static sal_uInt8 nFormEntryNumLen; // 4 characters
|
2000-09-18 11:15:01 -05:00
|
|
|
static const sal_Char* aFormEntryTxt; // <ET>
|
2011-01-17 08:06:54 -06:00
|
|
|
static sal_uInt8 nFormEntryTxtLen; // 4 characters
|
2000-09-18 11:15:01 -05:00
|
|
|
static const sal_Char* aFormChapterMark; // <C>
|
2011-01-17 08:06:54 -06:00
|
|
|
static sal_uInt8 nFormChapterMarkLen; // 3 characters
|
2000-09-18 11:15:01 -05:00
|
|
|
static const sal_Char* aFormText; // <TX>
|
2011-01-17 08:06:54 -06:00
|
|
|
static sal_uInt8 nFormTextLen; // 4 characters
|
2000-09-18 11:15:01 -05:00
|
|
|
static const sal_Char* aFormAuth; // <Axx> xx - decimal enum value
|
2011-01-17 08:06:54 -06:00
|
|
|
static sal_uInt8 nFormAuthLen; // 3 characters
|
2000-09-18 11:15:01 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
2001-06-06 04:41:26 -05:00
|
|
|
Description: Content to create indexes of
|
2000-09-18 11:15:01 -05:00
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
typedef sal_uInt16 SwTOXElement;
|
2007-09-27 02:13:47 -05:00
|
|
|
namespace nsSwTOXElement
|
2000-09-18 11:15:01 -05:00
|
|
|
{
|
2007-09-27 02:13:47 -05: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;
|
|
|
|
}
|
2000-09-18 11:15:01 -05:00
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
typedef sal_uInt16 SwTOIOptions;
|
2007-09-27 02:13:47 -05:00
|
|
|
namespace nsSwTOIOptions
|
2000-09-18 11:15:01 -05:00
|
|
|
{
|
2007-09-27 02:13:47 -05: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 11:15:01 -05:00
|
|
|
|
|
|
|
//which part of the caption is to be displayed
|
|
|
|
enum SwCaptionDisplay
|
|
|
|
{
|
|
|
|
CAPTION_COMPLETE,
|
|
|
|
CAPTION_NUMBER,
|
|
|
|
CAPTION_TEXT
|
|
|
|
};
|
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
typedef sal_uInt16 SwTOOElements;
|
2007-09-27 02:13:47 -05:00
|
|
|
namespace nsSwTOOElements
|
2000-09-18 11:15:01 -05:00
|
|
|
{
|
2007-09-27 02:13:47 -05: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 11:15:01 -05:00
|
|
|
|
2010-11-15 05:59:57 -06:00
|
|
|
#define TOX_STYLE_DELIMITER ((sal_Unicode)0x01)
|
2000-09-18 11:15:01 -05:00
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
2001-06-06 04:41:26 -05:00
|
|
|
Description: Class for all indexes
|
2000-09-18 11:15:01 -05:00
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
2004-08-23 02:41:10 -05:00
|
|
|
class SW_DLLPUBLIC SwTOXBase : public SwClient
|
2000-09-18 11:15:01 -05:00
|
|
|
{
|
2001-06-06 04:41:26 -05:00
|
|
|
SwForm aForm; // description of the lines
|
2000-09-18 11:15:01 -05:00
|
|
|
String aName; // unique name
|
2001-06-06 04:41:26 -05:00
|
|
|
String aTitle; // title
|
2000-09-18 11:15:01 -05:00
|
|
|
|
|
|
|
String sMainEntryCharStyle; // name of the character style applied to main index entries
|
|
|
|
|
|
|
|
String aStyleNames[MAXLEVEL]; // (additional) style names TOX_CONTENT, TOX_USER
|
|
|
|
String sSequenceName; // FieldTypeName of a caption sequence
|
|
|
|
|
2001-06-06 04:41:26 -05:00
|
|
|
LanguageType eLanguage;
|
|
|
|
String sSortAlgorithm;
|
|
|
|
|
2000-09-18 11:15:01 -05:00
|
|
|
union {
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_uInt16 nLevel; // consider outline levels
|
|
|
|
sal_uInt16 nOptions; // options of alphabetical index
|
2000-09-18 11:15:01 -05:00
|
|
|
} aData;
|
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_uInt16 nCreateType; // sources to create the index from
|
|
|
|
sal_uInt16 nOLEOptions; // OLE sources
|
2000-09-18 11:15:01 -05:00
|
|
|
SwCaptionDisplay eCaptionDisplay; //
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_Bool bProtected : 1; // index protected ?
|
|
|
|
sal_Bool bFromChapter : 1; // create from chapter or document
|
|
|
|
sal_Bool bFromObjectNames : 1; // create a table or object index
|
2000-09-18 11:15:01 -05:00
|
|
|
// from the names rather than the caption
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_Bool bLevelFromChapter : 1; // User index: get the level from the source chapter
|
2000-09-18 11:15:01 -05:00
|
|
|
public:
|
|
|
|
SwTOXBase( const SwTOXType* pTyp, const SwForm& rForm,
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_uInt16 nCreaType, const String& rTitle );
|
2000-09-18 11:15:01 -05:00
|
|
|
SwTOXBase( const SwTOXBase& rCopy, SwDoc* pDoc = 0 );
|
|
|
|
virtual ~SwTOXBase();
|
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const;
|
2000-09-18 11:15:01 -05: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; //
|
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_uInt16 GetCreateType() const; // creation types
|
2000-09-18 11:15:01 -05:00
|
|
|
|
|
|
|
const String& GetTOXName() const {return aName;}
|
|
|
|
void SetTOXName(const String& rSet) {aName = rSet;}
|
|
|
|
|
2001-06-06 04:41:26 -05:00
|
|
|
const String& GetTitle() const; // Title
|
|
|
|
const String& GetTypeName() const; // Name
|
|
|
|
const SwForm& GetTOXForm() const; // description of the lines
|
2000-09-18 11:15:01 -05:00
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
void SetCreate(sal_uInt16);
|
2000-09-18 11:15:01 -05:00
|
|
|
void SetTitle(const String& rTitle);
|
|
|
|
void SetTOXForm(const SwForm& rForm);
|
|
|
|
|
|
|
|
TOXTypes GetType() const;
|
|
|
|
|
|
|
|
const String& GetMainEntryCharStyle() const {return sMainEntryCharStyle;}
|
|
|
|
void SetMainEntryCharStyle(const String& rSet) {sMainEntryCharStyle = rSet;}
|
|
|
|
|
2001-06-06 04:41:26 -05:00
|
|
|
// content index only
|
2011-01-17 08:06:54 -06:00
|
|
|
inline void SetLevel(sal_uInt16); // consider outline level
|
|
|
|
inline sal_uInt16 GetLevel() const;
|
2000-09-18 11:15:01 -05:00
|
|
|
|
2001-06-06 04:41:26 -05:00
|
|
|
// alphabetical index only
|
2011-01-17 08:06:54 -06:00
|
|
|
inline sal_uInt16 GetOptions() const; // alphabetical index options
|
|
|
|
inline void SetOptions(sal_uInt16 nOpt);
|
2000-09-18 11:15:01 -05:00
|
|
|
|
|
|
|
// index of objects
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_uInt16 GetOLEOptions() const {return nOLEOptions;}
|
|
|
|
void SetOLEOptions(sal_uInt16 nOpt) {nOLEOptions = nOpt;}
|
2000-09-18 11:15:01 -05:00
|
|
|
|
|
|
|
// index of objects
|
|
|
|
|
2001-06-06 04:41:26 -05:00
|
|
|
// user defined index only
|
2000-09-18 11:15:01 -05:00
|
|
|
inline void SetTemplateName(const String& rName); // Absatzlayout beachten
|
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
const String& GetStyleNames(sal_uInt16 nLevel) const
|
2000-09-18 11:15:01 -05:00
|
|
|
{
|
2011-05-08 15:14:45 -05:00
|
|
|
OSL_ENSURE( nLevel < MAXLEVEL, "Which level?");
|
2000-09-18 11:15:01 -05:00
|
|
|
return aStyleNames[nLevel];
|
|
|
|
}
|
2011-01-17 08:06:54 -06:00
|
|
|
void SetStyleNames(const String& rSet, sal_uInt16 nLevel)
|
2000-09-18 11:15:01 -05:00
|
|
|
{
|
2011-05-08 15:14:45 -05:00
|
|
|
OSL_ENSURE( nLevel < MAXLEVEL, "Which level?");
|
2000-09-18 11:15:01 -05:00
|
|
|
aStyleNames[nLevel] = rSet;
|
|
|
|
}
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_Bool IsFromChapter() const { return bFromChapter;}
|
|
|
|
void SetFromChapter(sal_Bool bSet) { bFromChapter = bSet;}
|
2000-09-18 11:15:01 -05:00
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_Bool IsFromObjectNames() const {return bFromObjectNames;}
|
|
|
|
void SetFromObjectNames(sal_Bool bSet) {bFromObjectNames = bSet;}
|
2000-09-18 11:15:01 -05:00
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_Bool IsLevelFromChapter() const {return bLevelFromChapter;}
|
|
|
|
void SetLevelFromChapter(sal_Bool bSet) {bLevelFromChapter = bSet;}
|
2000-09-18 11:15:01 -05:00
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_Bool IsProtected() const { return bProtected; }
|
|
|
|
void SetProtected(sal_Bool bSet) { bProtected = bSet; }
|
2000-09-18 11:15:01 -05:00
|
|
|
|
|
|
|
const String& GetSequenceName() const {return sSequenceName;}
|
|
|
|
void SetSequenceName(const String& rSet) {sSequenceName = rSet;}
|
|
|
|
|
|
|
|
SwCaptionDisplay GetCaptionDisplay() const { return eCaptionDisplay;}
|
|
|
|
void SetCaptionDisplay(SwCaptionDisplay eSet) {eCaptionDisplay = eSet;}
|
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_Bool IsTOXBaseInReadonly() const;
|
2000-09-18 11:15:01 -05:00
|
|
|
|
|
|
|
const SfxItemSet* GetAttrSet() const;
|
|
|
|
void SetAttrSet( const SfxItemSet& );
|
|
|
|
|
2001-06-06 04:41:26 -05:00
|
|
|
LanguageType GetLanguage() const {return eLanguage;}
|
|
|
|
void SetLanguage(LanguageType nLang) {eLanguage = nLang;}
|
|
|
|
|
|
|
|
const String& GetSortAlgorithm()const {return sSortAlgorithm;}
|
|
|
|
void SetSortAlgorithm(const String& rSet) {sSortAlgorithm = rSet;}
|
2004-05-17 10:11:16 -05:00
|
|
|
// #i21237#
|
2011-01-17 08:06:54 -06:00
|
|
|
void AdjustTabStops(SwDoc & rDoc, sal_Bool bDefaultRightTabStop);
|
2004-05-18 08:38:25 -05:00
|
|
|
SwTOXBase& operator=(const SwTOXBase& rSource);
|
2010-12-17 02:02:23 -06:00
|
|
|
void RegisterToTOXType( SwTOXType& rMark );
|
2000-09-18 11:15:01 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
2001-06-06 04:41:26 -05:00
|
|
|
Description: Inlines
|
2000-09-18 11:15:01 -05:00
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
//
|
|
|
|
//SwTOXMark
|
|
|
|
//
|
|
|
|
inline const String& SwTOXMark::GetAlternativeText() const
|
|
|
|
{ return aAltText; }
|
|
|
|
|
|
|
|
inline const SwTOXType* SwTOXMark::GetTOXType() const
|
|
|
|
{ return (SwTOXType*)GetRegisteredIn(); }
|
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
inline sal_Bool SwTOXMark::IsAlternativeText() const
|
2000-09-18 11:15:01 -05:00
|
|
|
{ return aAltText.Len() > 0; }
|
|
|
|
|
|
|
|
inline void SwTOXMark::SetAlternativeText(const String& rAlt)
|
|
|
|
{
|
|
|
|
aAltText = rAlt;
|
|
|
|
}
|
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
inline void SwTOXMark::SetLevel( sal_uInt16 nLvl )
|
2000-09-18 11:15:01 -05:00
|
|
|
{
|
2010-11-25 10:08:45 -06:00
|
|
|
OSL_ENSURE( !GetTOXType() || GetTOXType()->GetType() != TOX_INDEX, "Falscher Feldtyp");
|
2000-09-18 11:15:01 -05:00
|
|
|
nLevel = nLvl;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void SwTOXMark::SetPrimaryKey( const String& rKey )
|
|
|
|
{
|
2010-11-25 10:08:45 -06:00
|
|
|
OSL_ENSURE( GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
|
2000-09-18 11:15:01 -05:00
|
|
|
aPrimaryKey = rKey;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void SwTOXMark::SetSecondaryKey( const String& rKey )
|
|
|
|
{
|
2010-11-25 10:08:45 -06:00
|
|
|
OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
|
2000-09-18 11:15:01 -05:00
|
|
|
aSecondaryKey = rKey;
|
|
|
|
}
|
|
|
|
|
2002-06-06 07:16:41 -05:00
|
|
|
inline void SwTOXMark::SetTextReading( const String& rTxt )
|
|
|
|
{
|
2010-11-25 10:08:45 -06:00
|
|
|
OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
|
2002-06-06 07:16:41 -05:00
|
|
|
aTextReading = rTxt;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void SwTOXMark::SetPrimaryKeyReading( const String& rKey )
|
|
|
|
{
|
2010-11-25 10:08:45 -06:00
|
|
|
OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
|
2002-06-06 07:16:41 -05:00
|
|
|
aPrimaryKeyReading = rKey;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void SwTOXMark::SetSecondaryKeyReading( const String& rKey )
|
|
|
|
{
|
2010-11-25 10:08:45 -06:00
|
|
|
OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
|
2002-06-06 07:16:41 -05:00
|
|
|
aSecondaryKeyReading = rKey;
|
|
|
|
}
|
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
inline sal_uInt16 SwTOXMark::GetLevel() const
|
2000-09-18 11:15:01 -05:00
|
|
|
{
|
2010-11-25 10:08:45 -06:00
|
|
|
OSL_ENSURE( !GetTOXType() || GetTOXType()->GetType() != TOX_INDEX, "Falscher Feldtyp");
|
2000-09-18 11:15:01 -05:00
|
|
|
return nLevel;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline const String& SwTOXMark::GetPrimaryKey() const
|
|
|
|
{
|
2010-11-25 10:08:45 -06:00
|
|
|
OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
|
2000-09-18 11:15:01 -05:00
|
|
|
return aPrimaryKey;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline const String& SwTOXMark::GetSecondaryKey() const
|
|
|
|
{
|
2010-11-25 10:08:45 -06:00
|
|
|
OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
|
2000-09-18 11:15:01 -05:00
|
|
|
return aSecondaryKey;
|
|
|
|
}
|
|
|
|
|
2002-06-06 07:16:41 -05:00
|
|
|
inline const String& SwTOXMark::GetTextReading() const
|
|
|
|
{
|
2010-11-25 10:08:45 -06:00
|
|
|
OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
|
2002-06-06 07:16:41 -05:00
|
|
|
return aTextReading;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline const String& SwTOXMark::GetPrimaryKeyReading() const
|
|
|
|
{
|
2010-11-25 10:08:45 -06:00
|
|
|
OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
|
2002-06-06 07:16:41 -05:00
|
|
|
return aPrimaryKeyReading;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline const String& SwTOXMark::GetSecondaryKeyReading() const
|
|
|
|
{
|
2010-11-25 10:08:45 -06:00
|
|
|
OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
|
2002-06-06 07:16:41 -05:00
|
|
|
return aSecondaryKeyReading;
|
|
|
|
}
|
2000-09-18 11:15:01 -05:00
|
|
|
|
|
|
|
//
|
|
|
|
//SwForm
|
|
|
|
//
|
2011-01-17 08:06:54 -06:00
|
|
|
inline void SwForm::SetTemplate(sal_uInt16 nLevel, const String& rTemplate)
|
2000-09-18 11:15:01 -05:00
|
|
|
{
|
2010-11-25 10:08:45 -06:00
|
|
|
OSL_ENSURE(nLevel < GetFormMax(), "Index >= FORM_MAX");
|
2004-05-17 10:11:16 -05:00
|
|
|
aTemplate[nLevel] = rTemplate;
|
2000-09-18 11:15:01 -05:00
|
|
|
}
|
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
inline const String& SwForm::GetTemplate(sal_uInt16 nLevel) const
|
2000-09-18 11:15:01 -05:00
|
|
|
{
|
2010-11-25 10:08:45 -06:00
|
|
|
OSL_ENSURE(nLevel < GetFormMax(), "Index >= FORM_MAX");
|
2000-09-18 11:15:01 -05:00
|
|
|
return aTemplate[nLevel];
|
|
|
|
}
|
|
|
|
|
2007-09-27 02:13:47 -05:00
|
|
|
inline TOXTypes SwForm::GetTOXType() const
|
2000-09-18 11:15:01 -05:00
|
|
|
{
|
2007-09-27 02:13:47 -05:00
|
|
|
return eType;
|
2000-09-18 11:15:01 -05:00
|
|
|
}
|
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
inline sal_uInt16 SwForm::GetFormMax() const
|
2000-09-18 11:15:01 -05:00
|
|
|
{
|
|
|
|
return nFormMaxLevel;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//SwTOXType
|
|
|
|
//
|
|
|
|
inline const String& SwTOXType::GetTypeName() const
|
|
|
|
{ return aName; }
|
|
|
|
|
|
|
|
inline TOXTypes SwTOXType::GetType() const
|
|
|
|
{ return eType; }
|
|
|
|
|
|
|
|
//
|
|
|
|
// SwTOXBase
|
|
|
|
//
|
|
|
|
inline const SwTOXType* SwTOXBase::GetTOXType() const
|
|
|
|
{ return (SwTOXType*)GetRegisteredIn(); }
|
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
inline sal_uInt16 SwTOXBase::GetCreateType() const
|
2000-09-18 11:15:01 -05:00
|
|
|
{ return nCreateType; }
|
|
|
|
|
|
|
|
inline const String& SwTOXBase::GetTitle() const
|
|
|
|
{ return aTitle; }
|
|
|
|
|
|
|
|
inline const String& SwTOXBase::GetTypeName() const
|
|
|
|
{ return GetTOXType()->GetTypeName(); }
|
|
|
|
|
|
|
|
inline const SwForm& SwTOXBase::GetTOXForm() const
|
|
|
|
{ return aForm; }
|
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
inline void SwTOXBase::AdjustTabStops(SwDoc & rDoc, sal_Bool bDefaultRightTabStop)
|
2004-05-17 10:11:16 -05:00
|
|
|
{
|
|
|
|
aForm.AdjustTabStops(rDoc, bDefaultRightTabStop);
|
|
|
|
}
|
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
inline void SwTOXBase::SetCreate(sal_uInt16 nCreate)
|
2000-09-18 11:15:01 -05:00
|
|
|
{ nCreateType = nCreate; }
|
|
|
|
|
|
|
|
inline void SwTOXBase::SetTOXForm(const SwForm& rForm)
|
|
|
|
{ aForm = rForm; }
|
|
|
|
|
|
|
|
inline TOXTypes SwTOXBase::GetType() const
|
|
|
|
{ return GetTOXType()->GetType(); }
|
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
inline void SwTOXBase::SetLevel(sal_uInt16 nLev)
|
2000-09-18 11:15:01 -05:00
|
|
|
{
|
2010-11-25 10:08:45 -06:00
|
|
|
OSL_ENSURE(GetTOXType()->GetType() != TOX_INDEX, "Falscher Feldtyp");
|
2000-09-18 11:15:01 -05:00
|
|
|
aData.nLevel = nLev;
|
|
|
|
}
|
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
inline sal_uInt16 SwTOXBase::GetLevel() const
|
2000-09-18 11:15:01 -05:00
|
|
|
{
|
2010-11-25 10:08:45 -06:00
|
|
|
OSL_ENSURE(GetTOXType()->GetType() != TOX_INDEX, "Falscher Feldtyp");
|
2000-09-18 11:15:01 -05:00
|
|
|
return aData.nLevel;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void SwTOXBase::SetTemplateName(const String& rName)
|
|
|
|
{
|
2011-05-08 15:14:45 -05:00
|
|
|
OSL_FAIL("SwTOXBase::SetTemplateName obsolete");
|
2000-09-18 11:15:01 -05:00
|
|
|
aStyleNames[0] = rName;
|
|
|
|
}
|
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
inline sal_uInt16 SwTOXBase::GetOptions() const
|
2000-09-18 11:15:01 -05:00
|
|
|
{
|
2010-11-25 10:08:45 -06:00
|
|
|
OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
|
2000-09-18 11:15:01 -05:00
|
|
|
return aData.nOptions;
|
|
|
|
}
|
|
|
|
|
2011-01-17 08:06:54 -06:00
|
|
|
inline void SwTOXBase::SetOptions(sal_uInt16 nOpt)
|
2000-09-18 11:15:01 -05:00
|
|
|
{
|
2010-11-25 10:08:45 -06:00
|
|
|
OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
|
2000-09-18 11:15:01 -05:00
|
|
|
aData.nOptions = nOpt;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-01-08 10:14:00 -06:00
|
|
|
#endif // SW_TOX_HXX
|
2010-10-14 01:30:41 -05:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|