1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: gtk/hildon/notifmsg.cpp
3 // Purpose: Hildon implementation of wxNotificationMessage
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 // ============================================================================
13 // ============================================================================
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 // for compilers that support precompilation, includes "wx.h".
20 #include "wx/wxprec.h"
31 #include "wx/notifmsg.h"
32 #include "wx/toplevel.h"
34 #include <hildon-widgets/hildon-banner.h>
36 // ============================================================================
37 // wxNotificationMessage implementation
38 // ============================================================================
40 wxString
wxNotificationMessage::HildonGetMarkup() const
42 const wxString
& message
= GetMessage(),
46 if ( message
.empty() )
50 else // combine title with message in a single string
52 text
<< "<big><b>" << title
<< "</b></big>\n"
60 GtkWidget
*wxNotificationMessage::HildonGetWindow() const
62 wxWindow
*parent
= GetParent();
65 parent
= wxGetTopLevelParent(parent
);
68 wxTopLevelWindow
* const
69 tlw
= wxDynamicCast(parent
, wxTopLevelWindow
);
71 return tlw
->m_mainWidget
;
78 bool wxNotificationMessage::Show(int timeout
)
80 if ( timeout
== Timeout_Never
)
82 m_banner
= hildon_banner_show_animation
86 GetFullMessage() // markup not supported here
91 else // the message will time out
93 // we don't have any way to set the timeout interval so we just let it
94 // time out automatically
95 hildon_banner_show_information_with_markup
106 bool wxNotificationMessage::Close()
110 // either we hadn't been shown or we are using an information banner
111 // which will disappear on its own, nothing we can do about it
115 gtk_widget_destroy(m_banner
);
121 wxNotificationMessage::~wxNotificationMessage()
126 #endif // wxUSE_LIBHILDON