Warning, file /office/calligra/libs/text/KoBookmarkManager.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) 2007 Fredy Yanardi <fyanardi@gmail.com>
0003  * Copyright (C) 2012 C. Boemann <cbo@boemann.dk>
0004  *
0005  * This library is free software; you can redistribute it and/or
0006  * modify it under the terms of the GNU Library General Public
0007  * License as published by the Free Software Foundation; either
0008  * version 2 of the License, or (at your option) any later version.
0009  *
0010  * This library is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013  * Library General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU Library General Public License
0016  * along with this library; see the file COPYING.LIB.  If not, write to
0017  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0018  * Boston, MA 02110-1301, USA.
0019  */
0020 
0021 #ifndef KOBOOKMARKMANAGER_H
0022 #define KOBOOKMARKMANAGER_H
0023 
0024 #include "kotext_export.h"
0025 
0026 #include <QObject>
0027 #include <QList>
0028 #include <QString>
0029 
0030 class KoBookmark;
0031 class KoBookmarkManagerPrivate;
0032 
0033 /**
0034  * A manager for all bookmarks in a document. Every bookmark is identified by a unique name.
0035  * Note that only SinglePosition and StartBookmark bookmarks can be retrieved from this
0036  * manager. An end bookmark should be retrieved from it's parent (StartBookmark) using
0037  * KoBookmark::endBookmark()
0038  * This class also maintains a list of bookmark names so that it can be easily used to
0039  * show all available bookmark.
0040  */
0041 class KOTEXT_EXPORT KoBookmarkManager : public QObject
0042 {
0043     Q_OBJECT
0044 public:
0045     /// constructor
0046     KoBookmarkManager();
0047     ~KoBookmarkManager() override;
0048 
0049     /// @return a bookmark with the specified name, or 0 if there is none
0050     KoBookmark *bookmark(const QString &name) const;
0051 
0052     /// @return a list of QString containing all bookmark names
0053     QList<QString> bookmarkNameList() const;
0054 
0055 public Q_SLOTS:
0056     /**
0057      * Insert a new bookmark to this manager. The name of the bookmark
0058      * will be set to @p name, no matter what name has been set on
0059      * it.
0060      * @param name the name of the bookmark
0061      * @param bookmark the bookmark object to insert
0062      */
0063     void insert(const QString &name, KoBookmark *bookmark);
0064 
0065     /**
0066      * Remove a bookmark from this manager.
0067      * @param name the name of the bookmark to remove
0068      */
0069     void remove(const QString &name);
0070 
0071     /**
0072      * Rename a bookmark
0073      * @param oldName the old name of the bookmark
0074      * @param newName the new name of the bookmark
0075      */
0076     void rename(const QString &oldName, const QString &newName);
0077 
0078 private:
0079     KoBookmarkManagerPrivate * const d;
0080 };
0081 
0082 #endif