File indexing completed on 2024-04-21 05:50:33

0001 /*
0002     kfinddlg.h
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 
0006 */
0007 
0008 #ifndef KFINDDLG_H
0009 #define KFINDDLG_H
0010 
0011 #include <QDialog>
0012 #include <QLabel>
0013 
0014 #include <KDirWatch>
0015 #include <KFileItem>
0016 
0017 QT_FORWARD_DECLARE_CLASS(QDir)
0018 QT_FORWARD_DECLARE_CLASS(QString)
0019 QT_FORWARD_DECLARE_CLASS(QUrl)
0020 
0021 class KQuery;
0022 class KfindTabWidget;
0023 class KFindTreeView;
0024 class QPushButton;
0025 class QStatusBar;
0026 
0027 class KfindDlg : public QDialog
0028 {
0029     Q_OBJECT
0030 
0031 public:
0032     explicit KfindDlg(const QUrl &url, QWidget *parent = nullptr);
0033     ~KfindDlg() override;
0034     void copySelection();
0035 
0036     void setStatusMsg(const QString &);
0037     void setProgressMsg(const QString &);
0038 
0039 private:
0040     /*Return a QStringList of all subdirs of d*/
0041     QStringList getAllSubdirs(QDir d);
0042 
0043 public Q_SLOTS:
0044     void startSearch();
0045     void stopSearch();
0046     void newSearch();
0047     void addFiles(const QList< QPair<KFileItem, QString> > &);
0048     void setFocus();
0049     void slotResult(int);
0050 //  void slotSearchDone();
0051     void  about();
0052     void slotDeleteItem(const QString &);
0053     void slotNewItems(const QString &);
0054 
0055     void finishAndClose();
0056 
0057 Q_SIGNALS:
0058     void haveResults(bool);
0059     void resultSelected(bool);
0060 
0061 private:
0062     KfindTabWidget *tabWidget = nullptr;
0063     KFindTreeView *win = nullptr;
0064     QPushButton *m_saveAsButton = nullptr;
0065     QPushButton *m_stopButton = nullptr;
0066     QPushButton *m_findButton = nullptr;
0067     QStatusBar *mStatusBar = nullptr;
0068     QLabel *m_labelStatus = nullptr;
0069     QLabel *m_labelProgress = nullptr;
0070 
0071     bool isResultReported = false;
0072     KQuery *query = nullptr;
0073     KDirWatch *dirwatch = nullptr;
0074 };
0075 
0076 #endif