kexi
KexiDB::MessageHandler Class Reference
#include <msghandler.h>
Inheritance diagram for KexiDB::MessageHandler:

Detailed Description
A prototype for Message Handler usable for reacting on messages sent by KexiDB::Object object(s).
Definition at line 52 of file msghandler.h.
Public Types | |
enum | MessageType { Error, Sorry, Warning } |
Public Member Functions | |
MessageHandler (QWidget *parent=0) | |
virtual | ~MessageHandler () |
void | enableMessages (bool enable) |
virtual void | showErrorMessage (const QString &title, const QString &details=QString::null)=0 |
virtual void | showErrorMessage (KexiDB::Object *obj, const QString &msg=QString::null)=0 |
virtual int | askQuestion (const QString &message, KMessageBox::DialogType dlgType, KMessageBox::ButtonCode defaultResult, const KGuiItem &buttonYes=KStdGuiItem::yes(), const KGuiItem &buttonNo=KStdGuiItem::no(), const QString &dontShowAskAgainName=QString::null, int options=KMessageBox::Notify) |
Protected Attributes | |
QGuardedPtr< QWidget > | m_messageHandlerParentWidget |
bool | m_enableMessages: 1 |
Constructor & Destructor Documentation
MessageHandler::MessageHandler | ( | QWidget * | parent = 0 |
) |
Constructs mesage handler, parent is a widget that will be a parent for displaying gui elements (e.g. message boxes). Can be 0 for non-gui usage.
Definition at line 38 of file msghandler.cpp.
Member Function Documentation
void KexiDB::MessageHandler::enableMessages | ( | bool | enable | ) | [inline] |
This method can be used to block/unblock messages. Sometimes you are receiving both lower- and higher-level messages, but you do not need to display two message boxes but only one (higher level with details). All you need is to call enableMessages(false) before action that can fail and restore messages by enableMessages(true) after the action. See KexiMainWindowImpl::renameObject() implementation for example.
Definition at line 68 of file msghandler.h.
virtual void KexiDB::MessageHandler::showErrorMessage | ( | const QString & | title, | |
const QString & | details = QString::null | |||
) | [pure virtual] |
Shows error message with title (it is not caption) and details.
Implemented in KexiGUIMessageHandler.
virtual void KexiDB::MessageHandler::showErrorMessage | ( | KexiDB::Object * | obj, | |
const QString & | msg = QString::null | |||
) | [pure virtual] |
Shows error message with msg text. Existing error message from obj object is also copied, if present.
Implemented in KexiGUIMessageHandler.
int MessageHandler::askQuestion | ( | const QString & | message, | |
KMessageBox::DialogType | dlgType, | |||
KMessageBox::ButtonCode | defaultResult, | |||
const KGuiItem & | buttonYes = KStdGuiItem::yes() , |
|||
const KGuiItem & | buttonNo = KStdGuiItem::no() , |
|||
const QString & | dontShowAskAgainName = QString::null , |
|||
int | options = KMessageBox::Notify | |||
) | [virtual] |
Interactively asks a question. For GUI version, KMessageBox class is used. See KMessageBox documentation for explanation of the parameters. defaultResult is returned in case when no message handler is installed. message should be i18n's string. Value from KMessageBox::ButtonCode enum is returned. Reimplement this. This implementation does nothing, just returns defaultResult.
Reimplemented in KexiGUIMessageHandler.
Definition at line 48 of file msghandler.cpp.
The documentation for this class was generated from the following files: