Warning, file /office/calligra/libs/textlayout/ToCGenerator.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* This file is part of the KDE project 0002 * Copyright (C) 2010 Thomas Zander <zander@kde.org> 0003 * Copyright (C) 2011 Pavol Korinek <pavol.korinek@ixonos.com> 0004 * Copyright (C) 2011 Lukáš Tvrdý <lukas.tvrdy@ixonos.com> 0005 * Copyright (C) 2011 Ko GmbH <cbo@kogmbh.com> 0006 * 0007 * This library is free software; you can redistribute it and/or 0008 * modify it under the terms of the GNU Library General Public 0009 * License as published by the Free Software Foundation; either 0010 * version 2 of the License, or (at your option) any later version. 0011 * 0012 * This library is distributed in the hope that it will be useful, 0013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0015 * Library General Public License for more details. 0016 * 0017 * You should have received a copy of the GNU Library General Public License 0018 * along with this library; see the file COPYING.LIB. If not, write to 0019 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0020 * Boston, MA 02110-1301, USA. 0021 */ 0022 #ifndef TOCGENERATOR_H 0023 #define TOCGENERATOR_H 0024 0025 #include <QTextBlock> 0026 #include <QObject> 0027 0028 class KoTextRangeManager; 0029 class KoTextDocumentLayout; 0030 class KoTableOfContentsGeneratorInfo; 0031 0032 class QTextDocument; 0033 0034 class ToCGenerator : public QObject 0035 { 0036 Q_OBJECT 0037 public: 0038 explicit ToCGenerator(QTextDocument *tocDocument, KoTableOfContentsGeneratorInfo *tocInfo); 0039 ~ToCGenerator() override; 0040 0041 virtual void setBlock(const QTextBlock &block); 0042 0043 bool generate(); 0044 0045 private: 0046 QString resolvePageNumber(const QTextBlock &headingBlock); 0047 void generateEntry(int outlineLevel, QTextCursor &cursor, QTextBlock &block, int &blockId); 0048 0049 QTextDocument *m_ToCDocument; 0050 KoTableOfContentsGeneratorInfo *m_ToCInfo; 0051 QTextBlock m_block; 0052 QTextDocument *m_document; 0053 KoTextDocumentLayout *m_documentLayout; 0054 bool m_success; 0055 bool m_preservePagebreak; 0056 0057 // Return the ref (name) of the first KoBookmark in the block, if KoBookmark not found, null QString is returned 0058 QString fetchBookmarkRef(const QTextBlock &block, KoTextRangeManager *textRangeManager); 0059 }; 0060 0061 #endif