hgl 0.5.25
A compiler/interpreter suite for developing images
Public Member Functions | List of all members
HGL::Common::Application Class Referenceabstract

Base class of a typical HGL Suite application. More...

#include "application.h"

Inheritance diagram for HGL::Common::Application:
[legend]

Public Member Functions

 Application (const OBSERVERS &obs, bool signals=true, bool initGPGMe=true)
 Constructor. More...
 
 Application (bool signals=true, bool initGPGMe=true)
 
bool hasTerminated () const
 Indicates if the application got a termination signal and should prepare to shutdown. More...
 
virtual bool notificationsAvailable () const
 Checks if notifications are available and enabled. More...
 
virtual void notifyError (const std::string &msg, NOTIFYOPT opt=DEFAULT, const std::string &summary=std::string()) const
 Emits an error desktop notification if possible. More...
 
virtual void notifyFatal (const std::string &msg, NOTIFYOPT opt=DEFAULT, const std::string &summary=std::string()) const
 Emits an fatal error desktop notification if possible. More...
 
virtual void notifyInfo (const std::string &msg, NOTIFYOPT opt=DEFAULT, const std::string &summary=std::string()) const
 Emits an information desktop notification if possible. More...
 
virtual void notifyWarn (const std::string &msg, NOTIFYOPT opt=DEFAULT, const std::string &summary=std::string()) const
 Emits a warning desktop notification if possible. More...
 
void registerApplicationObserver (const IApplicationObserver *const)
 Registers an IApplicationObserver. More...
 
void unregisterApplicationObserver (const IApplicationObserver *const)
 Unregisters an IApplicationObserver. More...
 

Additional Inherited Members

- Public Types inherited from HGL::Common::IApplication
enum  NOTIFYOPT {
  DEFAULT,
  UPDATE,
  CLOSE
}
 Behaviour options to be passed to the notifyXXX functions. More...
 

Detailed Description

Base class of a typical HGL Suite application.

Author
Heiko Schäfer heiko.nosp@m.@hgl.nosp@m..rang.nosp@m.un.d.nosp@m.e

Constructor & Destructor Documentation

Application::Application ( const OBSERVERS &  obs,
bool  signals = true,
bool  initGPGMe = true 
)

Constructor.

Note
the GPGMe subsystem is only needed if signing key actions are neccessary
Parameters
obsan initial vector of IApplicationObserver to register
signalsif true than signal handling will be enabled
initGPGMeif true than the GPGMe subsystem gets initialized
Application::Application ( bool  signals = true,
bool  initGPGMe = true 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Member Function Documentation

bool HGL::Common::Application::hasTerminated ( ) const
virtual

Indicates if the application got a termination signal and should prepare to shutdown.

Returns
true if the application shut prepare to shut down, false otherwise

Implements HGL::Common::IApplication.

bool Application::notificationsAvailable ( ) const
virtual

Checks if notifications are available and enabled.

Returns
true if notifications are available, false otherwise
Since
0.5.25

Implements HGL::Common::IApplication.

void Application::notifyError ( const std::string &  msg,
NOTIFYOPT  opt = DEFAULT,
const std::string &  summary = std::string() 
) const
virtual

Emits an error desktop notification if possible.

Parameters
msgthe message to display
optbehaviour option
summaryan optional summary
Since
0.5.25

Implements HGL::Common::IApplication.

void Application::notifyFatal ( const std::string &  msg,
NOTIFYOPT  opt = DEFAULT,
const std::string &  summary = std::string() 
) const
virtual

Emits an fatal error desktop notification if possible.

Parameters
msgthe message to display
optbehaviour option
summaryan optional summary
Since
0.5.25

Implements HGL::Common::IApplication.

void Application::notifyInfo ( const std::string &  msg,
NOTIFYOPT  opt = DEFAULT,
const std::string &  summary = std::string() 
) const
virtual

Emits an information desktop notification if possible.

Parameters
msgthe message to display
optbehaviour option
summaryan optional summary
Since
0.5.25

Implements HGL::Common::IApplication.

void Application::notifyWarn ( const std::string &  msg,
NOTIFYOPT  opt = DEFAULT,
const std::string &  summary = std::string() 
) const
virtual

Emits a warning desktop notification if possible.

Parameters
msgthe message to display
optbehaviour option
summaryan optional summary
Since
0.5.25

Implements HGL::Common::IApplication.

void Application::registerApplicationObserver ( const IApplicationObserver iao)
virtual

Registers an IApplicationObserver.

Parameters
iaoan IApplicationObserver to register

Implements HGL::Common::IApplication.

void Application::unregisterApplicationObserver ( const IApplicationObserver iao)
virtual

Unregisters an IApplicationObserver.

Parameters
iaoan IApplicationObserver to unregister

Implements HGL::Common::IApplication.