Message object used to pass messages throughout the Doomseeker's system. More...
#include <message.h>
Classes | |
class | Type |
One of possible, Doomseeker recognizable error types. More... | |
Public Member Functions | |
Message () | |
'Null' message object, returns true on isIgnore(). More... | |
Message (unsigned type) | |
Message with defined type but carrying nothing to display. More... | |
Message (unsigned type, const QString &content) | |
Message with defined type and custom display content. More... | |
Message (const Message &other) | |
QString | contents () const |
Customized displayable contents of this Message. More... | |
bool | isCustom () const |
True if type() equals to CUSTOM_INFORMATION or CUSTOM_ERROR. More... | |
bool | isError () const |
True if type() is equal to or greater than CUSTOM_ERROR. More... | |
bool | isIgnore () const |
True for 'Null' messages. More... | |
bool | isInformation () const |
True if type() is equal to or greater than CUSTOM_INFORMATION, and lesser than CUSTOM_ERROR. More... | |
Message & | operator= (const Message &other) |
unsigned | timestamp () const |
Generation time in seconds since UTC epoch. More... | |
unsigned | type () const |
Message::Type. More... | |
Static Public Member Functions | |
static Message | customError (const QString &content) |
Convenience method. Sets type to Type::CUSTOM_ERROR. More... | |
static Message | customInformation (const QString &content) |
Convenience method. Sets type to Type::CUSTOM_INFORMATION. More... | |
Message object used to pass messages throughout the Doomseeker's system.
Message type and content is carried over through this object. If type member is set to Message::Type::IGNORE_TYPE then content member should be ignored and the entire Message object should be treated as carrying no message at all.
Messages can be displayed by the application through a pop-up box or in the program log. This may differ depending on message severity and current procedure.
Message objects are safe to copy.
Message::Message | ( | ) |
'Null' message object, returns true on isIgnore().
Message::Message | ( | unsigned | type | ) |
Message with defined type but carrying nothing to display.
Sometimes Doomseeker may override and display a hard-coded message anyway, depending on current procedure and message type.
Definition at line 52 of file message.cpp.
Message::Message | ( | unsigned | type, |
const QString & | content | ||
) |
Message with defined type and custom display content.
Sometimes Doomseeker may override and display a hard-coded message anyway, depending on current procedure and message type.
Definition at line 58 of file message.cpp.
QString Message::contents | ( | ) | const |
Customized displayable contents of this Message.
Definition at line 87 of file message.cpp.
|
inlinestatic |
Convenience method. Sets type to Type::CUSTOM_ERROR.
|
inlinestatic |
Convenience method. Sets type to Type::CUSTOM_INFORMATION.
bool Message::isCustom | ( | ) | const |
True if type() equals to CUSTOM_INFORMATION or CUSTOM_ERROR.
Definition at line 99 of file message.cpp.
bool Message::isError | ( | ) | const |
True if type() is equal to or greater than CUSTOM_ERROR.
Definition at line 104 of file message.cpp.
bool Message::isIgnore | ( | ) | const |
True for 'Null' messages.
Definition at line 109 of file message.cpp.
bool Message::isInformation | ( | ) | const |
True if type() is equal to or greater than CUSTOM_INFORMATION, and lesser than CUSTOM_ERROR.
Definition at line 114 of file message.cpp.
unsigned Message::timestamp | ( | ) | const |
Generation time in seconds since UTC epoch.
Definition at line 119 of file message.cpp.
unsigned Message::type | ( | ) | const |
Definition at line 124 of file message.cpp.