File indexing completed on 2024-04-21 03:58:27

0001 /*
0002     This file is part of the KDE project
0003     SPDX-FileCopyrightText: 2001 S.R. Haque <srhaque@iee.org>.
0004     SPDX-FileCopyrightText: 2002 David Faure <david@mandrakesoft.com>
0005 
0006     SPDX-License-Identifier: LGPL-2.0-only
0007 */
0008 
0009 #ifndef KFINDDIALOG_P_H
0010 #define KFINDDIALOG_P_H
0011 
0012 #include "kfind.h"
0013 #include "kfinddialog.h"
0014 
0015 #include <QStringList>
0016 
0017 class KHistoryComboBox;
0018 
0019 class QCheckBox;
0020 class QDialogButtonBox;
0021 class QGridLayout;
0022 class QGroupBox;
0023 class QMenu;
0024 class QPushButton;
0025 
0026 class KFindDialogPrivate
0027 {
0028     Q_DECLARE_PUBLIC(KFindDialog)
0029 
0030 public:
0031     KFindDialogPrivate(KFindDialog *qq)
0032         : q_ptr(qq)
0033         , regexpDialog(nullptr)
0034         , regexpDialogQueryDone(false)
0035         , initialShowDone(false)
0036         , enabled(KFind::WholeWordsOnly | KFind::FromCursor | KFind::SelectedText | KFind::CaseSensitive | KFind::FindBackwards | KFind::RegularExpression)
0037         , findExtension(nullptr)
0038         , buttonBox(nullptr)
0039     {
0040     }
0041     virtual ~KFindDialogPrivate() = default;
0042 
0043     void init(bool forReplace, const QStringList &findStrings, bool hasSelection);
0044 
0045     void slotPlaceholdersAboutToShow();
0046     void slotOk();
0047     void slotReject();
0048     void slotSelectedTextToggled(bool);
0049     void showPatterns();
0050     void showPlaceholders();
0051     void textSearchChanged(const QString &);
0052 
0053     KFindDialog *const q_ptr = nullptr;
0054     QDialog *regexpDialog = nullptr;
0055     bool regexpDialogQueryDone : 1;
0056     bool initialShowDone : 1;
0057     long enabled; // uses Options to define which search options are enabled
0058     QStringList findStrings;
0059     QString pattern;
0060     mutable QWidget *findExtension = nullptr;
0061     QDialogButtonBox *buttonBox = nullptr;
0062 
0063     QGroupBox *findGrp = nullptr;
0064     KHistoryComboBox *find = nullptr;
0065     QCheckBox *regExp = nullptr;
0066     QPushButton *regExpItem = nullptr;
0067     QGridLayout *findLayout = nullptr;
0068 
0069     QCheckBox *wholeWordsOnly = nullptr;
0070     QCheckBox *fromCursor = nullptr;
0071     QCheckBox *selectedText = nullptr;
0072     QCheckBox *caseSensitive = nullptr;
0073     QCheckBox *findBackwards = nullptr;
0074 
0075     QMenu *patterns = nullptr;
0076 
0077     // for the replace dialog
0078 
0079     QGroupBox *replaceGrp = nullptr;
0080     KHistoryComboBox *replace = nullptr;
0081     QCheckBox *backRef = nullptr;
0082     QPushButton *backRefItem = nullptr;
0083     QGridLayout *replaceLayout = nullptr;
0084 
0085     QCheckBox *promptOnReplace = nullptr;
0086 
0087     QMenu *placeholders = nullptr;
0088 };
0089 
0090 #endif // KFINDDIALOG_P_H