| 1 | /* |
| 2 | This file is part of the KDE project |
| 3 | SPDX-FileCopyrightText: 2001 S.R. Haque <srhaque@iee.org>. |
| 4 | SPDX-FileCopyrightText: 2002 David Faure <david@mandrakesoft.com> |
| 5 | |
| 6 | SPDX-License-Identifier: LGPL-2.0-only |
| 7 | */ |
| 8 | |
| 9 | #ifndef KFINDDIALOG_P_H |
| 10 | #define KFINDDIALOG_P_H |
| 11 | |
| 12 | #include "kfind.h" |
| 13 | #include "kfinddialog.h" |
| 14 | |
| 15 | #include <QStringList> |
| 16 | |
| 17 | class KHistoryComboBox; |
| 18 | |
| 19 | class QCheckBox; |
| 20 | class QDialogButtonBox; |
| 21 | class QGridLayout; |
| 22 | class QGroupBox; |
| 23 | class ; |
| 24 | class QPushButton; |
| 25 | |
| 26 | class KFindDialogPrivate |
| 27 | { |
| 28 | Q_DECLARE_PUBLIC(KFindDialog) |
| 29 | |
| 30 | public: |
| 31 | KFindDialogPrivate(KFindDialog *qq) |
| 32 | : q_ptr(qq) |
| 33 | , regexpDialog(nullptr) |
| 34 | , regexpDialogQueryDone(false) |
| 35 | , initialShowDone(false) |
| 36 | , enabled(KFind::WholeWordsOnly | KFind::FromCursor | KFind::SelectedText | KFind::CaseSensitive | KFind::FindBackwards | KFind::RegularExpression) |
| 37 | , findExtension(nullptr) |
| 38 | , buttonBox(nullptr) |
| 39 | { |
| 40 | } |
| 41 | virtual ~KFindDialogPrivate() = default; |
| 42 | |
| 43 | void init(bool forReplace, const QStringList &findStrings, bool hasSelection); |
| 44 | |
| 45 | void slotPlaceholdersAboutToShow(); |
| 46 | void slotOk(); |
| 47 | void slotReject(); |
| 48 | void slotSelectedTextToggled(bool); |
| 49 | void showPatterns(); |
| 50 | void showPlaceholders(); |
| 51 | void textSearchChanged(const QString &); |
| 52 | |
| 53 | KFindDialog *const q_ptr = nullptr; |
| 54 | QDialog *regexpDialog = nullptr; |
| 55 | bool regexpDialogQueryDone : 1; |
| 56 | bool initialShowDone : 1; |
| 57 | long enabled; // uses Options to define which search options are enabled |
| 58 | QStringList findStrings; |
| 59 | QString pattern; |
| 60 | mutable QWidget *findExtension = nullptr; |
| 61 | QDialogButtonBox *buttonBox = nullptr; |
| 62 | |
| 63 | QGroupBox *findGrp = nullptr; |
| 64 | KHistoryComboBox *find = nullptr; |
| 65 | QCheckBox *regExp = nullptr; |
| 66 | QPushButton *regExpItem = nullptr; |
| 67 | QGridLayout *findLayout = nullptr; |
| 68 | |
| 69 | QCheckBox *wholeWordsOnly = nullptr; |
| 70 | QCheckBox *fromCursor = nullptr; |
| 71 | QCheckBox *selectedText = nullptr; |
| 72 | QCheckBox *caseSensitive = nullptr; |
| 73 | QCheckBox *findBackwards = nullptr; |
| 74 | |
| 75 | QMenu *patterns = nullptr; |
| 76 | |
| 77 | // for the replace dialog |
| 78 | |
| 79 | QGroupBox *replaceGrp = nullptr; |
| 80 | KHistoryComboBox *replace = nullptr; |
| 81 | QCheckBox *backRef = nullptr; |
| 82 | QPushButton *backRefItem = nullptr; |
| 83 | QGridLayout *replaceLayout = nullptr; |
| 84 | |
| 85 | QCheckBox *promptOnReplace = nullptr; |
| 86 | |
| 87 | QMenu *placeholders = nullptr; |
| 88 | }; |
| 89 | |
| 90 | #endif // KFINDDIALOG_P_H |
| 91 | |