/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * 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
class SW_DLLPUBLIC SwTOXMark final
: public SfxPoolItem
, public SvtListener
{ friendvoid InitCore(); friendclass SwTextTOXMark; friend SwTOXMark* createSwTOXMarkForItemInfoPackage(); // friend class ItemInfoPackageSwAttributes;
const SwTOXType* m_pType;
OUString m_aAltText; // Text of caption is different.
OUString m_aPrimaryKey;
OUString m_aSecondaryKey;
// three more strings for phonetic sorting
OUString m_aTextReading;
OUString m_aPrimaryKeyReading;
OUString m_aSecondaryKeyReading;
SwTextTOXMark* m_pTextAttr;
sal_uInt16 m_nLevel;
OUString m_aBookmarkName; bool m_bAutoGenerated; // generated using a concordance file bool m_bMainEntry; // main entry emphasized by character style
// @@@ public copy ctor, but no copy assignment?
SwTOXType & operator= (const SwTOXType &) = delete;
};
// Structure of the index lines #define FORM_TITLE 0 #define FORM_ALPHA_DELIMITER 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! 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
{
OUString sText;
UIName sCharStyleName;
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
sal_Unicode cTabFillChar; bool bWithTab; // true: do generate tab // character only the tab stop // #i21237#
// Class for all indexes class SW_DLLPUBLIC SwTOXBase : public SwClient
{
SwForm m_aForm; // description of the lines
UIName m_aName; // unique name
OUString m_aTitle; // title
OUString m_aBookmarkName; //Bookmark Name
UIName m_sMainEntryCharStyle; // name of the character style applied to main index entries
UIName m_aStyleNames[MAXLEVEL]; // (additional) style names TOX_CONTENT, TOX_USER
UIName m_sSequenceName; // FieldTypeName of a caption sequence
union {
sal_uInt16 nLevel; // consider outline levels
SwTOIOptions nOptions; // options of alphabetical index
} m_aData;
SwTOXElement m_nCreateType; // sources to create the index from
SwTOOElements 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 // 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 fidelity and may giving a better exporting performance
OUString maMSTOCExpression; bool mbKeepExpression;
virtualvoid SwClientNotify(const SwModify& rMod, const SfxHint& rHint) override
{ if(rHint.GetId() == SfxHintId::SwDocumentDying)
GetRegisteredIn()->Remove(*this); else
SwClient::SwClientNotify(rMod, rHint);
} // a kind of CopyCtor - check if the TOXBase is at TOXType of the doc. // If not, so create it and copy all other used things. void CopyTOXBase( SwDoc*, const SwTOXBase& );
// 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;}
const OUString& GetTitle() const; // Title const OUString& GetBookmarkName() const;
OUString const & GetTypeName() const; // Name const SwForm& GetTOXForm() const; // description of the lines
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.