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

Interface to a typical HGL Suite application. More...

#include "iapplication.h"

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

Public Types

enum  NOTIFYOPT {
  DEFAULT,
  UPDATE,
  CLOSE
}
 Behaviour options to be passed to the notifyXXX functions. More...
 

Public Member Functions

virtual bool hasTerminated () const =0
 Indicates if the application got a termination signal and should prepare to shutdown. More...
 
virtual bool notificationsAvailable () const =0
 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 =0
 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 =0
 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 =0
 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 =0
 Emits a warning desktop notification if possible. More...
 
virtual void registerApplicationObserver (const IApplicationObserver *const iao)=0
 Registers an IApplicationObserver. More...
 
virtual void unregisterApplicationObserver (const IApplicationObserver *const iao)=0
 Unregisters an IApplicationObserver. More...
 

Detailed Description

Interface to a typical HGL Suite application.

A typical HGL Suite application should implement this interface, resp. derive from HGL::Common::Application.

Since version 0.5.25 it is tried to register with a desktop notification daemon. If there is such one and the config value enable-notifications is true a desktop notification can be emitted by calling notifyInfo, notifyWarn or notifyError else if the config value enable-notifications is true a console log to the respective logger is emitted.

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

Member Enumeration Documentation

Behaviour options to be passed to the notifyXXX functions.

Since
0.5.25
Enumerator
DEFAULT 

a default notification, which expires automatically

UPDATE 

an UPDATE notification, which expires never expires until CLOSEd

CLOSE 

closes the last emitted notification

Member Function Documentation

virtual bool HGL::Common::IApplication::hasTerminated ( ) const
pure 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

Implemented in HGL::Common::Application.

virtual bool HGL::Common::IApplication::notificationsAvailable ( ) const
pure virtual

Checks if notifications are available and enabled.

Returns
true if notifications are available, false otherwise
Since
0.5.25

Implemented in HGL::Common::Application.

virtual void HGL::Common::IApplication::notifyError ( const std::string &  msg,
NOTIFYOPT  opt = DEFAULT,
const std::string &  summary = std::string() 
) const
pure virtual

Emits an error desktop notification if possible.

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

Implemented in HGL::Common::Application.

virtual void HGL::Common::IApplication::notifyFatal ( const std::string &  msg,
NOTIFYOPT  opt = DEFAULT,
const std::string &  summary = std::string() 
) const
pure virtual

Emits an fatal error desktop notification if possible.

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

Implemented in HGL::Common::Application.

virtual void HGL::Common::IApplication::notifyInfo ( const std::string &  msg,
NOTIFYOPT  opt = DEFAULT,
const std::string &  summary = std::string() 
) const
pure virtual

Emits an information desktop notification if possible.

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

Implemented in HGL::Common::Application.

virtual void HGL::Common::IApplication::notifyWarn ( const std::string &  msg,
NOTIFYOPT  opt = DEFAULT,
const std::string &  summary = std::string() 
) const
pure virtual

Emits a warning desktop notification if possible.

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

Implemented in HGL::Common::Application.

virtual void HGL::Common::IApplication::registerApplicationObserver ( const IApplicationObserver *const  iao)
pure virtual

Registers an IApplicationObserver.

Parameters
iaoan IApplicationObserver to register

Implemented in HGL::Common::Application.

virtual void HGL::Common::IApplication::unregisterApplicationObserver ( const IApplicationObserver *const  iao)
pure virtual

Unregisters an IApplicationObserver.

Parameters
iaoan IApplicationObserver to unregister

Implemented in HGL::Common::Application.