3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.1 (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
9 // http://floralicense.org/license/
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.
18 //!Internet HistoryListForm class
19 /*@file: HistoryListForm.h
20 *@brief: This class defines HistoryListForm used define history
24 #ifndef _INT_HISTORY_LIST_FORM_H_
25 #define _INT_HISTORY_LIST_FORM_H_
32 * @class HistoryListForm
33 * @brief This class declares functions which displays history of browsed items, also one can search for items
36 : public Tizen::Ui::Controls::Form
37 , public Tizen::Ui::IActionEventListener
38 , public Tizen::Ui::Controls::IFormBackEventListener
39 , public Tizen::Ui::Controls::IGroupedListViewItemProvider
40 , public Tizen::Ui::Controls::IGroupedListViewItemEventListener
41 , public Tizen::Ui::IKeypadEventListener
42 , public Tizen::Ui::IOrientationEventListener
43 , public Tizen::Ui::Controls::ISearchBarEventListener
44 , public Tizen::Ui::Scenes::ISceneEventListener
45 , public Tizen::System::ISettingEventListener
49 * @brief The Default Constructor
51 HistoryListForm(void);
53 * @brief The Default Destructor
55 virtual ~HistoryListForm(void);
58 * @brief Initializes this HistoryListForm.
60 bool Initialize(void);
63 * @brief creates group items and store them in arraylist for later use.
65 void CreateGroupItems(void);
68 * @brief converts the integer value of month to string value for that corresponding month.
70 Tizen::Base::String GetMonth(int month);
72 // IActionEventListener
73 virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
75 // IFormBackEventListener
76 virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
78 //IGroupedListViewItemEventListener
79 void OnGroupedListViewContextItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListContextItemStatus status);
80 void OnGroupedListViewItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListItemStatus status);
81 void OnGroupedListViewItemSwept(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, Tizen::Ui::Controls::SweepDirection direction);
84 * brief Initializes the controls of the UI for HistoryListForm.
86 virtual result OnInitializing(void);
88 virtual result OnTerminating(void);
90 //IOrientationEventListener
91 virtual void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus);
93 //IGroupedListViewItemProvider
94 Tizen::Ui::Controls::GroupItem* CreateGroupItem(int groupIndex, int itemWidth);
95 Tizen::Ui::Controls::ListItemBase* CreateItem(int groupIndex, int itemIndex, int itemWidth);
96 bool DeleteGroupItem(int groupIndex, Tizen::Ui::Controls::GroupItem* pItem, int itemWidth);
97 bool DeleteItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth);
98 int GetGroupCount(void);
99 int GetItemCount(int groupIndex);
101 //IKeypadEventListener
102 virtual void OnKeypadWillOpen(Tizen::Ui::Control& source);
103 virtual void OnKeypadOpened(Tizen::Ui::Control& source);
104 virtual void OnKeypadClosed(Tizen::Ui::Control& source);
105 virtual void OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui::KeypadAction keypadAction);
106 virtual void OnKeypadBoundsChanged(Tizen::Ui::Control& source);
108 //ISceneEventListener
109 virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
110 virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
112 //ISearchBarEventListener
113 virtual void OnSearchBarModeChanged(Tizen::Ui::Controls::SearchBar& source, Tizen::Ui::Controls::SearchBarMode mode);
115 void OnSettingChanged(Tizen::Base::String& key);
118 static const int IDA_TABBAR_ITEM_1;
119 static const int IDA_TABBAR_ITEM_2;
120 static const int IDA_EDIT_HISTORY_LIST_FORM;
121 static const int IDA_FORMAT_ICON;
122 static const int IDA_FORMAT_TITLE;
123 static const int IDA_FORMAT_URL;
124 static const int IDA_FORMAT_BOOKMARK;
127 bool __isNoHistoryPresent;
128 Tizen::Base::Collection::ArrayList* __pBookmarkList;
129 Tizen::Base::Collection::ArrayList* __pGroupData;
130 Tizen::Ui::Controls::GroupedListView* __pGroupedListView; // The GroupedListView which contains the history lists
131 Tizen::Ui::Controls::SearchBar* __pSearchBar;
132 Tizen::Base::Collection::ArrayList* __pSearchedData;
133 Tizen::Ui::Controls::GroupedListView* __pSearchListView; // The GroupedListView which contains the Search history lists
134 bool __searchHistory;
135 Tizen::Base::String __searchText;
136 Tizen::Ui::Scenes::SceneId __previousSceneId;
140 * @class GroupItemClass
141 * @brief This class helps in storing group item data
144 :public Tizen::Base::Object
147 Tizen::Base::DateTime __startTime;
148 Tizen::Base::DateTime __endTime;
149 Tizen::Base::String __titleText;
150 Tizen::Base::Collection::ArrayList* __pData;
153 GroupItemClass(void);
154 ~GroupItemClass(void);
155 GroupItemClass(const GroupItemClass& groupItem);
156 GroupItemClass& operator =(const GroupItemClass& groupItem);
158 * This function gets the GetEndTime of History
161 * @param No parameter
163 Tizen::Base::DateTime GetEndTime(void);
166 * This function gets the GetHistoryData of History
168 * @return A Pointer to ArrayList
169 * @param No parameter
171 Tizen::Base::Collection::ArrayList* GetHistoryData(void);
174 * This function gets the GetStartTime of History
177 * @param No parameter
179 Tizen::Base::DateTime GetStartTime(void);
182 * This function gets the GetTitleText of History
185 * @param No parameter
187 Tizen::Base::String GetTitleText(void);
190 * This function sets the StartTime for the History object
192 * @return No return type
193 * @param startTime The StartTime for the History
195 void SetStartTime(Tizen::Base::DateTime& startTime);
198 * This function sets the endTime for the History object
200 * @return No return type
201 * @param endTime The endTime for the History
203 void SetEndTime(Tizen::Base::DateTime& endTime);
206 * This function sets the titleText for the History object
208 * @return No return type
209 * @param titleText The titleText for the History
211 void SetTitleText(Tizen::Base::String& titleText);
214 * This function sets the data for the History object
216 * @return No return type
217 * @param pData The data for the History
219 void SetHistoryData(Tizen::Base::Collection::ArrayList* pData);
222 #endif /* _INT_HISTORY_LIST_FORM_H_ */