Maps SDK for C++ 1.0.0
Loading...
Searching...
No Matches
gem::Login Class Reference

Login service for social service activity. More...

Inheritance diagram for gem::Login:
Collaboration diagram for gem::Login:

Public Member Functions

 Login (const Login &)=delete
Login & operator= (const Login &)=delete
 Login (Login &&)=default
 Default move constructor noexcept is deduced.
Login & operator= (Login &&login)=default
 Default move assignment noexcept is deduced.
int checkNameAvailability (const String &name, ProgressListener listener) noexcept
 Check for available map name.
int registerAccount (const String &name, const String &pwd, const String &firstName, const String &lastName, const String &phone, const String &mail, int iconId, ProgressListener listener) noexcept
 Register new user account.
int login (const String &name, const String &pwd, ProgressListener listener) noexcept
 Login user.
int registerExternalLogin (const String &loginId, ProgressListener listener) noexcept
 Register external login.
int logout () noexcept
 Logout user.
int deleteAccount (ProgressListener listener) noexcept
 Delete current logged account.
bool isLoggedIn () const noexcept
 Check login state.
LargeInteger getUserId () const noexcept
 Get current logged account unique id.
String getUserName () const noexcept
 Get current logged account name.
String getUserFirstName () const noexcept
 Get current logged account first name.
String getUserLastName () const noexcept
 Get current logged account last name.
String getUserPhone () const noexcept
 Get current logged account phone number.
String getUserEmail () const noexcept
 Get current logged account email.
Image getUserImage () const noexcept
 Get current logged account image.
int getUserImageId () const noexcept
 Get current logged account image id.
float getUserSocialCredibility () const noexcept
 Get current logged account social credibility.
Time getLoginTime () const noexcept
 Get the current login session time.
int setUserLoginData (const String &firstName, const String &lastName, const String &phone, const String &mail, int iconId, ProgressListener listener) noexcept
 Set current logged in user data.
ImageList getLoginIconList () const noexcept
 Get available login icons.

Detailed Description

Login service for social service activity.

Implements share-read / write Api object over ILogin.

This behaves like a singleton, i.e. all instances are shared behind the same API interface

Member Function Documentation

◆ checkNameAvailability()

int gem::Login::checkNameAvailability ( const String & name,
ProgressListener listener )
inlinenoexcept

Check for available map name.

Parameters
[in]nameThe user name check for availability ( must be unique in login group )
[in]listenerThe operation listener, will receive the result error code
Returns
Error code

◆ deleteAccount()

int gem::Login::deleteAccount ( ProgressListener listener)
inlinenoexcept

Delete current logged account.

All local data and cloud data will be removed

Parameters
[in]listenerThe operation listener, will receive the result error code
Returns
Error code

◆ getLoginIconList()

ImageList gem::Login::getLoginIconList ( ) const
inlinenoexcept

Get available login icons.

Returns
The login icon list

◆ getLoginTime()

Time gem::Login::getLoginTime ( ) const
inlinenoexcept

Get the current login session time.

Returns
The current login session operation time

If the user is logout a default object is returned

◆ getUserEmail()

String gem::Login::getUserEmail ( ) const
inlinenoexcept

Get current logged account email.

Returns
The user email address

If the user is logout, an empty string is returned

◆ getUserFirstName()

String gem::Login::getUserFirstName ( ) const
inlinenoexcept

Get current logged account first name.

Returns
The user first name

If the user is logout, an empty string is returned

◆ getUserId()

LargeInteger gem::Login::getUserId ( ) const
inlinenoexcept

Get current logged account unique id.

Returns
The user id

If the user is logout, a 0 value is returned

◆ getUserImage()

Image gem::Login::getUserImage ( ) const
inlinenoexcept

Get current logged account image.

Returns
The user image

If the user is logout, a default object is returned

◆ getUserImageId()

int gem::Login::getUserImageId ( ) const
inlinenoexcept

Get current logged account image id.

Returns
The user image id

If the user is logout, KInvalidIconId is returned

◆ getUserLastName()

String gem::Login::getUserLastName ( ) const
inlinenoexcept

Get current logged account last name.

Returns
The user last name

If the user is logout, an empty string is returned

◆ getUserName()

String gem::Login::getUserName ( ) const
inlinenoexcept

Get current logged account name.

Returns
The user name

If the user is logout, an empty string is returned

◆ getUserPhone()

String gem::Login::getUserPhone ( ) const
inlinenoexcept

Get current logged account phone number.

Returns
The user phone number

If the user is logout, an empty string is returned

◆ getUserSocialCredibility()

float gem::Login::getUserSocialCredibility ( ) const
inlinenoexcept

Get current logged account social credibility.

Returns
The user social credibility

If the user is logout a 0 value is returned

◆ isLoggedIn()

bool gem::Login::isLoggedIn ( ) const
inlinenoexcept

Check login state.

Returns
True if the user is logged in

◆ login()

int gem::Login::login ( const String & name,
const String & pwd,
ProgressListener listener )
inlinenoexcept

Login user.

Parameters
[in]nameThe unique user name ( must be checked for availability with checkNameAvailability )
[in]pwdThe user password. The server will not keep the password literal ( nor a hash )
[in]listenerThe operation listener, will receive the result error code
Returns
Error code

◆ logout()

int gem::Login::logout ( )
inlinenoexcept

Logout user.

Returns
Error code

◆ operator=()

Login & gem::Login::operator= ( Login && login)
default

Default move assignment noexcept is deduced.

Returns
A reference to the current object
Parameters
[in]loginThe login object to be moved

◆ registerAccount()

int gem::Login::registerAccount ( const String & name,
const String & pwd,
const String & firstName,
const String & lastName,
const String & phone,
const String & mail,
int iconId,
ProgressListener listener )
inlinenoexcept

Register new user account.

Parameters
[in]nameThe unique user name ( must be checked for availability with checkNameAvailability )
[in]pwdThe user password. The server will not keep the password literal ( nor a hash )
[in]firstNameThe user first name ( optional )
[in]lastNameThe user last name ( optional )
[in]phoneThe user phone ( optional )
[in]mailThe user email address ( optional )
[in]iconIdThe user icon index in getLoginIconList( optional, if no icon is set must be -1 )
[in]listenerThe operation listener, will receive the result error code
Returns
Error code

◆ registerExternalLogin()

int gem::Login::registerExternalLogin ( const String & loginId,
ProgressListener listener )
inlinenoexcept

Register external login.

Parameters
[in]loginIdThe unique login id. The use must ensure the secrecy and uniqueness of the login id
[in]listenerThe operation listener, will receive the result error code
Returns
Error code

error::KInUse if the external login id is already registered as a user

◆ setUserLoginData()

int gem::Login::setUserLoginData ( const String & firstName,
const String & lastName,
const String & phone,
const String & mail,
int iconId,
ProgressListener listener )
inlinenoexcept

Set current logged in user data.

Parameters
[in]firstNameThe user first name
[in]lastNameThe user last name
[in]phoneThe user phone
[in]mailThe user email address
[in]iconIdThe user icon index in getLoginIconList( if no icon is set must be -1 )
[in]listenerThe operation listener, will receive the result error code
Returns
Error code