popup modifications as a result of client area change
[framework/osp/web.git] / src / controls / FWebCtrl_WebPopup.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 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                FWebCtrl_WebPopup.h
20  * @brief               The file contains the declaration of _WebPopup class.
21  *
22  * The file contains the declaration of _WebPopup class.
23  */
24 #ifndef _FWEB_CTRL_INTERNAL_WEB_POPUP_H_
25 #define _FWEB_CTRL_INTERNAL_WEB_POPUP_H_
26
27 #include <unique_ptr.h>
28 #include <FUiCtrlPopup.h>
29
30
31 namespace Tizen { namespace Base {  namespace Collection
32 {
33 class IList;
34 }}} // Tizen::Base::Collection
35
36 namespace Tizen { namespace Graphics
37 {
38 class Dimension;
39 }} // Tizen::Graphics
40
41 namespace Tizen { namespace Ui
42 {
43 class IActionEventListener;
44 }} // Tizen::Ui
45
46 namespace Tizen { namespace Ui { namespace Controls
47 {
48 class Button;
49 class Panel;
50 class Popup;
51 }}} // Tizen::Ui::Controls
52
53 namespace Tizen { namespace Web { namespace Controls
54 {
55
56 enum _WebPopupButtonId
57 {
58         ID_BUTTON_COMMON_CLOSE
59 };
60
61 struct _WebPopupData
62 {
63         Tizen::Graphics::Dimension btnDim;
64         Tizen::Graphics::Dimension editDim;
65         Tizen::Graphics::Dimension popupDim;
66         Tizen::Graphics::Dimension dateDim;
67         Tizen::Graphics::Dimension colorDim;
68         Tizen::Graphics::Dimension checkDim;
69         Tizen::Graphics::Dimension labelDim;
70
71         int labelFontSize;
72         int spacePad;
73         int sideMargin;
74 };
75
76 class _WebPopup
77         : public Tizen::Ui::Controls::Popup
78         , virtual public Tizen::Ui::IActionEventListener
79 {
80 public:
81         /**
82          * Constructor
83          */
84         _WebPopup(void);
85
86         /**
87          * Destructor
88          */
89         virtual ~_WebPopup(void);
90
91         result Construct(bool hasTitle, const Tizen::Graphics::Dimension& popupDim);
92
93         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
94
95         /**
96          * This function launches non modal (asynchronous) popup
97          */
98         result ShowPopup(void);
99
100         result HidePopup(int modalResult = 0);
101
102         /**
103          * This function launches modal (synchronous) popup
104          */
105         result ShowAndWait(int& modalResult);
106
107         Tizen::Ui::Controls::Panel* CreateAndAddPanel(void);
108
109         result CreateAndAddButtons(const Tizen::Base::Collection::IList& buttonIds,
110                                         const Tizen::Base::Collection::IList& buttonTitles,
111                                         Tizen::Ui::Controls::Panel* pPanel);
112
113         bool IsModalPopup(void);
114
115 protected:
116         static _WebPopupData* GetPopupData(bool refresh = false);
117
118 private:
119         _WebPopup(const _WebPopup& source);
120
121         _WebPopup& operator =(const _WebPopup& source);
122
123 private:
124         static std::unique_ptr<_WebPopupData> __pWebPopupData;
125         bool __isModal;
126         int __modal;
127
128 }; // _WebPopup
129
130 }}} //Tizen::Web::Controls
131 #endif // _FWEB_CTRL_INTERNAL_WEB_POPUP_H_