Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_Progress.h
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_Progress.h
19  * @brief               This is the header file for the _Progress class.
20  *
21  * This header file contains the declarations of the %_Progress class.
22  */
23 #ifndef _FUI_CTRL_INTERNAL_PROGRESS_H_
24 #define _FUI_CTRL_INTERNAL_PROGRESS_H_
25
26 #include <FUiCtrlProgress.h>
27 #include "FUi_Control.h"
28
29 namespace Tizen { namespace Ui
30 {
31 class _AccessibilityElement;
32 }} // Tizen::Ui
33
34 namespace Tizen { namespace Ui { namespace Controls
35 {
36 class _ProgressPresenter;
37
38
39 class _OSP_EXPORT_ _Progress
40         : public Tizen::Ui::_Control
41         , virtual public Tizen::Base::Runtime::IEventListener
42         , virtual public Tizen::Ui::_IUiEventListener
43         , virtual public Tizen::Ui::_IUiEventPreviewer
44 {
45         DECLARE_CLASS_BEGIN(_Progress, Tizen::Ui::_Control);
46         DECLARE_PROPERTY("value", GetPropertyValue, SetPropertyValue);
47         DECLARE_PROPERTY("minValue", GetPropertyMinValue, SetPropertyMinValue);
48         DECLARE_PROPERTY("maxValue", GetPropertyMaxValue, SetPropertyMaxValue);
49         DECLARE_PROPERTY("barColor", GetPropertyBarColor, SetPropertyBarColor);
50         DECLARE_CLASS_END();
51
52 public:
53         virtual ~_Progress(void);
54
55 public:
56         result SetValue(int value);
57         result SetRange(int minValue, int maxValue);
58         result SetBarColor(const Tizen::Graphics::Color& color);
59         int GetValue(void) const;
60         result GetRange(int& minValue, int& maxValue) const;
61         Tizen::Graphics::Color GetBarColor(void) const;
62         int GetPercentComplete(void) const;
63
64         result SetPropertyValue(const Tizen::Ui::Variant& value);
65         result SetPropertyMinValue(const Tizen::Ui::Variant& minValue);
66         result SetPropertyMaxValue(const Tizen::Ui::Variant& maxValue);
67         result SetPropertyBarColor(const Tizen::Ui::Variant& barColor);
68         Tizen::Ui::Variant GetPropertyValue(void) const;
69         Tizen::Ui::Variant GetPropertyMinValue(void) const;
70         Tizen::Ui::Variant GetPropertyMaxValue(void) const;
71         Tizen::Ui::Variant GetPropertyBarColor(void) const;
72
73         virtual void OnDraw(void);
74         virtual result OnAttachedToMainTree(void);
75         virtual void OnBoundsChanged(void);
76         static _Progress* CreateProgressN(void);
77
78 private:
79         _Progress(void);
80         _Progress(const _Progress&);
81         _Progress& operator =(const _Progress&);
82         result InitializeAccessibilityElement(void);
83
84 private:
85         _ProgressPresenter* __pProgressPresenter;
86         Tizen::Graphics::Color __barColor;
87         Tizen::Ui::_AccessibilityElement* __pAccessibilityElement;
88
89 };  // _Progress
90
91 }}} // Tizen::Ui::Controls
92
93 #endif  // _FUI_CTRL_INTERNAL_PROGRESS_H_