Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_ProgressPopup.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 /**
19  * @file                FUiCtrl_ProgressPopup.h
20  * @brief       This is the header file for the _ProgressPopup class.
21  *
22  * This header file contains the declarations of the %_ProgressPopup class.
23  */
24
25 #ifndef _FUI_CTRL_INTERNAL_PROGRESS_POPUP_H_
26 #define _FUI_CTRL_INTERNAL_PROGRESS_POPUP_H_
27
28
29 #include <FUiCtrlProgressPopup.h>
30 #include "FUiCtrl_Popup.h"
31 #include "FUiCtrl_IActionEventListener.h"
32 #include "FUiCtrl_IProgressPopupEventListener.h"
33 #include "FUiCtrl_ProgressPopupEvent.h"
34
35
36 namespace Tizen { namespace Ui { namespace Controls
37 {
38
39 class Button;
40 class _ProgressPopupPresenter;
41
42 /**
43  * @class _ProgressPopup
44  * @brief
45  * @since 2.0
46  *
47  *
48  *
49  *
50  */
51 class _ProgressPopup
52         : public _Popup
53         , public _IActionEventListener
54         , virtual public Tizen::Base::Runtime::IEventListener
55         , virtual public _IUiEventListener
56         , virtual public _IUiEventPreviewer
57 {
58
59 //Lifecycle
60 public:
61         virtual ~_ProgressPopup(void);
62
63 // Operations
64 public:
65         static _ProgressPopup* CreateProgressPopupN(void);
66         result Initialize(bool cancelButton, bool translucent, const Tizen::Graphics::Rectangle& animationRect);
67
68         virtual result DoModal(int& modalResult);
69
70         virtual void OnDraw(void);
71
72         virtual void OnFontChanged(Tizen::Graphics::Font* pFont);
73         virtual void OnFontInfoRequested(unsigned long& style, int& size);
74
75         virtual result OnAttachedToMainTree(void);
76
77         virtual void OnActivated(void);
78         virtual void OnDeactivated(void);
79
80         virtual void OnVisibleStateChanged(void);
81         virtual void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation);
82         virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId);
83
84         virtual void OnBoundsChanged(void);
85
86         // Touch Event Listener
87         virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
88         virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
89         virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo);
90
91 public:
92         result AddProgressPopupEventListener(const Tizen::Ui::Controls::_IProgressPopupEventListener& listener);
93
94         void FireProgressPopupEvent(void);
95
96         bool HasText(void) const;
97         bool HasButton(void) const;
98         bool IsTranslucent(void) const;
99
100         virtual result SetTitleText(const Tizen::Base::String& title);
101
102         result SetText(const Tizen::Base::String& text);
103         Tizen::Base::String GetText(void) const;
104
105         result SetTextColor(const Tizen::Graphics::Color& color);
106         Tizen::Graphics::Color GetTextColor(void) const;
107
108         result UpdateBounds(void);
109
110         int GetTotalHeight(void) const;
111         Tizen::Graphics::Rectangle GetAnimationRect(void) const;
112
113 protected:
114         result SetPresenter(const _ProgressPopupPresenter& ProgressPopupPresenter);
115
116         virtual void InitializeAccessibilityElement(void);
117
118 private:
119         _ProgressPopup(void);
120
121         _ProgressPopup(const _ProgressPopup& rhs);
122         _ProgressPopup& operator =(const _ProgressPopup& rhs);
123
124 // Attribute
125 private:
126         _ProgressPopupPresenter* __pProgressPopupPresenter;
127         _ProgressPopupEvent* __pProgressPopupEvent;
128
129         Tizen::Ui::Controls::Button* __pButton;
130
131         Tizen::Base::String __text;
132         Tizen::Graphics::Color __textColor;
133
134         Tizen::Graphics::Rectangle __animationRect;
135
136         Tizen::Ui::_AccessibilityElement* __pTextAccessibilityElement;
137
138         bool __textState;
139         bool __buttonState;
140         bool __isTranslucent;
141
142         // Cancel button action ID
143         static const int ID_PROGRESS_POPUP_CANCEL_BUTTON = 701;
144
145 };  // _ProgressPopup
146
147
148 }}} // Tizen::Ui::Controls
149
150 #endif //_FUI_CTRL_INTERNAL_PROGRESS_POPUP_H_