Maintains authentication information for a Gluon Player. More...
#include <authentication.h>
Signals | |
void | initialized () |
void | initFailed () |
void | registered () |
void | loggedIn () |
void | loginFailed () |
Public Member Functions | |
void | init () |
bool | isInitialized () |
Q_INVOKABLE bool | login (const QString &username, const QString &password) |
bool | isLoggedIn () |
bool | hasCredentials () |
QString | username () |
QString | password () |
Protected Slots | |
void | finishInit () |
void | checkLoginResult (Attica::BaseJob *) |
void | onRegisterClicked (const QString &username, const QString &password, const QString &mail, const QString &firstName, const QString &lastName) |
void | onRegisterAccountFinished (Attica::BaseJob *job) |
Friends | |
class | GluonCore::Singleton< Authentication > |
Maintains authentication information for a Gluon Player.
This singleton maintains authentication credentials to access the online OCS server and provides a way to Gluon Player implementations to login, save credentials, load credentials etc.
Definition at line 45 of file authentication.h.
void Authentication::checkLoginResult | ( | Attica::BaseJob * | baseJob | ) | [protected, slot] |
Definition at line 175 of file authentication.cpp.
void Authentication::finishInit | ( | ) | [protected, slot] |
Definition at line 104 of file authentication.cpp.
bool Authentication::hasCredentials | ( | ) |
use to check if saved credentials are available
Definition at line 99 of file authentication.cpp.
void Authentication::init | ( | ) |
function to initialize the Authentication module. Must be called before using the library
Definition at line 41 of file authentication.cpp.
void GluonPlayer::Authentication::initFailed | ( | ) | [signal] |
signal which is emitted if the initialization failed
void GluonPlayer::Authentication::initialized | ( | ) | [signal] |
signal which is emitted when the initialization is complete
bool Authentication::isInitialized | ( | ) |
returns if the library is initialized and ready to use
Definition at line 50 of file authentication.cpp.
bool Authentication::isLoggedIn | ( | ) |
use to check if we are logged in
Definition at line 94 of file authentication.cpp.
void GluonPlayer::Authentication::loggedIn | ( | ) | [signal] |
signal which is emitted if the login is complete
bool Authentication::login | ( | const QString & | username, | |
const QString & | password | |||
) |
use to perform a login. Connect to the signal loggedIn() and loginFailed() to know the result.
username | The username to be used
|
Definition at line 78 of file authentication.cpp.
void GluonPlayer::Authentication::loginFailed | ( | ) | [signal] |
signal which is emitted when the login failed
void Authentication::onRegisterAccountFinished | ( | Attica::BaseJob * | job | ) | [protected, slot] |
Definition at line 158 of file authentication.cpp.
void Authentication::onRegisterClicked | ( | const QString & | username, | |
const QString & | password, | |||
const QString & | mail, | |||
const QString & | firstName, | |||
const QString & | lastName | |||
) | [protected, slot] |
Definition at line 65 of file authentication.cpp.
QString Authentication::password | ( | ) |
use to retrieve the password
Definition at line 60 of file authentication.cpp.
void GluonPlayer::Authentication::registered | ( | ) | [signal] |
signal which is emitted if the new account is registered
QString Authentication::username | ( | ) |
use to retrieve the username
Definition at line 55 of file authentication.cpp.
friend class GluonCore::Singleton< Authentication > [friend] |
Definition at line 112 of file authentication.h.