2 using System.Collections.Generic;
11 public class RotaryColorPart : Efl.Object, Efl.Gfx.Color
15 public RotaryColorPart() { _r = _g = _b = _a = -1; }
17 public void SetColor(int r, int g, int b, int a)
25 public virtual void GetColor(out int r, out int g, out int b, out int a)
34 public void SetColorCode(System.String colorcode)
40 public System.String GetColorCode()
46 public System.String GetColorClassCode(System.String color_class, Efl.Gfx.ColorClassLayer layer)
51 public void SetColorClassCode(System.String color_class, Efl.Gfx.ColorClassLayer layer, System.String colorcode)
53 //This function will be removed after interface work is done
57 public System.String ColorCode
59 //This function will be removed afater interface work is done
65 public class RotarySelectorItem
67 const string MainTextPartName = "selector,main_text";
68 const string SubTextPartName = "selector,sub_text";
69 const string IconPartName = "item,icon";
70 const string BgPartName = "item,bg_image";
71 const string SelectorIconPartName = "selector,icon";
75 Image _normalIconImage;
76 Image _pressedIconImage;
77 Image _disabledIconImage;
78 Image _selectedIconImage;
80 Image _pressedBgImage;
81 Image _disabledBgImage;
82 Image _selectedBgImage;
83 Image _selectorIconImage;
85 public RotaryColorPart MainTextColor;
86 public RotaryColorPart SubTextColor;
87 public RotaryColorPart NormalBgColor;
88 public RotaryColorPart PressedBgColor;
89 public RotaryColorPart DisabledBgColor;
90 public RotaryColorPart SelectedBgColor;
92 public IntPtr _handle;
93 public IntPtr NativeHandle
97 if (_handle == value) return;
100 if (_handle == null) return;
103 SetPart(MainTextPartName, _mainText);
104 SetPart(SubTextPartName, _subText);
106 SetPart(MainTextPartName, ItemState.Normal, MainTextColor);
107 SetPart(SubTextPartName, ItemState.Normal, SubTextColor);
109 SetPart(IconPartName, ItemState.Normal, _normalIconImage);
110 SetPart(IconPartName, ItemState.Pressed, _pressedIconImage);
111 SetPart(IconPartName, ItemState.Disabled, _disabledIconImage);
112 SetPart(IconPartName, ItemState.Selected, _selectedIconImage);
114 SetPart(BgPartName, ItemState.Normal, _normalBgImage);
115 SetPart(BgPartName, ItemState.Pressed, _pressedBgImage);
116 SetPart(BgPartName, ItemState.Disabled, _disabledBgImage);
117 SetPart(BgPartName, ItemState.Selected, _selectedBgImage);
119 SetPart(BgPartName, ItemState.Normal, NormalBgColor);
120 SetPart(BgPartName, ItemState.Normal, PressedBgColor);
121 SetPart(BgPartName, ItemState.Normal, DisabledBgColor);
122 SetPart(BgPartName, ItemState.Normal, SelectedBgColor);
124 SetPart(SelectorIconPartName, ItemState.Normal, _selectorIconImage);
132 void SetPart(string partName, ItemState state, Image img)
134 if (NativeHandle != null && partName != null && img != null)
136 Interop.Eext.eext_rotary_selector_item_part_content_set(NativeHandle, partName, (int)state, img.NativeHandle);
140 void SetPart(string partName, string text)
142 if (NativeHandle != null && text != null)
144 Interop.Eext.eext_rotary_selector_item_part_text_set(NativeHandle, partName, text);
148 void SetPart(string partName, ItemState state, RotaryColorPart color)
150 if (NativeHandle != null && partName != null && color != null)
153 color.GetColor(out r, out g, out b, out a);
155 if (r != -1 || g != -1 || b != -1 || a != -1)
156 Interop.Eext.eext_rotary_selector_item_part_color_set(NativeHandle, partName, (int)state, r, g, b, a);
160 public string MainText
162 get { return _mainText; }
166 SetPart(MainTextPartName, value);
170 public string SubText
172 get { return _subText; }
176 SetPart(SubTextPartName, value);
180 public Image NormalIconImage
182 get { return _normalIconImage; }
185 _normalIconImage = value;
186 SetPart(IconPartName, ItemState.Normal, value);
190 public Image PressedIconImage
192 get { return _pressedIconImage; }
195 _pressedIconImage = value;
196 SetPart(IconPartName, ItemState.Pressed, value);
200 public Image DisabledIconImage
202 get { return _disabledIconImage; }
205 _disabledIconImage = value;
206 SetPart(IconPartName, ItemState.Disabled, value);
210 public Image SelectedIconImage
212 get { return _selectedIconImage; }
215 _selectedIconImage = value;
216 SetPart(IconPartName, ItemState.Selected, value);
220 public Image NormalBackgroundImage
222 get { return _normalBgImage; }
225 _normalBgImage = value;
226 SetPart(BgPartName, ItemState.Normal, value);
230 public Image PressedBackgroundImage
232 get { return _pressedBgImage; }
235 _pressedBgImage = value;
236 SetPart(BgPartName, ItemState.Pressed, value);
240 public Image DisabledBackgroundImage
242 get { return _disabledBgImage; }
245 _disabledBgImage = value;
246 SetPart(BgPartName, ItemState.Disabled, value);
250 public Image SelectedBackgroundImage
252 get { return _selectedBgImage; }
255 _selectedBgImage = value;
256 SetPart(BgPartName, ItemState.Selected, value);
260 public Image SelectorIconImage
262 get { return _selectorIconImage; }
265 _selectorIconImage = value;
266 SetPart(SelectorIconPartName, ItemState.Normal, value);
270 internal enum ItemState