MagicSmoke  $VERSION$
MSessionClient Class Reference

#include <scli.h>

Inheritance diagram for MSessionClient:

Public Slots

void execServerCommand (QString)
 
void login (QString user, QString password, bool attemptLogin=true)
 
void setProfile (QString)
 

Signals

void managerLost ()
 
void menuChanged ()
 
void profilesChanged ()
 
void readyReceived ()
 
void sessionIdChanged (QString sessionId)
 
void sessionLost ()
 

Public Member Functions

 MSessionClient ()
 Initialize the session client, make sure it is connected to the Session Manager. More...
 
virtual ~MSessionClient ()
 Disconnect the session client. More...
 
virtual QString currentProfileId () const
 Returns the profile id. More...
 
virtual QString currentSessionId () const
 Returns the session id. More...
 
virtual QString currentUsername () const
 Returns the user name. More...
 
virtual QString defaultProfileId () const
 gets the default profile ID More...
 
virtual bool isConnected () const
 Returns true if the client is connected to a manager. If false there is something wrong. More...
 
virtual QList< QPair< QString,
QString > > 
menuEntries (bool force=false) const
 retrieves and returns the menu entries of the session manager in the format command -> menu text More...
 
virtual QList< QPair< QString,
QString > > 
profiles (bool force=false) const
 retrieves and returns all configured profiles in the format profileId -> profile name More...
 
virtual bool sessionIsAvailable () const
 Returns true if there currently is a session available. More...
 
virtual bool waitForReady ()
 Wait until the session manager is ready to receive commands. More...
 
virtual bool waitForSessionAvailable ()
 Wait until a session is available or the Session Manager quits. More...
 

Static Public Member Functions

static MSessionClientinstance ()
 returns the current instance of the Session Client class returns nullptr if there is no instance More...
 

Constructor & Destructor Documentation

MSessionClient::MSessionClient ( )

Initialize the session client, make sure it is connected to the Session Manager.

References MagicSmokeRandom::getRandomBytes(), and sessionclientinstance.

MSessionClient::~MSessionClient ( )
virtual

Disconnect the session client.

Member Function Documentation

QString MSessionClient::currentProfileId ( ) const
virtual

Returns the profile id.

Referenced by main(), and MagicSmokeMain::realmain().

QString MSessionClient::currentSessionId ( ) const
virtual

Returns the session id.

Referenced by main(), and MagicSmokeMain::realmain().

QString MSessionClient::currentUsername ( ) const
virtual

Returns the user name.

Referenced by main(), and MagicSmokeMain::realmain().

QString MSessionClient::defaultProfileId ( ) const
virtual

gets the default profile ID

References profiles().

void MSessionClient::execServerCommand ( QString  cmd)
slot
MSessionClient * MSessionClient::instance ( )
static

returns the current instance of the Session Client class returns nullptr if there is no instance

References sessionclientinstance.

Referenced by MPClientConfig::MPClientConfig(), and MSessionClient_createMenuObject().

bool MSessionClient::isConnected ( ) const
virtual

Returns true if the client is connected to a manager. If false there is something wrong.

Referenced by menuEntries(), profiles(), waitForReady(), and waitForSessionAvailable().

void MSessionClient::login ( QString  user,
QString  password,
bool  attemptLogin = true 
)
slot
void MSessionClient::managerLost ( )
signal
void MSessionClient::menuChanged ( )
signal

Referenced by menuEntries().

QList< QPair< QString, QString > > MSessionClient::menuEntries ( bool  force = false) const
virtual

retrieves and returns the menu entries of the session manager in the format command -> menu text

Parameters
forceif true: force fresh retrieval of the menu even if it is already known

References isConnected(), managerLost(), and menuChanged().

QList< QPair< QString, QString > > MSessionClient::profiles ( bool  force = false) const
virtual

retrieves and returns all configured profiles in the format profileId -> profile name

Parameters
forceif true: force fresh retrieval of the menu profiles if it is already known

References isConnected(), managerLost(), and profilesChanged().

Referenced by defaultProfileId(), and MPClientConfig::MPClientConfig().

void MSessionClient::profilesChanged ( )
signal

Referenced by profiles().

void MSessionClient::readyReceived ( )
signal

Referenced by waitForReady().

void MSessionClient::sessionIdChanged ( QString  sessionId)
signal

Referenced by waitForSessionAvailable().

bool MSessionClient::sessionIsAvailable ( ) const
virtual

Returns true if there currently is a session available.

void MSessionClient::sessionLost ( )
signal
void MSessionClient::setProfile ( QString  pn)
slot
bool MSessionClient::waitForReady ( )
virtual

Wait until the session manager is ready to receive commands.

References isConnected(), managerLost(), and readyReceived().

Referenced by MPClientConfig::performAutoLogin().

bool MSessionClient::waitForSessionAvailable ( )
virtual

Wait until a session is available or the Session Manager quits.

Returns
true if a session is available, false on error

References isConnected(), managerLost(), and sessionIdChanged().

Referenced by main(), and MagicSmokeMain::realmain().


The documentation for this class was generated from the following files: