prevent issue fixed
[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                 delete pImage;
590                 pImage = null;
591                 return NULL;
592         }
593         if ( pBookMark->GetBookmarkType() == BOOKMARK_TYPE_FOLDER )
594         {
595                 r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth,112), LIST_ANNEX_STYLE_DETAILED);
596                 TryCatch(!IsFailed(r),,"BookmarkListForm::CreateItem Construct failed %s",GetErrorMessage(r));
597
598                 pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_ICON_FOLDER_OPEN);
599                 if (pBitmap != null)
600                 {
601                         pItem->AddElement(Rectangle(x_Margin_Icon, 20, width_Icon, height_Icon), IDA_FORMAT_ICON, *pBitmap, null);
602                         delete pBitmap;
603                 }
604
605                 pItem->AddElement(Rectangle(x_Margin_Title, 26, width_Title, 60), IDA_FORMAT_FOLDER, pBookMark->GetBookmarkTitle(), true);
606
607                 if ( __pItemContextFolder != NULL)
608                 {
609                         pItem->SetContextItem(__pItemContextFolder);
610                 }
611         }
612         else
613         {
614                 r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth, itemHeight), style);
615                 TryCatch( !IsFailed(r),,"BookmarkListForm::CreateItem Construct failed %s",GetErrorMessage(r));
616
617                 AppLogDebug("BookmarkListForm::faviconid %ls",pBookMark->GetFaviconId().GetPointer());
618                 bitmapId = pBookMark->GetFaviconId();
619
620                 dim = Dimension(pBookMark->GetFavIconWidth(), pBookMark->GetFavIconHeight());
621
622                 AppLog("BookmarkListForm::CreateItem check 0");
623
624                 // get fav icon bitmap
625                 ByteBuffer* pFavIconBuffer = null;
626                 pFavIconBuffer = pBookMark->GetFavIconBuffer();
627
628                 AppLog("BookmarkListForm::CreateItem check 0");
629
630                 if (pFavIconBuffer != null)
631                 {
632                         AppLog("BookmarkListForm::CreateItem pFavIconBuffer is not null");
633                 }
634                 else
635                 {
636                         AppLog("BookmarkListForm::CreateItem pFavIconBuffer is null");
637                 }
638
639                 pBitmap = pImage->DecodeN(*pFavIconBuffer, IMG_FORMAT_PNG, BITMAP_PIXEL_FORMAT_ARGB8888);
640
641                 AppLog("BookmarkListForm::CreateItem check 1");
642
643                 if (pBitmap != null)
644                 {
645                         AppLog("rahul bitmap is not null");
646                         int width = pBitmap->GetWidth();
647                         int height = pBitmap->GetHeight();
648                         AppLog("rahul bitmap width is %d", width);
649                         AppLog("rahul bitmap height is %d", height);
650                         AppLog("rahul favicon width is %d", pBookMark->GetFavIconWidth());
651                         AppLog("rahul favicon height is %d", pBookMark->GetFavIconHeight());
652                 }
653                 else
654                 {
655                         AppLog("rahul bitmap is null");
656                 }
657
658                 if (pBitmap == null)
659                 {
660                         AppLogDebug("BookmarkListForm::CreateItem bitmap is null");
661                         pBitmap = FaviconManager::GetInstance()->GetDefaultFaviconN();
662                 }
663                 pItem->AddElement(Rectangle(x_Margin_Icon, y_Margin_Icon, width_Icon, height_Icon), IDA_FORMAT_ICON, *pBitmap, null);
664                 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);
665                 if(__pSearchBar->GetMode() == SEARCH_BAR_MODE_INPUT)
666                         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);
667                 else
668                         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);
669
670                 if (pBitmap != null)
671                 {
672                         delete pBitmap;
673                 }
674                 if ( __pItemContextSite != NULL)
675                 {
676                         pItem->SetContextItem(__pItemContextSite);
677                 }
678         }
679
680         delete pImage;
681         return pItem;
682
683         CATCH:
684
685         delete pImage;
686         delete pItem;
687         pItem = null;
688         return null;
689
690 }
691
692 bool
693 BookmarkListForm::DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth)
694 {
695         delete pItem;
696         pItem = null;
697         return true;
698 }
699
700 int
701 BookmarkListForm::GetItemCount(void)
702 {
703         int count = 0;
704
705         if (__pData != NULL )
706         {
707                 __pData->RemoveAll(true);
708                 delete __pData;
709                 __pData = null;
710         }
711         __pData = new(std::nothrow) Collection::ArrayList();
712         __pData->Construct();
713
714         if (__searchBookmark == false)
715         {
716                 BookmarkPresentationModel::GetInstance()->GetFolderBookmarkCount(__parentID, count);
717                 BookmarkPresentationModel::GetInstance()->GetFoldersBookmarks(__parentID, 0, count, *__pData);
718         }
719         else
720         {
721                 BookmarkPresentationModel::GetInstance()->GetSearchFolderBookmarkCount(count,__searchText);
722                 BookmarkPresentationModel::GetInstance()->GetSearchFoldersBookmarks(0, count, *__pData, __searchText);
723         }
724
725         AppLogDebug("Count = %d parentId = %ls", count, __parentID.GetPointer());
726
727         if (count <= 0)
728         {
729                 __noBookmarks = true;
730                 GetFooter()->SetItemEnabled(1,false);
731         }
732         else
733         {
734                 __noBookmarks = false;
735                 GetFooter()->SetItemEnabled(1,true);
736         }
737
738         AppLogDebug("Result: %s", GetErrorMessage(GetLastResult()));
739         GetFooter()->Invalidate(true);
740         if (__pData != null && __pData->GetCount() >= 1)
741         {
742                 //              __pSearchBar->SetMode(SEARCH_BAR_MODE_NORMAL);
743                 __pSearchBar->SetShowState(true);
744                 __pSearchBar->Invalidate(true);
745         }
746         else if (__searchBookmark == false)
747         {
748                 __pSearchBar->SetShowState(false);
749                 __pSearchBar->Invalidate(true);
750         }
751
752         if (__parentID.CompareTo(L"0") != 0)
753         {
754                 __pSearchBar->SetShowState(false);
755                 __pSearchBar->Invalidate(true);
756         }
757         if (__noBookmarks == true)
758         {
759                 __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetPosition().y,__pSearchBar->GetWidth() ,GetClientAreaBounds().height);
760                 Bitmap* pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_NO_CONTENT_BOOKMARK);
761
762                 if ( pBitmap != NULL)
763                 {
764                         __pListview->SetBitmapOfEmptyList(pBitmap);
765                         delete pBitmap;
766                 }
767         }
768         else
769         {
770                 if (__parentID.CompareTo(L"0") == 0)
771                 {
772                         __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetHeight(),GetClientAreaBounds().width ,GetClientAreaBounds().height - __pSearchBar->GetY() - __pSearchBar->GetHeight());
773                 }
774                 else
775                 {
776                         __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetY(),__pSearchBar->GetWidth() ,GetClientAreaBounds().height);
777
778                 }
779
780         }
781         __pListview->Invalidate(true);
782         return count;
783
784 }
785
786 void
787 BookmarkListForm::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus status)
788 {
789         AppLogDebug("BookmarkListForm::OnListViewContextItemStateChanged int index %d, int elementId %d, Tizen::Ui::Controls::ListContextItemStatus status %d",index,elementId,status);
790
791         String deleteText = CommonUtil::GetString(L"IDS_BR_SK_DELETE_ABB");
792         deleteText.Append(L"? ");
793         int timeOut = 25000;
794         result r = E_SUCCESS;
795
796         switch(elementId)
797         {
798         case IDA_CONTEXT_ITEM_FOLDER_EDIT:
799         {
800                 ArrayList* pArgList = null;
801                 String* pEdit = null;
802
803                 SceneManager* pSceneManager = SceneManager::GetInstance();
804                 BookmarkData* pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(index));
805                 if (pBookMark != null && pBookMark->GetBookmarkType() == BOOKMARK_TYPE_FOLDER)
806                 {
807                         pArgList = new(std::nothrow) ArrayList();
808                         if (pArgList != null)
809                         {
810                                 pEdit= new(std::nothrow) String(CommonUtil::GetString(L"IDS_BR_HEADER_EDIT_FOLDER"));
811                                 pArgList->Construct();
812                                 pArgList->Add(*new(std::nothrow) BookmarkData(*pBookMark));
813                                 pArgList->Add(*pEdit);
814                                 if (    pSceneManager != null)
815                                 {
816                                         result r;
817                                         r = pSceneManager->GoForward(ForwardSceneTransition(IDSCN_CREATE_BOOKMARK_FOLDER), pArgList);
818                                 }
819
820                                 if (pArgList != null)
821                                 {
822                                         delete pArgList;
823                                         pArgList = null;
824                                 }
825                                 if(IsFailed(r))
826                                 {
827                                         AppLogDebug("BookmarkListForm::OnListViewContextItemStateChanged GoForward failed %s",GetErrorMessage(r));
828                                         return;
829                                 }
830                         }
831                 }
832
833         }
834         break;
835
836         case IDA_CONTEXT_ITEM_FOLDER_DELETE:
837         case IDA_CONTEXT_ITEM_DELETE:
838         {
839                 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
840                 __pConfirmationPopup->Initialize();
841                 __pConfirmationPopup->RemoveActionListener(*this);
842                 __pConfirmationPopup->AddActionListener(*this);
843                 __pConfirmationPopup->setMessage(deleteText);
844                 __pConfirmationPopup->Show();
845                 __selectedindex = index;
846         }
847         break;
848
849         case IDA_CONTEXT_ITEM_EDIT:
850         {
851                 ArrayList* pArgList = null;
852                 SceneManager* pSceneManager = SceneManager::GetInstance();
853                 BookmarkData* pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(index));
854                 if (pBookMark!= null && pBookMark->GetBookmarkType() == BOOKMARK_TYPE_URL)
855                 {
856                         AppLogDebug("ID_CONTEXT_ITEM_SITE_1 BOOKMARK_TYPE_URL");
857                         pArgList = new(std::nothrow) ArrayList();
858                         if (pArgList != null)
859                         {
860                                 pArgList->Construct();
861                                 pArgList->Add(*new(std::nothrow) String(L"1"));
862                                 pArgList->Add(*new(std::nothrow) BookmarkData(*pBookMark));
863                                 if (    pSceneManager != null)
864                                 {
865                                         result r;
866                                         r = pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ADD_BOOKMARK), pArgList);
867                                         if (pArgList != null)
868                                         {
869                                                 delete pArgList;
870                                                 pArgList = null;
871                                         }
872                                         if(IsFailed(r))
873                                         {
874                                                 AppLogDebug("BookmarkListForm::OnListViewContextItemStateChanged GoForward failed %s",GetErrorMessage(r));
875                                                 return;
876                                         }
877                                 }
878                         }
879                 }
880         }
881         break;
882         case IDA_CONTEXT_ITEM_SHARE:
883         {
884                 AppLogDebug("OnListViewContextItemStateChanged Share");
885
886                 BookmarkData* pBookmark = dynamic_cast<BookmarkData*>(__pData->GetAt(index));
887                 if (pBookmark != null)
888                 {
889                         ShareInfo* pShareInfo = new(std::nothrow) ShareInfo();
890                         pShareInfo->SetPageTitle(pBookmark->GetBookmarkTitle());
891                         pShareInfo->SetPageUrl(pBookmark->GetUrl());
892                         pShareInfo->SetImageAttached(false);
893                         __pPopUp->RemoveAllShareInfo();
894                         __pPopUp->AddShareInfo(pShareInfo);
895                 }
896
897                 if (__pPopUp != null)
898                 {
899                         __pPopUp->SetShowState(true);
900                         __pPopUp->Show();
901                 }
902         }
903         break;
904         default:
905                 break;
906         }
907
908 }
909
910 void
911 BookmarkListForm::OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback)
912 {
913
914 }
915
916 void
917 BookmarkListForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
918 {
919         AppLogDebug("BookmarkListForm::OnListViewItemStateChanged");
920
921         result r = E_FAILURE;
922         ArrayList *pArgList = null;
923         SceneManager* pSceneManager = SceneManager::GetInstance();
924         BookmarkData* pBookmark = dynamic_cast< BookmarkData* >(__pData->GetAt(index));
925
926         if ( pBookmark == NULL )
927         {
928                 return;
929         }
930
931         switch (pBookmark->GetBookmarkType())
932         {
933         case BOOKMARK_TYPE_FOLDER:
934
935                 __parentID = pBookmark->GetBookmarkId();
936                 AppLogDebug("BOOKMARK_TYPE_FOLDER parent ID is %ls",__parentID.GetPointer());
937
938                 listView.UpdateList();
939                 if (listView.GetItemCount() == 0)
940                 {
941                         GetFooter()->SetItemEnabled(1,false);
942                 }
943                 else
944                 {
945                         GetFooter()->SetItemEnabled(1,true);
946                 }
947                 GetFooter()->SetItemEnabled(2,false);
948                 GetFooter()->Invalidate(true);
949                 __pSearchBar->HideKeypad();
950                 __pSearchBar->SetMode(SEARCH_BAR_MODE_NORMAL);
951                 __pSearchBar->SetShowState(false);
952                 __pSearchBar->Invalidate(true);
953                 __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetY(),__pListview->GetWidth() ,GetClientAreaBounds().height);
954                 break;
955
956         case BOOKMARK_TYPE_URL:
957
958                 pArgList = new(std::nothrow) ArrayList();
959                 if (pArgList != null)
960                 {
961                         r = pArgList->Construct();
962                         TryCatch(!IsFailed(r), L"BookmarkListForm::OnListViewItemStateChanged pArgList Construct failed %s", GetErrorMessage(r));
963
964                         AppLogDebug("bookmark url = %ls",pBookmark->GetUrl().GetPointer());
965                         r = pArgList->Add(*MultipleWindowPresentationModel::GetInstance()->GetActiveWindowInfo());
966                         pArgList->Add(*new(std::nothrow) String(pBookmark->GetUrl()));
967
968                         if (pSceneManager != null)
969                         {
970                                 AppLogDebug("pSceneManager exists");
971                                 String prevSceneId;
972                                 MultipleWindowPresentationModel::GetInstance()->GetCurrentSceneId(prevSceneId);
973                                 r = pSceneManager->GoBackward(BackwardSceneTransition(prevSceneId), pArgList);
974                                 TryCatch(!IsFailed(r), L"BookmarkListForm::OnListViewItemStateChanged pArgList Construct failed %s", GetErrorMessage(r));
975                         }
976                         delete pArgList;
977                 }
978                 break;
979
980         default:
981                 break;
982         }
983
984         return;
985         CATCH:
986         if(pArgList)
987         {
988                 pArgList->RemoveAll(true);
989                 delete pArgList;
990         }
991
992 }
993
994 void
995 BookmarkListForm::OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction)
996 {
997
998
999 }
1000
1001 void
1002 BookmarkListForm::OnFastScrollIndexSelected(Tizen::Ui::Control& source, Tizen::Base::String& index)
1003 {
1004
1005 }
1006
1007 void
1008 BookmarkListForm::OnSearchBarModeChanged(Tizen::Ui::Controls::SearchBar& source, Tizen::Ui::Controls::SearchBarMode mode)
1009 {
1010         result r = E_FAILURE;
1011
1012         if (mode == SEARCH_BAR_MODE_NORMAL)
1013         {
1014                 __pSearchListView->SetShowState(false);
1015                 __pSearchListView->UpdateList();
1016                 __pListview->SetShowState(true);
1017                 Invalidate(true);
1018                 __searchBookmark = false;
1019                 r = __pListview->UpdateList();
1020 //              __pSearchListView->SetBounds(0,0,GetClientAreaBounds().width,GetClientAreaBounds().height -__pSearchBar->GetHeight());
1021                 __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), __pSearchListView->GetHeight()));
1022                 TryCatch( !IsFailed(r),,"BookmarkListForm::OnSearchBarModeChanged Update list failed %s",GetErrorMessage(r));
1023                 CATCH:return;
1024         }
1025         else
1026         {
1027                 __pSearchListView->SetShowState(true);
1028                 __pSearchListView->SetEnabled(false);
1029                 __pListview->SetShowState(false);
1030
1031                 if(__pSearchBar)
1032                 {
1033                         __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), __pSearchListView->GetHeight()));
1034                         __pSearchBar->SetText(L"");
1035                 }
1036                 AppLog("OnSearchBarModeChanged SetContentAreaSize heihgt %d",__pSearchListView->GetHeight());
1037                  __pListview->UpdateList();
1038                 __pSearchListView->UpdateList();
1039         }
1040 }
1041
1042 void
1043 BookmarkListForm::OnKeypadWillOpen(Tizen::Ui::Control& source)
1044 {
1045 //      GetFooter()->SetShowState(false);
1046         __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), __pSearchListView->GetHeight() + GetFooter()->GetHeight());
1047         __pSearchListView->SetEnabled(false);
1048         __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), __pSearchListView->GetHeight()));
1049         Invalidate(true);
1050         __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), __pSearchListView->GetHeight() - GetFooter()->GetHeight());
1051 }
1052
1053 void
1054 BookmarkListForm::OnKeypadOpened(Tizen::Ui::Control& source)
1055 {
1056         GetFooter()->SetShowState(false);
1057 //      __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight());
1058         __pSearchListView->UpdateList();
1059         Invalidate(true);
1060 }
1061
1062 void
1063 BookmarkListForm::OnKeypadClosed(Tizen::Ui::Control& source)
1064 {
1065         AppLog("jahsjkdad %d",Clipboard::GetInstance()->IsPopupVisible());
1066         if(Clipboard::GetInstance()->IsPopupVisible() == true)
1067         {
1068                 return;
1069         }
1070         GetFooter()->SetShowState(true);
1071         GetFooter()->Invalidate(true);
1072         __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight());
1073         __pListview->SetBounds(__pSearchListView->GetX(), __pSearchBar->GetY() + __pSearchBar->GetHeight(), __pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight());
1074         __pSearchListView->Invalidate(false);
1075         //__pSearchListView->SetEnabled(true);
1076         __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight()));
1077         Invalidate(true);
1078 }
1079
1080 void
1081 BookmarkListForm::OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui::KeypadAction keypadAction)
1082 {
1083         AppLog("BookmarkListForm::OnKeypadActionPerformed %d",keypadAction);
1084
1085         if ( __pSearchBar != null && keypadAction == KEYPAD_ACTION_SEARCH)
1086         {
1087                 if (__pSearchBar->GetText().GetLength() == 0)
1088                 {
1089                         return;
1090                 }
1091
1092                 if (__pSearchBar != null)
1093                 {
1094                         __pSearchBar->HideKeypad();
1095                 }
1096
1097                 __searchText = __pSearchBar->GetText();
1098                 __searchBookmark = true;
1099                 __pListview->SetShowState(false);
1100                 __pSearchListView->SetEnabled(true);
1101                 __pSearchListView->SetShowState(true);
1102                 __pSearchListView->SetBounds(0,0,GetClientAreaBounds().width,GetClientAreaBounds().height -__pSearchBar->GetHeight());
1103                 __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), __pSearchListView->GetHeight()));
1104                 __pSearchListView->UpdateList();
1105
1106         }
1107         Invalidate(true);
1108 }
1109
1110 void
1111 BookmarkListForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
1112 {
1113         AppLogDebug("BookmarkListForm::OnSceneActivatedN called");
1114         ArrayListT<String> * pList = dynamic_cast<ArrayListT<String>* >(SceneManager::GetInstance()->GetSceneHistoryN());
1115         if(pList != null)
1116         {
1117                 pList->GetAt(pList->GetCount()-1,__previousSceneId);
1118         }
1119
1120         __searchBookmark = false;
1121         GetFooter()->SetShowState(true);
1122         GetFooter()->Invalidate(true);
1123         GetHeader()->SetItemSelected(0);
1124         GetHeader()->Invalidate(true);
1125
1126         /*      if (previousSceneId != IDSCN_HISTORY_LIST && previousSceneId != IDSCN_CREATE_BOOKMARK_FOLDER && previousSceneId != IDSCN_EDIT_BOOKMARK_LIST)
1127         {
1128                 __previousSceneId = previousSceneId;
1129         }*/
1130
1131         if (__pListview != null)
1132         {
1133                 __pListview->UpdateList();
1134         }
1135
1136         return;
1137 }
1138
1139 void
1140 BookmarkListForm::OnOrientationChanged (const Tizen::Ui::Control &source, Tizen::Ui::OrientationStatus orientationStatus)
1141 {
1142         AppLog("BookmarkListForm::OnOrientationChanged start");
1143
1144         if (__pListview)
1145         {
1146                 if(__pSearchBar->GetShowState())
1147                 {
1148                         __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetHeight(),GetClientAreaBounds().width ,GetClientAreaBounds().height - __pSearchBar->GetY() - __pSearchBar->GetHeight());
1149                 }
1150                 else
1151                 {
1152                         __pListview->SetBounds(__pListview->GetX(),0,GetClientAreaBounds().width ,GetClientAreaBounds().height);
1153                 }
1154                 __pListview->UpdateList();
1155         }
1156
1157         if (__pSearchListView && __pListview)
1158         {
1159                 AppLog("__pListview->GetBounds() %d, %d, %d, %d",__pListview->GetBounds().x,__pListview->GetBounds().y,__pListview->GetBounds().width,__pListview->GetBounds().height);
1160                 __pSearchListView->SetBounds(0,0,GetClientAreaBounds().width,GetClientAreaBounds().height -__pSearchBar->GetHeight());
1161
1162                 __pSearchListView->UpdateList();
1163         }
1164
1165         if (__pSearchListView && __pData != null )
1166         {
1167                 if (__parentID != DEFAULT_VALUE_PARENTID)
1168                 {
1169                         AppLog("BookmarkListForm::OnOrientationChanged parent id true");
1170                         __pSearchBar->SetShowState(false);
1171                         __pSearchBar->Invalidate(true);
1172                 }
1173
1174                 __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), GetClientAreaBounds().height));
1175         }
1176
1177
1178         Invalidate(true);
1179 }
1180
1181 void
1182 BookmarkListForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
1183 {
1184         __pSearchBar->SetMode(SEARCH_BAR_MODE_NORMAL);
1185         return;
1186 }
1187