[DllImport(Libraries.Notification, EntryPoint = "notification_set_delete_timeout")]
internal static extern NotificationError SetDeleteTime(NotificationSafeHandle handle, int timeout);
- [DllImport(Libraries.Notification, EntryPoint = "notification_set_extension_image_size")]
- internal static extern NotificationError SetBigPictureSize(NotificationSafeHandle handle, int size);
-
- [DllImport(Libraries.Notification, EntryPoint = "notification_get_extension_image_size")]
- internal static extern NotificationError GetBigPictureSize(NotificationSafeHandle handle, out int size);
-
[DllImport(Libraries.Notification, EntryPoint = "notification_set_extention_data")]
internal static extern NotificationError SetExtentionData(NotificationSafeHandle handle, string key, SafeBundleHandle bundleHandle);
IndicatorBinder.BindSafeHandle(this);
ActiveBinder.BindSafeHandle(this);
LockBinder.BindSafehandle(this);
- BigPictureBinder.BindSafeHandle(this);
return this;
}
+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-namespace Tizen.Applications.Notifications
-{
- /// <summary>
- /// Class containing common properties and methods of Notifications
- /// </summary>
- /// <remarks>
- /// A notification is a message that is displayed on the notification area.
- /// It is created to notify information to the user through the application.
- /// This class helps you to provide method and property for creating notification object.
- /// </remarks>
- public sealed partial class Notification
- {
- /// <summary>
- /// Class for generating BigPicture style notification
- /// </summary>
- public sealed class BigPictureStyle : StyleBase
- {
- /// <summary>
- /// Gets or sets the absolute path for a big picture image file to display on BigPicture style of the notification.
- /// </summary>
- public string ImagePath { get; set; }
-
- /// <summary>
- /// Gets or sets the absolute path for a big picture image size to display on BigPicture style of the notification.
- /// </summary>
- /// <value>
- /// This value is only height size.
- /// </value>>
- public int ImageSize { get; set; }
-
- /// <summary>
- /// Gets or sets the content text to display on BigPicture style of the notification.
- /// </summary>
- public string Content { get; set; }
-
- /// <summary>
- /// Gets the key of BigPictureStyle
- /// </summary>
- internal override string Key
- {
- get
- {
- return "BigPicture";
- }
- }
-
- internal override void Make(Notification notification)
- {
- BigPictureBinder.BindObject(notification);
- }
- }
- }
-}
\ No newline at end of file
ThirdButton = 15,
PlaceHolder = 19,
InputButton = 20,
- BigPicture = 21,
}
internal enum NotificationImage
SecondButton,
ThirdButton,
TextInputButton = 18,
- BigPicture = 19,
}
internal enum LaunchOption
}
}
}
-
- internal static class BigPictureBinder
- {
- internal static void BindObject(Notification notification)
- {
- Notification.BigPictureStyle style = (Notification.BigPictureStyle)notification.GetStyle("BigPicture");
-
- Interop.Notification.SetImage(notification.Handle, NotificationImage.BigPicture, style.ImagePath);
- Interop.Notification.SetBigPictureSize(notification.Handle, style.ImageSize);
- Interop.Notification.SetText(notification.Handle, NotificationText.BigPicture, style.Content, null, -1);
- Interop.Notification.SetLayout(notification.Handle, NotificationLayout.Extension);
- }
-
- internal static void BindSafeHandle(Notification notification)
- {
- NotificationLayout layout;
-
- Interop.Notification.GetLayout(notification.Handle, out layout);
- if (layout == NotificationLayout.Extension)
- {
- Notification.BigPictureStyle style = new Notification.BigPictureStyle();
-
- string text;
- Interop.Notification.GetImage(notification.Handle, NotificationImage.BigPicture, out text);
- style.ImagePath = text;
-
- int size;
- Interop.Notification.GetBigPictureSize(notification.Handle, out size);
- style.ImageSize = size;
-
- Interop.Notification.GetText(notification.Handle, NotificationText.BigPicture, out text);
- style.Content = text;
-
- notification.AddStyle(style);
- }
- }
- }
}
[DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_text_input_max_length")]
internal static extern ErrorCode GetPlaceHolderLength(SafeNotificationHandle handle, out int max);
- [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_extension_image_size")]
- internal static extern ErrorCode GetBigPictureSize(SafeNotificationHandle handle, out int size);
-
[DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_launch_option")]
internal static extern ErrorCode GetAppControl(SafeNotificationHandle handle, LaunchOption type, out SafeAppControlHandle appControlHandle);
+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-namespace Tizen.Applications.NotificationEventListener
-{
- /// <summary>
- /// This class provides the methods and properties to get information about the posted or updated notification.
- /// </summary>
- public partial class NotificationEventArgs
- {
- /// <summary>
- /// Class to get infomation about Notification BigPticture style.
- /// </summary>
- public class BigPictureStyleArgs : StyleArgs
- {
- /// <summary>
- /// Gets the path of the image file to display on the image of BigPicture style.
- /// </summary>
- public string ImagePath { get; internal set; }
-
- /// <summary>
- /// Gets the size image to display on the image of BigPicture style.
- /// </summary>
- public int ImageSize { get; internal set; }
-
- /// <summary>
- /// Gets the content to display BigPicture style.
- /// </summary>
- public string Content { get; internal set; }
-
- internal override string Key
- {
- get
- {
- return "BigPicture";
- }
- }
- }
- }
-}
/// Text on button the on message reply box
/// </summary>
InputButton = 20,
-
- /// <summary>
- /// Content for extended notification
- /// </summary>
- ContentExtension = 21,
}
/// <summary>
/// Image for message reply
/// </summary>
TextInputButton = 18,
-
- /// <summary>
- /// Image for extended notification
- /// </summary>
- BigPicture = 19,
}
/// <summary>
/// Layout for ongoing notification. Used to display progress
/// </summary>
OngoingProgress = 5,
-
- /// <summary>
- /// Layout for extended notification
- /// </summary>
- Extension = 6
}
/// <summary>
bool autoRemove;
string path;
int styleList;
- int size;
int timeout;
- NotificationLayout layout;
Interop.NotificationEventListener.GetStyleList(eventargs.Handle, out styleList);
Interop.NotificationEventListener.GetText(eventargs.Handle, NotificationText.FirstMainText, out path);
indicatorStyle.SubText = path;
}
-
- Interop.NotificationEventListener.GetLayout(eventargs.Handle, out layout);
- if (layout == NotificationLayout.Extension)
- {
- NotificationEventArgs.BigPictureStyleArgs bigpictureStyle = new NotificationEventArgs.BigPictureStyleArgs();
-
- Interop.NotificationEventListener.GetImage(eventargs.Handle, NotificationImage.BigPicture, out path);
- if (string.IsNullOrEmpty(path) == false)
- {
- bigpictureStyle.ImagePath = path;
- }
-
- Interop.NotificationEventListener.GetBigPictureSize(eventargs.Handle, out size);
- if (size > 0)
- {
- bigpictureStyle.ImageSize = size;
- }
-
- Interop.NotificationEventListener.GetText(eventargs.Handle, NotificationText.ContentExtension, out path);
- if (string.IsNullOrEmpty(path) == false)
- {
- bigpictureStyle.Content = path;
- }
-
- eventargs.Style.Add(bigpictureStyle.Key, bigpictureStyle);
- }
- }
+ }
}
-}
\ No newline at end of file
+}