Apply to remove download listener before deleting _WebImpl
[framework/osp/web.git] / src / controls / FWebCtrl_FormDataWindow.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_FormDataWindow.h
20  * @brief               The file contains the declaration of _FormDataWindow class.
21  *
22  * The file contains the declaration of _FormDataWindow class.
23  */
24 #ifndef _FWEB_CTRL_INTERNAL_FORMDATA_WINDOW_H_
25 #define _FWEB_CTRL_INTERNAL_FORMDATA_WINDOW_H_
26
27 #include <FBaseColIList.h>
28 #include <FBaseString.h>
29 #include <FUiCtrlIListViewItemEventListener.h>
30 #include <FUiCtrlIListViewItemProvider.h>
31 #include <FUiWindow.h>
32
33
34 namespace Tizen { namespace Graphics
35 {
36 class Rectangle;
37 }} // Tizen::Graphics
38
39 namespace Tizen { namespace Ui
40 {
41 class IActionEventListener;
42 }} // Tizen::Ui
43
44 namespace Tizen { namespace Ui { namespace Controls
45 {
46 class ListItemBase;
47 class ListView;
48 }}} // Tizen::Ui::Controls
49
50 namespace Tizen { namespace Web { namespace Controls
51 {
52
53 class _WebImpl;
54
55 class _FormDataWindow
56         : public Tizen::Ui::Window
57         , public Tizen::Ui::Controls::IListViewItemEventListener
58         , public Tizen::Ui::Controls::IListViewItemProvider
59 {
60 public:
61         /**
62          * Constructor
63          */
64         _FormDataWindow(void);
65
66         /**
67          * Destructor
68          */
69         virtual ~_FormDataWindow(void);
70
71         result Construct(const Tizen::Graphics::Rectangle& rect, _WebImpl* pImpl, Evas_Object* pWebView);
72
73         //IListViewItemProvider
74         virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);
75         virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth);
76         virtual int GetItemCount(void);
77
78         // IListViewItemEventListener
79         virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state);
80         virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status);
81         virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction);
82
83         result UpdateList(Eina_List* pDataList, const Tizen::Graphics::Rectangle& rect);
84         result LaunchFormDataWindow(void);
85
86 private:
87         /**
88          * This is the copy constructor for this class.
89          */
90         _FormDataWindow(const _FormDataWindow& source);
91
92         /**
93          * This is the assignment operator for this class.
94          */
95         _FormDataWindow& operator =(const _FormDataWindow& source);
96
97 public:
98         static const int ID_FORMAT_STRING = 300;
99
100 private:
101         Tizen::Base::Collection::ArrayList __listElementArray;
102         Tizen::Ui::Controls::ListView* __pListView;
103         Evas_Object* __pWebView;
104         _WebImpl* __pWebImpl;
105         int __listItemHeight;
106 }; // _FormDataWindow
107
108 }}} //Tizen::Web::Controls
109 #endif // _FWEB_CTRL_INTERNAL_FORMDATA_WINDOW_H_