QtPdCom  1.5.2
LoginManager.h
Go to the documentation of this file.
1/*****************************************************************************
2 *
3 * Copyright (C) 2009-2023 Bjarne von Horn <vh@igh.de>
4 *
5 * This file is part of the QtPdCom library.
6 *
7 * The QtPdCom library is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * The QtPdCom library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 * License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with the QtPdCom Library. If not, see <http://www.gnu.org/licenses/>.
19 *
20 ****************************************************************************/
21
22#ifndef QTPDCOM_LOGINMANAGER_H
23#define QTPDCOM_LOGINMANAGER_H
24
25#include "Export.h"
26
27#include <QObject>
28#include <QScopedPointer>
29#include <QString>
30
31namespace QtPdCom {
32
34class Process;
35
46class QTPDCOM_PUBLIC LoginManager: public QObject
47{
48 Q_OBJECT
49
50 public:
51 explicit LoginManager(QString server_name = QString(), QObject *parent = nullptr);
53
59 Q_INVOKABLE void setAuthName(QString name);
65 Q_INVOKABLE void setPassword(QString password);
66
71 Q_INVOKABLE void clearCredentials();
72
83 Q_INVOKABLE void login();
87 Q_INVOKABLE void logout();
88
89 /* Retrieve reason for login failure.
90 */
91 Q_INVOKABLE QString getErrorMessage();
92
101 static void InitLibrary(const char *plugin_path = nullptr);
104 static void FinalizeLibrary();
105
106 signals:
107
121
122 private:
127
128 QScopedPointer<LoginManagerPrivate> d_ptr;
129 friend Process;
130};
131
132} // namespace QtPdCom
133
134#endif // QTPDCOM_LOGINMANAGER_H
#define QTPDCOM_PUBLIC
Definition Export.h:30
LoginManager(QString server_name=QString(), QObject *parent=nullptr)
Definition LoginManager.cpp:31
Definition LoginManager_p.h:35
LoginManager & operator=(LoginManager &&)=delete
Q_INVOKABLE void setAuthName(QString name)
Set Login Name.
Definition LoginManager.cpp:48
void loginSuccessful()
Authentification was successful.
LoginManager(QString server_name=QString(), QObject *parent=nullptr)
Definition LoginManager.cpp:31
void needCredentials()
Username and/or password has not been set.
Q_DECLARE_PRIVATE(LoginManager)
Q_INVOKABLE void logout()
logout.
Definition LoginManager.cpp:73
void loginFailed()
Authentification was not successful.
static void FinalizeLibrary()
Sasl global finalization.
Definition LoginManager.cpp:43
Q_INVOKABLE QString getErrorMessage()
Definition LoginManager.cpp:142
Q_INVOKABLE void login()
Start the login process.
Definition LoginManager.cpp:62
Q_DISABLE_COPY(LoginManager)
static void InitLibrary(const char *plugin_path=nullptr)
Sasl global initialization.
Definition LoginManager.cpp:38
LoginManager(LoginManager &&)=delete
Q_INVOKABLE void setPassword(QString password)
Set Password.
Definition LoginManager.cpp:55
Q_INVOKABLE void clearCredentials()
Clear stored credentials.
Definition LoginManager.cpp:136
friend Process
Definition LoginManager.h:129
QScopedPointer< LoginManagerPrivate > d_ptr
Definition LoginManager.h:128
PdCom::Process implementation for Qt.
Definition Process.h:72
Definition BroadcastModel.h:32