Add template getter

This commit is contained in:
LAGonauta 2021-02-26 08:29:48 -03:00
parent 9d9b9e8e42
commit bc9b9b95e0
3 changed files with 19 additions and 0 deletions

View file

@ -1,12 +1,19 @@
#ifndef __WINRT_GLIB_2_H__ #ifndef __WINRT_GLIB_2_H__
#define __WINRT_GLIB_2_H__ #define __WINRT_GLIB_2_H__
#if !defined(WINRT_GLIB_H_INSIDE) && !defined(WINRT_GLIB_COMPILATION)
#error "Only <winrt-glib.h> can be included directly."
#endif
#include "winrt-enums.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {
#endif #endif
gboolean winrt_InitApartment(); gboolean winrt_InitApartment();
char* winrt_windows_ui_notifications_toast_notification_manager_GetTemplateContent(winrtWindowsUINotificationsToastTemplateType type);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -22,4 +22,10 @@ gboolean winrt_InitApartment()
} }
return false; return false;
}
char* winrt_windows_ui_notifications_toast_notification_manager_GetTemplateContent(winrtWindowsUINotificationsToastTemplateType type)
{
using namespace winrt::Windows::UI::Notifications;
return wsview_to_char(ToastNotificationManager::GetTemplateContent(static_cast<ToastTemplateType>(type)).GetXml());
} }

View file

@ -56,4 +56,10 @@ namespace winrt.Windows.UI.Notifications {
public void Show(ToastNotification notification); public void Show(ToastNotification notification);
public void Hide(ToastNotification notification); public void Hide(ToastNotification notification);
} }
[Compact]
[CCode]
public class ToastNotificationManager {
public static string GetTemplateContent(ToastTemplateType type);
}
} }