test
[push-it] / src / mainwindow.h
1 /*
2     Copyright (C) <2010>  <Markus Scharnowski markus.scharnowski@gmail.com>
3
4     This program is free software: you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation, either version 3 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 */
17 #ifndef MAINWINDOW_H
18 #define MAINWINDOW_H
19
20 #include <QMainWindow>
21 #include <QTimer>
22 #include <QPushButton>
23 #include <QAction>
24 #include <QMenuBar>
25 #include "fullscreenexitbutton.h"
26 #include "timekeeper.h"
27 #include <stdio.h>
28
29 class MainWindow : public QMainWindow
30 {
31     Q_OBJECT
32
33 public:
34     explicit MainWindow(QWidget *parent = 0);
35     ~MainWindow();
36
37   public slots:
38     void mainButtonRefresh();
39     void mainButtonRefreshTextOnly();
40     void resetProgram();
41     void resetProgramAndFullscreen();
42     void pauseCounting();
43     void mainButtonTimeoutUpdate();
44     void saveToFile();
45     void toggleFullDate();
46     void toggleTimeDate();
47     void about();
48     void showFullList();
49     void showFullScreenHandler();
50     void slotFullscreenExit();
51     void changeNumberOfLines(int number = 0);
52     void changeFontSize(int size = 0);
53
54 private:
55     int resetCounters();
56     int resetUi();
57     int updateTime();
58     int toggleTimer();
59     int toggleActionPause();
60     int updateUiText();
61
62     void setupUi();
63     void retranslateUi();
64
65     QAction *actionReset;
66     QAction *actionResetFs;
67     QAction *actionSimulated_click;
68     QAction *actionPause;
69     QAction *actionShow_full_list;
70     QAction *actionSave_full_list;
71     QAction *actionAbout;
72     QAction *actionEnable_full_date;
73     QAction *actionEnable_time_and_date;
74     QAction *action_Fullscreen;
75     QAction *actionChangeNumberOfLines;
76     QAction *actionChangeFontSize;
77     QWidget *centralWidget;
78     QPushButton *mainButton;
79     QMenuBar *menuBar;
80     QMenu *menuPush_It_Menu;
81     QMenu *menuHelp;
82     QMenu *menuData;
83     QMenu *menuView;
84     FullScreenExitButton *fsExitButton;
85
86     QString generateHistoryString();
87     QString getHeaderLine();
88
89     class timeKeeper overallTime;
90
91     char mainButtonStartText[BUFSIZ];
92     QTimer *timer;
93     QString completeString;
94     int hitCount;
95     int timerRefreshTimeMs;
96     bool timeOutput;
97     int maximumNumberOfLines;
98 };
99
100 #endif // MAINWINDOW_H