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