File indexing completed on 2024-05-12 05:22:09

0001 /*
0002     SPDX-FileCopyrightText: 2019 David Barchiesi <david@barchie.si>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #pragma once
0008 
0009 #include "ui_mainwindow.h"
0010 #include <QMainWindow>
0011 
0012 #include "core/types.h"
0013 
0014 namespace KGAPI2
0015 {
0016 class Job;
0017 }
0018 
0019 class MainWindow : public QMainWindow
0020 {
0021     Q_OBJECT
0022 
0023 public:
0024     explicit MainWindow(QWidget *parent = nullptr);
0025 
0026 private Q_SLOTS:
0027     /**
0028      * Retrieves tokens from Google that we will use to authenticate
0029      * further requests
0030      */
0031     void authenticate();
0032 
0033     /**
0034      * Creates the Drive with name in newDrivesEdit
0035      */
0036     void createDrives();
0037 
0038     /**
0039      * Rename the selected Drive with name in renameDrivesEdit
0040      */
0041     void renameSelectedDrives();
0042 
0043     /**
0044      * Hide the selected Drive
0045      */
0046     void hideSelectedDrives();
0047 
0048     /**
0049      * Unhide the selected Drive
0050      */
0051     void unhideSelectedDrives();
0052 
0053     /**
0054      * Drive was modified.
0055      */
0056     void slotDrivesHideJobFinished(KGAPI2::Job *job);
0057 
0058     /**
0059      * Retrieves list of all drives from user's Google drives
0060      */
0061     void fetchDrivesList();
0062 
0063     /**
0064      * Deletes the selected Drive
0065      */
0066     void deleteSelectedDrives();
0067 
0068     /**
0069      * A specific team drive in drives list has been selected. Sends a request
0070      * to Google to retrieve the team drive file list.
0071      */
0072     void drivesSelected();
0073 
0074     /**
0075      * A specific item in the drives list has been selected. Sends a request
0076      * to Google to retrieve full details about the specific file
0077      */
0078     void drivesItemSelected();
0079 
0080 private:
0081     Ui::MainWindow ui;
0082 
0083     KGAPI2::AccountPtr m_account;
0084 };