add patch
[framework/osp/web.git] / src / controls / FWebCtrl_PromptPopup.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_PromptPopup.h
20  * @brief       The file contains the definition of _PromptPopup class.
21  */
22 #ifndef _FWEB_CTRL_PROMPT_POPUP_H_
23 #define _FWEB_CTRL_PROMPT_POPUP_H_
24
25 #include <unique_ptr.h>
26 #include <FBaseString.h>
27 #include <FUiIPropagatedKeyEventListener.h>
28 #include "FWebCtrl_WebPopup.h"
29
30 namespace Tizen { namespace Ui { namespace Controls
31 {
32 class EditField;
33 }}} // Tizen::Ui::Controls
34
35 namespace Tizen { namespace Web { namespace Controls
36 {
37 class _WebImpl;
38 }}} // Tizen::Web::Controls
39
40 namespace Tizen { namespace Web { namespace Controls
41 {
42
43 enum _PromptPopupButtonId
44 {
45         ID_BUTTON_PROMPT_CANCEL,
46         ID_BUTTON_PROMPT_OK
47 };
48
49
50 class _PromptPopup
51         : public _WebPopup
52         , public Tizen::Ui::IPropagatedKeyEventListener
53 {
54
55 public:
56         /**
57          * Constructor
58          */
59         _PromptPopup(void);
60
61         /**
62          * Destructor
63          */
64         virtual ~_PromptPopup(void);
65
66         result Construct(const Tizen::Base::String& message, const Tizen::Base::String& defaultValue, Evas_Object* pView, _WebImpl* pImpl);
67
68         const Tizen::Base::String GetPromptText(void);
69
70         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
71
72         virtual bool  OnKeyPressed (Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo);
73         virtual bool  OnKeyReleased (Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo);
74         virtual bool  OnPreviewKeyPressed (Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo);
75         virtual bool  OnPreviewKeyReleased (Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo);
76         virtual bool  TranslateKeyEventInfo (Tizen::Ui::Control &source, Tizen::Ui::KeyEventInfo &keyEventInfo);
77
78 private:
79
80         _PromptPopup(const _PromptPopup&);
81
82         _PromptPopup& operator =(const _PromptPopup&);
83
84 private:
85
86         Tizen::Ui::Controls::EditField* __pEditField;
87         Evas_Object* __pWebView;
88         _WebImpl* __pImpl;
89 }; // _PromptPopup
90
91 }}} // Tizen::Web::Controls
92 #endif // _FWEB_CTRL_PROMPT_POPUP_H_