Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_MessageBox.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_MessageBox.h
20  * @brief       This is the header file for the _MessageBox class.
21  *
22  * This header file contains the declarations of the %_MessageBox class.
23  */
24
25 #ifndef _FUI_CTRL_INTERNAL_MESSAGEBOX_H_
26 #define _FUI_CTRL_INTERNAL_MESSAGEBOX_H_
27
28
29 #include <FUiCtrlMessageBox.h>
30 #include "FUiCtrl_Popup.h"
31
32
33 namespace Tizen { namespace Ui { namespace Controls
34 {
35
36 class _MessageBoxPresenter;
37
38 /**
39  * @class _MessageBox
40  * @brief
41  * @since       1.0
42  *
43  *
44  *
45  *
46  */
47 class _OSP_EXPORT_ _MessageBox
48         : public _Popup
49         , virtual public Tizen::Base::Runtime::IEventListener
50         , virtual public _IUiEventListener
51         , virtual public _IUiEventPreviewer
52 {
53 // Lifecycle
54 public:
55         virtual ~_MessageBox(void);
56
57 // Operations
58 public:
59         static _MessageBox* CreateMessageBoxN(void);
60         result Initialize(const Tizen::Base::String& title, const Tizen::Base::String& text, MessageBoxStyle style, unsigned long timeout);
61
62         virtual result ShowAndWait(int& modalResult);
63
64         int GetTotalHeight(void) const;
65
66         virtual void OnDraw(void);
67
68         virtual void OnFontChanged(Tizen::Graphics::Font* pFont);
69         virtual void OnFontInfoRequested(unsigned long& style, int& size);
70
71         virtual void OnActivated(void);
72         virtual void OnDeactivated(void);
73
74         virtual result OnAttachedToMainTree(void);
75
76         virtual void OnChangeLayout(_ControlOrientation orientation);
77
78         virtual void OnBoundsChanged(void);
79
80
81 // Accessors
82 public:
83         MessageBoxStyle GetMsgBoxStyle(void) const;
84
85         unsigned long GetTimeout(void) const;
86
87         Tizen::Base::String GetText(void) const;
88
89         void SetTextColor(const Tizen::Graphics::Color& color);
90         Tizen::Graphics::Color GetTextColor(void) const;
91
92 protected:
93         result SetPresenter(const _MessageBoxPresenter& msgboxPresenter);
94
95         // Touch Event Listener
96         virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
97         virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
98         virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo);
99
100 private:
101         _MessageBox(void);
102
103         _MessageBox(const _MessageBox& rhs);
104         _MessageBox& operator =(const _MessageBox& rhs);
105
106 // Attributes
107 private:
108         _MessageBoxPresenter* __pMsgboxPresenter;
109
110         MessageBoxStyle __msgboxStyle;
111
112         Tizen::Graphics::Color __textColor;
113         Tizen::Base::String __text;
114
115         unsigned long __timeout;
116
117 };  // _MessageBox
118
119
120 }}} // Tizen::Ui::Controls
121
122 #endif  // _FUI_CTRL_INTERNAL_MESSAGEBOX_H_
123