Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _DOCTXM_HXX
30 : : #define _DOCTXM_HXX
31 : :
32 : : #include <tools/gen.hxx>
33 : : #include <tox.hxx>
34 : : #include <section.hxx>
35 : :
36 : : class SwTOXInternational;
37 : : class SwPageDesc;
38 : : class SwTxtNode;
39 : : class SwTxtFmtColl;
40 : : struct SwPosition;
41 : : struct SwTOXSortTabBase;
42 : :
43 : : typedef std::vector<SwTOXSortTabBase*> SwTOXSortTabBases;
44 : :
45 : : class SwTOXBaseSection : public SwTOXBase, public SwSection
46 : : {
47 : : SwTOXSortTabBases aSortArr;
48 : :
49 : : void UpdateMarks( const SwTOXInternational& rIntl,
50 : : const SwTxtNode* pOwnChapterNode );
51 : : void UpdateOutline( const SwTxtNode* pOwnChapterNode );
52 : : void UpdateTemplate( const SwTxtNode* pOwnChapterNode );
53 : : void UpdateCntnt( SwTOXElement eType,
54 : : const SwTxtNode* pOwnChapterNode );
55 : : void UpdateTable( const SwTxtNode* pOwnChapterNode );
56 : : void UpdateSequence( const SwTxtNode* pOwnChapterNode );
57 : : void UpdateAuthorities( const SwTOXInternational& rIntl );
58 : : void UpdateAll();
59 : :
60 : : // insert sorted into array for creation
61 : : void InsertSorted(SwTOXSortTabBase* pBase);
62 : :
63 : : // insert alpha delimiter at creation
64 : : void InsertAlphaDelimitter( const SwTOXInternational& rIntl );
65 : :
66 : : // generate text body
67 : : void GenerateText( sal_uInt16 nArrayIdx,
68 : : sal_uInt16 nCount,
69 : : const sal_uInt32 _nTOXSectNdIdx,
70 : : const SwPageDesc* _pDefaultPageDesc );
71 : :
72 : : // replace page num placeholder with actual page number
73 : : void _UpdatePageNum( SwTxtNode* pNd,
74 : : const std::vector<sal_uInt16>& rNums,
75 : : const std::vector<SwPageDesc*>& rDescs,
76 : : const std::vector<sal_uInt16>* pMainEntryNums,
77 : : const SwTOXInternational& rIntl );
78 : :
79 : : // get section for entering keywords
80 : : Range GetKeyRange( const String& rStr, const String& rStrReading,
81 : : const SwTOXSortTabBase& rNew, sal_uInt16 nLevel,
82 : : const Range& rRange );
83 : :
84 : : // return text collection via name/ from format pool
85 : : SwTxtFmtColl* GetTxtFmtColl( sal_uInt16 nLevel );
86 : :
87 : : public:
88 : : SwTOXBaseSection(SwTOXBase const& rBase, SwSectionFmt & rFmt);
89 : : virtual ~SwTOXBaseSection();
90 : :
91 : : // <_bNewTOX> : distinguish between the creation of a new table-of-content
92 : : // (true) or an update of a table-of-content (false)
93 : : void Update( const SfxItemSet* pAttr = 0,
94 : : const bool _bNewTOX = false );
95 : : void UpdatePageNum(); // insert page numbering
96 : : TYPEINFO(); // for rtti
97 : :
98 : : sal_Bool SetPosAtStartEnd( SwPosition& rPos, sal_Bool bAtStart = sal_True ) const;
99 : : };
100 : :
101 : : struct SwDefTOXBase_Impl
102 : : {
103 : : SwTOXBase* pContBase;
104 : : SwTOXBase* pIdxBase;
105 : : SwTOXBase* pUserBase;
106 : : SwTOXBase* pTblBase;
107 : : SwTOXBase* pObjBase;
108 : : SwTOXBase* pIllBase;
109 : : SwTOXBase* pAuthBase;
110 : :
111 : 1549 : SwDefTOXBase_Impl() :
112 : : pContBase(0),
113 : : pIdxBase(0),
114 : : pUserBase(0),
115 : : pTblBase(0),
116 : : pObjBase(0),
117 : : pIllBase(0),
118 : 1549 : pAuthBase(0)
119 : : {
120 : 1549 : }
121 : 1458 : ~SwDefTOXBase_Impl()
122 : : {
123 [ - + ]: 1458 : delete pContBase;
124 [ - + ]: 1458 : delete pIdxBase;
125 [ - + ]: 1458 : delete pUserBase;
126 [ - + ]: 1458 : delete pTblBase;
127 [ - + ]: 1458 : delete pObjBase;
128 [ - + ]: 1458 : delete pIllBase;
129 [ - + ]: 1458 : delete pAuthBase;
130 : 1458 : }
131 : :
132 : : };
133 : :
134 : : #endif
135 : :
136 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|