Fixed the bg image issues in popup group of controls.
[platform/framework/native/uifw.git] / src / ui / inc / FUiCtrl_ProgressPopupPresenter.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0/
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_ProgressPopupPresenter.h
20  * @brief       This is the header file for the _ProgressPopupPresenter class.
21  *
22  * This header file contains the declarations of the _ProgressPopupPresenter class.
23  */
24
25 #ifndef _FUI_CTRL_INTERNAL_PROGRESS_POPUP_PRESENTER_H_
26 #define _FUI_CTRL_INTERNAL_PROGRESS_POPUP_PRESENTER_H_
27
28
29 #include "FUiCtrl_Animation.h"
30 #include "FUiCtrl_PopupPresenter.h"
31
32
33 namespace Tizen { namespace Ui { namespace Controls
34 {
35
36 class _ProgressPopup;
37 class _Label;
38 class _ScrollPanel;
39
40
41 /**
42  * @class _ProgressPopupPresenter
43  * @brief
44  * @since       2.0
45  *
46  *
47  *
48  *
49  */
50 class _ProgressPopupPresenter
51         : public _PopupPresenter
52         , public Tizen::Ui::Controls::_IAnimationEventListener
53         , virtual public Tizen::Base::Runtime::IEventListener
54 {
55 // Lifecycle
56 public:
57         _ProgressPopupPresenter(void);
58         virtual ~_ProgressPopupPresenter(void);
59
60 // Operations
61 public:
62         result Initialize(_ProgressPopup& ProgressPopup, bool cancelButton, bool transparent, const Tizen::Graphics::FloatRectangle& animationRect);
63
64         void SetTitleTextObject(void);
65         void SetTextObject(void);
66
67         virtual void Draw(void);
68
69         virtual result DoModal(int& modalResult);
70
71         float GetBodyTextHeight(void) const;
72         float GetBodyTextObjHeight(void) const;
73
74         Tizen::Graphics::FloatRectangle GetButtonBounds(void);
75         Tizen::Graphics::FloatRectangle GetTextBounds(void) const;
76
77         result PlayProcessAnimation(void);
78         result StopProcessAnimation(void);
79         result SetProcessAnimation(void);
80         result UpdateProcessAnimation(void);
81
82         // Touch Event Listener
83         virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
84         virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo);
85         virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
86
87         virtual void OnAnimationStopped(const Tizen::Ui::_Control& source);
88
89         result OnChangeLayout(_ControlOrientation orientation);
90
91         void InitializeAccessibilityElement(void);
92
93 private:
94         _ProgressPopupPresenter(const _ProgressPopupPresenter& rhs);
95         _ProgressPopupPresenter& operator =(const _ProgressPopupPresenter& rhs);
96         virtual _Popup* GetCore(void);
97 //Attribute
98 private:
99         _ProgressPopup* __pProgressPopup;
100
101         Tizen::Graphics::_Text::TextObject* __pBodyTextObject;
102
103         Tizen::Graphics::FloatRectangle __textBounds;
104         Tizen::Graphics::FloatRectangle __titleBgBounds;
105         Tizen::Graphics::FloatRectangle __buttonBgBounds;
106
107         Tizen::Ui::Controls::_Label* __pLabel;
108         Tizen::Ui::Controls::_ScrollPanel* __pScrollPanel;
109
110         _Animation* __pAnimation;
111         Tizen::Base::Collection::ArrayList* __pAnimationFrameList;
112
113         float __textObjectHeight;
114         int __currentIndex;
115
116         bool __buttonPressState;
117         bool __cancelButton;
118         bool __transparent;
119
120         static const int ANIMATION_REPEAT_COUNT = 100;
121
122 };  // _ProgressPopupPresenter
123
124
125 }}} // Tizen::Ui::Controls
126
127 #endif //_FUI_CTRL_INTERNAL_PROGRESS_POPUP_PRESENTER_H_