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