2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
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 .
|
|
|
|
*/
|
2012-06-02 16:15:10 +02:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
#ifndef _DOCTXM_HXX
|
|
|
|
#define _DOCTXM_HXX
|
|
|
|
|
2001-09-27 16:23:38 +00:00
|
|
|
#include <tools/gen.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <tox.hxx>
|
|
|
|
#include <section.hxx>
|
|
|
|
|
2000-10-20 09:56:11 +00:00
|
|
|
class SwTOXInternational;
|
2005-06-14 15:27:52 +00:00
|
|
|
class SwPageDesc;
|
2000-09-18 23:08:29 +00:00
|
|
|
class SwTxtNode;
|
|
|
|
class SwTxtFmtColl;
|
|
|
|
struct SwPosition;
|
|
|
|
struct SwTOXSortTabBase;
|
|
|
|
|
2012-04-26 15:05:20 +02:00
|
|
|
typedef std::vector<SwTOXSortTabBase*> SwTOXSortTabBases;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
class SwTOXBaseSection : public SwTOXBase, public SwSection
|
|
|
|
{
|
|
|
|
SwTOXSortTabBases aSortArr;
|
|
|
|
|
2012-06-02 16:15:10 +02:00
|
|
|
void UpdateMarks( const SwTOXInternational& rIntl,
|
|
|
|
const SwTxtNode* pOwnChapterNode );
|
|
|
|
void UpdateOutline( const SwTxtNode* pOwnChapterNode );
|
|
|
|
void UpdateTemplate( const SwTxtNode* pOwnChapterNode );
|
|
|
|
void UpdateCntnt( SwTOXElement eType,
|
|
|
|
const SwTxtNode* pOwnChapterNode );
|
|
|
|
void UpdateTable( const SwTxtNode* pOwnChapterNode );
|
|
|
|
void UpdateSequence( const SwTxtNode* pOwnChapterNode );
|
|
|
|
void UpdateAuthorities( const SwTOXInternational& rIntl );
|
|
|
|
void UpdateAll();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2012-06-02 16:04:18 +02:00
|
|
|
// insert sorted into array for creation
|
2012-06-02 16:15:10 +02:00
|
|
|
void InsertSorted(SwTOXSortTabBase* pBase);
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2012-06-02 16:04:18 +02:00
|
|
|
// insert alpha delimiter at creation
|
2012-06-02 16:15:10 +02:00
|
|
|
void InsertAlphaDelimitter( const SwTOXInternational& rIntl );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2012-06-02 16:04:18 +02:00
|
|
|
// generate text body
|
2011-01-17 15:06:54 +01:00
|
|
|
void GenerateText( sal_uInt16 nArrayIdx,
|
|
|
|
sal_uInt16 nCount,
|
2003-04-17 09:11:03 +00:00
|
|
|
const sal_uInt32 _nTOXSectNdIdx,
|
|
|
|
const SwPageDesc* _pDefaultPageDesc );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2012-06-02 16:04:18 +02:00
|
|
|
// replace page num placeholder with actual page number
|
2012-06-02 16:15:10 +02:00
|
|
|
void _UpdatePageNum( SwTxtNode* pNd,
|
|
|
|
const std::vector<sal_uInt16>& rNums,
|
2012-06-22 13:26:58 +02:00
|
|
|
const std::vector<SwPageDesc*>& rDescs,
|
2012-06-02 16:15:10 +02:00
|
|
|
const std::vector<sal_uInt16>* pMainEntryNums,
|
|
|
|
const SwTOXInternational& rIntl );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2012-06-02 16:04:18 +02:00
|
|
|
// get section for entering keywords
|
2002-06-26 08:32:38 +00:00
|
|
|
Range GetKeyRange( const String& rStr, const String& rStrReading,
|
2011-01-17 15:06:54 +01:00
|
|
|
const SwTOXSortTabBase& rNew, sal_uInt16 nLevel,
|
2002-06-26 08:32:38 +00:00
|
|
|
const Range& rRange );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2012-06-02 16:04:18 +02:00
|
|
|
// return text collection via name/ from format pool
|
2011-01-17 15:06:54 +01:00
|
|
|
SwTxtFmtColl* GetTxtFmtColl( sal_uInt16 nLevel );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
public:
|
2010-03-16 11:28:29 +01:00
|
|
|
SwTOXBaseSection(SwTOXBase const& rBase, SwSectionFmt & rFmt);
|
2000-09-18 23:08:29 +00:00
|
|
|
virtual ~SwTOXBaseSection();
|
|
|
|
|
2012-06-02 16:04:18 +02:00
|
|
|
// <_bNewTOX> : distinguish between the creation of a new table-of-content
|
|
|
|
// (true) or an update of a table-of-content (false)
|
2003-04-17 09:11:03 +00:00
|
|
|
void Update( const SfxItemSet* pAttr = 0,
|
2012-06-02 16:04:18 +02:00
|
|
|
const bool _bNewTOX = false );
|
|
|
|
void UpdatePageNum(); // insert page numbering
|
|
|
|
TYPEINFO(); // for rtti
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2012-11-06 14:59:50 +09:00
|
|
|
bool SetPosAtStartEnd( SwPosition& rPos, bool bAtStart = true ) const;
|
2000-09-18 23:08:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct SwDefTOXBase_Impl
|
|
|
|
{
|
|
|
|
SwTOXBase* pContBase;
|
|
|
|
SwTOXBase* pIdxBase;
|
|
|
|
SwTOXBase* pUserBase;
|
|
|
|
SwTOXBase* pTblBase;
|
|
|
|
SwTOXBase* pObjBase;
|
|
|
|
SwTOXBase* pIllBase;
|
|
|
|
SwTOXBase* pAuthBase;
|
|
|
|
|
|
|
|
SwDefTOXBase_Impl() :
|
|
|
|
pContBase(0),
|
|
|
|
pIdxBase(0),
|
|
|
|
pUserBase(0),
|
|
|
|
pTblBase(0),
|
|
|
|
pObjBase(0),
|
|
|
|
pIllBase(0),
|
|
|
|
pAuthBase(0)
|
2012-06-02 16:15:10 +02:00
|
|
|
{
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
~SwDefTOXBase_Impl()
|
|
|
|
{
|
|
|
|
delete pContBase;
|
|
|
|
delete pIdxBase;
|
|
|
|
delete pUserBase;
|
|
|
|
delete pTblBase;
|
|
|
|
delete pObjBase;
|
|
|
|
delete pIllBase;
|
|
|
|
delete pAuthBase;
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2012-06-02 16:15:10 +02:00
|
|
|
#endif
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|