Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_PopupPresenter.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_PopupPresenter.h
20  * @brief       This is the header file for the _PopupPresenter class.
21  *
22  * This header file contains the declarations of the _PopupPresenter class.
23  */
24
25 #ifndef _FUI_CTRL_INTERNAL_POPUP_PRESENTER_H_
26 #define _FUI_CTRL_INTERNAL_POPUP_PRESENTER_H_
27
28
29 #include <FApp_AppImpl.h>
30 #include <FGrp_TextTextObject.h>
31 #include "FUiCtrl_Label.h"
32 #include "FUiCtrl_Popup.h"
33
34 namespace Tizen { namespace Ui { namespace Controls
35 {
36
37 class _Popup;
38
39 /**
40  * @class _PopupPresenter
41  * @brief
42  * @since       1.0
43  *
44  *
45  *
46  *
47  */
48 class _PopupPresenter
49         : virtual public Tizen::Base::Runtime::IEventListener
50         , virtual public _IUiEventListener
51         , virtual public _IUiEventPreviewer
52 {
53 // Lifecycle
54 public:
55         _PopupPresenter(void);
56         virtual ~_PopupPresenter(void);
57
58 // Operations
59 public:
60         void Initialize(_Popup& popup);
61
62         void OnDraw(void);
63         virtual void Draw(void);
64
65         virtual result DoModal(int& modalResult);
66
67         result SetTitleTextObject(const Tizen::Base::String& title);
68
69         Tizen::Ui::Controls::_Label* GetSystemLabel(void) const;
70
71         Tizen::Graphics::Rectangle GetTitleTextBounds(void) const;
72
73         void OnActivated(void);
74
75         void OnFontChanged(Tizen::Graphics::Font* pFont);
76         void OnFontInfoRequested(unsigned long& style, int& size);
77         void UpdateEffectBounds(void);
78
79         // Touch Event Listener
80         virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
81         virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
82
83 protected:
84         virtual void ProcessEvent(void);
85
86 private:
87         _PopupPresenter(const _PopupPresenter& rhs);
88         _PopupPresenter& operator =(const _PopupPresenter& rhs);
89
90         void DrawSystemLabel(void);
91
92 //Attribute
93 protected:
94         Tizen::Graphics::Font* _pFont;
95
96 private:
97         _Popup* __pPopup;
98         Tizen::Ui::Animations::_VisualElement* __pPopupVE;
99         Tizen::Ui::Animations::_VisualElement* __pBackgroundVE;
100
101         Tizen::Graphics::_Text::TextObject* __pTextObject;
102         Tizen::Ui::Controls::_Label* __pLabelCore;
103         Tizen::Graphics::Rectangle __titleBounds;
104
105         static const int POPUP_LABEL_GAP = 8;
106 };  // _PopupPresenter
107
108
109 }}} // Tizen::Ui::Controls
110
111 #endif //_FUI_CTRL_INTERNAL_POPUP_PRESENTER_H_