Changeset View
Changeset View
Standalone View
Standalone View
examples/teamdrive/mainwindow.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | Copyright (C) 2019 David Barchiesi <david@barchie.si> | ||||
3 | | ||||
4 | This library is free software; you can redistribute it and/or | ||||
5 | modify it under the terms of the GNU Lesser General Public | ||||
6 | License as published by the Free Software Foundation; either | ||||
7 | version 2.1 of the License, or (at your option) version 3, or any | ||||
8 | later version accepted by the membership of KDE e.V. (or its | ||||
9 | successor approved by the membership of KDE e.V.), which shall | ||||
10 | act as a proxy defined in Section 6 of version 3 of the license. | ||||
11 | | ||||
12 | This library is distributed in the hope that it will be useful, | ||||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
15 | GNU Lesser General Public License for more details. | ||||
16 | | ||||
17 | You should have received a copy of the GNU Lesser General Public | ||||
18 | License along with this library. If not, see <https://www.gnu.org/licenses/>. | ||||
19 | */ | ||||
20 | | ||||
21 | | ||||
22 | #ifndef MAINWINDOW_H | ||||
23 | #define MAINWINDOW_H | ||||
24 | | ||||
25 | #include <QMainWindow> | ||||
26 | | ||||
27 | #include <types.h> | ||||
28 | | ||||
29 | namespace Ui { | ||||
30 | class MainWindow; | ||||
31 | } | ||||
32 | | ||||
33 | namespace KGAPI2 { | ||||
34 | class Job; | ||||
35 | } | ||||
36 | | ||||
37 | | ||||
38 | class MainWindow : public QMainWindow | ||||
39 | { | ||||
40 | Q_OBJECT | ||||
41 | | ||||
42 | public: | ||||
43 | explicit MainWindow(QWidget *parent = nullptr); | ||||
44 | ~MainWindow() override; | ||||
45 | | ||||
46 | private Q_SLOTS: | ||||
47 | /** | ||||
48 | * Retrieves tokens from Google that we will use to authenticate | ||||
49 | * fursther requests | ||||
50 | */ | ||||
51 | void authenticate(); | ||||
52 | | ||||
53 | /** | ||||
54 | * Authentication has finished | ||||
55 | */ | ||||
56 | void slotAuthJobFinished(KGAPI2::Job *job); | ||||
57 | | ||||
58 | /** | ||||
59 | * All Team Drives were fetched. | ||||
60 | */ | ||||
61 | void slotFetchJobFinished(KGAPI2::Job *job); | ||||
62 | | ||||
63 | /** | ||||
64 | * Team Drive listing was fetched. | ||||
65 | */ | ||||
66 | void slotTeamdriveFetchJobFinished(KGAPI2::Job *job); | ||||
67 | | ||||
68 | /** | ||||
69 | * Retrieves list of all teamdrive from user's Google teamdrive | ||||
70 | * addressbook | ||||
71 | */ | ||||
72 | void fetchTeamdriveList(); | ||||
73 | | ||||
74 | /** | ||||
75 | * A specific contact in contact list has been selected. Sends a request | ||||
76 | * to Google to retrieve full details about the specific contact | ||||
77 | */ | ||||
78 | void teamdriveSelected(); | ||||
79 | | ||||
80 | private: | ||||
81 | Ui::MainWindow *m_ui; | ||||
82 | | ||||
83 | KGAPI2::AccountPtr m_account; | ||||
84 | | ||||
85 | }; | ||||
86 | | ||||
87 | #endif // MAINWINDOW_H |