2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 /// Enumeration for the modes of ColorSelector.
24 /// <since_tizen> preview </since_tizen>
25 [Obsolete("This has been deprecated in API12")]
26 public enum ColorSelectorMode
29 /// Only the color palette is displayed, by default.
33 /// Only the color selector is displayed.
35 [Obsolete("Components is obsolete as of version 1.2.3 and is no longer supported.")]
38 /// Both the palette and the selector is displayed.
40 [Obsolete("Both is obsolete as of version 1.2.3 and is no longer supported.")]
43 /// Only the color picker is displayed.
45 [Obsolete("Picker is obsolete as of version 1.2.3 and is no longer supported.")]
48 /// This mode is not supported. If you use this, nothing will be shown.
50 [Obsolete("Plane is obsolete as of version 1.2.3 and is no longer supported.")]
53 /// This mode is not supported. If you use this, it will be shown same with the Palette mode.
55 [Obsolete("PallettePlane is obsolete as of version 1.2.3 and is no longer supported.")]
58 /// This mode is not supported. If you use this, it will be shown same with the Palette mode.
60 [Obsolete("All is obsolete as of version 1.2.3 and is no longer supported.")]
65 /// The ColorSelector is a widget to set a series of colors.
66 /// It also allows to load/save colors from/to the configuration with a unique identifier.
69 /// By default, the colors are loaded/saved from/to configuration using the "default" identifier.
70 /// The colors can be picked by the user from the color set by clicking on individual
71 /// color items on the palette, or by selecting it from the selector.
73 /// <since_tizen> preview </since_tizen>
74 [Obsolete("This has been deprecated in API12")]
75 public class ColorSelector : Layout
77 private readonly SmartEvent<ColorChangedEventArgs> _changed;
78 private Color _currentColor;
81 /// Creates and initializes a new instance of the ColorSelector class.
83 /// <param name="parent"></param>
84 /// <since_tizen> preview </since_tizen>
85 [Obsolete("This has been deprecated in API12")]
86 public ColorSelector(EvasObject parent) : base(parent)
88 _changed = new SmartEvent<ColorChangedEventArgs>(this, "changed", (data, obj, info) =>
90 return new ColorChangedEventArgs(_currentColor, SelectedColor);
95 /// ColorChanged will be triggered when the SelectedColor is changed.
97 /// <since_tizen> preview </since_tizen>
98 [Obsolete("This has been deprecated in API12")]
99 public event EventHandler<ColorChangedEventArgs> ColorChanged
101 add { _changed.On += value; }
102 remove { _changed.On -= value; }
106 /// Gets or sets the color of colorselector.
108 /// <since_tizen> preview </since_tizen>
109 [Obsolete("This has been deprecated in API12")]
110 public Color SelectedColor
115 Interop.Elementary.elm_colorselector_color_get(Handle, out r, out g, out b, out a);
116 _currentColor = new Color(r, g, b, a);
117 return _currentColor;
121 Interop.Elementary.elm_colorselector_color_set(Handle, value.R, value.G, value.B, value.A);
122 _currentColor = new Color(value.R, value.G, value.B, value.A);
127 /// Gets the Alpha of a default Color class (value is -1).
129 /// <since_tizen> preview </since_tizen>
130 [Obsolete("This has been deprecated in API12")]
131 public override int Opacity
135 return Color.Default.A;
139 Console.WriteLine("ColorSelector instance doesn't support to set Opacity.");
144 /// Gets or sets the Colorselector's mode.
146 /// <since_tizen> preview </since_tizen>
147 [Obsolete("This has been deprecated in API12")]
148 public ColorSelectorMode Mode
152 return (ColorSelectorMode)Interop.Elementary.elm_colorselector_mode_get(Handle);
156 if (ColorSelectorMode.Palette == value)
158 Interop.Elementary.elm_colorselector_mode_set(Handle, (Interop.Elementary.Elm_Colorselector_Mode)value);
164 /// Gets or sets the current palette's name.
166 /// <since_tizen> preview </since_tizen>
167 [Obsolete("This has been deprecated in API12")]
168 public string PaletteName
172 return Interop.Elementary.elm_colorselector_palette_name_get(Handle);
176 Interop.Elementary.elm_colorselector_palette_name_set(Handle, value);
181 /// Adds a new color item to the palette.
183 /// <param name="color">The color item to add.</param>
184 /// <returns>A new color palette Item.</returns>
185 /// <since_tizen> preview </since_tizen>
186 [Obsolete("This has been deprecated in API12")]
187 public ColorSelectorItem AddPaletteColor(Color color)
189 ColorSelectorItem item = new ColorSelectorItem(this);
190 item.Handle = Interop.Elementary.elm_colorselector_palette_color_add(Handle, color.R, color.G, color.B, color.A);
195 /// Clears the palette items.
197 /// <since_tizen> preview </since_tizen>
198 [Obsolete("This has been deprecated in API12")]
199 public void ClearPalette()
201 Interop.Elementary.elm_colorselector_palette_clear(Handle);
205 /// Creates a widget handle.
207 /// <param name="parent">Parent EvasObject.</param>
208 /// <returns>Handle IntPtr.</returns>
209 /// <since_tizen> preview </since_tizen>
210 [Obsolete("This has been deprecated in API12")]
211 protected override IntPtr CreateHandle(EvasObject parent)
213 return Interop.Elementary.elm_colorselector_add(parent.Handle);