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

0001 /*
0002     kftabdlg.h
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 
0006 */
0007 
0008 #ifndef KFTABDLG_H
0009 #define KFTABDLG_H
0010 
0011 #include <QMimeType>
0012 #include <QTabWidget>
0013 #include <QUrl>
0014 
0015 class KUrlComboBox;
0016 class QButtonGroup;
0017 class QPushButton;
0018 class QRadioButton;
0019 class QCheckBox;
0020 class KLineEdit;
0021 class QString;
0022 class KDateComboBox;
0023 class KComboBox;
0024 class QSpinBox;
0025 class QLabel;
0026 
0027 class KfDirDialog;
0028 
0029 class KfindTabWidget : public QTabWidget
0030 {
0031     Q_OBJECT
0032 
0033 public:
0034     explicit KfindTabWidget(QWidget *parent = nullptr);
0035     ~KfindTabWidget() override;
0036     void setQuery(class KQuery *query);
0037     void setDefaults();
0038 
0039     void beginSearch();
0040     void endSearch();
0041     void loadHistory();
0042     void saveHistory();
0043     bool isSearchRecursive();
0044 
0045     void setURL(const QUrl &url);
0046 
0047     QSize sizeHint() const override;
0048 
0049 public Q_SLOTS:
0050     void setFocus();
0051     void slotUpdateDateLabelsForNumber(int value);
0052     void slotUpdateDateLabelsForType(int index);
0053     void slotUpdateByteComboBox(int value);
0054 
0055 private Q_SLOTS:
0056     void getDirectory();
0057     void fixLayout();
0058     void slotSizeBoxChanged(int);
0059 
0060 Q_SIGNALS:
0061     void startSearch();
0062 
0063 protected:
0064 public:
0065     KComboBox *nameBox;
0066     KUrlComboBox *dirBox;
0067     // for first page
0068     QCheckBox *subdirsCb;
0069     QCheckBox *useLocateCb;
0070     QCheckBox *hiddenFilesCb;
0071     // for third page
0072     KComboBox *typeBox;
0073     KLineEdit *textEdit;
0074     QCheckBox *caseSensCb;
0075     KComboBox *m_usernameBox;
0076     KComboBox *m_groupBox;
0077     //for fourth page
0078     KLineEdit *metainfoEdit;
0079     KLineEdit *metainfokeyEdit;
0080 
0081 private:
0082     bool isDateValid();
0083     void fillDirBox();
0084 
0085     void updateDateLabels(int type, int value);
0086 
0087     QWidget *pages[3];
0088 
0089     //1st page
0090     QPushButton *browseB;
0091 
0092     KfDirDialog *dirselector;
0093 
0094     //2nd page
0095     QCheckBox *findCreated;
0096     KComboBox *betweenType;
0097     QLabel *andL;
0098     QButtonGroup *bg;
0099     QRadioButton *rb[2];
0100     KDateComboBox *fromDate;
0101     KDateComboBox *toDate;
0102     QSpinBox *timeBox;
0103 
0104     //3rd page
0105     KComboBox *sizeBox;
0106     KComboBox *sizeUnitBox;
0107     QSpinBox *sizeEdit;
0108     QCheckBox *caseContextCb;
0109     QCheckBox *binaryContextCb;
0110 
0111     QUrl m_url;
0112 
0113     QList<QMimeType> m_types;
0114     QStringList m_ImageTypes;
0115     QStringList m_VideoTypes;
0116     QStringList m_AudioTypes;
0117 };
0118 
0119 #endif