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"
26 #if wxUSE_LIBHILDON || wxUSE_LIBHILDON2
31 #include "wx/notifmsg.h"
32 #include "wx/toplevel.h"
35 #include <hildon-widgets/hildon-banner.h>
36 #endif // wxUSE_LIBHILDON
39 #include <hildon/hildon.h>
40 #endif // wxUSE_LIBHILDON2
42 // ============================================================================
43 // wxNotificationMessage implementation
44 // ============================================================================
46 wxString
wxNotificationMessage::HildonGetMarkup() const
48 const wxString
& message
= GetMessage(),
52 if ( message
.empty() )
56 else // combine title with message in a single string
58 text
<< "<big><b>" << title
<< "</b></big>\n"
66 GtkWidget
*wxNotificationMessage::HildonGetWindow() const
68 wxWindow
*parent
= GetParent();
71 parent
= wxGetTopLevelParent(parent
);
74 wxTopLevelWindow
* const
75 tlw
= wxDynamicCast(parent
, wxTopLevelWindow
);
77 return tlw
->m_mainWidget
;
84 bool wxNotificationMessage::Show(int timeout
)
86 if ( timeout
== Timeout_Never
)
88 m_banner
= hildon_banner_show_animation
92 GetFullMessage() // markup not supported here
97 else // the message will time out
99 // we don't have any way to set the timeout interval so we just let it
100 // time out automatically
101 hildon_banner_show_information_with_markup
112 bool wxNotificationMessage::Close()
116 // either we hadn't been shown or we are using an information banner
117 // which will disappear on its own, nothing we can do about it
121 gtk_widget_destroy(m_banner
);
127 wxNotificationMessage::~wxNotificationMessage()
132 #endif // wxUSE_LIBHILDON || wxUSE_LIBHILDON2