2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: notifmsg.h
|
2008-03-10 15:24:38 +00:00
|
|
|
// Purpose: interface of wxNotificationMessage
|
2008-03-08 13:52:38 +00:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxNotificationMessage
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-10-13 08:55:12 +00:00
|
|
|
This class allows to show the user a message non intrusively.
|
|
|
|
|
|
|
|
Currently it is implemented natively only for the Maemo platform and uses
|
|
|
|
(non-modal) dialogs for the display of the notifications under the other
|
|
|
|
platforms but it will be extended to use the platform-specific notifications
|
|
|
|
in the other ports in the future.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
Notice that this class is not a window and so doesn't derive from wxWindow.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-10-13 08:55:12 +00:00
|
|
|
@library{wxadv}
|
|
|
|
@category{misc}
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
class wxNotificationMessage : public wxEvtHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2008-10-13 08:55:12 +00:00
|
|
|
Default constructor, use SetParent(), SetTitle() and SetMessage() to
|
|
|
|
initialize the object before showing it.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
wxNotificationMessage();
|
2008-10-13 08:55:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Create a notification object with the given attributes.
|
|
|
|
|
|
|
|
See SetTitle(), SetMessage(), SetParent() and SetFlags() for the
|
|
|
|
description of the corresponding parameters.
|
|
|
|
*/
|
|
|
|
wxNotificationMessage(const wxString& title, const wxString& message = wxEmptyString,
|
|
|
|
wxWindow* parent = NULL, int flags = wxICON_INFORMATION);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Hides the notification.
|
2008-10-13 08:55:12 +00:00
|
|
|
|
|
|
|
Returns @true if it was hidden or @false if it couldn't be done
|
|
|
|
(e.g. on some systems automatically hidden notifications can't be
|
|
|
|
hidden manually).
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual bool Close();
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
This parameter can be currently used to specify the icon to show in the
|
2008-10-13 08:55:12 +00:00
|
|
|
notification.
|
|
|
|
|
|
|
|
Valid values are @c wxICON_INFORMATION, @c wxICON_WARNING and
|
|
|
|
@c wxICON_ERROR (notice that @c wxICON_QUESTION is not allowed here).
|
2008-03-08 13:52:38 +00:00
|
|
|
Some implementations of this class may not support the icons.
|
|
|
|
*/
|
|
|
|
void SetFlags(int flags);
|
|
|
|
|
|
|
|
/**
|
2008-10-13 08:55:12 +00:00
|
|
|
Set the main text of the notification.
|
|
|
|
|
|
|
|
This should be a more detailed description than the title but still limited
|
|
|
|
to reasonable length (not more than 256 characters).
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void SetMessage(const wxString& message);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set the parent for this notification: the notification will be associated with
|
|
|
|
the top level parent of this window or, if this method is not called, with the
|
2008-10-13 08:55:12 +00:00
|
|
|
main application window by default.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void SetParent(wxWindow* parent);
|
|
|
|
|
|
|
|
/**
|
2008-03-08 14:43:31 +00:00
|
|
|
Set the title, it must be a concise string (not more than 64 characters), use
|
2008-10-13 08:55:12 +00:00
|
|
|
SetMessage() to give the user more details.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void SetTitle(const wxString& title);
|
|
|
|
|
|
|
|
/**
|
2008-10-13 08:55:12 +00:00
|
|
|
Show the notification to the user and hides it after @a timeout seconds
|
|
|
|
are elapsed.
|
|
|
|
|
|
|
|
Special values @c Timeout_Auto and @c Timeout_Never can be used here,
|
|
|
|
notice that you shouldn't rely on @a timeout being exactly respected
|
|
|
|
because the current platform may only support default timeout value
|
2008-03-08 13:52:38 +00:00
|
|
|
and also because the user may be able to close the notification.
|
2008-10-13 08:55:12 +00:00
|
|
|
|
|
|
|
@return @false if an error occurred.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual bool Show(int timeout = Timeout_Auto);
|
2008-03-08 13:52:38 +00:00
|
|
|
};
|
2008-03-10 15:24:38 +00:00
|
|
|
|