a8493d9f019d99499e753316d8703e4ae86f7616
[platform/core/csapi/tizenfx.git] / src / ElmSharp / ElmSharp / Icon.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 using System;
18
19 namespace ElmSharp
20 {
21     /// <summary>
22     /// Enumeration for the icon lookup order. Should look for icons in the theme, FDO paths, or both.
23     /// </summary>
24     /// <since_tizen> preview </since_tizen>
25     [Obsolete("This has been deprecated in API12")]
26     public enum IconLookupOrder
27     {
28         /// <summary>
29         /// Icon look up order: freedesktop, theme.
30         /// </summary>
31         FreeDesktopFirst = 0,
32         /// <summary>
33         /// Icon look up order: theme, freedesktop.
34         /// </summary>
35         ThemeFirst,
36         /// <summary>
37         /// Icon look up order: freedesktop.
38         /// </summary>
39         FreeDesktopOnly,
40         /// <summary>
41         /// Icon look up order: theme.
42         /// </summary>
43         ThemeOnly
44     }
45
46     /// <summary>
47     /// The Icon is a widget that displays the standard icon images ("delete", "edit", "arrows", etc.)
48     /// or images coming from a custom file (PNG, JPG, EDJE, etc.), on the icon context.
49     /// Inherits Image.
50     /// </summary>
51     /// <since_tizen> preview </since_tizen>
52     [Obsolete("This has been deprecated in API12")]
53     public class Icon : Image
54     {
55         /// <summary>
56         /// Creates and initializes a new instance of the Icon class.
57         /// </summary>
58         /// <param name="parent">The parent is a given container, which will be attached by Icon as a child. It's <see cref="EvasObject"/> type.</param>
59         /// <since_tizen> preview </since_tizen>
60         [Obsolete("This has been deprecated in API12")]
61         public Icon(EvasObject parent) : base(parent)
62         {
63         }
64
65         /// <summary>
66         /// Sets or gets the standard icon name of a given Icon widget.
67         /// </summary>
68         /// <since_tizen> preview </since_tizen>
69         [Obsolete("This has been deprecated in API12")]
70         public string StandardIconName
71         {
72             get
73             {
74                 return Interop.Elementary.elm_icon_standard_get(RealHandle);
75             }
76             set
77             {
78                 Interop.Elementary.elm_icon_standard_set(RealHandle, value);
79             }
80         }
81
82         /// <summary>
83         /// Sets or gets the icon lookup order of a given Icon widget.
84         /// </summary>
85         /// <since_tizen> preview </since_tizen>
86         [Obsolete("This has been deprecated in API12")]
87         public IconLookupOrder IconLookupOrder
88         {
89             get
90             {
91                 return (IconLookupOrder)Interop.Elementary.elm_icon_order_lookup_get(RealHandle);
92             }
93             set
94             {
95                 Interop.Elementary.elm_icon_order_lookup_set(RealHandle, (int)value);
96             }
97         }
98
99         /// <summary>
100         /// Sets the file that is used, but uses a generated thumbnail.
101         /// </summary>
102         /// <param name="file">The path to the file that is used as an icon image.</param>
103         /// <param name="group">The group that the icon belongs to.</param>
104         /// <since_tizen> preview </since_tizen>
105         [Obsolete("This has been deprecated in API12")]
106         public void SetThumb(string file, string group)
107         {
108             Interop.Elementary.elm_icon_thumb_set(RealHandle, file, group);
109         }
110
111         /// <summary>
112         /// Adds a new icon object to the parent.
113         /// </summary>
114         /// <param name="parent">EvasObject</param>
115         /// <returns>The new object, otherwise null if it cannot be created.</returns>
116         /// <since_tizen> preview </since_tizen>
117         [Obsolete("This has been deprecated in API12")]
118         protected override IntPtr CreateHandle(EvasObject parent)
119         {
120             IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
121             Interop.Elementary.elm_layout_theme_set(handle, "layout", "background", "default");
122
123             RealHandle = Interop.Elementary.elm_icon_add(handle);
124             Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
125
126             return handle;
127         }
128     }
129 }