UserMsg Pile   version 0.0.1
UserMsg pile.
UserMsg Class Reference

user messages mediator More...

#include <usermsg.h>

Public Member Functions

 UserMsg ()
 Default constructor. More...
 
 UserMsg (const UserMsg &other)
 Copy constructor. More...
 
 UserMsg (const QString &title, void *user_data=NULL)
 Constructor that also sets the title and payload.
 
virtual ~UserMsg ()
 Destructor.
 
const QString & title () const
 Get the title.
 
void setTitle (const QString &value)
 Set the title.
 
void * userData () const
 Get the payload.
 
void setUserData (void *value)
 Set the payload.
 
void show ()
 Show the content of this structure. More...
 
int count () const
 The number of entries in the list.
 
void clear ()
 Clear all entries from the list.
 
const UserMsgEntryat (int i) const
 Get an entry at a specific location.
 
void remove (int i)
 Remove an entry at a specific location.
 
void append (const UserMsg &other)
 Appends all entries in other entry to current entry. More...
 
void addErr (const QString &s_message)
 Add an error entry to the list.
 
void addWar (const QString &s_message)
 add a warning entry to the list.
 
void addInfo (const QString &s_message)
 Add an informative entry to the list.
 
void addDbgErr (const QString &s_message)
 Add an error entry to the list.
 
void addDbgWar (const QString &s_message)
 Add a warning entry to the list.
 
void addDbgInfo (const QString &s_message)
 Add an informative entry to the list.
 
void addMsg (UserMsgEntry::Type ty, const QString &s_message)
 Add an entry to the list. More...
 

Static Public Member Functions

static void err (const QString &s_message)
 Show an error entry.
 
static void war (const QString &s_message)
 Show a warning entry.
 
static void info (const QString &s_message)
 Show an informative entry.
 
static void dbgErr (const QString &s_message)
 Show an error entry.
 
static void dbgWar (const QString &s_message)
 Show a warning entry.
 
static void dbgInfo (const QString &s_message)
 Show an informative entry.
 
static void msg (UserMsgEntry::Type ty, const QString &s_message)
 Show an entry. More...
 
static void fatalException (const QString &s_message)
 Termination message. More...
 
static int consoleAskYN (const QString &s_message)
 Ask a question at the console; accept Yes/No answer. More...
 

Detailed Description

user messages mediator

The class associates a title, a user-defined value and a list of entries, each with its own timestamp, type and string message.

Constructor & Destructor Documentation

UserMsg::UserMsg ( )

Default constructor.

Creates an instance without a title and with a NULL value for user payload.

UserMsg::UserMsg ( const UserMsg other)

Copy constructor.

This is a bit dangerous as the user pointer is copied without any notice or reference counting. Pointer lifetime must be well understood.

Member Function Documentation

void UserMsg::addMsg ( UserMsgEntry::Type  ty,
const QString &  s_message 
)

Add an entry to the list.

Creates a UserMsgEntry instance and appends it to the list.

void UserMsg::append ( const UserMsg other)

Appends all entries in other entry to current entry.

The list is not sorted based on the timestamps.

int UserMsg::consoleAskYN ( const QString &  s_message)
static

Ask a question at the console; accept Yes/No answer.

Returns
either QMessageBox::Yes or QMessageBox::No.
Todo:
stub
void UserMsg::fatalException ( const QString &  s_message)
static

Termination message.

Uses the underlying platform to show the message.

Todo:
stub
void UserMsg::msg ( UserMsgEntry::Type  ty,
const QString &  s_message 
)
static

Show an entry.

The function simply creates an instance, adds the message and shows it.

void UserMsg::show ( )

Show the content of this structure.

Requests the manager to show this instance. identical to UserMsgMan::show().


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