Refresh UI every 10 seconds
[qcpufreq] / src / mainwindow.h
1 /*
2  * QCPUFreq - a simple cpufreq GUI
3  * Copyright (C) 2010 Daniel Klaffenbach <daniel.klaffenbach@cs.tu-chemnitz.de>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18
19 #ifndef MAINWINDOW_H
20 #define MAINWINDOW_H
21
22 #include <QMainWindow>
23 #include <QGraphicsScene>
24 #include <QTimer>
25
26 namespace Ui {
27     class MainWindow;
28 }
29
30 class MainWindow : public QMainWindow
31 {
32     Q_OBJECT
33
34 public:
35     explicit MainWindow(QWidget *parent = 0);
36     ~MainWindow();
37
38 public slots:
39     void about();
40     void adjustFreq();
41     void orientationChanged();
42     void refresh();
43     void setAutoRotaion();
44     void setSmartReflex();
45
46
47 private:
48     Ui::MainWindow *ui;
49     int callHelper( QString action, QString param );
50     QString getCPUTemp();
51     int getMaxFreq();
52     int getMinFreq();
53     int getScalingFreq( int step );
54     QString getScalingGovernor();
55     int getScalingStep( int freq );
56     int getScalingSteps();
57     int getSmartReflexState();
58     QString readSysFile( QString sys_file );
59     //! the timer for refreshing the UI
60     QTimer *refreshTimer;
61     //! the QGraphicsScene will contain the large chip icon displayed in the UI
62     QGraphicsScene *scene;
63     bool usePortrait();
64 };
65
66 #endif // MAINWINDOW_H