New GUI, many changes
[pierogi] / mainwindow.h
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3
4 #include <QtGui/QMainWindow>
5
6 #include "pirkeynames.h"
7 #include "pirpanelnames.h"
8 #include "pirmodprobe.h"
9
10 class QListWidget;
11 class QListWidgetItem;
12 class PIRSelectKeysetForm;
13 class PIRSelectDeviceForm;
14 class PIRPanelSelectionForm;
15 class PIRDocumentationForm;
16 class PIRAboutForm;
17 class PIRKeysetManager;
18 class PIRPanelManager;
19
20 namespace Ui {
21     class MainWindow;
22 }
23
24 class MainWindow : public QMainWindow
25 {
26   Q_OBJECT
27
28 public:
29   enum ScreenOrientation {
30     ScreenOrientationLockPortrait,
31     ScreenOrientationLockLandscape,
32     ScreenOrientationAuto
33   };
34
35   explicit MainWindow(QWidget *parent = 0);
36   virtual ~MainWindow();
37
38   // Note that this will only have an effect on Symbian and Fremantle.
39   void setOrientation(ScreenOrientation orientation);
40
41   void showExpanded();
42
43   void startRepeating(
44     PIRKeyName name);
45
46   void stopRepeating();
47
48   void managePanel(
49     PIRPanelName name,
50     int state);
51
52   void insertPanel(
53     int index,
54     QWidget *panel,
55     const QString &displayName);
56
57   void removePanel(
58     int index,
59     QWidget *panel);
60
61   // Favorites panel actions:
62   void addCurrentKeyset(
63     QListWidget *qlw);
64
65   void removeFavoriteKeyset(
66     QListWidget *qlw);
67
68   void enableButtons();
69
70 signals:
71   void buttonPressed(
72     unsigned int keysetID,
73     PIRKeyName name);
74
75   void buttonReleased();
76
77 public slots:
78   void receivedExternalWarning(
79     const char *warning);
80
81   void selectPrevFavKeyset();
82   void selectNextFavKeyset();
83
84   void keysetSelectionChanged(
85     QListWidgetItem *item);
86
87 private slots:
88   void on_actionSelectKeyset_triggered();
89   void on_actionSelect_Device_By_Name_triggered();
90   void on_actionArrange_Button_Panels_triggered();
91   void on_actionAbout_triggered();
92   void on_actionDocumentation_triggered();
93
94   void on_prevPanelButton_clicked();
95   void on_nextPanelButton_clicked();
96   void on_selectPanelComboBox_currentIndexChanged(int index);
97
98   // Internal actions:
99   void finalCleanup();
100
101 private:
102   void populateFavorites();
103 //  void setupTabs();
104
105   Ui::MainWindow *ui;
106
107   PIRSelectKeysetForm *selectKeysetForm;
108   PIRSelectDeviceForm *selectDeviceForm;
109   PIRPanelSelectionForm *panelSelectionForm;
110   PIRDocumentationForm *documentationForm;
111   PIRAboutForm *aboutForm;
112
113   PIRKeysetManager *myKeysets;
114   PIRPanelManager *myPanels;
115
116   unsigned int currentKeyset;
117
118   PIRModprobe modprobeObj;
119 };
120
121
122 #endif // MAINWINDOW_H