Warning, file /office/calligra/libs/text/KoSectionUtils.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 * Copyright (c) 2014 Denis Kuplyakov <dener.kup@gmail.com> 0003 * 0004 * This library is free software; you can redistribute it and/or 0005 * modify it under the terms of the GNU Lesser General Public 0006 * License as published by the Free Software Foundation; either 0007 * version 2.1 of the License, or (at your option) any later version. 0008 * 0009 * This library is distributed in the hope that it will be useful, 0010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0012 * Lesser General Public License for more details. 0013 * 0014 * You should have received a copy of the GNU Lesser General Public License 0015 * along with this library; see the file COPYING.LIB. If not, write to 0016 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0017 * Boston, MA 02110-1301, USA. 0018 */ 0019 #ifndef KOSECTIONUTILS_H 0020 #define KOSECTIONUTILS_H 0021 0022 #include <KoSection.h> 0023 #include <KoSectionEnd.h> 0024 0025 #include <QTextCursor> 0026 #include <QVariant> 0027 #include <QString> 0028 0029 namespace KoSectionUtils { 0030 /** 0031 * Moves the cursors to the next block within the same QTextFrame. 0032 * @param cur cursor to move, modified during call 0033 * @return @c false if there is no next block, @c true otherwise 0034 */ 0035 bool getNextBlock(QTextCursor &cur); 0036 0037 /** 0038 * Convenient function to set a list of startings to QTextBlockFormat. 0039 * This checks that list is empty. 0040 * 0041 * @param fmt QTextBlockFormat reference to set startings. 0042 * @param list QList<KoSection *> is a list to set. 0043 */ 0044 KOTEXT_EXPORT void setSectionStartings(QTextBlockFormat &fmt, const QList<KoSection *> &list); 0045 0046 /** 0047 * Convenient function to set a list of endings to QTextBlockFormat. 0048 * This checks that list is empty. 0049 * 0050 * @param fmt QTextBlockFormat reference to set endings. 0051 * @param list QList<KoSectionEnd *> is a list to set. 0052 */ 0053 KOTEXT_EXPORT void setSectionEndings(QTextBlockFormat& fmt, const QList<KoSectionEnd *> &list); 0054 0055 /** 0056 * Convenient function to get section startings from QTextBlockFormat. 0057 * @param fmt QTextBlockFormat format to retrieve section startings from. 0058 * @return QList<KoSection *> that contains pointers to sections that start 0059 * according to QTextBlockFormat. 0060 */ 0061 KOTEXT_EXPORT QList<KoSection *> sectionStartings(const QTextBlockFormat &fmt); 0062 0063 /** 0064 * Convenient function to get section endings from QTextBlockFormat. 0065 * @param fmt QTextBlockFormat format to retrieve section startings from. 0066 * @return QList<KoSectionEnd *> that contains pointers to sections that end 0067 * according to QTextBlockFormat. 0068 */ 0069 KOTEXT_EXPORT QList<KoSectionEnd *> sectionEndings(const QTextBlockFormat& fmt); 0070 0071 } 0072 0073 #endif //KOSECTIONUTILS_H