-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpds_cal.h
127 lines (102 loc) · 4.16 KB
/
pds_cal.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#ifndef PDS_CAL_H
#define PDS_CAL_H
#include <QMainWindow>
#include <QListWidget>
#include <QTreeWidgetItem>
#include <QtNetwork/QNetworkAccessManager>
#include <QTimer>
#include "calendar_manager.h"
#include "event.h"
#include "todo.h"
#include "calendar.h"
QT_BEGIN_NAMESPACE
namespace Ui { class pds_cal; }
QT_END_NAMESPACE
class QNetworkAccessManager;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
private slots:
// parsing
void parse_vcalendar(QString data);
void parse_request(QString data);
// auth
bool login(std::string usr, std::string pwd);
void login_slot(QNetworkReply* reply);
void do_authentication(QNetworkReply *, QAuthenticator *q);
bool get_calendars(std::string usr, std::string pwd);
void getCalendars_slot(QNetworkReply* reply);
void report_function(QNetworkReply* reply);
// events
void getAllEvents(QString user, QString pass, QString calendar_name);
void report_getAllEvents(QNetworkReply* reply);
void createEvent(QString user, QString calendar_name, QString summary, QDateTime start_date_time, QDateTime end_date_time);
void report_createEvent(QNetworkReply* reply);
void editEvent(QString user, QString uid, QString calendar_name, QString summary, QDateTime start_date_time, QDateTime end_date_time);
void report_editEvent(QNetworkReply* reply);
void deleteEvent(QString user, QString pass, QString calendar_name, QString uid);
void report_deleteEvent(QNetworkReply* reply);
QList<Event> getEventsOnDate(QDate date);
void showEventsOnDate(QDate date);
QString eventsListToString(QList<Event>);
// todos
void createTODO(QString user, QString calendar_name, QString summary, QDateTime end_date);
void report_createTODO(QNetworkReply* reply);
void deleteTODO(QString user, QString pass, QString calendar_name, QString uid);
void report_deleteTODO(QNetworkReply* reply);
void editTODO(QString user, QString calendar_name, QString summary, QDateTime new_due, QString uid, bool comp);
void report_editTODO(QNetworkReply* reply);
// calendar
void create_calendar(std::string usr, std::string pwd, std::string calendar_name);
void createCalendar_slot(QNetworkReply* reply);
bool isASCII (std::string s);
void delete_calendar(std::string usr, std::string pwd, std::string calendar_name);
void deleteCalendar_slot(QNetworkReply* reply);
void share_calendar(std::string usr, std::string pwd, std::string calendar_name, std::string mail);
void shareCalendar_slot(QNetworkReply* reply);
bool is_email_valid(std::string email);
// timer
void startSynchronization();
void handle_synch_reply(QNetworkReply*);
// clicking buttons
void on_loginButton_clicked();
void on_createEventButton_clicked();
void on_createTodoButton_clicked();
void on_deleteTodoButton_clicked();
void on_editButton_clicked();
void on_closeEditButton_clicked();
void on_confirmEditButton_clicked();
void on_cancelEditButton_clicked();
void on_deleteButton_clicked();
void on_goBackButton_clicked();
void on_confirmDelete_clicked();
void on_new_calendar_btn_clicked();
void on_create_cal_goback_clicked();
void on_create_cal_go_clicked();
void on_cal_list_itemClicked(QTreeWidgetItem *item, int column);
void on_delete_calendar_btn_clicked();
void on_displayedCalendar_clicked(const QDate &date);
void on_listOfEvents_itemClicked(QListWidgetItem *item);
void on_TODO_list_itemClicked(QTreeWidgetItem *item, int column);
void on_editTodoButton_clicked();
void on_backTODOedit_clicked();
void on_backSAVEedit_clicked();
void on_share_calendar_btn_clicked();
void on_share_cal_goback_clicked();
void on_share_cal_go_clicked();
void on_newEventShortcut_clicked();
void on_newCalendarShortcut_clicked();
protected slots:
void clear_selected_todo(std::string display_name);
void clear_selected_cal(std::string display_name);
void refresh_todos();
private:
Ui::pds_cal *ui;
QNetworkAccessManager *mManager;
CalendarManager cal_man;
QTimer* synch_timer;
};
#endif // PDS_CAL_H