Warning, file /office/calligra/libs/text/KoFind.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 Thomas Zander <zander@kde.org> 0003 * Copyright (C) 2008 Thorsten Zachmann <zachmann@kde.org> 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 #ifndef KOFIND_H 0021 #define KOFIND_H 0022 0023 #include "kotext_export.h" 0024 0025 #include <QObject> 0026 0027 class QTextDocument; 0028 class KoCanvasResourceManager; 0029 class KActionCollection; 0030 class KoFindPrivate; 0031 0032 /** 0033 * This controller class allows you to get the relevant find actions 0034 * added to your action collection and make them act similarly for all Calligra apps. 0035 */ 0036 class KOTEXT_EXPORT KoFind : public QObject 0037 { 0038 Q_OBJECT 0039 public: 0040 /** 0041 * Constructor for the KoFind controller. 0042 * You can create and forget this class in order to gain find features for your application. 0043 * @param parent the parent widget, used both as an anchor for the find dialog and for 0044 * memory management purposes. 0045 * @param canvasResourceManager the resource provider for the canvas, used to signal the text shape. 0046 * @param ac the action collection that the find actions can be added to. 0047 */ 0048 KoFind(QWidget *parent, KoCanvasResourceManager *canvasResourceManager, KActionCollection *ac); 0049 /// destructor 0050 ~KoFind() override; 0051 0052 Q_SIGNALS: 0053 /** 0054 * @brief This signal is send when the current document has reached its end 0055 * 0056 * Connect to this signal if you want to support find in multiple text shapes. 0057 * In you code you then should select the next text shape and select the text 0058 * tool. 0059 * 0060 * @param document The currently document where find was used. 0061 */ 0062 void findDocumentSetNext(QTextDocument *document); 0063 0064 /** 0065 * @brief This signal is send when the current document has reached its beginning 0066 * 0067 * Connect to this signal if you want to support find in multiple text shapes. 0068 * In you code you then should select the next text shape and select the text 0069 * tool. 0070 * 0071 * @param document The currently document where find was used. 0072 */ 0073 void findDocumentSetPrevious(QTextDocument *document); 0074 0075 private: 0076 KoFindPrivate * const d; 0077 friend class KoFindPrivate; 0078 0079 Q_PRIVATE_SLOT(d, void resourceChanged(int, const QVariant&)) 0080 Q_PRIVATE_SLOT(d, void findActivated()) 0081 Q_PRIVATE_SLOT(d, void findNextActivated()) 0082 Q_PRIVATE_SLOT(d, void findPreviousActivated()) 0083 Q_PRIVATE_SLOT(d, void replaceActivated()) 0084 Q_PRIVATE_SLOT(d, void startFind()) 0085 Q_PRIVATE_SLOT(d, void startReplace()) 0086 }; 0087 0088 #endif 0089