Add Win8+ toast notification to wxNotificationMessage.
Since Windows 8 there are native toast notifications available via WinRT defined in windows.ui.notifications.h. This adds support for these notifications via wxNotificationMessage. These notifications have to be explicitly enabled via wxNotificationMessage::MSWEnableToasts() because they require a start menu shortcut to the application.
This commit is contained in:
26
include/wx/msw/rt/private/notifmsg.h
Normal file
26
include/wx/msw/rt/private/notifmsg.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/msw/rt/private/notifmsg.h
|
||||
// Purpose: WinRT implementation of wxNotificationMessageImpl
|
||||
// Author: Tobias Taschner
|
||||
// Created: 2015-09-13
|
||||
// Copyright: (c) 2015 wxWidgets development team
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef _WX_MSW_RT_PRIVATE_NOTIFMSG_H_
|
||||
#define _WX_MSW_RT_PRIVATE_NOTIFMSG_H_
|
||||
|
||||
#include "wx/notifmsg.h"
|
||||
#include "wx/private/notifmsg.h"
|
||||
|
||||
class wxToastNotificationHelper
|
||||
{
|
||||
public:
|
||||
static bool UseToasts(const wxString& shortcutPath,
|
||||
const wxString& appId);
|
||||
|
||||
static bool IsEnabled();
|
||||
|
||||
static wxNotificationMessageImpl* CreateInstance(wxNotificationMessageBase* notification);
|
||||
};
|
||||
|
||||
#endif // _WX_MSW_RT_PRIVATE_NOTIFMSG_H_
|
@@ -160,9 +160,14 @@ public:
|
||||
}
|
||||
|
||||
#if defined(__WXMSW__) && defined(wxHAS_NATIVE_NOTIFICATION_MESSAGE)
|
||||
static bool MSWUseToasts(
|
||||
const wxString& shortcutPath = wxString(),
|
||||
const wxString& appId = wxString());
|
||||
|
||||
// returns the task bar icon which was used previously (may be NULL)
|
||||
static wxTaskBarIcon *UseTaskBarIcon(wxTaskBarIcon *icon);
|
||||
#endif
|
||||
|
||||
#endif // defined(__WXMSW__) && defined(wxHAS_NATIVE_NOTIFICATION_MESSAGE)
|
||||
|
||||
private:
|
||||
// common part of all ctors
|
||||
|
Reference in New Issue
Block a user