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