QVisu
Qt-based visualization for smart homes
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
qvgooglecalendar.h
1 /* QVisu (c) 2015 Maximilian Gauger mgauger@kalassi.de
2  *
3  * This program is free software: you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation, either version 2 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12 
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef QVGOOGLECALENDAR_H
18 #define QVGOOGLECALENDAR_H
19 
20 #include <QTimer>
21 #include <QString>
22 #include <QLabel>
23 #include <QSettings>
24 #include <QNetworkReply>
25 #include <QNetworkAccessManager>
26 #include "../qvelement.h"
27 
29 public:
30  QString summary, location;
31  QDateTime begin, end;
32  bool all_day;
33 };
34 
36 {
37  Q_OBJECT
38 public:
39  explicit QVGoogleCalendar(QDomElement xml_desc, QString container, QWidget *parent = 0);
40 
41 protected:
42  void resizeEvent(QResizeEvent*);
43 
44 signals:
45 
46 protected slots:
47  void onDataReceived(QNetworkReply*);
48  void getAccessToken();
49  void getEventList();
50 
51 private:
52  QNetworkAccessManager *network_manager;
53 
54  QSettings *registry_settings;
55  QString device_code;
56  QString access_token;
57  QString next_sync_token, next_page_token;
58  int refresh_value, refresh_counter;
59  QString calendar_id;
60  int max_days;
61 
62  QMap<QString,calendar_entry> entries;
63  QTimer *timer;
64 
65  QList<QLabel*> w_summary, w_date, w_location;
66  QLabel w_auth;
67 
68  void do_getEventList(bool);
69  void showCalendarEvents();
70 
71  static const int padding = 8;
72 };
73 
74 
75 
76 
77 #endif // QVGOOGLECALENDAR_H
Definition: qvgooglecalendar.h:28
Definition: qvelement.h:34
void resizeEvent(QResizeEvent *)
Definition: qvgooglecalendar.cpp:334
Definition: qvgooglecalendar.h:35
QString container
Definition: qvelement.h:73