Fixed Nabi Issues
[apps/osp/Internet.git] / src / IntBookmarkListForm.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://floralicense.org/license/
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 //!Internet
18 /*@file:    IntBookmarkListForm
19  *@brief:       This class defines BookmarkListForm
20  *
21  */
22
23 #include <FApp.h>
24 #include "IntBookmarkData.h"
25 #include "IntBookmarkListForm.h"
26 #include "IntBookmarkPresentationModel.h"
27 #include "IntCommonLib.h"
28 #include "IntConfirmationPopup.h"
29 #include "IntFaviconManager.h"
30 #include "IntMultipleWindowPresentationModel.h"
31 #include "IntSceneRegister.h"
32 #include "IntTypes.h"
33
34
35 using namespace Tizen::App;
36 using namespace Tizen::Base;
37 using namespace Tizen::Base::Collection;
38 using namespace Tizen::Base::Runtime;
39 using namespace Tizen::Graphics;
40 using namespace Tizen::Ui;
41 using namespace Tizen::Ui::Controls;
42 using namespace Tizen::Ui::Scenes;
43 using namespace Tizen::Media;
44
45 const wchar_t* DEFAULT_VALUE_PARENTID = L"0";
46 static const wchar_t* IDB_TAB_ICON_BOOKMARK = L"I01_tab_icon_bookmarks.png";
47 static const wchar_t* IDB_TAB_ICON_HISTORY = L"I01_tab_icon_history.png";
48 static const wchar_t* IDB_NO_CONTENT_BOOKMARK = L"I01_Nocontents_Bookmarks.png";
49 static const wchar_t* IDB_ICON_FOLDER_OPEN = L"I01_icon_folder_open.png";
50
51 const int BookmarkListForm::IDA_TABBAR_ITEM_1 = 101;
52 const int BookmarkListForm::IDA_TABBAR_ITEM_2 = 102;
53 const int BookmarkListForm::IDA_FOOTER_ITEM1 = 103;
54 const int BookmarkListForm::IDA_FOOTER_ITEM2 = 104;
55 const int BookmarkListForm::IDA_FOOTER_ITEM_ADDBOOKMARK = 105;
56 const int BookmarkListForm::IDA_FORMAT_FOLDER = 106;
57 const int BookmarkListForm::IDA_FORMAT_SITE = 107;
58 const int BookmarkListForm::IDA_CONTEXT_ITEM_FOLDER_EDIT = 108;
59 const int BookmarkListForm::IDA_CONTEXT_ITEM_FOLDER_DELETE = 109;
60 const int BookmarkListForm::IDA_CONTEXT_ITEM_EDIT = 110;
61 const int BookmarkListForm::IDA_CONTEXT_ITEM_SHARE = 111;
62 const int BookmarkListForm::IDA_CONTEXT_ITEM_DELETE = 112;
63 const int BookmarkListForm::IDA_FORMAT_ICON = 113;
64 const int BookmarkListForm::IDA_FORMAT_URL = 114;
65
66 //const int BookmarkListForm::IDA_CONFIRMATION_NO = 1000;
67 //const int BookmarkListForm::IDA_CONFIRMATION_YES = 1001;
68
69 BookmarkListForm::BookmarkListForm(void)
70 {
71         __pItemContextFolder = null ;
72         __pItemContextSite = null ;
73         __pListview = null;
74         __pData = null;
75         __pSearchListView = null;
76         __pSearchBar = null;
77         __searchBookmark = false;
78         __parentID = DEFAULT_VALUE_PARENTID;
79         __noBookmarks = true;
80         __selectedindex = 0;
81         __searchText = L"";
82         __previousSceneId = L"";
83 }
84
85 BookmarkListForm::~BookmarkListForm(void)
86 {
87
88         if (__pData != null)
89         {
90                 __pData->RemoveAll(true);
91                 delete __pData;
92                 __pData = NULL;
93         }
94
95         if (__pItemContextFolder != null)
96         {
97                 delete __pItemContextFolder;
98                 __pItemContextFolder = null;
99         }
100
101         if (__pItemContextSite != null)
102         {
103                 delete __pItemContextSite;
104                 __pItemContextSite = null;
105         }
106 }
107
108 result
109 BookmarkListForm::OnTerminating(void)
110 {
111         result r = E_SUCCESS;
112
113         if (__pData != null)
114         {
115                 __pData->RemoveAll(true);
116                 delete __pData;
117                 __pData = NULL;
118         }
119
120         return r;
121 }
122
123
124 bool
125 BookmarkListForm::Initialize(void)
126 {
127         Construct(L"IDL_BOOKMARK_LIST");
128         return true;
129 }
130
131 result
132 BookmarkListForm::OnInitializing(void)
133 {
134         result r = E_SUCCESS;
135         HeaderItem bookmark;
136         HeaderItem history;
137         Bitmap *pBitmapNormal = null;
138         Bitmap *pBitmapPressed = null;
139         Header *pHeader = GetHeader();
140         Bitmap *pIconBitmap = null;
141         AppResource* pAppResource = UiApp::GetInstance()->GetAppResource();
142         int bookmarkCount = 0;
143         const int WIDTH_CONTEXT_MENU_TWO_BUTTON = 336;
144         const int WIDTH_CONTEXT_MENU_THREE_BUTTON = 160;
145         const int HEIGHT_CONTEXT_MENU_BUTTON = 72;
146
147
148         // Setup back event listener
149         SetFormBackEventListener(this);
150         AddOrientationEventListener(*this);
151
152         SceneManager::GetInstance()->AddSceneEventListener(IDSCN_BOOKMARK_VIEW, *this);
153         GetHeader()->AddActionEventListener(*this);
154         GetFooter()->AddActionEventListener(*this);
155
156         if ( pAppResource == NULL )
157         {
158                 return E_FAILURE;
159         }
160
161         __pItemContextFolder = new(std::nothrow) ListContextItem();
162         __pItemContextFolder->Construct();
163         __pItemContextFolder->AddElement(IDA_CONTEXT_ITEM_FOLDER_EDIT, CommonUtil::GetString(L"IDS_BR_SK_EDIT"));
164         pBitmapNormal = CommonUtil::GetNinepatchedBitmapN(L"00_button_sweep_delete.9.png", WIDTH_CONTEXT_MENU_TWO_BUTTON, HEIGHT_CONTEXT_MENU_BUTTON);
165         pBitmapPressed = CommonUtil::GetNinepatchedBitmapN(L"00_button_sweep_delete_press.9.png", WIDTH_CONTEXT_MENU_TWO_BUTTON, HEIGHT_CONTEXT_MENU_BUTTON);
166
167         if (pBitmapNormal != null && pBitmapPressed != null)
168         {
169                 __pItemContextFolder->AddElement(IDA_CONTEXT_ITEM_FOLDER_DELETE, CommonUtil::GetString(L"IDS_BR_SK_DELETE_ABB"),  *pBitmapNormal, *pBitmapPressed, pBitmapPressed);
170         }
171
172         if (pBitmapNormal != null)
173         {
174                 delete pBitmapNormal;
175         }
176
177         if (pBitmapPressed != null)
178         {
179                 delete pBitmapPressed;
180         }
181
182         __pItemContextSite = new(std::nothrow) ListContextItem();
183         __pItemContextSite->Construct();
184         __pItemContextSite->AddElement(IDA_CONTEXT_ITEM_EDIT, CommonUtil::GetString(L"IDS_BR_SK_EDIT"));
185         __pItemContextSite->AddElement(IDA_CONTEXT_ITEM_SHARE, CommonUtil::GetString(L"IDS_BR_OPT_SHARE"));
186         pBitmapNormal = CommonUtil::GetNinepatchedBitmapN(L"00_button_sweep_delete.9.png", WIDTH_CONTEXT_MENU_THREE_BUTTON, HEIGHT_CONTEXT_MENU_BUTTON);
187         pBitmapPressed = CommonUtil::GetNinepatchedBitmapN(L"00_button_sweep_delete_press.9.png", WIDTH_CONTEXT_MENU_THREE_BUTTON, HEIGHT_CONTEXT_MENU_BUTTON);
188
189         if (pBitmapNormal != null && pBitmapPressed != null)
190         {
191                 __pItemContextSite->AddElement(IDA_CONTEXT_ITEM_DELETE, CommonUtil::GetString(L"IDS_BR_SK_DELETE_ABB"), *pBitmapNormal, *pBitmapPressed, pBitmapPressed);
192         }
193
194         if (pBitmapNormal != null)
195         {
196                 delete pBitmapNormal;
197         }
198
199         if (pBitmapPressed != null)
200         {
201                 delete pBitmapPressed;
202         }
203         __pListview = static_cast< ListView* >(GetControl("IDC_LISTVIEW1"));
204
205         if (__pListview == null)
206         {
207                 return E_FAILURE;
208         }
209         __pSearchBar = static_cast< SearchBar* >(GetControl(L"IDC_SEARCHBAR1"));
210
211         if (__pSearchBar == null)
212         {
213                 return E_FAILURE;
214         }
215
216         if (__pListview != null)
217         {
218                 //              __pListview->SetBounds(__pListview->GetX(), __pListview->GetY(), GetClientAreaBounds().width, GetClientAreaBounds().height);
219                 __pListview->AddFastScrollListener(*this);
220                 __pListview->AddListViewItemEventListener(*this);
221                 __pListview->SetItemProvider(*this);
222                 __pListview->UpdateList();
223         }
224
225         __pPopUp = new(std::nothrow) SharePopup();
226
227         if (__pPopUp != null)
228         {
229                 __pPopUp->Initialize();
230                 AddControl(*__pPopUp);
231         }
232
233         __pSearchListView = new(std::nothrow) ListView();
234
235         if (__pSearchListView == null)
236         {
237                 return E_FAILURE;
238         }
239
240         r = __pSearchListView->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height -72 - 30), true, false);
241         TryCatch( !IsFailed(r),,"BookmarkListForm::OnSearchBarModeChanged Update list failed %s",GetErrorMessage(r));
242
243         __pSearchListView->SetItemProvider(*this);
244         __pSearchListView->SetTextOfEmptyList(CommonUtil::GetString(L"IDS_BR_BODY_NO_RESULTS_FOUND"));
245         __pSearchListView->SetTextColorOfEmptyList(Color::GetColor(COLOR_ID_BLACK));
246         __pSearchListView->SetShowState(false);
247         __pSearchListView->AddListViewItemEventListener(*this);
248
249         __pSearchBar->AddSearchBarEventListener(*this);
250         __pSearchBar->AddKeypadEventListener(*this);
251         __pSearchBar->SetContent(__pSearchListView);
252
253         BookmarkPresentationModel::GetInstance()->GetFolderBookmarkCount(__parentID, bookmarkCount);
254         if(bookmarkCount <= 0)
255         {
256                 __pSearchBar->SetShowState(false);
257                 //__pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetY(),__pSearchBar->GetWidth(),GetClientAreaBounds().height - __pSearchBar->GetPosition().y);
258                 __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetY(),__pListview->GetWidth(),GetClientAreaBounds().height);
259         }
260         else
261         {
262                 __pSearchBar->SetShowState(true);
263         }
264
265
266         if (pHeader != null)
267         {
268                 pHeader->SetStyle(HEADER_STYLE_TAB);
269                 bookmark.Construct(IDA_TABBAR_ITEM_1);
270                 String strbookmark;
271                 pAppResource->GetString(L"IDS_BR_TAB_BOOKMARKS", strbookmark);
272                 bookmark.SetText(strbookmark);
273                 pIconBitmap = pAppResource->GetBitmapN(IDB_TAB_ICON_BOOKMARK);
274                 bookmark.SetIcon(HEADER_ITEM_STATUS_NORMAL, pIconBitmap);
275                 bookmark.SetIcon(HEADER_ITEM_STATUS_PRESSED, pIconBitmap);
276                 pHeader->AddItem(bookmark);
277
278                 if (pIconBitmap != NULL)
279                 {
280                         delete pIconBitmap;
281                 }
282
283                 history.Construct(IDA_TABBAR_ITEM_2);
284                 String strhistory;
285                 pAppResource->GetString(L"IDS_BR_TAB_HISTORY", strhistory);
286                 history.SetText(strhistory);
287                 pIconBitmap = pAppResource->GetBitmapN(IDB_TAB_ICON_HISTORY);
288                 history.SetIcon(HEADER_ITEM_STATUS_NORMAL, pIconBitmap);
289                 history.SetIcon(HEADER_ITEM_STATUS_PRESSED, pIconBitmap);
290                 pHeader->AddItem(history);
291                 pHeader->SetItemSelected(0);
292                 pHeader->SetTabEditModeEnabled(false);
293
294                 if (pIconBitmap != NULL)
295                 {
296                         delete pIconBitmap;
297                 }
298         }
299
300
301         CATCH:return r;
302 }
303
304 void
305 BookmarkListForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
306 {
307         AppLogDebug("BookmarkListForm::OnActionPerformed actionId = %d",actionId);
308         String bookmarkId;
309         int id = 0;
310         BookmarkData* pBookMark = null;
311
312         switch (actionId)
313         {
314         case IDA_FOOTER_ITEM1:
315         {
316                 GetHeader()->SetItemSelected(0);
317                 GetHeader()->Invalidate(true);
318                 SceneManager* pSceneManager = SceneManager::GetInstance();
319                 pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(__selectedindex));
320
321                 if ( pBookMark == NULL )
322                 {
323                         return;
324                 }
325
326                 ArrayList* pArgList = null;
327                 pArgList = new(std::nothrow) ArrayList();
328                 if (pArgList != null)
329                 {
330                         pArgList->Construct();
331                         pArgList->Add(*new(std::nothrow) String(pBookMark->GetParentId()));
332                 }
333                 //pArgList->Add(*new(std::nothrow) String(pBookmark->);
334                 if (pSceneManager != null)
335                 {
336                         if(pSceneManager->GoForward(ForwardSceneTransition(IDSCN_EDIT_BOOKMARK_LIST),pArgList) != E_SUCCESS)
337                         {
338                                 AppLogDebug("BookmarkListForm::OnActionPerformed GoForward failed");
339                                 pArgList->RemoveAll(true);
340                                 delete pArgList;
341                                 pArgList = null;
342                                 return;
343                         }
344                 }
345
346                 if ( pArgList != NULL)
347                 {
348                         pArgList->RemoveAll(true);
349                         delete pArgList;
350                 }
351         }
352
353         break;
354         case IDA_TABBAR_ITEM_2:
355         {
356                 GetHeader()->SetItemSelected(0);
357                 GetHeader()->Invalidate(true);
358
359                 SceneManager* pSceneManager = SceneManager::GetInstance();
360
361                 if (pSceneManager != null)
362                 {
363                         if(__previousSceneId.CompareTo(IDSCN_HISTORY_LIST) != 0)
364                         {
365                                 if(pSceneManager->GoForward(ForwardSceneTransition(IDSCN_HISTORY_LIST, SCENE_TRANSITION_ANIMATION_TYPE_LEFT)) != E_SUCCESS)
366                                 {
367                                         AppLogDebug("BookmarkListForm::OnActionPerformed GoForward failed");
368                                         return;
369                                 }
370                         }
371                         else
372                         {
373
374                                 if(pSceneManager->GoBackward(BackwardSceneTransition())!= E_SUCCESS)
375                                 {
376                                         AppLogDebug("BookmarkListForm::OnActionPerformed GoBackward failed");
377                                         return;
378                                 }
379
380                         }
381                 }
382         }
383         break;
384         case IDA_FOOTER_ITEM2:
385         {
386                 SceneManager* pSceneManager = SceneManager::GetInstance();
387
388                 if (pSceneManager)
389                 {
390                         if(pSceneManager->GoForward(ForwardSceneTransition(IDSCN_CREATE_BOOKMARK_FOLDER)) != E_SUCCESS)
391                         {
392                                 AppLogDebug("BookmarkListForm::OnActionPerformed GoForward failed");
393                                 return;
394                         }
395                 }
396         }
397         break;
398         case IDA_FOOTER_ITEM_ADDBOOKMARK:
399         {
400                 SceneManager* pSceneManager = SceneManager::GetInstance();
401
402                 // send array list 0-for add, 1 for edit with parent ID
403                 ArrayList* pArgList = null;
404                 pArgList = new(std::nothrow) ArrayList();
405                 if (pArgList != null)
406                 {
407                         pArgList->Construct();
408                         pArgList->Add(*new(std::nothrow) String(L"0"));
409                         pArgList->Add(*new(std::nothrow) String(__parentID));
410                 }
411
412                 if (pSceneManager)
413                 {
414                         if(pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ADD_BOOKMARK),pArgList) != E_SUCCESS)
415                         {
416                                 AppLogDebug("BookmarkListForm::OnActionPerformed GoForward failed");
417                                 pArgList->RemoveAll(true);
418                                 delete pArgList;
419                                 return;
420                         }
421                 }
422
423                 if (pArgList != null)
424                 {
425                         pArgList->RemoveAll(true);
426                         delete pArgList;
427                 }
428
429         }
430         break;
431         case IDA_BUTTON_NO:
432                 __pConfirmationPopup->SetShowState(false);
433                 __pConfirmationPopup->Show();
434                 break;
435         case IDA_BUTTON_YES:
436                 pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(__selectedindex));
437                 if ( pBookMark== null)
438                         return;
439                 bookmarkId=pBookMark->GetBookmarkId();
440                 Integer::Parse(bookmarkId,id);
441                 if (pBookMark->GetBookmarkType() == BOOKMARK_TYPE_FOLDER)
442                         BookmarkPresentationModel::GetInstance()->DeleteFolder(id);
443                 else
444                         BookmarkPresentationModel::GetInstance()->DeleteBookmark(id);
445                 if (__pListview == null)
446                 {
447                         return;
448                 }
449                 AppLogDebug("__pListview GetBounds %d,%d,%d,%d",__pListview->GetBounds().x,__pListview->GetBounds().y,__pListview->GetBounds().width,__pListview->GetBounds().height);
450                 __pSearchListView->UpdateList();
451                 __pListview->UpdateList();
452
453                 if (__pListview->GetItemCount() == 0)
454                 {
455                         GetFooter()->SetItemEnabled(1,false);
456                         __pSearchBar->SetShowState(false);
457                         __pSearchBar->Invalidate(true);
458                 }
459
460                 if (__noBookmarks == true)
461                 {
462                         Bitmap* emptyListBmp = AppResource::GetInstance()->GetBitmapN(IDB_NO_CONTENT_BOOKMARK);
463                         GetFooter()->SetItemEnabled(1,false);
464                         __pSearchBar->SetShowState(false);
465                         __pSearchBar->Invalidate(true);
466                         //                      __pListview->SetBounds(__pSearchBar->GetPosition().x,__pSearchBar->GetPosition().y,__pSearchBar->GetWidth() ,GetClientAreaBounds().height);
467                         __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetPosition().y,__pSearchBar->GetWidth() ,GetClientAreaBounds().height);
468                         __pListview->SetBitmapOfEmptyList(emptyListBmp);
469                         if (emptyListBmp)
470                         {
471                                 delete emptyListBmp;
472                                 emptyListBmp = null;
473                         }
474                         __pListview->UpdateList();
475
476                 }
477                 else
478                 {
479                         GetFooter()->SetItemEnabled(1,true);
480
481                         if (__parentID.CompareTo(L"0") == 0)
482                         {
483                                 __pSearchBar->SetShowState(true);
484                                 __pSearchBar->Invalidate(true);
485                         }
486                 }
487
488                 GetFooter()->Invalidate(true);
489                 __pConfirmationPopup->SetShowState(false);
490                 __pConfirmationPopup->Show();
491                 __selectedindex = 0;
492
493                 break;
494         default:
495                 break;
496         }
497 }
498
499 void
500 BookmarkListForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
501 {
502         AppLogDebug("BrowserApplicationForm::OnFormBackRequested");
503
504         UiApp* pApp = UiApp::GetInstance();
505         if      (pApp == null)
506         {
507                 return;
508         }
509
510         if (__parentID != DEFAULT_VALUE_PARENTID)
511         {
512                 __parentID = DEFAULT_VALUE_PARENTID;
513                 __pSearchBar->SetShowState(true);
514                 __pListview->SetBounds(__pListview->GetX() ,__pSearchBar->GetPosition().y + __pSearchBar->GetHeight(),__pListview->GetWidth(),GetClientAreaBounds().height - (__pSearchBar->GetY() + __pSearchBar->GetHeight()));
515                 __pListview->UpdateList();
516                 __pFooter = GetFooter();
517                 GetFooter()->SetItemEnabled(2,true);
518                 GetFooter()->Invalidate(true);
519         }
520         else
521         {
522                 SceneManager* pSceneManager = SceneManager::GetInstance();
523                 if (pSceneManager != null)
524                 {
525                         if(__previousSceneId.CompareTo(IDSCN_HISTORY_LIST) != 0)
526                         {
527                                 pSceneManager->GoBackward(BackwardSceneTransition());
528                         }
529                         else
530                         {
531                                 pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_LEFT));
532                         }
533                 }
534         }
535
536         if (__noBookmarks == true)
537         {
538                 GetFooter()->SetItemEnabled(1,false);
539         }
540         else
541         {
542                 GetFooter()->SetItemEnabled(1,true);
543         }
544 }
545
546 Tizen::Ui::Controls::ListItemBase*
547 BookmarkListForm::CreateItem(int index, int itemWidth)
548 {
549
550         AppLog("BookmarkListForm::CreateItem index %d , itemWidth %d",index, itemWidth);
551         AppLog("listviewwidth %d",__pListview->GetWidth());
552         result r = E_FAILURE;
553         ListAnnexStyle style = LIST_ANNEX_STYLE_NORMAL;
554         if(__pData == null)
555         {
556                 return null;
557         }
558         CustomItem* pItem = new(std::nothrow) CustomItem();
559
560         BookmarkData* pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(index));
561         Bitmap* pBitmap = null;
562         Dimension dim;
563
564         Image* pImage = null;
565         pImage = new Image();
566         pImage->Construct();
567
568         const int x_Margin_Icon = 16;                 // local as there used only in this function
569         const int y_Margin_Icon = 28;
570         const int height_Icon = 72;
571         const int width_Icon = 72 ;
572         const int x_Margin_Title = 104 ;
573         const int y_Margin_Title = 10;
574         const int width_Title = GetClientAreaBounds().width - 108 - 52 - 30;
575         const int x_Margin_Url = 104 ;
576         const int y_Margin_Url = 70 ;
577         const int width_Url = GetClientAreaBounds().width - 108 - 52 ;
578         const int height_Url = 48;
579         const int itemHeight = 128;
580         const int textSize = 32;
581         String bitmapId;
582
583         if( pBookMark == NULL )
584         {
585                 delete pItem;
586                 pItem = null;
587                 return NULL;
588         }
589         if ( pBookMark->GetBookmarkType() == BOOKMARK_TYPE_FOLDER )
590         {
591                 r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth,112), LIST_ANNEX_STYLE_DETAILED);
592                 TryCatch(!IsFailed(r),,"BookmarkListForm::CreateItem Construct failed %s",GetErrorMessage(r));
593
594                 pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_ICON_FOLDER_OPEN);
595                 if (pBitmap != null)
596                 {
597                         pItem->AddElement(Rectangle(x_Margin_Icon, 20, width_Icon, height_Icon), IDA_FORMAT_ICON, *pBitmap, null);
598                         delete pBitmap;
599                 }
600
601                 pItem->AddElement(Rectangle(x_Margin_Title, 26, width_Title, 60), IDA_FORMAT_FOLDER, pBookMark->GetBookmarkTitle(), true);
602
603                 if ( __pItemContextFolder != NULL)
604                 {
605                         pItem->SetContextItem(__pItemContextFolder);
606                 }
607         }
608         else
609         {
610                 r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth, itemHeight), style);
611                 TryCatch( !IsFailed(r),,"BookmarkListForm::CreateItem Construct failed %s",GetErrorMessage(r));
612
613                 AppLogDebug("BookmarkListForm::faviconid %ls",pBookMark->GetFaviconId().GetPointer());
614                 bitmapId = pBookMark->GetFaviconId();
615
616                 dim = Dimension(pBookMark->GetFavIconWidth(), pBookMark->GetFavIconHeight());
617
618                 AppLog("BookmarkListForm::CreateItem check 0");
619
620                 // get fav icon bitmap
621                 ByteBuffer* pFavIconBuffer = null;
622                 pFavIconBuffer = pBookMark->GetFavIconBuffer();
623
624                 AppLog("BookmarkListForm::CreateItem check 0");
625
626                 if (pFavIconBuffer != null)
627                 {
628                         AppLog("BookmarkListForm::CreateItem pFavIconBuffer is not null");
629                 }
630                 else
631                 {
632                         AppLog("BookmarkListForm::CreateItem pFavIconBuffer is null");
633                 }
634
635                 pBitmap = pImage->DecodeN(*pFavIconBuffer, IMG_FORMAT_PNG, BITMAP_PIXEL_FORMAT_ARGB8888);
636
637                 AppLog("BookmarkListForm::CreateItem check 1");
638
639                 if (pBitmap != null)
640                 {
641                         AppLog("rahul bitmap is not null");
642                         int width = pBitmap->GetWidth();
643                         int height = pBitmap->GetHeight();
644                         AppLog("rahul bitmap width is %d", width);
645                         AppLog("rahul bitmap height is %d", height);
646                         AppLog("rahul favicon width is %d", pBookMark->GetFavIconWidth());
647                         AppLog("rahul favicon height is %d", pBookMark->GetFavIconHeight());
648                 }
649                 else
650                 {
651                         AppLog("rahul bitmap is null");
652                 }
653
654                 if (pBitmap == null)
655                 {
656                         AppLogDebug("BookmarkListForm::CreateItem bitmap is null");
657                         pBitmap = FaviconManager::GetInstance()->GetDefaultFaviconN();
658                 }
659                 pItem->AddElement(Rectangle(x_Margin_Icon, y_Margin_Icon, width_Icon, height_Icon), IDA_FORMAT_ICON, *pBitmap, null);
660                 pItem->AddElement(Rectangle(x_Margin_Title, 0, width_Title, itemHeight - height_Url), IDA_FORMAT_SITE, pBookMark->GetBookmarkTitle(),44,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true);
661                 if(__pSearchBar->GetMode() == SEARCH_BAR_MODE_INPUT)
662                         pItem->AddElement(Rectangle(x_Margin_Url, y_Margin_Url, width_Url, height_Url), IDA_FORMAT_URL, pBookMark->GetUrl(),textSize,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true);
663                 else
664                         pItem->AddElement(Rectangle(x_Margin_Url, y_Margin_Url, width_Url, height_Url), IDA_FORMAT_URL, pBookMark->GetUrl(),textSize,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,true);
665
666                 if (pBitmap != null)
667                 {
668                         delete pBitmap;
669                 }
670                 if ( __pItemContextSite != NULL)
671                 {
672                         pItem->SetContextItem(__pItemContextSite);
673                 }
674         }
675
676         delete pImage;
677         return pItem;
678
679         CATCH:
680
681         delete pImage;
682         delete pItem;
683         pItem = null;
684         return null;
685
686 }
687
688 bool
689 BookmarkListForm::DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth)
690 {
691         delete pItem;
692         pItem = null;
693         return true;
694 }
695
696 int
697 BookmarkListForm::GetItemCount(void)
698 {
699         int count = 0;
700
701         if (__pData != NULL )
702         {
703                 __pData->RemoveAll(true);
704                 delete __pData;
705                 __pData = null;
706         }
707         __pData = new(std::nothrow) Collection::ArrayList();
708         __pData->Construct();
709
710         if (__searchBookmark == false)
711         {
712                 BookmarkPresentationModel::GetInstance()->GetFolderBookmarkCount(__parentID, count);
713                 BookmarkPresentationModel::GetInstance()->GetFoldersBookmarks(__parentID, 0, count, *__pData);
714         }
715         else
716         {
717                 BookmarkPresentationModel::GetInstance()->GetSearchFolderBookmarkCount(count,__searchText);
718                 BookmarkPresentationModel::GetInstance()->GetSearchFoldersBookmarks(0, count, *__pData, __searchText);
719         }
720
721         AppLogDebug("Count = %d parentId = %ls", count, __parentID.GetPointer());
722
723         if (count <= 0)
724         {
725                 __noBookmarks = true;
726                 GetFooter()->SetItemEnabled(1,false);
727         }
728         else
729         {
730                 __noBookmarks = false;
731                 GetFooter()->SetItemEnabled(1,true);
732         }
733
734         AppLogDebug("Result: %s", GetErrorMessage(GetLastResult()));
735         GetFooter()->Invalidate(true);
736         if (__pData != null && __pData->GetCount() >= 1)
737         {
738                 //              __pSearchBar->SetMode(SEARCH_BAR_MODE_NORMAL);
739                 __pSearchBar->SetShowState(true);
740                 __pSearchBar->Invalidate(true);
741         }
742         else if (__searchBookmark == false)
743         {
744                 __pSearchBar->SetShowState(false);
745                 __pSearchBar->Invalidate(true);
746         }
747
748         if (__parentID.CompareTo(L"0") != 0)
749         {
750                 __pSearchBar->SetShowState(false);
751                 __pSearchBar->Invalidate(true);
752         }
753         if (__noBookmarks == true)
754         {
755                 __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetPosition().y,__pSearchBar->GetWidth() ,GetClientAreaBounds().height);
756                 Bitmap* pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_NO_CONTENT_BOOKMARK);
757
758                 if ( pBitmap != NULL)
759                 {
760                         __pListview->SetBitmapOfEmptyList(pBitmap);
761                         delete pBitmap;
762                 }
763         }
764         else
765         {
766                 if (__parentID.CompareTo(L"0") == 0)
767                 {
768                         __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetHeight(),GetClientAreaBounds().width ,GetClientAreaBounds().height - __pSearchBar->GetY() - __pSearchBar->GetHeight());
769                 }
770                 else
771                 {
772                         __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetY(),__pSearchBar->GetWidth() ,GetClientAreaBounds().height);
773
774                 }
775
776         }
777         __pListview->Invalidate(true);
778         return count;
779
780 }
781
782 void
783 BookmarkListForm::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus status)
784 {
785         AppLogDebug("BookmarkListForm::OnListViewContextItemStateChanged int index %d, int elementId %d, Tizen::Ui::Controls::ListContextItemStatus status %d",index,elementId,status);
786
787         String deleteText = CommonUtil::GetString(L"IDS_BR_SK_DELETE_ABB");
788         deleteText.Append(L"? ");
789         int timeOut = 25000;
790         result r = E_SUCCESS;
791
792         switch(elementId)
793         {
794         case IDA_CONTEXT_ITEM_FOLDER_EDIT:
795         {
796                 ArrayList* pArgList = null;
797                 String* pEdit = null;
798
799                 SceneManager* pSceneManager = SceneManager::GetInstance();
800                 BookmarkData* pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(index));
801                 if (pBookMark != null && pBookMark->GetBookmarkType() == BOOKMARK_TYPE_FOLDER)
802                 {
803                         pArgList = new(std::nothrow) ArrayList();
804                         if (pArgList != null)
805                         {
806                                 pEdit= new(std::nothrow) String(CommonUtil::GetString(L"IDS_BR_HEADER_EDIT_FOLDER"));
807                                 pArgList->Construct();
808                                 pArgList->Add(*new(std::nothrow) BookmarkData(*pBookMark));
809                                 pArgList->Add(*pEdit);
810                                 if (    pSceneManager != null)
811                                 {
812                                         result r;
813                                         r = pSceneManager->GoForward(ForwardSceneTransition(IDSCN_CREATE_BOOKMARK_FOLDER), pArgList);
814                                 }
815
816                                 if (pArgList != null)
817                                 {
818                                         delete pArgList;
819                                         pArgList = null;
820                                 }
821                                 if(IsFailed(r))
822                                 {
823                                         AppLogDebug("BookmarkListForm::OnListViewContextItemStateChanged GoForward failed %s",GetErrorMessage(r));
824                                         return;
825                                 }
826                         }
827                 }
828
829         }
830         break;
831
832         case IDA_CONTEXT_ITEM_FOLDER_DELETE:
833         case IDA_CONTEXT_ITEM_DELETE:
834         {
835                 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
836                 __pConfirmationPopup->Initialize();
837                 __pConfirmationPopup->RemoveActionListener(*this);
838                 __pConfirmationPopup->AddActionListener(*this);
839                 __pConfirmationPopup->setMessage(deleteText);
840                 __pConfirmationPopup->Show();
841                 __selectedindex = index;
842         }
843         break;
844
845         case IDA_CONTEXT_ITEM_EDIT:
846         {
847                 ArrayList* pArgList = null;
848                 SceneManager* pSceneManager = SceneManager::GetInstance();
849                 BookmarkData* pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(index));
850                 if (pBookMark!= null && pBookMark->GetBookmarkType() == BOOKMARK_TYPE_URL)
851                 {
852                         AppLogDebug("ID_CONTEXT_ITEM_SITE_1 BOOKMARK_TYPE_URL");
853                         pArgList = new(std::nothrow) ArrayList();
854                         if (pArgList != null)
855                         {
856                                 pArgList->Construct();
857                                 pArgList->Add(*new(std::nothrow) String(L"1"));
858                                 pArgList->Add(*new(std::nothrow) BookmarkData(*pBookMark));
859                                 if (    pSceneManager != null)
860                                 {
861                                         result r;
862                                         r = pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ADD_BOOKMARK), pArgList);
863                                         if (pArgList != null)
864                                         {
865                                                 delete pArgList;
866                                                 pArgList = null;
867                                         }
868                                         if(IsFailed(r))
869                                         {
870                                                 AppLogDebug("BookmarkListForm::OnListViewContextItemStateChanged GoForward failed %s",GetErrorMessage(r));
871                                                 return;
872                                         }
873                                 }
874                         }
875                 }
876         }
877         break;
878         case IDA_CONTEXT_ITEM_SHARE:
879         {
880                 AppLogDebug("OnListViewContextItemStateChanged Share");
881
882                 BookmarkData* pBookmark = dynamic_cast<BookmarkData*>(__pData->GetAt(index));
883                 if (pBookmark != null)
884                 {
885                         ShareInfo* pShareInfo = new(std::nothrow) ShareInfo();
886                         pShareInfo->SetPageTitle(pBookmark->GetBookmarkTitle());
887                         pShareInfo->SetPageUrl(pBookmark->GetUrl());
888                         pShareInfo->SetImageAttached(false);
889                         __pPopUp->RemoveAllShareInfo();
890                         __pPopUp->AddShareInfo(pShareInfo);
891                 }
892
893                 if (__pPopUp != null)
894                 {
895                         __pPopUp->SetShowState(true);
896                         __pPopUp->Show();
897                 }
898         }
899         break;
900         default:
901                 break;
902         }
903
904 }
905
906 void
907 BookmarkListForm::OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback)
908 {
909
910 }
911
912 void
913 BookmarkListForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
914 {
915         AppLogDebug("BookmarkListForm::OnListViewItemStateChanged");
916
917         result r = E_FAILURE;
918         ArrayList *pArgList = null;
919         SceneManager* pSceneManager = SceneManager::GetInstance();
920         BookmarkData* pBookmark = dynamic_cast< BookmarkData* >(__pData->GetAt(index));
921
922         if ( pBookmark == NULL )
923         {
924                 return;
925         }
926
927         switch (pBookmark->GetBookmarkType())
928         {
929         case BOOKMARK_TYPE_FOLDER:
930
931                 __parentID = pBookmark->GetBookmarkId();
932                 AppLogDebug("BOOKMARK_TYPE_FOLDER parent ID is %ls",__parentID.GetPointer());
933
934                 listView.UpdateList();
935                 if (listView.GetItemCount() == 0)
936                 {
937                         GetFooter()->SetItemEnabled(1,false);
938                 }
939                 else
940                 {
941                         GetFooter()->SetItemEnabled(1,true);
942                 }
943                 GetFooter()->SetItemEnabled(2,false);
944                 GetFooter()->Invalidate(true);
945                 __pSearchBar->HideKeypad();
946                 __pSearchBar->SetMode(SEARCH_BAR_MODE_NORMAL);
947                 __pSearchBar->SetShowState(false);
948                 __pSearchBar->Invalidate(true);
949                 __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetY(),__pListview->GetWidth() ,GetClientAreaBounds().height);
950                 break;
951
952         case BOOKMARK_TYPE_URL:
953
954                 pArgList = new(std::nothrow) ArrayList();
955                 if (pArgList != null)
956                 {
957                         r = pArgList->Construct();
958                         TryCatch(!IsFailed(r), L"BookmarkListForm::OnListViewItemStateChanged pArgList Construct failed %s", GetErrorMessage(r));
959
960                         AppLogDebug("bookmark url = %ls",pBookmark->GetUrl().GetPointer());
961                         r = pArgList->Add(*MultipleWindowPresentationModel::GetInstance()->GetActiveWindowInfo());
962                         pArgList->Add(*new(std::nothrow) String(pBookmark->GetUrl()));
963
964                         if (pSceneManager != null)
965                         {
966                                 AppLogDebug("pSceneManager exists");
967                                 String prevSceneId;
968                                 MultipleWindowPresentationModel::GetInstance()->GetCurrentSceneId(prevSceneId);
969                                 r = pSceneManager->GoBackward(BackwardSceneTransition(prevSceneId), pArgList);
970                                 TryCatch(!IsFailed(r), L"BookmarkListForm::OnListViewItemStateChanged pArgList Construct failed %s", GetErrorMessage(r));
971                         }
972                         delete pArgList;
973                 }
974                 break;
975
976         default:
977                 break;
978         }
979
980         return;
981         CATCH:
982         if(pArgList)
983         {
984                 pArgList->RemoveAll(true);
985                 delete pArgList;
986         }
987
988 }
989
990 void
991 BookmarkListForm::OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction)
992 {
993
994
995 }
996
997 void
998 BookmarkListForm::OnFastScrollIndexSelected(Tizen::Ui::Control& source, Tizen::Base::String& index)
999 {
1000
1001 }
1002
1003 void
1004 BookmarkListForm::OnSearchBarModeChanged(Tizen::Ui::Controls::SearchBar& source, Tizen::Ui::Controls::SearchBarMode mode)
1005 {
1006         result r = E_FAILURE;
1007
1008         if (mode == SEARCH_BAR_MODE_NORMAL)
1009         {
1010                 __pSearchListView->SetShowState(false);
1011                 __pSearchListView->UpdateList();
1012                 __pListview->SetShowState(true);
1013                 Invalidate(true);
1014                 __searchBookmark = false;
1015                 r = __pListview->UpdateList();
1016 //              __pSearchListView->SetBounds(0,0,GetClientAreaBounds().width,GetClientAreaBounds().height -__pSearchBar->GetHeight());
1017                 __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), __pSearchListView->GetHeight()));
1018                 TryCatch( !IsFailed(r),,"BookmarkListForm::OnSearchBarModeChanged Update list failed %s",GetErrorMessage(r));
1019                 CATCH:return;
1020         }
1021         else
1022         {
1023                 __pSearchListView->SetShowState(true);
1024                 __pSearchListView->SetEnabled(false);
1025                 __pListview->SetShowState(false);
1026
1027                 if(__pSearchBar)
1028                 {
1029                         __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), __pSearchListView->GetHeight()));
1030                         __pSearchBar->SetText(L"");
1031                 }
1032                 AppLog("OnSearchBarModeChanged SetContentAreaSize heihgt %d",__pSearchListView->GetHeight());
1033                  __pListview->UpdateList();
1034                 __pSearchListView->UpdateList();
1035         }
1036 }
1037
1038 void
1039 BookmarkListForm::OnKeypadWillOpen(Tizen::Ui::Control& source)
1040 {
1041         GetFooter()->SetShowState(false);
1042         __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), __pSearchListView->GetHeight() + GetFooter()->GetHeight());
1043         __pSearchListView->SetEnabled(false);
1044         __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), __pSearchListView->GetHeight()));
1045         Invalidate(true);
1046         __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), __pSearchListView->GetHeight() - GetFooter()->GetHeight());
1047 }
1048
1049 void
1050 BookmarkListForm::OnKeypadOpened(Tizen::Ui::Control& source)
1051 {
1052         GetFooter()->SetShowState(false);
1053         __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight());
1054         __pSearchListView->UpdateList();
1055         Invalidate(true);
1056 }
1057
1058 void
1059 BookmarkListForm::OnKeypadClosed(Tizen::Ui::Control& source)
1060 {
1061
1062         GetFooter()->SetShowState(true);
1063         GetFooter()->Invalidate(true);
1064         __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight());
1065         __pListview->SetBounds(__pSearchListView->GetX(), __pSearchBar->GetY() + __pSearchBar->GetHeight(), __pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight());
1066         __pSearchListView->Invalidate(false);
1067         __pSearchListView->SetEnabled(true);
1068         __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight()));
1069         Invalidate(true);
1070 }
1071
1072 void
1073 BookmarkListForm::OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui::KeypadAction keypadAction)
1074 {
1075         AppLog("BookmarkListForm::OnKeypadActionPerformed %d",keypadAction);
1076
1077         if (__pSearchBar != null)
1078         {
1079                 __pSearchBar->HideKeypad();
1080         }
1081
1082         if ( __pSearchBar != null && keypadAction == KEYPAD_ACTION_SEARCH)
1083         {
1084                 if (__pSearchBar->GetText().GetLength() == 0)
1085                 {
1086                         return;
1087                 }
1088
1089                 __searchText = __pSearchBar->GetText();
1090                 __searchBookmark = true;
1091                 __pListview->SetShowState(false);
1092                 __pSearchListView->SetEnabled(true);
1093                 __pSearchListView->SetShowState(true);
1094                 __pSearchListView->SetBounds(0,0,GetClientAreaBounds().width,GetClientAreaBounds().height -__pSearchBar->GetHeight());
1095                 __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), __pSearchListView->GetHeight()));
1096                 __pSearchListView->UpdateList();
1097
1098         }
1099         Invalidate(true);
1100 }
1101
1102 void
1103 BookmarkListForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
1104 {
1105         AppLogDebug("BookmarkListForm::OnSceneActivatedN called");
1106         ArrayListT<String> * pList = dynamic_cast<ArrayListT<String>* >(SceneManager::GetInstance()->GetSceneHistoryN());
1107         if(pList != null)
1108         {
1109                 pList->GetAt(pList->GetCount()-1,__previousSceneId);
1110         }
1111
1112         __searchBookmark = false;
1113         GetFooter()->SetShowState(true);
1114         GetFooter()->Invalidate(true);
1115         GetHeader()->SetItemSelected(0);
1116         GetHeader()->Invalidate(true);
1117
1118         /*      if (previousSceneId != IDSCN_HISTORY_LIST && previousSceneId != IDSCN_CREATE_BOOKMARK_FOLDER && previousSceneId != IDSCN_EDIT_BOOKMARK_LIST)
1119         {
1120                 __previousSceneId = previousSceneId;
1121         }*/
1122
1123         if (__pListview != null)
1124         {
1125                 __pListview->UpdateList();
1126         }
1127
1128         return;
1129 }
1130
1131 void
1132 BookmarkListForm::OnOrientationChanged (const Tizen::Ui::Control &source, Tizen::Ui::OrientationStatus orientationStatus)
1133 {
1134         AppLog("BookmarkListForm::OnOrientationChanged start");
1135
1136         if (__pListview)
1137         {
1138                 if(__pSearchBar->GetShowState())
1139                 {
1140                         __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetHeight(),GetClientAreaBounds().width ,GetClientAreaBounds().height - __pSearchBar->GetY() - __pSearchBar->GetHeight());
1141                 }
1142                 else
1143                 {
1144                         __pListview->SetBounds(__pListview->GetX(),0,GetClientAreaBounds().width ,GetClientAreaBounds().height);
1145                 }
1146                 __pListview->UpdateList();
1147         }
1148
1149         if (__pSearchListView && __pListview)
1150         {
1151                 AppLog("__pListview->GetBounds() %d, %d, %d, %d",__pListview->GetBounds().x,__pListview->GetBounds().y,__pListview->GetBounds().width,__pListview->GetBounds().height);
1152                 __pSearchListView->SetBounds(0,0,GetClientAreaBounds().width,GetClientAreaBounds().height -__pSearchBar->GetHeight());
1153
1154                 __pSearchListView->UpdateList();
1155         }
1156
1157         if (__pSearchListView && __pData != null )
1158         {
1159                 if (__parentID != DEFAULT_VALUE_PARENTID)
1160                 {
1161                         AppLog("BookmarkListForm::OnOrientationChanged parent id true");
1162                         __pSearchBar->SetShowState(false);
1163                         __pSearchBar->Invalidate(true);
1164                 }
1165
1166                 __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), GetClientAreaBounds().height));
1167         }
1168
1169
1170         Invalidate(true);
1171 }
1172
1173 void
1174 BookmarkListForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
1175 {
1176         __pSearchBar->SetMode(SEARCH_BAR_MODE_NORMAL);
1177         return;
1178 }
1179