1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: QT C++ main window Class. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef MAINWINDOW_H_ |
|
19 #define MAINWINDOW_H_ |
|
20 |
|
21 #include <QMainWindow> |
|
22 #include <QtGui> |
|
23 |
|
24 // Forward declarations |
|
25 class QAction; |
|
26 class QTabWidget; |
|
27 class QPushButton; |
|
28 class QWidget; |
|
29 class QMenu; |
|
30 class DialogAddTests; |
|
31 class DialogSettings; |
|
32 class TabWidgetTestRun; |
|
33 class QTreeWidgetItem; |
|
34 class QKeyEvent; |
|
35 class Settings; |
|
36 class DialogMsg; |
|
37 |
|
38 class MainWindow : public QMainWindow |
|
39 { |
|
40 Q_OBJECT |
|
41 |
|
42 public: |
|
43 // ctor and dtor |
|
44 MainWindow(QWidget* parent = 0); |
|
45 ~MainWindow(); |
|
46 |
|
47 private: |
|
48 void setTitle(); |
|
49 void load(); |
|
50 void createMenu(); |
|
51 void loadMenu(); |
|
52 void createTabWidget(); |
|
53 void loadTabWidget(); |
|
54 void createDialogs(); |
|
55 void setupMenuEventHandlers(); |
|
56 void setupDialogEventHandlers(); |
|
57 void setupTabWidgetEventHandlers(); |
|
58 void setupKeyEventHandlers(); |
|
59 void SetStyle(const QString&); |
|
60 |
|
61 public: |
|
62 void keyPressEvent(QKeyEvent *); |
|
63 |
|
64 signals: |
|
65 void testsAdded(QStringList); |
|
66 |
|
67 // Key press events |
|
68 void leftArrowPressed(); |
|
69 void rightArrowPressed(); |
|
70 void upArrowPressed(); |
|
71 void downArrowPressed(); |
|
72 void enterPressed(); |
|
73 |
|
74 private slots: |
|
75 void popupDialogAddTests(); |
|
76 void popupDialogSettings(); |
|
77 void popupDialogAbout(); |
|
78 |
|
79 void changCurrentTabToTests(bool hasTests); |
|
80 void changCurrentTabToExecution(); |
|
81 void enableMenuMarkUnmark(); |
|
82 void setRunMarkUnmarkEnabled(bool noneSelected, bool allSelected, bool curSelected); |
|
83 |
|
84 private: |
|
85 /* |
|
86 * Menu Items. |
|
87 */ |
|
88 // Cases |
|
89 QAction* atnAddTests; |
|
90 QMenu* menuMarkUnmark; |
|
91 QAction* atnMark; |
|
92 QAction* atnMarkAll; |
|
93 QAction* atnUnmark; |
|
94 QAction* atnUnmarkAll; |
|
95 QAction* atnRun; |
|
96 QAction* atnSettings; |
|
97 // App |
|
98 QAction* atnAbout; |
|
99 QAction* atnExit; |
|
100 |
|
101 // Add Tests dialog |
|
102 DialogAddTests* dlgAddTests; |
|
103 |
|
104 // Settings dialog |
|
105 DialogSettings* dlgSettings; |
|
106 |
|
107 // Tab widget containing cases list and result of execution. |
|
108 TabWidgetTestRun* tabWdgtTestRun; |
|
109 |
|
110 // About dialog |
|
111 DialogMsg* dlgAbout; |
|
112 }; |
|
113 |
|
114 #endif /* MAINWINDOW_H_ */ |
|