digiKam
mediawiki_login.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-03-22
7  * Description : a Iface C++ interface
8  *
9  * Copyright (C) 2011-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2011 by Alexandre Mendes <alex dot mendes1988 at gmail dot com>
11  * Copyright (C) 2011 by Peter Potrowl <peter dot potrowl at gmail dot com>
12  * Copyright (C) 2011 by Manuel Campomanes <campomanes dot manuel at gmail dot com>
13  *
14  * This program is free software; you can redistribute it
15  * and/or modify it under the terms of the GNU General
16  * Public License as published by the Free Software Foundation;
17  * either version 2, or (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * ============================================================ */
25 
26 #ifndef DIGIKAM_MEDIAWIKI_LOGIN_H
27 #define DIGIKAM_MEDIAWIKI_LOGIN_H
28 
29 // Qt includes
30 
31 #include <QString>
32 #include <QNetworkCookieJar>
33 
34 // Local includes
35 
36 #include "mediawiki_job.h"
37 
38 
39 namespace MediaWiki
40 {
41 
42 class Iface;
43 class LoginPrivate;
49 class Login : public Job
50 {
51  Q_OBJECT
52  Q_DECLARE_PRIVATE(Login)
53 
54 public:
55 
56  enum
57  {
61  LoginMissing = Job::UserDefinedError + 1,
62 
66  IllegalUsername,
67 
71  UsernameNotExists,
72 
76  PasswordMissing,
77 
81  WrongPassword,
82 
86  WrongPluginPassword,
87 
91  IPAddressBlocked,
92 
96  TooManyConnections,
97 
101  UserBlocked,
102 
106  TokenNeeded
107  };
108 
109 public:
110 
118  explicit Login(Iface& MediaWiki,
119  const QString& login,
120  const QString& password,
121  QObject* const parent = nullptr);
122 
126  ~Login() override;
127 
131  void start() override;
132 
133 private Q_SLOTS:
134 
138  void doWorkSendRequest();
139 
146  void doWorkProcessReply();
147 };
148 
149 } // namespace MediaWiki
150 
151 #endif // DIGIKAM_MEDIAWIKI_LOGIN_H
@ Login
Definition: rajcesession.h:41