summaryrefslogtreecommitdiff
path: root/plugins/Toaster
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-08-31 19:33:42 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-08-31 19:33:42 +0000
commit459bb02b8e0ad90693590fa1a5b161963acd091f (patch)
tree49091e2b7fb00c335bd332b5f3234b8cc01ec0c9 /plugins/Toaster
parent622986e86b7cae1dcc4ce42cecf679f1c48c2d25 (diff)
Toaster: loading toast template through string
git-svn-id: http://svn.miranda-ng.org/main/trunk@15129 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Toaster')
-rw-r--r--plugins/Toaster/src/toast_notification.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/plugins/Toaster/src/toast_notification.cpp b/plugins/Toaster/src/toast_notification.cpp
index 2e9bf89596..5a17833102 100644
--- a/plugins/Toaster/src/toast_notification.cpp
+++ b/plugins/Toaster/src/toast_notification.cpp
@@ -166,13 +166,33 @@ HRESULT ToastNotification::Setup(_In_ ABI::Windows::Data::Xml::Dom::IXmlDocument
HRESULT ToastNotification::CreateXml(_Outptr_ ABI::Windows::Data::Xml::Dom::IXmlDocument** xml)
{
- ABI::Windows::UI::Notifications::ToastTemplateType templateId = _imagePath == nullptr
+ Microsoft::WRL::ComPtr<ABI::Windows::Data::Xml::Dom::IXmlDocumentIO> xmlDocument;
+ HRESULT hr = Windows::Foundation::ActivateInstance(StringReferenceWrapper(RuntimeClass_Windows_Data_Xml_Dom_XmlDocument).Get(), &xmlDocument);
+ if (FAILED(hr))
+ return hr;
+
+ if(_imagePath == nullptr)
+ {
+ hr = xmlDocument->LoadXml(StringReferenceWrapper(L"<toast><visual><binding template=\"ToastText02\"><text id=\"1\"></text><text id=\"2\"></text></binding></visual></toast>").Get());
+ }
+ else
+ {
+ hr = xmlDocument->LoadXml(StringReferenceWrapper(L"<toast><visual><binding template=\"ToastImageAndText02\"><image id=\"1\" src=\"\"/><text id=\"1\"></text><text id=\"2\"></text></binding></visual></toast>").Get());
+ }
+ if (FAILED(hr))
+ return hr;
+
+ hr = xmlDocument.CopyTo(xml);
+ if (FAILED(hr))
+ return hr;
+
+ /*ABI::Windows::UI::Notifications::ToastTemplateType templateId = _imagePath == nullptr
? ABI::Windows::UI::Notifications::ToastTemplateType_ToastText02
: ABI::Windows::UI::Notifications::ToastTemplateType_ToastImageAndText02;
HRESULT hr = notificationManager->GetTemplateContent(templateId, xml);
if (FAILED(hr))
- return hr;
+ return hr;*/
hr = Setup(*xml);
if (FAILED(hr))