Changeset View
Changeset View
Standalone View
Standalone View
examples/drives/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 | * Creates the Drive with name in newDrivesEdit | ||||
60 | */ | ||||
61 | void createDrives(); | ||||
62 | | ||||
63 | /** | ||||
64 | * Drive was created. | ||||
65 | */ | ||||
66 | void slotDrivesCreateJobFinished(KGAPI2::Job *job); | ||||
67 | | ||||
68 | /** | ||||
69 | * Rename the selected Drive with name in renameDrivesEdit | ||||
70 | */ | ||||
71 | void renameSelectedDrives(); | ||||
72 | | ||||
73 | /** | ||||
74 | * Drive was modified. | ||||
75 | */ | ||||
76 | void slotDrivesModifyJobFinished(KGAPI2::Job *job); | ||||
77 | | ||||
78 | /** | ||||
79 | * Hide the selected Drive | ||||
80 | */ | ||||
81 | void hideSelectedDrives(); | ||||
82 | | ||||
83 | /** | ||||
84 | * Unhide the selected Drive | ||||
85 | */ | ||||
86 | void unhideSelectedDrives(); | ||||
87 | | ||||
88 | /** | ||||
89 | * Drive was modified. | ||||
90 | */ | ||||
91 | void slotDrivesHideJobFinished(KGAPI2::Job *job); | ||||
92 | | ||||
93 | /** | ||||
94 | * All Drives were fetched. | ||||
95 | */ | ||||
96 | void slotFetchJobFinished(KGAPI2::Job *job); | ||||
97 | | ||||
98 | /** | ||||
99 | * Drive listing was fetched. | ||||
100 | */ | ||||
101 | void slotDrivesFetchJobFinished(KGAPI2::Job *job); | ||||
102 | | ||||
103 | /** | ||||
104 | * Retrieves list of all drives from user's Google drives | ||||
105 | */ | ||||
106 | void fetchDrivesList(); | ||||
107 | | ||||
108 | /** | ||||
109 | * Deletes the selected Drive | ||||
110 | */ | ||||
111 | void deleteSelectedDrives(); | ||||
112 | | ||||
113 | /** | ||||
114 | * Drive was deleted. | ||||
115 | */ | ||||
116 | void slotDrivesDeleteJobFinished(KGAPI2::Job *job); | ||||
117 | | ||||
118 | /** | ||||
119 | * A specific team drive in drives list has been selected. Sends a request | ||||
120 | * to Google to retrieve teh team drive file list. | ||||
121 | */ | ||||
122 | void drivesSelected(); | ||||
123 | | ||||
124 | /** | ||||
125 | * A specific item in the drives list has been selected. Sends a request | ||||
126 | * to Google to retrieve full details about the specific file | ||||
127 | */ | ||||
128 | void drivesItemSelected(); | ||||
129 | | ||||
130 | /** | ||||
131 | * Drive item detail was fetched. | ||||
132 | */ | ||||
133 | void slotDrivesItemFetchJobFinished(KGAPI2::Job *job); | ||||
134 | | ||||
135 | private: | ||||
136 | Ui::MainWindow *m_ui; | ||||
137 | | ||||
138 | KGAPI2::AccountPtr m_account; | ||||
139 | | ||||
140 | }; | ||||
141 | | ||||
142 | #endif // MAINWINDOW_H |