Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / controls / FUiCtrl_ColorPicker.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 /**
18 * @file                 FUiCtrl_ColorPicker.cpp
19 * @brief                This file contains implementation of _ColorPicker class
20 *
21 * This file contains implementation of _ColorPicker class.
22 */
23
24 #include <new>
25 #include <FBaseSysLog.h>
26 #include "FUiAnim_VisualElement.h"
27 #include "FUiCtrl_ColorPicker.h"
28 #include "FUiCtrl_ColorPickerPresenter.h"
29 #include "FUiCtrl_IColorChangeEventListener.h"
30 #include "FUi_AccessibilityContainer.h"
31 #include "FUi_AccessibilityElement.h"
32 #include "FUi_ResourceManager.h"
33 #include "FUi_ResourceSizeInfo.h"
34
35 using namespace Tizen::Base;
36 using namespace Tizen::Base::Runtime;
37 using namespace Tizen::Graphics;
38 using namespace Tizen::Ui;
39 using namespace Tizen::Ui::Animations;
40
41 namespace Tizen { namespace Ui { namespace Controls
42 {
43
44 IMPLEMENT_PROPERTY(_ColorPicker);
45
46 _ColorPicker::_ColorPicker(void)
47         : __pColorPickerPresenter(null)
48         , __pColorChangeEvent(null)
49         , __pHueHandler(null)
50         , __pSaturationHandler(null)
51         , __pLuminanceHandler(null)
52         , __pDecreaseHueButtonElement(null)
53         , __pIncreaseHueButtonElement(null)
54         , __pDecreaseSaturationButtonElement(null)
55         , __pIncreaseSaturationButtonElement(null)
56         , __pDecreaseLuminanceButtonElement(null)
57         , __pIncreaseLuminanceButtonElement(null)
58         , __pHueBarElement(null)
59         , __pSaturationBarElement(null)
60         , __pLuminanceBarElement(null)
61 {
62 }
63
64 _ColorPicker::~_ColorPicker(void)
65 {
66         delete __pColorPickerPresenter;
67         __pColorPickerPresenter = null;
68
69         delete __pColorChangeEvent;
70         __pColorChangeEvent = null;
71
72         if (__pHueHandler != null)
73         {
74                 __pHueHandler->Destroy();
75                 __pHueHandler = null;
76         }
77
78         if (__pSaturationHandler != null)
79         {
80                 __pSaturationHandler->Destroy();
81                 __pSaturationHandler = null;
82         }
83
84         if (__pLuminanceHandler != null)
85         {
86                 __pLuminanceHandler->Destroy();
87                 __pLuminanceHandler = null;
88         }
89
90         if (__pDecreaseHueButtonElement)
91         {
92                 __pDecreaseHueButtonElement->Activate(false);
93                 __pDecreaseHueButtonElement = null;
94         }
95         if (__pIncreaseHueButtonElement)
96         {
97                 __pIncreaseHueButtonElement->Activate(false);
98                 __pIncreaseHueButtonElement = null;
99         }
100         if (__pDecreaseSaturationButtonElement)
101         {
102                 __pDecreaseSaturationButtonElement->Activate(false);
103                 __pDecreaseSaturationButtonElement = null;
104         }
105         if (__pIncreaseSaturationButtonElement)
106         {
107                 __pIncreaseSaturationButtonElement->Activate(false);
108                 __pIncreaseSaturationButtonElement = null;
109         }
110         if (__pDecreaseLuminanceButtonElement)
111         {
112                 __pDecreaseLuminanceButtonElement->Activate(false);
113                 __pDecreaseLuminanceButtonElement = null;
114         }
115         if (__pIncreaseLuminanceButtonElement)
116         {
117                 __pIncreaseLuminanceButtonElement->Activate(false);
118                 __pIncreaseLuminanceButtonElement = null;
119         }
120         if (__pHueBarElement)
121         {
122                 __pHueBarElement->Activate(false);
123                 __pHueBarElement = null;
124         }
125         if (__pSaturationBarElement)
126         {
127                 __pSaturationBarElement->Activate(false);
128                 __pSaturationBarElement = null;
129         }
130         if (__pLuminanceBarElement)
131         {
132                 __pLuminanceBarElement->Activate(false);
133                 __pLuminanceBarElement = null;
134         }
135 }
136
137 _ColorPicker*
138 _ColorPicker::CreateColorPickerN(void)
139 {
140         result r = E_SUCCESS;
141         Dimension colorPickerSize;
142         _VisualElement* pBase = null;
143
144         r = GET_DIMENSION_CONFIG(COLORPICKER::DEFAULT_SIZE, _ControlManager::GetInstance()->GetOrientation(), colorPickerSize);
145         SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get the default ColorPicker size from config file.");
146
147         _ColorPicker* pColorPicker = new (std::nothrow) _ColorPicker;
148         SysTryReturn(NID_UI_CTRL, (pColorPicker != null), null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
149
150         r = GetLastResult();
151         SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
152
153         pColorPicker->AcquireHandle();
154
155         pColorPicker->__pColorPickerPresenter = _ColorPickerPresenter::CreateInstanceN(*pColorPicker);
156         r = GetLastResult();
157         SysTryCatch(NID_UI_CTRL, (pColorPicker->__pColorPickerPresenter != null), , r,
158                            "[%s] Propagating.", GetErrorMessage(r));
159
160         pColorPicker->__pColorChangeEvent = _ColorChangeEvent::CreateInstanceN(*pColorPicker);
161         r = GetLastResult();
162         SysTryCatch(NID_UI_CTRL, (pColorPicker->__pColorChangeEvent != null), , r,
163                            "[%s] Propagating.", GetErrorMessage(r));
164
165         pBase = pColorPicker->GetVisualElement();
166         SysTryCatch(NID_UI_CTRL, (pBase != null), r = E_SYSTEM, E_SYSTEM,
167                            "[E_SYSTEM] A system error has occurred. Failed to get the ColorPicker visual element.");
168
169         // Set alpha merge to VisualElement
170         pBase->SetSurfaceOpaque(false);
171         pColorPicker->SetBackgroundColor(Color());
172
173         r = pColorPicker->SetSize(colorPickerSize);
174         SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
175
176         pColorPicker->SetResizable(false);
177
178         if (pColorPicker->GetAccessibilityContainer() != null)
179         {
180                 pColorPicker->GetAccessibilityContainer()->Activate(true);
181         }
182
183         return pColorPicker;
184
185 CATCH:
186         delete pColorPicker;
187         return null;
188 }
189
190 Color
191 _ColorPicker::GetColor(void) const
192 {
193         Variant color = GetProperty("color");
194
195         return color.ToColor();
196 }
197
198 Variant
199 _ColorPicker::GetPropertyColor(void) const
200 {
201         return Variant(__pColorPickerPresenter->GetColor());
202 }
203
204 int
205 _ColorPicker::GetHue(void) const
206 {
207         Variant varHue = GetProperty("hue");
208
209         return varHue.ToInt();
210 }
211
212 Variant
213 _ColorPicker::GetPropertyHue(void) const
214 {
215         return Variant(__pColorPickerPresenter->GetHue());
216 }
217
218 int
219 _ColorPicker::GetSaturation(void) const
220 {
221         Variant varSaturation = GetProperty("saturation");
222
223         return varSaturation.ToInt();
224 }
225
226 Variant
227 _ColorPicker::GetPropertySaturation(void) const
228 {
229         return Variant(__pColorPickerPresenter->GetSaturation());
230 }
231
232 int
233 _ColorPicker::GetLuminance(void) const
234 {
235         Variant varLuminance = GetProperty("luminance");
236
237         return varLuminance.ToInt();
238 }
239
240 Variant
241 _ColorPicker::GetPropertyLuminance(void) const
242 {
243         return Variant(__pColorPickerPresenter->GetLuminance());
244 }
245
246 result
247 _ColorPicker::SetColor(const Color& color)
248 {
249         return SetProperty("color", Variant(color));
250 }
251
252 result
253 _ColorPicker::SetPropertyColor(const Variant& color)
254 {
255         __pColorPickerPresenter->SetColor(color.ToColor());
256
257         return GetLastResult();
258 }
259
260 result
261 _ColorPicker::SetHue(int hue)
262 {
263         return SetProperty("hue", Variant(hue));
264 }
265
266 result
267 _ColorPicker::SetPropertyHue(const Variant& hue)
268 {
269         __pColorPickerPresenter->SetHue(hue.ToInt());
270
271         if (__pHueBarElement)
272         {
273                 String hueValue;
274                 hueValue.Append(__pColorPickerPresenter->GetHue());
275                 __pHueBarElement->SetValue(hueValue);
276         }
277
278         return GetLastResult();
279 }
280
281 result
282 _ColorPicker::SetSaturation(int saturation)
283 {
284         return SetProperty("saturation", Variant(saturation));
285 }
286
287 result
288 _ColorPicker::SetPropertySaturation(const Variant& saturation)
289 {
290         __pColorPickerPresenter->SetSaturation(saturation.ToInt());
291
292         if (__pSaturationBarElement)
293         {
294                 String saturationValue;
295                 saturationValue.Append(__pColorPickerPresenter->GetSaturation());
296                 __pSaturationBarElement->SetValue(saturationValue);
297         }
298
299         return GetLastResult();
300 }
301
302 result
303 _ColorPicker::SetLuminance(int luminance)
304 {
305         return SetProperty("luminance", Variant(luminance));
306 }
307
308 result
309 _ColorPicker::SetPropertyLuminance(const Variant& luminance)
310 {
311         __pColorPickerPresenter->SetLuminance(luminance.ToInt());
312
313         if (__pLuminanceBarElement)
314         {
315                 String luminanceValue;
316                 luminanceValue.Append(__pColorPickerPresenter->GetLuminance());
317                 __pLuminanceBarElement->SetValue(luminanceValue);
318         }
319
320         return GetLastResult();
321 }
322
323 bool
324 _ColorPicker::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
325 {
326         return __pColorPickerPresenter->OnTouchPressed(source, touchinfo);
327 }
328
329 bool
330 _ColorPicker::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
331 {
332         return __pColorPickerPresenter->OnTouchMoved(source, touchinfo);
333 }
334
335 bool
336 _ColorPicker::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
337 {
338         return __pColorPickerPresenter->OnTouchReleased(source, touchinfo);
339 }
340
341 bool
342 _ColorPicker::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
343 {
344         return __pColorPickerPresenter->OnTouchCanceled(source, touchinfo);
345 }
346
347 result
348 _ColorPicker::OnAttachedToMainTree(void)
349 {
350         InitializeAccessibilityElement();
351
352         __pColorPickerPresenter->LoadDrawingProperties(GetBounds());
353
354         _VisualElement* pBase = GetVisualElement();
355
356         // Create All Handler
357         _ColorPickerComponentType handlerType = HUE_HANDLER;
358
359         if (__pHueHandler == null)
360         {
361                 __pHueHandler = __pColorPickerPresenter->CreateHandlerN(*pBase, handlerType);
362         }
363
364         SysTryReturnResult(NID_UI_CTRL, (__pHueHandler != null), E_SYSTEM,
365                                            "A system error has occurred. Failed to create hue handler.");
366
367         handlerType = SAT_HANDLER;
368
369         if (__pSaturationHandler == null)
370         {
371                 __pSaturationHandler = __pColorPickerPresenter->CreateHandlerN(*pBase, handlerType);
372         }
373
374         SysTryReturnResult(NID_UI_CTRL, (__pSaturationHandler != null), E_SYSTEM,
375                            "A system error has occurred. Failed to create saturation handler.");
376
377         handlerType = LUM_HANDLER;
378
379         if (__pLuminanceHandler == null)
380         {
381                 __pLuminanceHandler = __pColorPickerPresenter->CreateHandlerN(*pBase, handlerType);
382         }
383
384         SysTryReturnResult(NID_UI_CTRL, (__pLuminanceHandler != null), E_SYSTEM,
385                            "A system error has occurred. Failed to create luminance handler.");
386
387         return E_SUCCESS;
388 }
389
390 void
391 _ColorPicker::InitializeAccessibilityElement(void)
392 {
393         if (likely(!(_AccessibilityManager::IsActivated())))
394         {
395                 return;
396         }
397
398         _AccessibilityContainer* pContainer = GetAccessibilityContainer();
399         if (pContainer != null)
400         {
401                 __pDecreaseHueButtonElement = new (std::nothrow) _AccessibilityElement(true);
402                 SysTryReturnVoidResult(NID_UI_CTRL, __pDecreaseHueButtonElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
403
404                 __pDecreaseHueButtonElement->SetLabel(L"Decrease Hue value");
405                 __pDecreaseHueButtonElement->SetTrait(ACCESSIBILITY_TRAITS_BUTTON);
406
407                 pContainer->AddElement(*__pDecreaseHueButtonElement);
408
409                 __pHueBarElement = new (std::nothrow) _AccessibilityElement(true);
410                 SysTryReturnVoidResult(NID_UI_CTRL, __pHueBarElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
411
412                 String hintText(L"Double tap and drag to adjust");
413
414                 __pHueBarElement->SetLabel("Hue Slider");
415                 __pHueBarElement->SetTrait(ACCESSIBILITY_TRAITS_NONE);
416                 __pHueBarElement->SetHint(hintText);
417                 pContainer->AddElement(*__pHueBarElement);
418
419                 String hueValue;
420                 hueValue.Append(__pColorPickerPresenter->GetHue());
421                 __pHueBarElement->SetValue(hueValue);
422
423                 __pIncreaseHueButtonElement = new (std::nothrow) _AccessibilityElement(true);
424                 SysTryReturnVoidResult(NID_UI_CTRL, __pIncreaseHueButtonElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
425
426                 __pIncreaseHueButtonElement->SetLabel(L"Increase Hue value");
427                 __pIncreaseHueButtonElement->SetTrait(ACCESSIBILITY_TRAITS_BUTTON);
428                 pContainer->AddElement(*__pIncreaseHueButtonElement);
429
430                 __pDecreaseSaturationButtonElement = new (std::nothrow) _AccessibilityElement(true);
431                 SysTryReturnVoidResult(NID_UI_CTRL, __pDecreaseSaturationButtonElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
432
433                 __pDecreaseSaturationButtonElement->SetLabel(L"Decrease Saturation value");
434                 __pDecreaseSaturationButtonElement->SetTrait(ACCESSIBILITY_TRAITS_BUTTON);
435                 pContainer->AddElement(*__pDecreaseSaturationButtonElement);
436
437                 __pSaturationBarElement = new (std::nothrow) _AccessibilityElement(true);
438                 SysTryReturnVoidResult(NID_UI_CTRL, __pSaturationBarElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
439
440                 __pSaturationBarElement->SetLabel("Saturation Slider");
441                 __pSaturationBarElement->SetTrait(ACCESSIBILITY_TRAITS_NONE);
442                 __pSaturationBarElement->SetHint(hintText);
443                 pContainer->AddElement(*__pSaturationBarElement);
444
445                 String saturationValue;
446                 saturationValue.Append(__pColorPickerPresenter->GetSaturation());
447                 __pSaturationBarElement->SetValue(saturationValue);
448
449                 __pIncreaseSaturationButtonElement = new (std::nothrow) _AccessibilityElement(true);
450                 SysTryReturnVoidResult(NID_UI_CTRL, __pIncreaseSaturationButtonElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
451
452                 __pIncreaseSaturationButtonElement->SetLabel(L"Increase Saturation value");
453                 __pIncreaseSaturationButtonElement->SetTrait(ACCESSIBILITY_TRAITS_BUTTON);
454                 pContainer->AddElement(*__pIncreaseSaturationButtonElement);
455
456                 __pDecreaseLuminanceButtonElement = new (std::nothrow) _AccessibilityElement(true);
457                 SysTryReturnVoidResult(NID_UI_CTRL, __pDecreaseLuminanceButtonElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
458
459                 __pDecreaseLuminanceButtonElement->SetLabel(L"Decrease Luminance value");
460                 __pDecreaseLuminanceButtonElement->SetTrait(ACCESSIBILITY_TRAITS_BUTTON);
461                 pContainer->AddElement(*__pDecreaseLuminanceButtonElement);
462
463                 __pLuminanceBarElement = new (std::nothrow) _AccessibilityElement(true);
464                 SysTryReturnVoidResult(NID_UI_CTRL, __pLuminanceBarElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
465
466                 __pLuminanceBarElement->SetLabel("Luminance Slider");
467                 __pLuminanceBarElement->SetTrait(ACCESSIBILITY_TRAITS_NONE);
468                 __pLuminanceBarElement->SetHint(hintText);
469                 pContainer->AddElement(*__pLuminanceBarElement);
470
471                 String luminanceValue;
472                 luminanceValue.Append(__pColorPickerPresenter->GetLuminance());
473                 __pLuminanceBarElement->SetValue(luminanceValue);
474
475                 __pIncreaseLuminanceButtonElement = new (std::nothrow) _AccessibilityElement(true);
476                 SysTryReturnVoidResult(NID_UI_CTRL, __pIncreaseLuminanceButtonElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
477
478                 __pIncreaseLuminanceButtonElement->SetLabel(L"Increase Luminance value");
479                 __pIncreaseLuminanceButtonElement->SetTrait(ACCESSIBILITY_TRAITS_BUTTON);
480                 pContainer->AddElement(*__pIncreaseLuminanceButtonElement);
481
482                 pContainer->AddListener(*this);
483         }
484         return;
485 }
486
487 void
488 _ColorPicker::OnBoundsChanged(void)
489 {
490         __pColorPickerPresenter->LoadDrawingProperties(GetBounds());
491         return;
492 }
493
494 void
495 _ColorPicker::OnChangeLayout(_ControlOrientation orientation)
496 {
497         __pColorPickerPresenter->OnChangeLayout(orientation);
498         return;
499 }
500
501 void
502 _ColorPicker::OnDraw(void)
503 {
504         __pColorPickerPresenter->Draw();
505         return;
506 }
507
508 result
509 _ColorPicker::AddColorChangeEventListener(const _IColorChangeEventListener& listener)
510 {
511         result r = __pColorChangeEvent->AddListener(listener);
512
513         SysTryReturnResult(NID_UI_CTRL, (r != E_OBJ_ALREADY_EXIST), E_SYSTEM,
514                         "A system error has occurred. The _IColorChangeEventListener instance already exists in the event listener list.");
515
516         return r;
517 }
518
519 result
520 _ColorPicker::RemoveColorChangeEventListener(const _IColorChangeEventListener& listener)
521 {
522         result r = __pColorChangeEvent->RemoveListener(listener);
523
524         SysTryReturnResult(NID_UI_CTRL, (r != E_OBJ_NOT_FOUND), E_SYSTEM,
525                         "A system error has occurred. The _IColorChangeEventListener instance does not exist in the event listener list.");
526
527         return r;
528 }
529
530 result
531 _ColorPicker::FireColorChangeEvent(const Color& color)
532 {
533         IEventArg* pEventArg = _ColorChangeEvent::CreateColorChangeEventArgN(color);
534         result r = GetLastResult();
535         SysTryReturn(NID_UI_CTRL, (pEventArg != null), r, r, "[%s] Propagating.", GetErrorMessage(r));
536
537         __pColorChangeEvent->Fire(*pEventArg);
538
539         return E_SUCCESS;
540 }
541
542 _VisualElement*
543 _ColorPicker::GetHueHandler(void)
544 {
545         return __pHueHandler;
546 }
547
548 _VisualElement*
549 _ColorPicker::GetSaturationHandler(void)
550 {
551         return __pSaturationHandler;
552 }
553
554 _VisualElement*
555 _ColorPicker::GetLuminanceHandler(void)
556 {
557         return __pLuminanceHandler;
558 }
559
560 _AccessibilityElement*
561 _ColorPicker::GetAccessibilityElement(int elementId)
562 {
563         _AccessibilityElement* pAccessibilityElement = null;
564
565         if (likely(!(_AccessibilityManager::IsActivated())))
566         {
567                 return null;
568         }
569
570         switch (elementId)
571         {
572         case HUE_BAR:
573                 pAccessibilityElement = __pHueBarElement;
574                 break;
575         case SAT_BAR:
576                 pAccessibilityElement = __pSaturationBarElement;
577                 break;
578         case LUM_BAR:
579                 pAccessibilityElement = __pLuminanceBarElement;
580                 break;
581         case HUE_ARROWLEFT:
582                 pAccessibilityElement = __pDecreaseHueButtonElement;
583                 break;
584         case HUE_ARROWRIGHT:
585                 pAccessibilityElement = __pIncreaseHueButtonElement;
586                 break;
587         case SAT_ARROWLEFT:
588                 pAccessibilityElement = __pDecreaseSaturationButtonElement;
589                 break;
590         case SAT_ARROWRIGHT:
591                 pAccessibilityElement = __pIncreaseSaturationButtonElement;
592                 break;
593         case LUM_ARROWLEFT:
594                 pAccessibilityElement = __pDecreaseLuminanceButtonElement;
595                 break;
596         case LUM_ARROWRIGHT:
597                 pAccessibilityElement = __pIncreaseLuminanceButtonElement;
598                 break;
599         }
600
601         return pAccessibilityElement;
602 }
603
604 result
605 _ColorPicker::UpdateView(void)
606 {
607         if (GetVisualElement() == null)
608         {
609                 return E_SYSTEM;
610         }
611
612         return GetVisualElement()->SetFlushNeeded();
613 }
614
615 bool
616 _ColorPicker::OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element)
617 {
618         String elementLabel = element.GetLabel();
619         String string;
620
621         if (elementLabel.Equals(L"Hue Slider", false))
622         {
623                 SetHue(GetHue() + 1);
624                 string.Append(GetHue() + 1);
625         }
626         else if (elementLabel.Equals(L"Saturation Slider", false))
627         {
628                 SetSaturation(GetSaturation() + 1);
629                 string.Append(GetSaturation() + 1);
630         }
631         else if (elementLabel.Equals(L"Luminance Slider", false))
632         {
633                 SetLuminance(GetLuminance() + 1);
634                 string.Append(GetLuminance() + 1);
635         }
636
637         Invalidate();
638         _AccessibilityManager::GetInstance()->ReadContent(string);
639
640         return true;
641 }
642
643 bool
644 _ColorPicker::OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element)
645 {
646         String elementLabel = element.GetLabel();
647         String string;
648
649         if (elementLabel.Equals(L"Hue Slider", false))
650         {
651                 SetHue(GetHue() - 1);
652                 string.Append(GetHue() - 1);
653         }
654         else if (elementLabel.Equals(L"Saturation Slider", false))
655         {
656                 SetSaturation(GetSaturation() - 1);
657                 string.Append(GetSaturation() - 1);
658         }
659         else if (elementLabel.Equals(L"Luminance Slider", false))
660         {
661                 SetLuminance(GetLuminance() - 1);
662                 string.Append(GetLuminance() - 1);
663         }
664
665         Invalidate();
666         _AccessibilityManager::GetInstance()->ReadContent(string);
667
668         return true;
669 }
670
671 }}} // Tizen::Ui::Controls