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>
10 #include <QVBoxLayout>
26 class EditFilterDialog
: public KDialog
30 EditFilterDialog( QWidget
* parent
, bool metaBundleKeywords
, const QString
&text
= "" );
33 QString
filter() const;
36 void filterChanged( const QString
&filter
);
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
;
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 "-"
75 void exclusiveSelectOf( int which
);
76 QString
keywordConditionString(const QString
& keyword
) const;
77 void setMinMaxValueSpins();
80 void selectedKeyword(int index
);
82 void minSpinChanged(int value
);
83 void maxSpinChanged(int value
);
86 void textWanted( const QStringList
&completions
);
89 void chooseCondition(int index
);
90 void chooseOneValue();
91 void chooseMinMaxValue();
94 void slotCheckAtLeastOne();
95 void slotCheckExactly();
96 void slotCheckExclude();
101 void assignPrefixNOT();
104 virtual void slotDefault();
105 virtual void slotUser1();
106 virtual void slotUser2();
107 virtual void slotOk();
110 #endif /* AMAROK_EDITFILTERDIALOG_H */