Not crap after all...
[amarok.git] / src / editfilterdialog.h
blobf3b205a5604cb94f72d9d5c52e750522ae3ac6e2
1 // (c) 2006 Giovanni Venturi <giovanni@kde-it.org>
2 // See COPYING file for licensing information.
4 #ifndef AMAROK_EDITFILTERDIALOG_H
5 #define AMAROK_EDITFILTERDIALOG_H
7 #include <q3valuelist.h>
8 #include <q3valuevector.h>
9 //Added by qt3to4:
10 #include <QVBoxLayout>
11 #include <QLabel>
13 #include <kdialog.h>
15 class QWidget;
16 class QVBoxLayout;
17 class QComboBox;
18 class QCheckBox;
19 class QLineEdit;
20 class QRadioButton;
21 class Q3GroupBox;
22 class QSpinBox;
23 class QStringList;
24 class KComboBox;
26 class EditFilterDialog : public KDialog
28 Q_OBJECT
29 public:
30 EditFilterDialog( QWidget* parent, bool metaBundleKeywords, const QString &text = "" );
31 ~EditFilterDialog();
33 QString filter() const;
35 signals:
36 void filterChanged( const QString &filter );
38 private:
39 QVBoxLayout *m_mainLay;
41 QCheckBox *m_prefixNOT;
42 QComboBox *m_comboKeyword;
43 KLineEdit *m_editKeyword;
45 Q3GroupBox *m_groupBox;
47 QComboBox *m_comboCondition;
48 QLabel *m_filesizeLabel;
49 QComboBox *m_comboUnitSize;
51 QRadioButton *m_minMaxRadio;
52 QSpinBox *m_spinMin1, *m_spinMin2;
53 QLabel *m_andLabel;
54 QSpinBox *m_spinMax1, *m_spinMax2;
56 Q3GroupBox *m_groupBox2;
57 QRadioButton *m_checkALL;
58 QRadioButton *m_checkAtLeastOne;
59 QRadioButton *m_checkExactly;
60 QRadioButton *m_checkExclude;
61 Q3ValueList<QRadioButton*> m_actionCheck;
63 Q3GroupBox *m_groupBox3;
64 QRadioButton *m_checkAND;
65 QRadioButton *m_checkOR;
67 bool m_appended; // true if a filter appended
68 int m_selectedIndex; // the position of the selected keyword in the combobox
69 Q3ValueVector<QString> m_vector; // the vector of the amarok filter keyword
70 QString m_filterText; // the resulting filter string
71 QString m_previousFilterText; // the previous resulting filter string
72 QString m_strPrefixNOT; // is empty if no NOT prefix is needed else it's "-"
74 private:
75 void exclusiveSelectOf( int which );
76 QString keywordConditionString(const QString& keyword) const;
77 void setMinMaxValueSpins();
79 private slots:
80 void selectedKeyword(int index);
82 void minSpinChanged(int value);
83 void maxSpinChanged(int value);
85 void textWanted();
86 void textWanted( const QStringList &completions );
87 void valueWanted();
89 void chooseCondition(int index);
90 void chooseOneValue();
91 void chooseMinMaxValue();
93 void slotCheckAll();
94 void slotCheckAtLeastOne();
95 void slotCheckExactly();
96 void slotCheckExclude();
98 void slotCheckAND();
99 void slotCheckOR();
101 void assignPrefixNOT();
103 protected slots:
104 virtual void slotDefault();
105 virtual void slotUser1();
106 virtual void slotUser2();
107 virtual void slotOk();
110 #endif /* AMAROK_EDITFILTERDIALOG_H */