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

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 class MainWindow : public QMainWindow
0015 {
0016     Q_OBJECT
0017 
0018 public:
0019     explicit MainWindow(QWidget *parent = nullptr);
0020 
0021 private Q_SLOTS:
0022     /**
0023      * Retrieves tokens from Google that we will use to authenticate
0024      * further requests
0025      */
0026     void authenticate();
0027 
0028     /**
0029      * Creates the Team Drive with name in newTeamdriveEdit
0030      */
0031     void createTeamdrive();
0032 
0033     /**
0034      * Rename the selected Team Drive with name in renameTeamdriveEdit
0035      */
0036     void renameSelectedTeamdrive();
0037 
0038     /**
0039      * Retrieves list of all teamdrive from user's Google teamdrive
0040      * addressbook
0041      */
0042     void fetchTeamdriveList();
0043 
0044     /**
0045      * Deletes the selected Team Drive
0046      */
0047     void deleteSelectedTeamdrive();
0048 
0049     /**
0050      * A specific team drive in teamdrive list has been selected. Sends a request
0051      * to Google to retrieve the team drive file list.
0052      */
0053     void teamdriveSelected();
0054 
0055     /**
0056      * A specific item in the teamdrive list has been selected. Sends a request
0057      * to Google to retrieve full details about the specific file
0058      */
0059     void teamdriveItemSelected();
0060 
0061 private:
0062     Ui::MainWindow ui;
0063 
0064     KGAPI2::AccountPtr m_account;
0065 };