Missed one file
[pierogi] / pirselectkeysetform.h
1 #ifndef PIRSELECTKEYSETFORM_H
2 #define PIRSELECTKEYSETFORM_H
3
4 #include <QWidget>
5 #include <QString>
6
7 #include "pirmakenames.h"
8
9 class QListWidget;
10 class QListWidgetItem;
11 class PIRKeysetWidgetItem;
12 class QKeyEvent;
13 class PIREditKeysetDialog;
14 class MainWindow;
15
16 namespace Ui {
17 class PIRSelectKeysetForm;
18 }
19
20 class PIRSelectKeysetForm : public QWidget
21 {
22   Q_OBJECT
23   
24 public:
25 //  explicit PIRSelectKeysetForm(QWidget *parent = 0);
26
27   PIRSelectKeysetForm(
28     MainWindow *mw);
29
30   ~PIRSelectKeysetForm();
31
32 /*
33   void addNameToList(
34     QString name,
35     unsigned int index,
36     PIRMakeName make);
37 */
38
39   void addWidgetItem(
40     PIRKeysetWidgetItem *kwi);
41
42   // This is a bit of a hack, but not sure how to create a connection otherwise.
43   QListWidget *getKeysetListWidget();
44
45   bool selectNextKeyset();
46   bool selectPrevKeyset();
47
48   QString getKeysetName();
49
50 protected:
51   void keyPressEvent(
52     QKeyEvent *event);
53
54 private slots:
55   void filterListByMake(
56     int make);
57
58   void filterListByString(
59     QString string);
60
61   void openKeysetDialog(
62     QListWidgetItem *);
63   
64   void on_searchStringLineEdit_textChanged(const QString &arg1);
65   void on_ssClosePushButton_clicked();
66   void on_showFavoritesCheckBox_toggled(bool checked);
67
68 private:
69   void refilterList();
70
71   Ui::PIRSelectKeysetForm *ui;
72
73   MainWindow *mainWindow;
74   PIREditKeysetDialog *editDialog;
75
76   bool showOnlyFavorites;
77   PIRMakeName currentMake;
78   QString searchString;
79 };
80
81 #endif // PIRSELECTKEYSETFORM_H