merge with master
[apps/osp/Internet.git] / inc / IntMultipleWindowForm.h
1 //\r
2 \r
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.\r
4 //\r
5 // Licensed under the Flora License, Version 1.0 (the License);\r
6 // you may not use this file except in compliance with the License.\r
7 // You may obtain a copy of the License at\r
8 //\r
9 //     http://floralicense.org/license/\r
10 //\r
11 // Unless required by applicable law or agreed to in writing, software\r
12 // distributed under the License is distributed on an AS IS BASIS,\r
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
14 // See the License for the specific language governing permissions and\r
15 // limitations under the License.\r
16 //\r
17 \r
18 //!Internet\r
19 /*@file:         IntMultipleWindowForm.h\r
20  *@brief:        The IntMultipleWindowForm provides multiple instance of mainscenes and displays them in a Listview\r
21  *\r
22  */\r
23 \r
24 #ifndef _INT_MULTIPLE_WINDOW_FORM_H_\r
25 #define _INT_MULTIPLE_WINDOW_FORM_H_\r
26 \r
27 #include <FBase.h>\r
28 #include <FGraphics.h>\r
29 #include <FMedia.h>\r
30 #include <FSystem.h>\r
31 #include <FUi.h>\r
32 \r
33 class MultipleWindowForm\r
34         : public Tizen::Ui::Controls::Form\r
35         , public Tizen::Ui::Controls::IFormBackEventListener\r
36         , public Tizen::Ui::Controls::IListViewItemEventListener\r
37         , public Tizen::Ui::Controls::IListViewItemProvider\r
38         , public Tizen::Ui::IActionEventListener\r
39         , public Tizen::Ui::IOrientationEventListener\r
40         , public Tizen::Ui::Scenes::ISceneEventListener\r
41 \r
42 {\r
43 public:\r
44         /**\r
45         *@brief                 Default constructor\r
46         */\r
47         MultipleWindowForm(void);\r
48 \r
49         /**\r
50         *@brief                 Default destructor\r
51         */\r
52         virtual ~MultipleWindowForm(void);\r
53 \r
54         /**\r
55          *@brief        Constructing and Initializing MultipleWindowForm\r
56          */\r
57         bool Initialize(void);\r
58 \r
59 public:\r
60         /**\r
61          *Used to create instances and set styles for the form content.\r
62          */\r
63         virtual result OnInitializing(void);\r
64 \r
65         /**\r
66          *Called on terminate of a form\r
67          */\r
68         virtual result OnTerminating(void);\r
69 \r
70         // ISceneEventListener\r
71 \r
72         /**\r
73          *Called after setting as current scene.\r
74          */\r
75         virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);\r
76 \r
77         /**\r
78          *Called when the current scene is deactivated.\r
79          */\r
80         virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);\r
81 \r
82         // IFormBackEventListener\r
83         /**\r
84          *Called when the current Form control needs to be closed to revert back to the previous Form control.\r
85          */\r
86         virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);\r
87 \r
88         // IActionEventListener\r
89         /**\r
90          *Called when an action event occurs.\r
91          */\r
92         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);\r
93 \r
94         // IListViewItemEventListener\r
95         /**\r
96          *Called when the state of an element in the ListContextItem is changed.\r
97          */\r
98         virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state);\r
99 \r
100         /**\r
101          *Called when the state of an element in the ListViewItem in the ListView or GroupedListView is changed.\r
102          */\r
103         virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status);\r
104 \r
105         /**\r
106          *Called when the ListItem is swept.\r
107          */\r
108         virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction);\r
109 \r
110         /**\r
111          *Called when the item or the element is long pressed.\r
112          */\r
113         virtual void OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback);\r
114 \r
115         //IListViewItemProvider\r
116         /**\r
117          *Called when items need to be loaded.\r
118          */\r
119         virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);\r
120 \r
121         /**\r
122          *Called when items need to be loaded.\r
123          */\r
124         virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth);\r
125 \r
126         /**\r
127          *Called when the IconListView is about to be drawn and requests the listener to set the number of total items.\r
128          */\r
129         virtual int GetItemCount(void);\r
130 \r
131         //IOrientationEventListener\r
132         /**\r
133          *Called when an orientation event occurs.\r
134          */\r
135         void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus);\r
136 \r
137 private:\r
138         static const int IDA_FORMAT_BITMAP = 500;\r
139         static const int IDA_FORMAT_DELETE_BITMAP = 501;\r
140         static const int IDA_FORMAT_TITLE_STRING = 502;\r
141         static const int IDA_FORMAT_URL_STRING = 503;\r
142         static const int IDA_BUTTON_NEW = 504;\r
143         static const int IDA_BUTTON_BACK = 505;\r
144         static const int IDA_BUTTON_CLOSEALL = 506;\r
145         static const int IDA_FORMAT_CUSTOM = 507;\r
146 \r
147         static const int IDA_CONFIRMATION_NO = 1000;\r
148         static const int IDA_CONFIRMATION_YES = 1001;\r
149 \r
150         // __pList Pointer to ListView\r
151         Tizen::Ui::Controls::ListView* __pList;\r
152         // __pListIconImage Pointer to Bitmap contains list icon image\r
153         Tizen::Graphics::Bitmap* __pListIconImage;\r
154         // __pListDeleteImage Pointer to Bitmap contains list delete image\r
155         Tizen::Graphics::Bitmap* __pListDeleteImage;\r
156         ConfirmationPopup* __pConfirmationPopup;\r
157 \r
158 };\r
159 \r
160 #endif /* _INT_MULTIPLE_WINDOW_FORM_H_ */\r