1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/gtk/hildon/notifmsg.cpp
3 // Purpose: Hildon implementation of wxNotificationMessage
4 // Author: Vadim Zeitlin
6 // Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 // ============================================================================
12 // ============================================================================
14 // ----------------------------------------------------------------------------
16 // ----------------------------------------------------------------------------
18 // for compilers that support precompilation, includes "wx.h".
19 #include "wx/wxprec.h"
25 #if wxUSE_LIBHILDON || wxUSE_LIBHILDON2
30 #include "wx/notifmsg.h"
31 #include "wx/toplevel.h"
34 #include <hildon-widgets/hildon-banner.h>
35 #endif // wxUSE_LIBHILDON
38 #include <hildon/hildon.h>
39 #endif // wxUSE_LIBHILDON2
41 // ============================================================================
42 // wxNotificationMessage implementation
43 // ============================================================================
45 wxString
wxNotificationMessage::HildonGetMarkup() const
47 const wxString
& message
= GetMessage(),
51 if ( message
.empty() )
55 else // combine title with message in a single string
57 text
<< "<big><b>" << title
<< "</b></big>\n"
65 GtkWidget
*wxNotificationMessage::HildonGetWindow() const
67 wxWindow
*parent
= GetParent();
70 parent
= wxGetTopLevelParent(parent
);
73 wxTopLevelWindow
* const
74 tlw
= wxDynamicCast(parent
, wxTopLevelWindow
);
76 return tlw
->m_mainWidget
;
83 bool wxNotificationMessage::Show(int timeout
)
85 if ( timeout
== Timeout_Never
)
87 m_banner
= hildon_banner_show_animation
91 GetFullMessage() // markup not supported here
96 else // the message will time out
98 // we don't have any way to set the timeout interval so we just let it
99 // time out automatically
100 hildon_banner_show_information_with_markup
111 bool wxNotificationMessage::Close()
115 // either we hadn't been shown or we are using an information banner
116 // which will disappear on its own, nothing we can do about it
120 gtk_widget_destroy(m_banner
);
126 wxNotificationMessage::~wxNotificationMessage()
131 #endif // wxUSE_LIBHILDON || wxUSE_LIBHILDON2