[ACR-564] deprecate unused API
[platform/core/csapi/tizenfx.git] / src / ElmSharp / ElmSharp / Label.cs
old mode 100755 (executable)
new mode 100644 (file)
index 77fa79b..4be595d
  */
 
 using System;
-
 namespace ElmSharp
 {
     /// <summary>
-    /// Label is a widget to display text, with simple html-like markup.
-    /// Inherits Layout
+    /// The Label is a widget to display text, with a simple HTML-like markup.
+    /// Inherits Layout.
     /// </summary>
+    /// <since_tizen> preview </since_tizen>
+    [Obsolete("This has been deprecated in API12")]
     public class Label : Layout
     {
         SmartEvent _slideCompleted;
 
         /// <summary>
-        /// Creates and initializes a new instance of Label class.
+        /// Creates and initializes a new instance of the Label class.
         /// </summary>
-        /// <param name="parent">The parent is a given container which will be attached by Label as a child. It's <see cref="EvasObject"/> type.</param>
+        /// <param name="parent">The parent is a given container, which will be attached by the Label as a child. It's <see cref="EvasObject"/> type.</param>
+        /// <since_tizen> preview </since_tizen>
+        [Obsolete("This has been deprecated in API12")]
         public Label(EvasObject parent) : base(parent)
         {
             _slideCompleted = new SmartEvent(this, this.RealHandle, "slide,end");
@@ -42,11 +45,15 @@ namespace ElmSharp
         /// <summary>
         /// SlideCompleted will be triggered when the slide is completed.
         /// </summary>
+        /// <since_tizen> preview </since_tizen>
+        [Obsolete("This has been deprecated in API12")]
         public event EventHandler SlideCompleted;
 
         /// <summary>
-        /// Sets or gets wrap width of the label.
+        /// Sets or gets the wrap width of the label.
         /// </summary>
+        /// <since_tizen> preview </since_tizen>
+        [Obsolete("This has been deprecated in API12")]
         public int LineWrapWidth
         {
             get
@@ -62,6 +69,8 @@ namespace ElmSharp
         /// <summary>
         /// Sets or gets the wrapping behavior of the label.
         /// </summary>
+        /// <since_tizen> preview </since_tizen>
+        [Obsolete("This has been deprecated in API12")]
         public WrapType LineWrapType
         {
             get
@@ -71,12 +80,19 @@ namespace ElmSharp
             set
             {
                 Interop.Elementary.elm_label_line_wrap_set(RealHandle, (int)value);
+                if (value != WrapType.None)
+                {
+                    Interop.Evas.evas_object_size_hint_min_get(RealHandle, IntPtr.Zero, out int h);
+                    Interop.Evas.evas_object_size_hint_min_set(RealHandle, 0, h);
+                }
             }
         }
 
         /// <summary>
-        /// Sets or gets the slide mode of the label widget.
+        /// Sets or gets the slide mode of the Label widget.
         /// </summary>
+        /// <since_tizen> preview </since_tizen>
+        [Obsolete("This has been deprecated in API12")]
         public LabelSlideMode SlideMode
         {
             get
@@ -92,6 +108,8 @@ namespace ElmSharp
         /// <summary>
         /// Sets or gets the slide duration of the label.
         /// </summary>
+        /// <since_tizen> preview </since_tizen>
+        [Obsolete("This has been deprecated in API12")]
         public double SlideDuration
         {
             get
@@ -105,13 +123,15 @@ namespace ElmSharp
         }
 
         /// <summary>
-        /// Sets or gets the slide Speed of the label.
+        /// Sets or gets the slide speed of the label.
         /// </summary>
         /// <remarks>
         /// The speed of the slide animation in px per seconds.
-        /// If you set the duration of the slide using elm_label_slide_duration_set() you cannot get the correct speed using this function until the label is actually rendered and resized.
+        /// If you set the duration of the slide using elm_label_slide_duration_set(), you cannot get the correct speed using this function until the label is actually rendered and resized.
         /// </remarks>
         /// <seealso cref="SlideDuration"/>
+        /// <since_tizen> preview </since_tizen>
+        [Obsolete("This has been deprecated in API12")]
         public double SlideSpeed
         {
             get
@@ -127,6 +147,8 @@ namespace ElmSharp
         /// <summary>
         /// Sets or gets the ellipsis behavior of the label.
         /// </summary>
+        /// <since_tizen> preview </since_tizen>
+        [Obsolete("This has been deprecated in API12")]
         public bool IsEllipsis
         {
             get
@@ -140,8 +162,38 @@ namespace ElmSharp
         }
 
         /// <summary>
-        /// Start slide effect.
+        /// Sets or gets the style of the label text.
+        /// </summary>
+        /// <remarks>
+        /// APIs, elm_label_text_style_user_peek/pop/push, are internal APIs only in Tizen. Available since Tizen_4.0.
+        /// </remarks>
+        /// 
+        /// <since_tizen> preview </since_tizen>
+        [Obsolete("This has been deprecated in API12")]
+        public string TextStyle
+        {
+            get
+            {
+                return Interop.Elementary.elm_label_text_style_user_peek(RealHandle);
+            }
+            set
+            {
+                if (string.IsNullOrEmpty(value))
+                {
+                    Interop.Elementary.elm_label_text_style_user_pop(RealHandle);
+                }
+                else
+                {
+                    Interop.Elementary.elm_label_text_style_user_push(RealHandle, value);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Starts the slide effect.
         /// </summary>
+        /// <since_tizen> preview </since_tizen>
+        [Obsolete("This has been deprecated in API12")]
         public void PlaySlide()
         {
             Interop.Elementary.elm_label_slide_go(RealHandle);
@@ -151,29 +203,32 @@ namespace ElmSharp
         /// Sets the content at a part of a given container widget.
         /// </summary>
         /// <param name="parent">EvasObject</param>
-        /// <returns>The new object, otherwise null if it cannot be created</returns>
+        /// <returns>The new object, otherwise null if it cannot be created.</returns>
+        /// <since_tizen> preview </since_tizen>
+        [Obsolete("This has been deprecated in API12")]
         protected override IntPtr CreateHandle(EvasObject parent)
         {
-            //TODO: Fix this to use layout
             return Interop.Elementary.elm_label_add(parent.Handle);
         }
     }
 
     /// <summary>
-    /// Enumeration for slide mode of a label widget
+    /// Enumeration for the slide modes of a label widget.
     /// </summary>
+    /// <since_tizen> preview </since_tizen>
+    [Obsolete("This has been deprecated in API12")]
     public enum LabelSlideMode
     {
         /// <summary>
-        /// no slide effect
+        /// No slide effect.
         /// </summary>
         None = 0,
         /// <summary>
-        /// slide only if the label area is bigger than the text width length
+        /// Slide only if the label area is bigger than the text width length.
         /// </summary>
         Auto,
         /// <summary>
-        /// slide always
+        /// Slide always.
         /// </summary>
         Always
     }