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.1 (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->SetBackgroundColor(GetBackgroundColor());
244         __pSearchListView->SetItemProvider(*this);
245         __pSearchListView->SetTextOfEmptyList(CommonUtil::GetString(L"IDS_BR_BODY_NO_RESULTS_FOUND"));
246         __pSearchListView->SetTextColorOfEmptyList(Color::GetColor(COLOR_ID_BLACK));
247         __pSearchListView->SetShowState(false);
248         __pSearchListView->AddListViewItemEventListener(*this);
249
250         __pSearchBar->AddSearchBarEventListener(*this);
251         __pSearchBar->AddKeypadEventListener(*this);
252         __pSearchBar->SetContent(__pSearchListView);
253
254         BookmarkPresentationModel::GetInstance()->GetFolderBookmarkCount(__parentID, bookmarkCount);
255         if(bookmarkCount <= 0)
256         {
257                 __pSearchBar->SetShowState(false);
258                 //__pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetY(),__pSearchBar->GetWidth(),GetClientAreaBounds().height - __pSearchBar->GetPosition().y);
259                 __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetY(),__pListview->GetWidth(),GetClientAreaBounds().height);
260         }
261         else
262         {
263                 __pSearchBar->SetShowState(true);
264         }
265
266
267         if (pHeader != null)
268         {
269                 pHeader->SetStyle(HEADER_STYLE_TAB);
270                 bookmark.Construct(IDA_TABBAR_ITEM_1);
271                 String strbookmark;
272                 pAppResource->GetString(L"IDS_BR_TAB_BOOKMARKS", strbookmark);
273                 bookmark.SetText(strbookmark);
274                 pIconBitmap = pAppResource->GetBitmapN(IDB_TAB_ICON_BOOKMARK);
275                 bookmark.SetIcon(HEADER_ITEM_STATUS_NORMAL, pIconBitmap);
276                 bookmark.SetIcon(HEADER_ITEM_STATUS_PRESSED, pIconBitmap);
277                 pHeader->AddItem(bookmark);
278
279                 if (pIconBitmap != NULL)
280                 {
281                         delete pIconBitmap;
282                 }
283
284                 history.Construct(IDA_TABBAR_ITEM_2);
285                 String strhistory;
286                 pAppResource->GetString(L"IDS_BR_TAB_HISTORY", strhistory);
287                 history.SetText(strhistory);
288                 pIconBitmap = pAppResource->GetBitmapN(IDB_TAB_ICON_HISTORY);
289                 history.SetIcon(HEADER_ITEM_STATUS_NORMAL, pIconBitmap);
290                 history.SetIcon(HEADER_ITEM_STATUS_PRESSED, pIconBitmap);
291                 pHeader->AddItem(history);
292                 pHeader->SetItemSelected(0);
293                 pHeader->SetTabEditModeEnabled(false);
294
295                 if (pIconBitmap != NULL)
296                 {
297                         delete pIconBitmap;
298                 }
299         }
300
301
302         CATCH:return r;
303 }
304
305 void
306 BookmarkListForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
307 {
308         AppLogDebug("BookmarkListForm::OnActionPerformed actionId = %d",actionId);
309         String bookmarkId;
310         int id = 0;
311         BookmarkData* pBookMark = null;
312
313         switch (actionId)
314         {
315         case IDA_FOOTER_ITEM1:
316         {
317                 __pSearchBar->SetMode(SEARCH_BAR_MODE_NORMAL);
318                 GetHeader()->SetItemSelected(0);
319                 GetHeader()->Invalidate(true);
320                 SceneManager* pSceneManager = SceneManager::GetInstance();
321                 pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(__selectedindex));
322
323                 if ( pBookMark == NULL )
324                 {
325                         return;
326                 }
327
328                 ArrayList* pArgList = null;
329                 pArgList = new(std::nothrow) ArrayList();
330                 if (pArgList != null)
331                 {
332                         pArgList->Construct();
333                         pArgList->Add(*new(std::nothrow) String(pBookMark->GetParentId()));
334                 }
335                 //pArgList->Add(*new(std::nothrow) String(pBookmark->);
336                 if (pSceneManager != null)
337                 {
338                         if(pSceneManager->GoForward(ForwardSceneTransition(IDSCN_EDIT_BOOKMARK_LIST),pArgList) != E_SUCCESS)
339                         {
340                                 AppLogDebug("BookmarkListForm::OnActionPerformed GoForward failed");
341                                 pArgList->RemoveAll(true);
342                                 delete pArgList;
343                                 pArgList = null;
344                                 return;
345                         }
346                 }
347
348                 if ( pArgList != NULL)
349                 {
350                         pArgList->RemoveAll(true);
351                         delete pArgList;
352                 }
353         }
354
355         break;
356         case IDA_TABBAR_ITEM_2:
357         {
358                 GetHeader()->SetItemSelected(0);
359                 GetHeader()->Invalidate(true);
360
361                 SceneManager* pSceneManager = SceneManager::GetInstance();
362
363                 if (pSceneManager != null)
364                 {
365                         if(__previousSceneId.CompareTo(IDSCN_HISTORY_LIST) != 0)
366                         {
367                                 if(pSceneManager->GoForward(ForwardSceneTransition(IDSCN_HISTORY_LIST, SCENE_TRANSITION_ANIMATION_TYPE_LEFT)) != E_SUCCESS)
368                                 {
369                                         AppLogDebug("BookmarkListForm::OnActionPerformed GoForward failed");
370                                         return;
371                                 }
372                         }
373                         else
374                         {
375
376                                 if(pSceneManager->GoBackward(BackwardSceneTransition())!= E_SUCCESS)
377                                 {
378                                         AppLogDebug("BookmarkListForm::OnActionPerformed GoBackward failed");
379                                         return;
380                                 }
381
382                         }
383                 }
384         }
385         break;
386         case IDA_FOOTER_ITEM2:
387         {
388                 SceneManager* pSceneManager = SceneManager::GetInstance();
389
390                 if (pSceneManager)
391                 {
392                         if(pSceneManager->GoForward(ForwardSceneTransition(IDSCN_CREATE_BOOKMARK_FOLDER)) != E_SUCCESS)
393                         {
394                                 AppLogDebug("BookmarkListForm::OnActionPerformed GoForward failed");
395                                 return;
396                         }
397                 }
398         }
399         break;
400         case IDA_FOOTER_ITEM_ADDBOOKMARK:
401         {
402                 SceneManager* pSceneManager = SceneManager::GetInstance();
403
404                 // send array list 0-for add, 1 for edit with parent ID
405                 ArrayList* pArgList = null;
406                 pArgList = new(std::nothrow) ArrayList();
407                 if (pArgList != null)
408                 {
409                         pArgList->Construct();
410                         pArgList->Add(*new(std::nothrow) String(L"0"));
411                         pArgList->Add(*new(std::nothrow) String(__parentID));
412                 }
413
414                 if (pSceneManager)
415                 {
416                         if(pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ADD_BOOKMARK),pArgList) != E_SUCCESS)
417                         {
418                                 AppLogDebug("BookmarkListForm::OnActionPerformed GoForward failed");
419                                 pArgList->RemoveAll(true);
420                                 delete pArgList;
421                                 return;
422                         }
423                 }
424
425                 if (pArgList != null)
426                 {
427                         pArgList->RemoveAll(true);
428                         delete pArgList;
429                 }
430
431         }
432         break;
433         case IDA_BUTTON_NO:
434                 __pConfirmationPopup->SetShowState(false);
435                 __pConfirmationPopup->Show();
436                 break;
437         case IDA_BUTTON_YES:
438                 pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(__selectedindex));
439                 if ( pBookMark== null)
440                         return;
441                 bookmarkId=pBookMark->GetBookmarkId();
442                 Integer::Parse(bookmarkId,id);
443                 if (pBookMark->GetBookmarkType() == BOOKMARK_TYPE_FOLDER)
444                         BookmarkPresentationModel::GetInstance()->DeleteFolder(id);
445                 else
446                         BookmarkPresentationModel::GetInstance()->DeleteBookmark(id);
447                 if (__pListview == null)
448                 {
449                         return;
450                 }
451                 AppLogDebug("__pListview GetBounds %d,%d,%d,%d",__pListview->GetBounds().x,__pListview->GetBounds().y,__pListview->GetBounds().width,__pListview->GetBounds().height);
452                 __pSearchListView->UpdateList();
453                 __pListview->UpdateList();
454
455                 if (__pListview->GetItemCount() == 0)
456                 {
457                         GetFooter()->SetItemEnabled(1,false);
458                         __pSearchBar->SetShowState(false);
459                         __pSearchBar->Invalidate(true);
460                 }
461
462                 if (__noBookmarks == true)
463                 {
464                         Bitmap* emptyListBmp = AppResource::GetInstance()->GetBitmapN(IDB_NO_CONTENT_BOOKMARK);
465                         GetFooter()->SetItemEnabled(1,false);
466                         __pSearchBar->SetShowState(false);
467                         __pSearchBar->Invalidate(true);
468                         //                      __pListview->SetBounds(__pSearchBar->GetPosition().x,__pSearchBar->GetPosition().y,__pSearchBar->GetWidth() ,GetClientAreaBounds().height);
469                         __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetPosition().y,__pSearchBar->GetWidth() ,GetClientAreaBounds().height);
470                         __pListview->SetBitmapOfEmptyList(emptyListBmp);
471                         if (emptyListBmp)
472                         {
473                                 delete emptyListBmp;
474                                 emptyListBmp = null;
475                         }
476                         __pListview->UpdateList();
477
478                 }
479                 else
480                 {
481                         GetFooter()->SetItemEnabled(1,true);
482
483                         if (__parentID.CompareTo(L"0") == 0)
484                         {
485                                 __pSearchBar->SetShowState(true);
486                                 __pSearchBar->Invalidate(true);
487                         }
488                 }
489
490                 GetFooter()->Invalidate(true);
491                 __pConfirmationPopup->SetShowState(false);
492                 __pConfirmationPopup->Show();
493                 __selectedindex = 0;
494
495                 break;
496         default:
497                 break;
498         }
499 }
500
501 void
502 BookmarkListForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
503 {
504         AppLogDebug("BrowserApplicationForm::OnFormBackRequested");
505
506         UiApp* pApp = UiApp::GetInstance();
507         if      (pApp == null)
508         {
509                 return;
510         }
511
512         if (__parentID != DEFAULT_VALUE_PARENTID)
513         {
514                 __parentID = DEFAULT_VALUE_PARENTID;
515                 __pSearchBar->SetShowState(true);
516                 __pListview->SetBounds(__pListview->GetX() ,__pSearchBar->GetPosition().y + __pSearchBar->GetHeight(),__pListview->GetWidth(),GetClientAreaBounds().height - (__pSearchBar->GetY() + __pSearchBar->GetHeight()));
517                 __pListview->UpdateList();
518                 __pFooter = GetFooter();
519                 GetFooter()->SetItemEnabled(2,true);
520                 GetFooter()->Invalidate(true);
521         }
522         else
523         {
524                 SceneManager* pSceneManager = SceneManager::GetInstance();
525                 if (pSceneManager != null)
526                 {
527                         if(__previousSceneId.CompareTo(IDSCN_HISTORY_LIST) != 0)
528                         {
529                                 pSceneManager->GoBackward(BackwardSceneTransition());
530                         }
531                         else
532                         {
533                                 pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_LEFT));
534                         }
535                 }
536         }
537
538         if (__noBookmarks == true)
539         {
540                 GetFooter()->SetItemEnabled(1,false);
541         }
542         else
543         {
544                 GetFooter()->SetItemEnabled(1,true);
545         }
546 }
547
548 Tizen::Ui::Controls::ListItemBase*
549 BookmarkListForm::CreateItem(int index, int itemWidth)
550 {
551
552         AppLog("BookmarkListForm::CreateItem index %d , itemWidth %d",index, itemWidth);
553         AppLog("listviewwidth %d",__pListview->GetWidth());
554         result r = E_FAILURE;
555         ListAnnexStyle style = LIST_ANNEX_STYLE_NORMAL;
556         if(__pData == null)
557         {
558                 return null;
559         }
560         CustomItem* pItem = new(std::nothrow) CustomItem();
561
562         BookmarkData* pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(index));
563         Bitmap* pBitmap = null;
564         Dimension dim;
565
566         Image* pImage = null;
567         pImage = new Image();
568         pImage->Construct();
569
570         const int x_Margin_Icon = 16;                 // local as there used only in this function
571         const int y_Margin_Icon = 28;
572         const int height_Icon = 72;
573         const int width_Icon = 72 ;
574         const int x_Margin_Title = 104 ;
575         const int y_Margin_Title = 10;
576         const int width_Title = GetClientAreaBounds().width - 108 - 52 - 30;
577         const int x_Margin_Url = 104 ;
578         const int y_Margin_Url = 70 ;
579         const int width_Url = GetClientAreaBounds().width - 108 - 52 ;
580         const int height_Url = 48;
581         const int itemHeight = 128;
582         const int textSize = 32;
583         String bitmapId;
584
585         if( pBookMark == NULL )
586         {
587                 delete pItem;
588                 pItem = null;
589                 return NULL;
590         }
591         if ( pBookMark->GetBookmarkType() == BOOKMARK_TYPE_FOLDER )
592         {
593                 r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth,112), LIST_ANNEX_STYLE_DETAILED);
594                 TryCatch(!IsFailed(r),,"BookmarkListForm::CreateItem Construct failed %s",GetErrorMessage(r));
595
596                 pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_ICON_FOLDER_OPEN);
597                 if (pBitmap != null)
598                 {
599                         pItem->AddElement(Rectangle(x_Margin_Icon, 20, width_Icon, height_Icon), IDA_FORMAT_ICON, *pBitmap, null);
600                         delete pBitmap;
601                 }
602
603                 pItem->AddElement(Rectangle(x_Margin_Title, 26, width_Title, 60), IDA_FORMAT_FOLDER, pBookMark->GetBookmarkTitle(), true);
604
605                 if ( __pItemContextFolder != NULL)
606                 {
607                         pItem->SetContextItem(__pItemContextFolder);
608                 }
609         }
610         else
611         {
612                 r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth, itemHeight), style);
613                 TryCatch( !IsFailed(r),,"BookmarkListForm::CreateItem Construct failed %s",GetErrorMessage(r));
614
615                 AppLogDebug("BookmarkListForm::faviconid %ls",pBookMark->GetFaviconId().GetPointer());
616                 bitmapId = pBookMark->GetFaviconId();
617
618                 dim = Dimension(pBookMark->GetFavIconWidth(), pBookMark->GetFavIconHeight());
619
620                 AppLog("BookmarkListForm::CreateItem check 0");
621
622                 // get fav icon bitmap
623                 ByteBuffer* pFavIconBuffer = null;
624                 pFavIconBuffer = pBookMark->GetFavIconBuffer();
625
626                 AppLog("BookmarkListForm::CreateItem check 0");
627
628                 if (pFavIconBuffer != null)
629                 {
630                         AppLog("BookmarkListForm::CreateItem pFavIconBuffer is not null");
631                 }
632                 else
633                 {
634                         AppLog("BookmarkListForm::CreateItem pFavIconBuffer is null");
635                 }
636
637                 pBitmap = pImage->DecodeN(*pFavIconBuffer, IMG_FORMAT_PNG, BITMAP_PIXEL_FORMAT_ARGB8888);
638
639                 AppLog("BookmarkListForm::CreateItem check 1");
640
641                 if (pBitmap != null)
642                 {
643                         AppLog("rahul bitmap is not null");
644                         int width = pBitmap->GetWidth();
645                         int height = pBitmap->GetHeight();
646                         AppLog("rahul bitmap width is %d", width);
647                         AppLog("rahul bitmap height is %d", height);
648                         AppLog("rahul favicon width is %d", pBookMark->GetFavIconWidth());
649                         AppLog("rahul favicon height is %d", pBookMark->GetFavIconHeight());
650                 }
651                 else
652                 {
653                         AppLog("rahul bitmap is null");
654                 }
655
656                 if (pBitmap == null)
657                 {
658                         AppLogDebug("BookmarkListForm::CreateItem bitmap is null");
659                         pBitmap = FaviconManager::GetInstance()->GetDefaultFaviconN();
660                 }
661                 pItem->AddElement(Rectangle(x_Margin_Icon, y_Margin_Icon, width_Icon, height_Icon), IDA_FORMAT_ICON, *pBitmap, null);
662                 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);
663                 if(__pSearchBar->GetMode() == SEARCH_BAR_MODE_INPUT)
664                         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);
665                 else
666                         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);
667
668                 if (pBitmap != null)
669                 {
670                         delete pBitmap;
671                 }
672                 if ( __pItemContextSite != NULL)
673                 {
674                         pItem->SetContextItem(__pItemContextSite);
675                 }
676         }
677
678         delete pImage;
679         return pItem;
680
681         CATCH:
682
683         delete pImage;
684         delete pItem;
685         pItem = null;
686         return null;
687
688 }
689
690 bool
691 BookmarkListForm::DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth)
692 {
693         delete pItem;
694         pItem = null;
695         return true;
696 }
697
698 int
699 BookmarkListForm::GetItemCount(void)
700 {
701         int count = 0;
702
703         if (__pData != NULL )
704         {
705                 __pData->RemoveAll(true);
706                 delete __pData;
707                 __pData = null;
708         }
709         __pData = new(std::nothrow) Collection::ArrayList();
710         __pData->Construct();
711
712         if (__searchBookmark == false)
713         {
714                 BookmarkPresentationModel::GetInstance()->GetFolderBookmarkCount(__parentID, count);
715                 BookmarkPresentationModel::GetInstance()->GetFoldersBookmarks(__parentID, 0, count, *__pData);
716         }
717         else
718         {
719                 BookmarkPresentationModel::GetInstance()->GetSearchFolderBookmarkCount(count,__searchText);
720                 BookmarkPresentationModel::GetInstance()->GetSearchFoldersBookmarks(0, count, *__pData, __searchText);
721         }
722
723         AppLogDebug("Count = %d parentId = %ls", count, __parentID.GetPointer());
724
725         if (count <= 0)
726         {
727                 __noBookmarks = true;
728                 GetFooter()->SetItemEnabled(1,false);
729         }
730         else
731         {
732                 __noBookmarks = false;
733                 GetFooter()->SetItemEnabled(1,true);
734         }
735
736         AppLogDebug("Result: %s", GetErrorMessage(GetLastResult()));
737         GetFooter()->Invalidate(true);
738         if (__pData != null && __pData->GetCount() >= 1)
739         {
740                 //              __pSearchBar->SetMode(SEARCH_BAR_MODE_NORMAL);
741                 __pSearchBar->SetShowState(true);
742                 __pSearchBar->Invalidate(true);
743         }
744         else if (__searchBookmark == false)
745         {
746                 __pSearchBar->SetShowState(false);
747                 __pSearchBar->Invalidate(true);
748         }
749
750         if (__parentID.CompareTo(L"0") != 0)
751         {
752                 __pSearchBar->SetShowState(false);
753                 __pSearchBar->Invalidate(true);
754         }
755         if (__noBookmarks == true)
756         {
757                 __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetPosition().y,__pSearchBar->GetWidth() ,GetClientAreaBounds().height);
758                 Bitmap* pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_NO_CONTENT_BOOKMARK);
759
760                 if ( pBitmap != NULL)
761                 {
762                         __pListview->SetBitmapOfEmptyList(pBitmap);
763                         delete pBitmap;
764                 }
765         }
766         else
767         {
768                 if (__parentID.CompareTo(L"0") == 0)
769                 {
770                         __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetHeight(),GetClientAreaBounds().width ,GetClientAreaBounds().height - __pSearchBar->GetY() - __pSearchBar->GetHeight());
771                 }
772                 else
773                 {
774                         __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetY(),__pSearchBar->GetWidth() ,GetClientAreaBounds().height);
775
776                 }
777
778         }
779         __pListview->Invalidate(true);
780         return count;
781
782 }
783
784 void
785 BookmarkListForm::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus status)
786 {
787         AppLogDebug("BookmarkListForm::OnListViewContextItemStateChanged int index %d, int elementId %d, Tizen::Ui::Controls::ListContextItemStatus status %d",index,elementId,status);
788
789         String deleteText = CommonUtil::GetString(L"IDS_BR_SK_DELETE_ABB");
790         deleteText.Append(L"? ");
791         int timeOut = 25000;
792         result r = E_SUCCESS;
793
794         switch(elementId)
795         {
796         case IDA_CONTEXT_ITEM_FOLDER_EDIT:
797         {
798                 ArrayList* pArgList = null;
799                 String* pEdit = null;
800
801                 SceneManager* pSceneManager = SceneManager::GetInstance();
802                 BookmarkData* pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(index));
803                 if (pBookMark != null && pBookMark->GetBookmarkType() == BOOKMARK_TYPE_FOLDER)
804                 {
805                         pArgList = new(std::nothrow) ArrayList();
806                         if (pArgList != null)
807                         {
808                                 pEdit= new(std::nothrow) String(CommonUtil::GetString(L"IDS_BR_HEADER_EDIT_FOLDER"));
809                                 pArgList->Construct();
810                                 pArgList->Add(*new(std::nothrow) BookmarkData(*pBookMark));
811                                 pArgList->Add(*pEdit);
812                                 if (    pSceneManager != null)
813                                 {
814                                         result r;
815                                         r = pSceneManager->GoForward(ForwardSceneTransition(IDSCN_CREATE_BOOKMARK_FOLDER), pArgList);
816                                 }
817
818                                 if (pArgList != null)
819                                 {
820                                         delete pArgList;
821                                         pArgList = null;
822                                 }
823                                 if(IsFailed(r))
824                                 {
825                                         AppLogDebug("BookmarkListForm::OnListViewContextItemStateChanged GoForward failed %s",GetErrorMessage(r));
826                                         return;
827                                 }
828                         }
829                 }
830
831         }
832         break;
833
834         case IDA_CONTEXT_ITEM_FOLDER_DELETE:
835         case IDA_CONTEXT_ITEM_DELETE:
836         {
837                 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
838                 __pConfirmationPopup->Initialize();
839                 __pConfirmationPopup->RemoveActionListener(*this);
840                 __pConfirmationPopup->AddActionListener(*this);
841                 __pConfirmationPopup->setMessage(deleteText);
842                 __pConfirmationPopup->Show();
843                 __selectedindex = index;
844         }
845         break;
846
847         case IDA_CONTEXT_ITEM_EDIT:
848         {
849                 ArrayList* pArgList = null;
850                 SceneManager* pSceneManager = SceneManager::GetInstance();
851                 BookmarkData* pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(index));
852                 if (pBookMark!= null && pBookMark->GetBookmarkType() == BOOKMARK_TYPE_URL)
853                 {
854                         AppLogDebug("ID_CONTEXT_ITEM_SITE_1 BOOKMARK_TYPE_URL");
855                         pArgList = new(std::nothrow) ArrayList();
856                         if (pArgList != null)
857                         {
858                                 pArgList->Construct();
859                                 pArgList->Add(*new(std::nothrow) String(L"1"));
860                                 pArgList->Add(*new(std::nothrow) BookmarkData(*pBookMark));
861                                 if (    pSceneManager != null)
862                                 {
863                                         result r;
864                                         r = pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ADD_BOOKMARK), pArgList);
865                                         if (pArgList != null)
866                                         {
867                                                 delete pArgList;
868                                                 pArgList = null;
869                                         }
870                                         if(IsFailed(r))
871                                         {
872                                                 AppLogDebug("BookmarkListForm::OnListViewContextItemStateChanged GoForward failed %s",GetErrorMessage(r));
873                                                 return;
874                                         }
875                                 }
876                         }
877                 }
878         }
879         break;
880         case IDA_CONTEXT_ITEM_SHARE:
881         {
882                 AppLogDebug("OnListViewContextItemStateChanged Share");
883
884                 BookmarkData* pBookmark = dynamic_cast<BookmarkData*>(__pData->GetAt(index));
885                 if (pBookmark != null)
886                 {
887                         ShareInfo* pShareInfo = new(std::nothrow) ShareInfo();
888                         pShareInfo->SetPageTitle(pBookmark->GetBookmarkTitle());
889                         pShareInfo->SetPageUrl(pBookmark->GetUrl());
890                         pShareInfo->SetImageAttached(false);
891                         __pPopUp->RemoveAllShareInfo();
892                         __pPopUp->AddShareInfo(pShareInfo);
893                 }
894
895                 if (__pPopUp != null)
896                 {
897                         __pPopUp->SetShowState(true);
898                         __pPopUp->Show();
899                 }
900         }
901         break;
902         default:
903                 break;
904         }
905
906 }
907
908 void
909 BookmarkListForm::OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback)
910 {
911
912 }
913
914 void
915 BookmarkListForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
916 {
917         AppLogDebug("BookmarkListForm::OnListViewItemStateChanged");
918
919         result r = E_FAILURE;
920         ArrayList *pArgList = null;
921         SceneManager* pSceneManager = SceneManager::GetInstance();
922         BookmarkData* pBookmark = dynamic_cast< BookmarkData* >(__pData->GetAt(index));
923
924         if ( pBookmark == NULL )
925         {
926                 return;
927         }
928
929         switch (pBookmark->GetBookmarkType())
930         {
931         case BOOKMARK_TYPE_FOLDER:
932
933                 __parentID = pBookmark->GetBookmarkId();
934                 AppLogDebug("BOOKMARK_TYPE_FOLDER parent ID is %ls",__parentID.GetPointer());
935
936                 listView.UpdateList();
937                 if (listView.GetItemCount() == 0)
938                 {
939                         GetFooter()->SetItemEnabled(1,false);
940                 }
941                 else
942                 {
943                         GetFooter()->SetItemEnabled(1,true);
944                 }
945                 GetFooter()->SetItemEnabled(2,false);
946                 GetFooter()->Invalidate(true);
947                 __pSearchBar->HideKeypad();
948                 __pSearchBar->SetMode(SEARCH_BAR_MODE_NORMAL);
949                 __pSearchBar->SetShowState(false);
950                 __pSearchBar->Invalidate(true);
951                 __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetY(),__pListview->GetWidth() ,GetClientAreaBounds().height);
952                 break;
953
954         case BOOKMARK_TYPE_URL:
955
956                 pArgList = new(std::nothrow) ArrayList();
957                 if (pArgList != null)
958                 {
959                         r = pArgList->Construct();
960                         TryCatch(!IsFailed(r), L"BookmarkListForm::OnListViewItemStateChanged pArgList Construct failed %s", GetErrorMessage(r));
961
962                         AppLogDebug("bookmark url = %ls",pBookmark->GetUrl().GetPointer());
963                         r = pArgList->Add(*MultipleWindowPresentationModel::GetInstance()->GetActiveWindowInfo());
964                         pArgList->Add(*new(std::nothrow) String(pBookmark->GetUrl()));
965
966                         if (pSceneManager != null)
967                         {
968                                 AppLogDebug("pSceneManager exists");
969                                 String prevSceneId;
970                                 MultipleWindowPresentationModel::GetInstance()->GetCurrentSceneId(prevSceneId);
971                                 r = pSceneManager->GoBackward(BackwardSceneTransition(prevSceneId), pArgList);
972                                 TryCatch(!IsFailed(r), L"BookmarkListForm::OnListViewItemStateChanged pArgList Construct failed %s", GetErrorMessage(r));
973                         }
974                         delete pArgList;
975                 }
976                 break;
977
978         default:
979                 break;
980         }
981
982         return;
983         CATCH:
984         if(pArgList)
985         {
986                 pArgList->RemoveAll(true);
987                 delete pArgList;
988         }
989
990 }
991
992 void
993 BookmarkListForm::OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction)
994 {
995
996
997 }
998
999 void
1000 BookmarkListForm::OnFastScrollIndexSelected(Tizen::Ui::Control& source, Tizen::Base::String& index)
1001 {
1002
1003 }
1004
1005 void
1006 BookmarkListForm::OnSearchBarModeChanged(Tizen::Ui::Controls::SearchBar& source, Tizen::Ui::Controls::SearchBarMode mode)
1007 {
1008         result r = E_FAILURE;
1009
1010         if (mode == SEARCH_BAR_MODE_NORMAL)
1011         {
1012                 __pSearchListView->SetShowState(false);
1013                 __pSearchListView->UpdateList();
1014                 __pListview->SetShowState(true);
1015                 Invalidate(true);
1016                 __searchBookmark = false;
1017                 r = __pListview->UpdateList();
1018 //              __pSearchListView->SetBounds(0,0,GetClientAreaBounds().width,GetClientAreaBounds().height -__pSearchBar->GetHeight());
1019                 __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), __pSearchListView->GetHeight()));
1020                 TryCatch( !IsFailed(r),,"BookmarkListForm::OnSearchBarModeChanged Update list failed %s",GetErrorMessage(r));
1021                 CATCH:return;
1022         }
1023         else
1024         {
1025                 __pSearchListView->SetShowState(true);
1026                 __pSearchListView->SetEnabled(false);
1027                 __pListview->SetShowState(false);
1028
1029                 if(__pSearchBar)
1030                 {
1031                         __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), __pSearchListView->GetHeight()));
1032                         __pSearchBar->SetText(L"");
1033                 }
1034                 AppLog("OnSearchBarModeChanged SetContentAreaSize heihgt %d",__pSearchListView->GetHeight());
1035                  __pListview->UpdateList();
1036                 __pSearchListView->UpdateList();
1037         }
1038 }
1039
1040 void
1041 BookmarkListForm::OnKeypadWillOpen(Tizen::Ui::Control& source)
1042 {
1043 //      GetFooter()->SetShowState(false);
1044         __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), __pSearchListView->GetHeight() + GetFooter()->GetHeight());
1045         __pSearchListView->SetEnabled(false);
1046         __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), __pSearchListView->GetHeight()));
1047         Invalidate(true);
1048         __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), __pSearchListView->GetHeight() - GetFooter()->GetHeight());
1049 }
1050
1051 void
1052 BookmarkListForm::OnKeypadOpened(Tizen::Ui::Control& source)
1053 {
1054         GetFooter()->SetShowState(false);
1055 //      __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight());
1056         __pSearchListView->UpdateList();
1057         Invalidate(true);
1058 }
1059
1060 void
1061 BookmarkListForm::OnKeypadClosed(Tizen::Ui::Control& source)
1062 {
1063         AppLog("jahsjkdad %d",Clipboard::GetInstance()->IsPopupVisible());
1064         if(Clipboard::GetInstance()->IsPopupVisible() == true)
1065         {
1066                 return;
1067         }
1068         GetFooter()->SetShowState(true);
1069         GetFooter()->Invalidate(true);
1070         __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight());
1071         __pListview->SetBounds(__pSearchListView->GetX(), __pSearchBar->GetY() + __pSearchBar->GetHeight(), __pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight());
1072         __pSearchListView->Invalidate(false);
1073         //__pSearchListView->SetEnabled(true);
1074         __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight()));
1075         Invalidate(true);
1076 }
1077
1078 void
1079 BookmarkListForm::OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui::KeypadAction keypadAction)
1080 {
1081         AppLog("BookmarkListForm::OnKeypadActionPerformed %d",keypadAction);
1082
1083         if ( __pSearchBar != null && keypadAction == KEYPAD_ACTION_SEARCH)
1084         {
1085                 if (__pSearchBar->GetText().GetLength() == 0)
1086                 {
1087                         return;
1088                 }
1089
1090                 if (__pSearchBar != null)
1091                 {
1092                         __pSearchBar->HideKeypad();
1093                 }
1094
1095                 __searchText = __pSearchBar->GetText();
1096                 __searchBookmark = true;
1097                 __pListview->SetShowState(false);
1098                 __pSearchListView->SetEnabled(true);
1099                 __pSearchListView->SetShowState(true);
1100                 __pSearchListView->SetBounds(0,0,GetClientAreaBounds().width,GetClientAreaBounds().height -__pSearchBar->GetHeight());
1101                 __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), __pSearchListView->GetHeight()));
1102                 __pSearchListView->UpdateList();
1103
1104         }
1105         Invalidate(true);
1106 }
1107
1108 void
1109 BookmarkListForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
1110 {
1111         AppLogDebug("BookmarkListForm::OnSceneActivatedN called");
1112         ArrayListT<String> * pList = dynamic_cast<ArrayListT<String>* >(SceneManager::GetInstance()->GetSceneHistoryN());
1113         if(pList != null)
1114         {
1115                 pList->GetAt(pList->GetCount()-1,__previousSceneId);
1116         }
1117
1118         __searchBookmark = false;
1119         GetFooter()->SetShowState(true);
1120         GetFooter()->Invalidate(true);
1121         GetHeader()->SetItemSelected(0);
1122         GetHeader()->Invalidate(true);
1123
1124         /*      if (previousSceneId != IDSCN_HISTORY_LIST && previousSceneId != IDSCN_CREATE_BOOKMARK_FOLDER && previousSceneId != IDSCN_EDIT_BOOKMARK_LIST)
1125         {
1126                 __previousSceneId = previousSceneId;
1127         }*/
1128
1129         if (__pListview != null)
1130         {
1131                 __pListview->UpdateList();
1132         }
1133
1134         return;
1135 }
1136
1137 void
1138 BookmarkListForm::OnOrientationChanged (const Tizen::Ui::Control &source, Tizen::Ui::OrientationStatus orientationStatus)
1139 {
1140         AppLog("BookmarkListForm::OnOrientationChanged start");
1141
1142         if (__pListview)
1143         {
1144                 if(__pSearchBar->GetShowState())
1145                 {
1146                         __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetHeight(),GetClientAreaBounds().width ,GetClientAreaBounds().height - __pSearchBar->GetY() - __pSearchBar->GetHeight());
1147                 }
1148                 else
1149                 {
1150                         __pListview->SetBounds(__pListview->GetX(),0,GetClientAreaBounds().width ,GetClientAreaBounds().height);
1151                 }
1152                 __pListview->UpdateList();
1153         }
1154
1155         if (__pSearchListView && __pListview)
1156         {
1157                 AppLog("__pListview->GetBounds() %d, %d, %d, %d",__pListview->GetBounds().x,__pListview->GetBounds().y,__pListview->GetBounds().width,__pListview->GetBounds().height);
1158                 __pSearchListView->SetBounds(0,0,GetClientAreaBounds().width,GetClientAreaBounds().height -__pSearchBar->GetHeight());
1159
1160                 __pSearchListView->UpdateList();
1161         }
1162
1163         if (__pSearchListView && __pData != null )
1164         {
1165                 if (__parentID != DEFAULT_VALUE_PARENTID)
1166                 {
1167                         AppLog("BookmarkListForm::OnOrientationChanged parent id true");
1168                         __pSearchBar->SetShowState(false);
1169                         __pSearchBar->Invalidate(true);
1170                 }
1171
1172                 __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), GetClientAreaBounds().height));
1173         }
1174
1175
1176         Invalidate(true);
1177 }
1178
1179 void
1180 BookmarkListForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
1181 {
1182         __pSearchBar->SetMode(SEARCH_BAR_MODE_NORMAL);
1183         return;
1184 }
1185