digiKam
vkontakte_authenticationdialog.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2011-02-19
7  * Description : a tool to export images to VKontakte web service
8  *
9  * Copyright (C) 2010 by Thomas McGuire <mcguire at kde dot org>
10  * Copyright (C) 2011-2015 by Alexander Potashev <aspotashev at gmail dot com>
11  * Copyright (C) 2011-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_VKONTAKTE_AUTHENTICATIONDIALOG_H
26 #define DIGIKAM_VKONTAKTE_AUTHENTICATIONDIALOG_H
27 
28 // Qt includes
29 
30 #include <QDialog>
31 
32 // Local includes
33 
35 
36 namespace Vkontakte
37 {
38 
39 class AuthenticationDialog : public QDialog
40 {
41  Q_OBJECT
42 
43 public:
44 
45  explicit AuthenticationDialog(QWidget* const parent);
46  ~AuthenticationDialog() override;
47 
48  void setAppId(const QString& appId);
49  void Q_DECL_DEPRECATED setPermissions(const QStringList& permissions);
50  void setPermissions(Vkontakte::AppPermissions::Value permissions);
51  void setDisplayMode(const QString& displayMode);
52  void start();
53 
54 Q_SIGNALS:
55 
56  void authenticated(const QString& accessToken);
57  void canceled();
58 
59 private Q_SLOTS:
60 
61  void urlChanged(const QUrl& url);
62  void loadFinished(bool ok);
63  void showErrorDialog();
64 
65 private:
66 
67  class Private;
68  Private* const d;
69 };
70 
71 } // namespace Vkontakte
72 
73 #endif // DIGIKAM_VKONTAKTE_AUTHENTICATIONDIALOG_H