Warning, file /office/calligra/libs/text/KoFind_p.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 Fredy Yanardi <fyanardi@gmail.com>
0004  * Copyright (C) 2008 Thorsten Zachmann <zachmann@kde.org>
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Library General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Library General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Library General Public License
0017  * along with this library; see the file COPYING.LIB.  If not, write to
0018  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0019  * Boston, MA 02110-1301, USA.
0020  */
0021 
0022 #ifndef KOFIND_P_H
0023 #define KOFIND_P_H
0024 
0025 #include <QTextCursor>
0026 
0027 #include "KoFindStrategy.h"
0028 #include "KoReplaceStrategy.h"
0029 #include "FindDirection_p.h"
0030 
0031 class KoFind;
0032 class KoCanvasResourceManager;
0033 class QAction;
0034 class QTextDocument;
0035 class QVariant;
0036 class QWidget;
0037 
0038 class KoFindPrivate
0039 {
0040 public:
0041     KoFindPrivate(KoFind *find, KoCanvasResourceManager *crp, QWidget *w);
0042 
0043     void resourceChanged(int key, const QVariant &variant);
0044 
0045     void findActivated();
0046 
0047     void findNextActivated();
0048 
0049     void findPreviousActivated();
0050 
0051     void replaceActivated();
0052 
0053     // executed when the user presses the 'find' button.
0054     void startFind();
0055 
0056     // executed when the user presses the 'replace' button.
0057     void startReplace();
0058 
0059     QAction *findNext;
0060     QAction *findPrev;
0061 
0062     void findDocumentSetNext(QTextDocument * document);
0063     void findDocumentSetPrevious(QTextDocument * document);
0064 
0065 protected:
0066     void parseSettingsAndFind();
0067 
0068 private:
0069     KoFind * q;
0070     KoCanvasResourceManager *provider;
0071     KoFindStrategy findStrategy; /// strategy used for find
0072     KoReplaceStrategy replaceStrategy; /// strategy used for replace
0073     KoFindStrategyBase * strategy; /// the current strategy used
0074 
0075     QTextDocument *document;
0076     QTextDocument *startDocument;
0077     QTextCursor lastKnownPosition;
0078     bool restarted;
0079     bool start; /// if true find/replace is restarted
0080     bool inFind; /// if true find/replace is running (not showing the dialog)
0081     QTextCursor startPosition;
0082     QTextCursor endPosition;
0083     FindDirection * findDirection; /// the current direction used
0084     FindForward findForward;
0085     FindBackward findBackward;
0086 };
0087 
0088 #endif /* KOFIND_P_H */