summaryrefslogtreecommitdiff
path: root/Runtime/Export/WSA/WSATiles.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Runtime/Export/WSA/WSATiles.txt')
-rw-r--r--Runtime/Export/WSA/WSATiles.txt848
1 files changed, 848 insertions, 0 deletions
diff --git a/Runtime/Export/WSA/WSATiles.txt b/Runtime/Export/WSA/WSATiles.txt
new file mode 100644
index 0000000..71d7ca4
--- /dev/null
+++ b/Runtime/Export/WSA/WSATiles.txt
@@ -0,0 +1,848 @@
+C++RAW
+
+#include "UnityPrefix.h"
+#include "Runtime/Math/Color.h"
+#include "Runtime/Math/Rect.h"
+#include "Runtime/Math/Vector2.h"
+#include "Runtime/Mono/MonoManager.h"
+#include "Runtime/Scripting/Scripting.h"
+#include "Runtime/Scripting/ScriptingUtility.h"
+#include "Runtime/Scripting/ScriptingExportUtility.h"
+#if UNITY_METRO
+ #include "PlatformDependent/MetroPlayer/MetroTiles.h"
+ typedef Windows::UI::Notifications::TileTemplateType TileTemplate;
+ typedef Windows::UI::Notifications::ToastTemplateType ToastTemplate;
+#else
+ typedef int TileTemplate;
+ typedef int ToastTemplate;
+#endif
+
+CSRAW
+using UnityEngine;
+
+namespace UnityEngine.WSA
+{
+
+CONDITIONAL UNITY_METRO_API
+ENUM TileTemplate
+ TileSquare150x150Image = 0,
+ TileSquare150x150Block = 1,
+ TileSquare150x150Text01 = 2,
+ TileSquare150x150Text02 = 3,
+ TileSquare150x150Text03 = 4,
+ TileSquare150x150Text04 = 5,
+ TileSquare150x150PeekImageAndText01 = 6,
+ TileSquare150x150PeekImageAndText02 = 7,
+ TileSquare150x150PeekImageAndText03 = 8,
+ TileSquare150x150PeekImageAndText04 = 9,
+ TileWide310x150Image = 10,
+ TileWide310x150ImageCollection = 11,
+ TileWide310x150ImageAndText01 = 12,
+ TileWide310x150ImageAndText02 = 13,
+ TileWide310x150BlockAndText01 = 14,
+ TileWide310x150BlockAndText02 = 15,
+ TileWide310x150PeekImageCollection01 = 16,
+ TileWide310x150PeekImageCollection02 = 17,
+ TileWide310x150PeekImageCollection03 = 18,
+ TileWide310x150PeekImageCollection04 = 19,
+ TileWide310x150PeekImageCollection05 = 20,
+ TileWide310x150PeekImageCollection06 = 21,
+ TileWide310x150PeekImageAndText01 = 22,
+ TileWide310x150PeekImageAndText02 = 23,
+ TileWide310x150PeekImage01 = 24,
+ TileWide310x150PeekImage02 = 25,
+ TileWide310x150PeekImage03 = 26,
+ TileWide310x150PeekImage04 = 27,
+ TileWide310x150PeekImage05 = 28,
+ TileWide310x150PeekImage06 = 29,
+ TileWide310x150SmallImageAndText01 = 30,
+ TileWide310x150SmallImageAndText02 = 31,
+ TileWide310x150SmallImageAndText03 = 32,
+ TileWide310x150SmallImageAndText04 = 33,
+ TileWide310x150SmallImageAndText05 = 34,
+ TileWide310x150Text01 = 35,
+ TileWide310x150Text02 = 36,
+ TileWide310x150Text03 = 37,
+ TileWide310x150Text04 = 38,
+ TileWide310x150Text05 = 39,
+ TileWide310x150Text06 = 40,
+ TileWide310x150Text07 = 41,
+ TileWide310x150Text08 = 42,
+ TileWide310x150Text09 = 43,
+ TileWide310x150Text10 = 44,
+ TileWide310x150Text11 = 45,
+ TileSquare310x310BlockAndText01 = 46,
+ TileSquare310x310BlockAndText02 = 47,
+ TileSquare310x310Image = 48,
+ TileSquare310x310ImageAndText01 = 49,
+ TileSquare310x310ImageAndText02 = 50,
+ TileSquare310x310ImageAndTextOverlay01 = 51,
+ TileSquare310x310ImageAndTextOverlay02 = 52,
+ TileSquare310x310ImageAndTextOverlay03 = 53,
+ TileSquare310x310ImageCollectionAndText01 = 54,
+ TileSquare310x310ImageCollectionAndText02 = 55,
+ TileSquare310x310ImageCollection = 56,
+ TileSquare310x310SmallImagesAndTextList01 = 57,
+ TileSquare310x310SmallImagesAndTextList02 = 58,
+ TileSquare310x310SmallImagesAndTextList03 = 59,
+ TileSquare310x310SmallImagesAndTextList04 = 60,
+ TileSquare310x310Text01 = 61,
+ TileSquare310x310Text02 = 62,
+ TileSquare310x310Text03 = 63,
+ TileSquare310x310Text04 = 64,
+ TileSquare310x310Text05 = 65,
+ TileSquare310x310Text06 = 66,
+ TileSquare310x310Text07 = 67,
+ TileSquare310x310Text08 = 68,
+ TileSquare310x310TextList01 = 69,
+ TileSquare310x310TextList02 = 70,
+ TileSquare310x310TextList03 = 71,
+ TileSquare310x310SmallImageAndText01 = 72,
+ TileSquare310x310SmallImagesAndTextList05 = 73,
+ TileSquare310x310Text09 = 74,
+END
+
+
+CONDITIONAL UNITY_METRO_API
+ENUM ToastTemplate
+ ToastImageAndText01 = 0,
+ ToastImageAndText02 = 1,
+ ToastImageAndText03 = 2,
+ ToastImageAndText04 = 3,
+ ToastText01 = 4,
+ ToastText02 = 5,
+ ToastText03 = 6,
+ ToastText04 = 7,
+END
+
+
+CONDITIONAL UNITY_METRO_API
+ENUM TileForegroundText
+{
+ Default = -1,
+ Dark = 0,
+ Light = 1
+}
+
+#if UNITY_METRO_API
+public struct SecondaryTileData
+{
+ public string arguments;
+ private Color32 background;
+ public Color32 backgroundColor
+ {
+ get {
+ return background;
+ }
+ set {
+ background = value;
+ backgroundColorSet = true;
+ }
+ }
+ public bool backgroundColorSet;
+ public string displayName;
+ public TileForegroundText foregroundText;
+ public string lockScreenBadgeLogo;
+ public bool lockScreenDisplayBadgeAndTileText;
+ public string phoneticName;
+ public bool roamingEnabled;
+ public bool showNameOnSquare150x150Logo;
+ public bool showNameOnSquare310x310Logo;
+ public bool showNameOnWide310x150Logo;
+ public string square150x150Logo;
+ public string square30x30Logo;
+ public string square310x310Logo;
+ public string square70x70Logo;
+ public string tileId;
+ public string wide310x150Logo;
+
+ public SecondaryTileData(string id, string displayName)
+ {
+ arguments = "";
+ background = new UnityEngine.Color32(0, 0, 0, 0);
+ backgroundColorSet = false;
+ this.displayName = displayName;
+ foregroundText = TileForegroundText.Default;
+ lockScreenBadgeLogo = "";
+ lockScreenDisplayBadgeAndTileText = false;
+ phoneticName = "";
+ roamingEnabled = true; // this is default in Win 8.1
+ showNameOnSquare150x150Logo = true;
+ showNameOnSquare310x310Logo = false;
+ showNameOnWide310x150Logo = false;
+ square150x150Logo = "";
+ square30x30Logo = "";
+ square310x310Logo = "";
+ square70x70Logo = "";
+ tileId = id;
+ wide310x150Logo = "";
+ }
+}
+#endif
+
+CONDITIONAL UNITY_METRO_API
+CLASS Tile
+
+ CSRAW private string m_TileId;
+
+ CSRAW private static Tile s_MainTile;
+
+ CSRAW private Tile(string tileId)
+ {
+ m_TileId = tileId;
+ }
+
+ CSRAW public static Tile main
+ {
+ get {
+ if (s_MainTile == null)
+ s_MainTile = new Tile("");
+ return s_MainTile;
+ }
+ }
+
+ CUSTOM public static string GetTemplate(TileTemplate templ)
+ {
+ #if UNITY_METRO
+ return scripting_string_new(metro::Tiles::GetTemplate(templ).c_str());
+ #else
+ return scripting_string_new("");
+ #endif
+ }
+
+ CSRAW public void Update(string xml)
+ {
+ Update(m_TileId, xml);
+ }
+
+ CUSTOM private static void Update(string tileId, string xml)
+ {
+ #if UNITY_METRO
+ metro::Tile::Ptr tile = metro::Tiles::Instance(tileId);
+ if (tile)
+ tile->Update(xml);
+ #endif
+ }
+
+ CSRAW public void Update(string medium, string wide, string large, string text)
+ {
+ UpdateImageAndText(m_TileId, medium, wide, large, text);
+ }
+
+ CUSTOM private static void UpdateImageAndText(string tileId, string medium, string wide, string large, string text)
+ {
+ #if UNITY_METRO
+ metro::Tile::Ptr tile = metro::Tiles::Instance(tileId);
+ if (tile)
+ tile->Update(medium, wide, large, text);
+ #endif
+ }
+
+ CSRAW public void PeriodicUpdate(string uri, float interval)
+ {
+ PeriodicUpdate(m_TileId, uri, interval);
+ }
+
+ CUSTOM private static void PeriodicUpdate(string tileId, string uri, float interval)
+ {
+ #if UNITY_METRO
+ metro::Tile::Ptr tile = metro::Tiles::Instance(tileId);
+ if (tile)
+ tile->PeriodicUpdate(uri, interval);
+ #endif
+ }
+
+ CSRAW public void StopPeriodicUpdate()
+ {
+ StopPeriodicUpdate(m_TileId);
+ }
+
+ CUSTOM private static void StopPeriodicUpdate(string tileId)
+ {
+ #if UNITY_METRO
+ metro::Tile::Ptr tile = metro::Tiles::Instance(tileId);
+ if (tile)
+ tile->StopPeriodicUpdate();
+ #endif
+ }
+
+ CSRAW public void UpdateBadgeImage(string image)
+ {
+ UpdateBadgeImage(m_TileId, image);
+ }
+
+ CUSTOM private static void UpdateBadgeImage(string tileId, string image)
+ {
+ #if UNITY_METRO
+ metro::Tile::Ptr tile = metro::Tiles::Instance(tileId);
+ if (tile)
+ tile->UpdateBadgeImage(image);
+ #endif
+ }
+
+ CSRAW public void UpdateBadgeNumber(float number)
+ {
+ UpdateBadgeNumber(m_TileId, number);
+ }
+
+ CUSTOM private static void UpdateBadgeNumber(string tileId, float number)
+ {
+ #if UNITY_METRO
+ metro::Tile::Ptr tile = metro::Tiles::Instance(tileId);
+ if (tile)
+ tile->UpdateBadgeNumber(number);
+ #endif
+ }
+
+ CSRAW public void RemoveBadge()
+ {
+ RemoveBadge(m_TileId);
+ }
+
+ CUSTOM private static void RemoveBadge(string tileId)
+ {
+ #if UNITY_METRO
+ metro::Tile::Ptr tile = metro::Tiles::Instance(tileId);
+ if (tile)
+ tile->RemoveBadge();
+ #endif
+ }
+
+ CSRAW public void PeriodicBadgeUpdate(string uri, float interval)
+ {
+ PeriodicBadgeUpdate(m_TileId, uri, interval);
+ }
+
+ CUSTOM private static void PeriodicBadgeUpdate(string tileId, string uri, float interval)
+ {
+ #if UNITY_METRO
+ metro::Tile::Ptr tile = metro::Tiles::Instance(tileId);
+ if (tile)
+ tile->PeriodicBadgeUpdate(uri, interval);
+ #endif
+ }
+
+ CSRAW public void StopPeriodicBadgeUpdate()
+ {
+ StopPeriodicBadgeUpdate(m_TileId);
+ }
+
+ CUSTOM private static void StopPeriodicBadgeUpdate(string tileId)
+ {
+ #if UNITY_METRO
+ metro::Tile::Ptr tile = metro::Tiles::Instance(tileId);
+ if (tile)
+ tile->StopPeriodicBadgeUpdate();
+ #endif
+ }
+
+ CSRAW public string id
+ {
+ get {
+ return m_TileId;
+ }
+ }
+
+
+ CSRAW public bool hasUserConsent
+ {
+ get {
+ return HasUserConsent(m_TileId);
+ }
+ }
+
+ CUSTOM private static bool HasUserConsent(string tileId)
+ {
+ #if UNITY_METRO
+ metro::Tile::Ptr tile = metro::Tiles::Instance(tileId);
+ return tile ? tile->HasUserConsent() : true; // No tile means user removed/rejected
+ #else
+ return false;
+ #endif
+ }
+
+ CSRAW public bool exists
+ {
+ get {
+ return Exists(m_TileId);
+ }
+ }
+
+ CUSTOM public static bool Exists(string tileId)
+ {
+ #if UNITY_METRO
+ return metro::Tiles::Instance(tileId) != NULL;
+ #else
+ return false;
+ #endif
+ }
+
+ CSRAW private static string[] MakeSecondaryTileSargs(SecondaryTileData data)
+ {
+ string[] sargs = new string[10];
+ sargs[0] = data.arguments;
+ sargs[1] = data.displayName;
+ sargs[2] = data.lockScreenBadgeLogo;
+ sargs[3] = data.phoneticName;
+ sargs[4] = data.square150x150Logo;
+ sargs[5] = data.square30x30Logo;
+ sargs[6] = data.square310x310Logo;
+ sargs[7] = data.square70x70Logo;
+ sargs[8] = data.tileId;
+ sargs[9] = data.wide310x150Logo;
+ return sargs;
+ }
+
+ CSRAW private static bool[] MakeSecondaryTileBargs(SecondaryTileData data)
+ {
+ bool[] bargs = new bool[6];
+ bargs[0] = data.backgroundColorSet;
+ bargs[1] = data.lockScreenDisplayBadgeAndTileText;
+ bargs[2] = data.roamingEnabled;
+ bargs[3] = data.showNameOnSquare150x150Logo;
+ bargs[4] = data.showNameOnSquare310x310Logo;
+ bargs[5] = data.showNameOnWide310x150Logo;
+ return bargs;
+ }
+
+ CSRAW public static Tile CreateOrUpdateSecondary(SecondaryTileData data)
+ {
+ string[] sargs = MakeSecondaryTileSargs(data);
+ bool[] bargs = MakeSecondaryTileBargs(data);
+ Color32 backgroundColor = data.backgroundColor;
+
+ string tileId = CreateOrUpdateSecondaryTile(
+ sargs,
+ bargs,
+ ref backgroundColor,
+ (int) data.foregroundText
+ );
+ if (string.IsNullOrEmpty(tileId))
+ return null;
+ return new Tile(tileId);
+ }
+
+ // On Win 8.0 there is limitation on argument count, so we pass them as arrays
+ CUSTOM private static string CreateOrUpdateSecondaryTile(
+ string[] sargs,
+ bool[] bargs,
+ ref Color32 backgroundColor,
+ int foregroundText
+ )
+ {
+ #if UNITY_METRO
+ std::string arguments = GetStringFromArray(sargs, 0);
+ std::string displayName = GetStringFromArray(sargs, 1);
+ std::string lockScreenBadgeLogo = GetStringFromArray(sargs, 2);
+ std::string phoneticName = GetStringFromArray(sargs, 3);
+ std::string square150x150Logo = GetStringFromArray(sargs, 4);
+ std::string square30x30Logo = GetStringFromArray(sargs, 5);
+ std::string square310x310Logo = GetStringFromArray(sargs, 6);
+ std::string square70x70Logo = GetStringFromArray(sargs, 7);
+ std::string tileId = GetStringFromArray(sargs, 8);
+ std::string wide310x150Logo = GetStringFromArray(sargs, 9);
+
+ bool backgroundColorSet = GetBoolFromArray(bargs, 0);
+ bool lockScreenDisplayBadgeAndTileText = GetBoolFromArray(bargs, 1);
+ bool roamingEnabled = GetBoolFromArray(bargs, 2);
+ bool showNameOnSquare150x150Logo = GetBoolFromArray(bargs, 3);
+ bool showNameOnSquare310x310Logo = GetBoolFromArray(bargs, 4);
+ bool showNameOnWide310x150Logo = GetBoolFromArray(bargs, 5);
+
+
+ return scripting_string_new(metro::Tiles::CreateOrUpdateSecondary(
+ arguments,
+ backgroundColor,
+ backgroundColorSet,
+ displayName,
+ foregroundText,
+ lockScreenBadgeLogo,
+ lockScreenDisplayBadgeAndTileText,
+ phoneticName,
+ roamingEnabled,
+ showNameOnSquare150x150Logo,
+ showNameOnSquare310x310Logo,
+ showNameOnWide310x150Logo,
+ square150x150Logo,
+ square30x30Logo,
+ square310x310Logo,
+ square70x70Logo,
+ tileId,
+ wide310x150Logo
+ )->GetId());
+ #else
+ return scripting_string_new("");
+ #endif
+ }
+
+ CSRAW public static Tile CreateOrUpdateSecondary(SecondaryTileData data, Vector2 pos)
+ {
+ string[] sargs = MakeSecondaryTileSargs(data);
+ bool[] bargs = MakeSecondaryTileBargs(data);
+ Color32 backgroundColor = data.backgroundColor;
+
+ string tileId = CreateOrUpdateSecondaryTilePoint(
+ sargs,
+ bargs,
+ ref backgroundColor,
+ (int) data.foregroundText,
+ pos
+ );
+ if (string.IsNullOrEmpty(tileId))
+ return null;
+ return new Tile(tileId);
+ }
+
+ CUSTOM private static string CreateOrUpdateSecondaryTilePoint(
+ string[] sargs,
+ bool[] bargs,
+ ref Color32 backgroundColor,
+ int foregroundText,
+ Vector2 pos
+ )
+ {
+ #if UNITY_METRO
+ std::string arguments = GetStringFromArray(sargs, 0);
+ std::string displayName = GetStringFromArray(sargs, 1);
+ std::string lockScreenBadgeLogo = GetStringFromArray(sargs, 2);
+ std::string phoneticName = GetStringFromArray(sargs, 3);
+ std::string square150x150Logo = GetStringFromArray(sargs, 4);
+ std::string square30x30Logo = GetStringFromArray(sargs, 5);
+ std::string square310x310Logo = GetStringFromArray(sargs, 6);
+ std::string square70x70Logo = GetStringFromArray(sargs, 7);
+ std::string tileId = GetStringFromArray(sargs, 8);
+ std::string wide310x150Logo = GetStringFromArray(sargs, 9);
+
+ bool backgroundColorSet = GetBoolFromArray(bargs, 0);
+ bool lockScreenDisplayBadgeAndTileText = GetBoolFromArray(bargs, 1);
+ bool roamingEnabled = GetBoolFromArray(bargs, 2);
+ bool showNameOnSquare150x150Logo = GetBoolFromArray(bargs, 3);
+ bool showNameOnSquare310x310Logo = GetBoolFromArray(bargs, 4);
+ bool showNameOnWide310x150Logo = GetBoolFromArray(bargs, 5);
+
+ return scripting_string_new(metro::Tiles::CreateOrUpdateSecondary(
+ arguments,
+ backgroundColor,
+ backgroundColorSet,
+ displayName,
+ foregroundText,
+ lockScreenBadgeLogo,
+ lockScreenDisplayBadgeAndTileText,
+ phoneticName,
+ roamingEnabled,
+ showNameOnSquare150x150Logo,
+ showNameOnSquare310x310Logo,
+ showNameOnWide310x150Logo,
+ square150x150Logo,
+ square30x30Logo,
+ square310x310Logo,
+ square70x70Logo,
+ tileId,
+ wide310x150Logo,
+ pos
+ )->GetId());
+ #else
+ return scripting_string_new("");
+ #endif
+ }
+
+ CSRAW public static Tile CreateOrUpdateSecondary(SecondaryTileData data, Rect area)
+ {
+ string[] sargs = MakeSecondaryTileSargs(data);
+ bool[] bargs = MakeSecondaryTileBargs(data);
+ Color32 backgroundColor = data.backgroundColor;
+
+ string tileId = CreateOrUpdateSecondaryTileArea(
+ sargs,
+ bargs,
+ ref backgroundColor,
+ (int) data.foregroundText,
+ area
+ );
+ if (string.IsNullOrEmpty(tileId))
+ return null;
+ return new Tile(tileId);
+ }
+
+ CUSTOM private static string CreateOrUpdateSecondaryTileArea(
+ string[] sargs,
+ bool[] bargs,
+ ref Color32 backgroundColor,
+ int foregroundText,
+ Rect area
+ )
+ {
+ #if UNITY_METRO
+ std::string arguments = GetStringFromArray(sargs, 0);
+ std::string displayName = GetStringFromArray(sargs, 1);
+ std::string lockScreenBadgeLogo = GetStringFromArray(sargs, 2);
+ std::string phoneticName = GetStringFromArray(sargs, 3);
+ std::string square150x150Logo = GetStringFromArray(sargs, 4);
+ std::string square30x30Logo = GetStringFromArray(sargs, 5);
+ std::string square310x310Logo = GetStringFromArray(sargs, 6);
+ std::string square70x70Logo = GetStringFromArray(sargs, 7);
+ std::string tileId = GetStringFromArray(sargs, 8);
+ std::string wide310x150Logo = GetStringFromArray(sargs, 9);
+
+ bool backgroundColorSet = GetBoolFromArray(bargs, 0);
+ bool lockScreenDisplayBadgeAndTileText = GetBoolFromArray(bargs, 1);
+ bool roamingEnabled = GetBoolFromArray(bargs, 2);
+ bool showNameOnSquare150x150Logo = GetBoolFromArray(bargs, 3);
+ bool showNameOnSquare310x310Logo = GetBoolFromArray(bargs, 4);
+ bool showNameOnWide310x150Logo = GetBoolFromArray(bargs, 5);
+
+ return scripting_string_new(metro::Tiles::CreateOrUpdateSecondary(
+ arguments,
+ backgroundColor,
+ backgroundColorSet,
+ displayName,
+ foregroundText,
+ lockScreenBadgeLogo,
+ lockScreenDisplayBadgeAndTileText,
+ phoneticName,
+ roamingEnabled,
+ showNameOnSquare150x150Logo,
+ showNameOnSquare310x310Logo,
+ showNameOnWide310x150Logo,
+ square150x150Logo,
+ square30x30Logo,
+ square310x310Logo,
+ square70x70Logo,
+ tileId,
+ wide310x150Logo,
+ area
+ )->GetId());
+ #else
+ return scripting_string_new("");
+ #endif
+ }
+
+ CSRAW public static Tile GetSecondary(string tileId)
+ {
+ if (Exists(tileId))
+ return new Tile(tileId);
+ return null;
+ }
+
+ CSRAW public static Tile[] GetSecondaries()
+ {
+ string[] ids = GetAllSecondaryTiles();
+ Tile[] tiles = new Tile[ids.Length];
+ for (int i = 0; i < ids.Length; ++i)
+ tiles[i] = new Tile(ids[i]);
+ return tiles;
+ }
+
+ CUSTOM private static string[] GetAllSecondaryTiles()
+ {
+ #if UNITY_METRO
+ return Scripting::StringVectorToMono(metro::Tiles::GetSecondaries());
+ #else
+ return ScriptingArrayPtr();
+ #endif
+ }
+
+ CSRAW public void Delete()
+ {
+ DeleteSecondary(m_TileId);
+ }
+
+ CUSTOM public static void DeleteSecondary(string tileId)
+ {
+ #if UNITY_METRO
+ metro::Tiles::Delete(tileId);
+ #endif
+ }
+
+ CSRAW public void Delete(Vector2 pos)
+ {
+ DeleteSecondaryPos(m_TileId, pos);
+ }
+
+ CSRAW public static void DeleteSecondary(string tileId, Vector2 pos)
+ {
+ DeleteSecondaryPos(tileId, pos);
+ }
+
+ CUSTOM private static void DeleteSecondaryPos(string tileId, Vector2 pos)
+ {
+ #if UNITY_METRO
+ metro::Tiles::Delete(tileId, pos);
+ #endif
+ }
+
+ CSRAW public void Delete(Rect area)
+ {
+ DeleteSecondaryArea(m_TileId, area);
+ }
+
+ CSRAW public static void DeleteSecondary(string tileId, Rect area)
+ {
+ DeleteSecondary(tileId, area);
+ }
+
+ CUSTOM private static void DeleteSecondaryArea(string tileId, Rect area)
+ {
+ #if UNITY_METRO
+ metro::Tiles::Delete(tileId, area);
+ #endif
+ }
+
+END
+
+
+CONDITIONAL UNITY_METRO_API
+CLASS Toast
+ CSRAW private int m_ToastId;
+
+ CSRAW private Toast(int id)
+ {
+ m_ToastId = id;
+ }
+
+ CUSTOM public static string GetTemplate(ToastTemplate templ)
+ {
+ #if UNITY_METRO
+ return scripting_string_new(metro::Toasts::GetTemplate(templ));
+ #else
+ return scripting_string_new("");
+ #endif
+ }
+
+ CSRAW public static Toast Create(string xml)
+ {
+ int id = CreateToastXml(xml);
+ if (id < 0)
+ return null;
+ return new Toast(id);
+ }
+
+ CUSTOM private static int CreateToastXml(string xml)
+ {
+ #if UNITY_METRO
+ return metro::Toasts::Create(xml);
+ #else
+ return 0;
+ #endif
+ }
+
+ CSRAW public static Toast Create(string image, string text)
+ {
+ int id = CreateToastImageAndText(image, text);
+ if (id < 0)
+ return null;
+ return new Toast(id);
+ }
+
+ CUSTOM private static int CreateToastImageAndText(string image, string text)
+ {
+ #if UNITY_METRO
+ return metro::Toasts::Create(image, text);
+ #else
+ return 0;
+ #endif
+ }
+
+ CSRAW public string arguments
+ {
+ get {
+ return GetArguments(m_ToastId);
+ }
+ set {
+ SetArguments(m_ToastId, value);
+ }
+ }
+
+ CUSTOM private static string GetArguments(int id)
+ {
+ #if UNITY_METRO
+ metro::Toast::Ptr toast = metro::Toasts::Instance(id);
+ if (toast)
+ return scripting_string_new(toast->GetArguments());
+ return scripting_string_new("");
+ #else
+ return scripting_string_new("");
+ #endif
+ }
+
+ CUSTOM private static void SetArguments(int id, string args)
+ {
+ #if UNITY_METRO
+ metro::Toast::Ptr toast = metro::Toasts::Instance(id);
+ if (toast)
+ toast->SetArguments(args);
+ #endif
+ }
+
+ CSRAW public void Show()
+ {
+ Show(m_ToastId);
+ }
+
+ CUSTOM private static void Show(int id)
+ {
+ #if UNITY_METRO
+ metro::Toast::Ptr toast = metro::Toasts::Instance(id);
+ if (toast)
+ toast->Show();
+ #endif
+ }
+
+ CSRAW public void Hide()
+ {
+ Hide(m_ToastId);
+ }
+
+ CUSTOM private static void Hide(int id)
+ {
+ #if UNITY_METRO
+ metro::Toast::Ptr toast = metro::Toasts::Instance(id);
+ if (toast)
+ toast->Hide();
+ #endif
+ }
+
+ CSRAW public bool activated
+ {
+ get {
+ return GetActivated(m_ToastId);
+ }
+ }
+
+ CUSTOM private static bool GetActivated(int id)
+ {
+ #if UNITY_METRO
+ metro::Toast::Ptr toast = metro::Toasts::Instance(id);
+ return toast ? toast->GetActivated() : false;
+ #else
+ return false;
+ #endif
+ }
+
+ CSRAW public bool dismissed
+ {
+ get {
+ return GetDismissed(m_ToastId, false);
+ }
+ }
+
+ CSRAW public bool dismissedByUser
+ {
+ get {
+ return GetDismissed(m_ToastId, true);
+ }
+ }
+
+ CUSTOM private static bool GetDismissed(int id, bool byUser)
+ {
+ #if UNITY_METRO
+ metro::Toast::Ptr toast = metro::Toasts::Instance(id);
+ return toast ? toast->GetDismissed(byUser) : false;
+ #else
+ return false;
+ #endif
+ }
+END
+
+CSRAW
+}