KDbMessageHandler
#include <KDbMessageHandler.h>
Public Types | |
enum | ButtonCode { Ok = 1 , Cancel = 2 , Yes = Ok , No = 3 , Continue = 4 } |
enum | MessageType { Information = 1 , Error = 2 , Warning = 3 , Sorry = 4 , Fatal = 5 } |
enum | Option { Notify = 1 , AllowLink = 2 , Dangerous = 4 } |
typedef QFlags< Option > | Options |
enum | QuestionType { QuestionYesNo = 1 , QuestionYesNoCancel = 2 , WarningYesNo = 3 , WarningContinueCancel = 4 , WarningYesNoCancel = 5 } |
Protected Member Functions | |
QWidget * | parentWidget () |
Protected Attributes | |
Private *const | d |
Detailed Description
A prototype for Message Handler usable for reacting on messages sent by KDbObject object(s).
Definition at line 134 of file KDbMessageHandler.h.
Member Typedef Documentation
◆ Options
Definition at line 174 of file KDbMessageHandler.h.
Member Enumeration Documentation
◆ ButtonCode
Button codes.
Definition at line 158 of file KDbMessageHandler.h.
◆ MessageType
Message types.
Definition at line 138 of file KDbMessageHandler.h.
◆ Option
Message options.
Enumerator | |
---|---|
Notify | Emit a KNotify event. |
AllowLink | The message may contain links. |
Dangerous | The action to be confirmed by the dialog is a potentially destructive one. |
Definition at line 168 of file KDbMessageHandler.h.
◆ QuestionType
Question types.
Definition at line 148 of file KDbMessageHandler.h.
Constructor & Destructor Documentation
◆ KDbMessageHandler()
|
explicit |
Constructs message 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 122 of file KDbMessageHandler.cpp.
◆ ~KDbMessageHandler()
|
virtual |
Definition at line 128 of file KDbMessageHandler.cpp.
Member Function Documentation
◆ askQuestion()
|
virtual |
Interactively asks a question. For GUI version, message boxes are used. defaultResult is returned in case when no message handler is installed. message should contain translated string. Value of ButtonCode is returned. Reimplement this. This implementation does nothing, just returns defaultResult.
Definition at line 143 of file KDbMessageHandler.cpp.
◆ messagesEnabled()
bool KDbMessageHandler::messagesEnabled | ( | ) | const |
- Returns
- true if the handler is enables so messages are not blocked.
- See also
- setEnabled(bool)
Definition at line 133 of file KDbMessageHandler.cpp.
◆ parentWidget()
|
protected |
- Returns
- a widget that will be parent for displaying gui elements (e.g. message boxes). Can be 0 for non-gui cases.
Definition at line 177 of file KDbMessageHandler.cpp.
◆ redirection() [1/2]
KDbMessageHandler * KDbMessageHandler::redirection | ( | ) |
- Returns
- message redirection for this handler or 0 if there is no redirection.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 162 of file KDbMessageHandler.cpp.
◆ redirection() [2/2]
const KDbMessageHandler * KDbMessageHandler::redirection | ( | ) | const |
Definition at line 167 of file KDbMessageHandler.cpp.
◆ setMessagesEnabled()
void KDbMessageHandler::setMessagesEnabled | ( | bool | enable | ) |
Enables or disabled the handler to block/unblock its messages. Sometimes both lower- and higher-level messages are received, what is not optimal as only one of them should be displayed (e.g. a higher level with details). This can be solved by calling setEnabled(false) shortly before an action that can send the unwanted message. Afterwards messages can be enabled again by calling setEnabled(true). By default messages are enabled.
Definition at line 138 of file KDbMessageHandler.cpp.
◆ setRedirection()
void KDbMessageHandler::setRedirection | ( | KDbMessageHandler * | otherHandler | ) |
Sets redirection of all messages for this handler to otherHandler. Passing 0 removes redirection. Setting new redirection replaces previous.
Definition at line 172 of file KDbMessageHandler.cpp.
◆ showErrorMessage() [1/2]
|
pure virtual |
Shows error message with message text. Existing error message from obj object is also copied, if present.
◆ showErrorMessage() [2/2]
|
pure virtual |
Shows error message with title (it is not caption) and details.
Member Data Documentation
◆ d
|
protected |
Definition at line 244 of file KDbMessageHandler.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:08 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.