File indexing completed on 2024-04-28 04:55:44
0001 /* 0002 This file is part of Choqok, the KDE micro-blogging client 0003 0004 SPDX-FileCopyrightText: 2017 Andrea Scarpino <scarpino@kde.org> 0005 0006 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0007 */ 0008 0009 #ifndef MASTODONEDITACCOUNTWIDGET_H 0010 #define MASTODONEDITACCOUNTWIDGET_H 0011 0012 #include "editaccountwidget.h" 0013 0014 #include <QUrlQuery> 0015 0016 #include "ui_mastodoneditaccountwidget.h" 0017 0018 class MastodonAccount; 0019 class MastodonMicroBlog; 0020 0021 class MastodonEditAccountWidget : public ChoqokEditAccountWidget, Ui::MastodonEditAccountWidget 0022 { 0023 Q_OBJECT 0024 public: 0025 explicit MastodonEditAccountWidget(MastodonMicroBlog *microblog, MastodonAccount *account, 0026 QWidget *parent); 0027 ~MastodonEditAccountWidget(); 0028 0029 virtual Choqok::Account *apply() override; 0030 0031 virtual bool validateData() override; 0032 0033 private Q_SLOTS: 0034 void authorizeUser(); 0035 void gotToken(); 0036 0037 private: 0038 void setAuthenticated(bool authenticated); 0039 void loadTimelinesTable(); 0040 void registerClient(); 0041 void saveTimelinesTable(); 0042 0043 MastodonAccount *m_account; 0044 bool isAuthenticated; 0045 }; 0046 0047 #endif // MASTODONEDITACCOUNTWIDGET_H