2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://floralicense.org/license/
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.
18 * @file MpSearchForm.cpp
19 * @brief This is the implementation file for SearchForm class.
22 #include "MpSearchForm.h"
23 #include "MpSearchListItem.h"
24 #include "MpMusicPlayerApp.h"
26 using namespace Tizen::App;
27 using namespace Tizen::Base;
28 using namespace Tizen::Base::Collection;
29 using namespace Tizen::Content;
30 using namespace Tizen::Graphics;
31 using namespace Tizen::Media;
32 using namespace Tizen::Ui;
33 using namespace Tizen::Ui::Controls;
34 using namespace Tizen::Ui::Scenes;
36 static const int H_SEARCH_BAR = 86;
37 static const int H_GROUP_NAME = 80;
38 static const int X_GAP = 16;
39 static const int SEARCH_FONT_SIZE = 50;
40 static const int IDA_GROUP_ITEM_ELEMENT = 100;
41 static const int IDA_SEARCH_ITEM_MAIN_ELEMENT = 101;
42 static const int IDA_SEARCH_ITEM_SUB_ELEMENT = 102;
43 static const Tizen::Graphics::Color COLOR_GROUP_NAME_BG (127, 127, 127);
44 static const Tizen::Graphics::Color COLOR_GROUP_TEXT (255, 255, 255);
46 SearchForm::SearchForm(void)
47 : __pSearchListView(null)
49 , __pNoContentTextLabel(null)
51 , __itemHeight(ITEM_HEIGHT_MAIN_TEXT_NORMAL)
52 , __fontSize(FONT_MAIN_TEXT_SIZE_NORMAL)
58 SearchForm::~SearchForm(void)
65 SearchForm::Initialize(void)
69 Construct(FORM_STYLE_NORMAL | FORM_STYLE_HEADER | FORM_STYLE_PORTRAIT_INDICATOR | FORM_STYLE_LANDSCAPE_INDICATOR_AUTO_HIDE);
76 SearchForm::OnInitializing(void)
79 AddOrientationEventListener(*this);
80 SetOrientation(ORIENTATION_AUTOMATIC_FOUR_DIRECTION);
82 GetHeader()->SetTitleText(ResourceManager::GetString("IDS_COM_BODY_SEARCH"));
84 __pPresentationModel = SearchPresentationModel::GetInstance();
85 __pSearchBar = new (std::nothrow) SearchBar();
86 __pSearchBar->Construct(Rectangle(0, 0, GetClientAreaBounds().width, H_SEARCH_BAR));
87 __pSearchBar->SetGuideText(ResourceManager::GetString("IDS_COM_BODY_SEARCH"));
88 __pSearchBar->AddSearchBarEventListener(*this);
89 __pSearchBar->AddTextEventListener(*this);
90 __pSearchBar->AddKeypadEventListener(*this);
91 // __pSearchBar->SetLowerCaseModeEnabled(true);
92 AddControl(__pSearchBar);
93 __pSearchListView = new (std::nothrow) ListView();
94 __pSearchListView->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height - __pSearchBar->GetHeight()),
96 SCROLL_STYLE_FADE_OUT);
98 __pSearchListView->SetItemProvider(*this);
99 __pSearchListView->AddListViewItemEventListener(*this);
100 __pSearchListView->AddTouchEventListener(*this);
101 __pSearchListView->AddScrollEventListener(*this);
102 __pSearchBar->SetContent(__pSearchListView);
104 __fontSizeValue = CommonUtil::GetFontSizeValue();
105 __itemHeight = CommonUtil::GetItemHeight(__fontSizeValue);
106 __fontSize = CommonUtil::GetFontSize(__fontSizeValue);
108 if (GetFooter() != null)
110 GetFooter()->SetBackButton();
113 SetFormBackEventListener(this);
119 SearchForm::OnTerminating(void)
121 AppLogDebug("ENTER");
122 __pSearchListView->Destroy();
128 SearchForm::OnSearchBarModeChanged(Tizen::Ui::Controls::SearchBar& source,
129 Tizen::Ui::Controls::SearchBarMode mode)
131 AppLogDebug("ENTER");
132 __pPresentationModel->RemoveSearchResult();
134 if (__pSearchListView != null)
136 __pSearchListView->UpdateList();
137 __pSearchListView->ScrollToItem(INIT_VALUE);
138 __pSearchListView->Invalidate(true);
144 SearchForm::OnSearchBarContentAreaResized(Tizen::Ui::Controls::SearchBar& source,
147 AppLogDebug("ENTER");
152 SearchForm::OnTextValueChanged(const Tizen::Ui::Control& source)
154 AppLogDebug("ENTER");
155 if (__pSearchBar->GetText().GetLength() != INIT_VALUE)
157 __pPresentationModel->InitializeContentList(__pSearchBar->GetText());
161 __pPresentationModel->RemoveSearchResult();
164 if (__pSearchListView != null)
166 __pSearchListView->UpdateList();
167 __pSearchListView->ScrollToItem(INIT_VALUE);
168 __pSearchListView->Invalidate(true);
174 SearchForm::OnTextValueChangeCanceled(const Tizen::Ui::Control& source)
176 AppLogDebug("ENTER");
181 SearchForm::OnKeypadActionPerformed(Tizen::Ui::Control& source,
182 Tizen::Ui::KeypadAction keypadAction)
184 AppLogDebug("ENTER");
185 if (keypadAction == KEYPAD_ACTION_SEARCH)
187 __pSearchBar->HideKeypad();
189 if (__pSearchBar->GetTextLength() != INIT_VALUE)
191 __pPresentationModel->InitializeContentList(__pSearchBar->GetText());
195 __pPresentationModel->RemoveSearchResult();
197 if (__pSearchListView != null)
199 __pSearchListView->UpdateList();
200 __pSearchListView->ScrollToItem(INIT_VALUE);
201 __pSearchListView->Invalidate(true);
208 SearchForm::OnKeypadClosed(Tizen::Ui::Control& source)
210 AppLogDebug("ENTER");
211 if (GetFooter() != null)
213 GetFooter()->SetShowState(true);
216 FloatRectangle clientRect = GetClientAreaBoundsF();
217 FloatRectangle searchBarBounds = CoordinateSystem::AlignToDevice(FloatRectangle(__pSearchBar->GetBoundsF()));
218 __pSearchBar->SetContentAreaSize(FloatDimension(clientRect.width, clientRect.height - searchBarBounds.height));
219 __pSearchListView->SetSize(FloatDimension(clientRect.width, clientRect.height - searchBarBounds.height));
220 if (__pNoContentTextLabel != null)
222 __pNoContentTextLabel->SetBounds(FloatRectangle(X_GAP,(searchBarBounds.y+searchBarBounds.height),GetWidth() - (X_GAP * 2),clientRect.height - (searchBarBounds.y+searchBarBounds.height)));
228 SearchForm::OnKeypadOpened(Tizen::Ui::Control& source)
230 AppLogDebug("ENTER");
231 FloatRectangle clientRect = CoordinateSystem::AlignToDevice(GetClientAreaBoundsF());
232 FloatRectangle searchBarBounds = CoordinateSystem::AlignToDevice(FloatRectangle(__pSearchBar->GetBoundsF()));
233 __pSearchBar->SetContentAreaSize(FloatDimension(clientRect.width, clientRect.height - searchBarBounds.height));
234 __pSearchListView->SetSize(FloatDimension(clientRect.width, clientRect.height - searchBarBounds.height));
236 if (__pNoContentTextLabel != null)
238 __pNoContentTextLabel->SetBounds(Rectangle(X_GAP,(searchBarBounds.y+searchBarBounds.height),GetWidth() - (X_GAP * 2),clientRect.height - (searchBarBounds.y+searchBarBounds.height)));
244 SearchForm::OnKeypadWillOpen(Tizen::Ui::Control &source)
246 AppLogDebug("ENTER");
247 // GetFooter()->SetShowState(false);
252 SearchForm::OnKeypadBoundsChanged(Tizen::Ui::Control& source)
254 FloatRectangle clientRect = GetClientAreaBoundsF();
255 FloatRectangle searchBarBounds = CoordinateSystem::AlignToDevice(FloatRectangle(__pSearchBar->GetBoundsF()));
256 __pSearchBar->SetContentAreaSize(FloatDimension(clientRect.width, clientRect.height - searchBarBounds.height));
257 __pSearchListView->SetSize(FloatDimension(clientRect.width, clientRect.height - searchBarBounds.height));
259 if (__pNoContentTextLabel != null && __pNoContentTextLabel->GetShowState())
261 __pNoContentTextLabel->SetBounds(Rectangle(X_GAP,(searchBarBounds.y+searchBarBounds.height),GetWidth() - (X_GAP * 2),clientRect.height - (searchBarBounds.y+searchBarBounds.height)));
266 SearchForm::GetItemCount(void)
268 AppLogDebug("ENTER");
269 int contentCount = __pPresentationModel->GetTotalContentCount();
271 if ( __pNoContentTextLabel != null)
273 if (contentCount == 0)
275 __pNoContentTextLabel->SetShowState(true);
279 __pNoContentTextLabel->SetShowState(false);
288 Tizen::Ui::Controls::ListItemBase*
289 SearchForm::CreateItem(const int itemIndex, int itemWidth)
291 AppLogDebug("ENTER");
292 int artistIndex = __pPresentationModel->GetArtistIndex();
293 int albumIndex = __pPresentationModel->GetAlbumIndex();
294 int songIndex = __pPresentationModel->GetSongIndex();
296 ContentInformation* pContentInfo = null;
297 CustomItem* pItem = new (std::nothrow) CustomItem();
299 result r = pItem->Construct(Dimension(itemWidth, H_GROUP_NAME), LIST_ANNEX_STYLE_NORMAL);
300 TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
302 if (artistIndex == itemIndex)
304 r = CreateGroupNameTableViewItem(pItem, ResourceManager::GetString(L"IDS_MUSIC_TAB4_ARTISTS"));
305 TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
310 else if (albumIndex == itemIndex)
312 r = CreateGroupNameTableViewItem(pItem, ResourceManager::GetString(L"IDS_MUSIC_BODY_ALBUMS"));
313 TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
318 else if (songIndex == itemIndex)
320 r = CreateGroupNameTableViewItem(pItem, ResourceManager::GetString(L"IDS_MUSIC_HEADER_SONGS"));
321 TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
331 pItem = new (std::nothrow) CustomItem();
332 r = pItem->Construct(Dimension(itemWidth, __itemHeight), LIST_ANNEX_STYLE_NORMAL);
333 TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
335 pContentInfo = __pPresentationModel->GetContentInfoN(itemIndex);
336 TryCatch(pContentInfo != null, delete pItem, "pContentInfo is null", GetErrorMessage(GetLastResult()));
338 if (artistIndex != -1 && itemIndex > artistIndex)
340 bool addArtist = true;
342 if(albumIndex != -1 && itemIndex > albumIndex)
347 if(songIndex != -1 && albumIndex == -1 && itemIndex > songIndex)
354 CreateSearchResultText(pItem, pContentInfo->ArtistName, SEARCH_NAME_ARTIST);
358 if(albumIndex != -1 && itemIndex > albumIndex)
360 bool addAlbum = true;
361 if(songIndex != -1 && itemIndex > songIndex)
368 CreateSearchResultText(pItem, pContentInfo->AlbumName, SEARCH_NAME_ALBUM);
369 CreateSubArtistNameText(pItem, pContentInfo->ArtistName);
372 if(songIndex != -1 && itemIndex > songIndex)
374 CreateSearchResultText(pItem, pContentInfo->TitleName, SEARCH_NAME_SONG);
382 AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
387 SearchForm::CreateSearchResultText(Tizen::Ui::Controls::CustomItem* pItem, const Tizen::Base::String& searchName, const SearchName name)
389 SearchListItem* pSearchItem = null;
390 String keyword = __pSearchBar->GetText();
391 keyword.ToLowerCase();
392 pSearchItem = new (std::nothrow) SearchListItem(keyword, searchName, __fontSize, __itemHeight, name);
394 if (name == SEARCH_NAME_ALBUM)
396 pItem->AddElement(Rectangle(X_GAP_THUMBNAIL, 0, GetClientAreaBounds().width - X_GAP_THUMBNAIL, __itemHeight - 50), IDA_SEARCH_ITEM_MAIN_ELEMENT, *pSearchItem);
400 pItem->AddElement(Rectangle(X_GAP_THUMBNAIL, 0, GetClientAreaBounds().width - X_GAP_THUMBNAIL, __itemHeight - 20), IDA_SEARCH_ITEM_MAIN_ELEMENT, *pSearchItem);
401 pItem->SetElementTextVerticalAlignment(IDA_SEARCH_ITEM_MAIN_ELEMENT, ALIGNMENT_MIDDLE);
408 SearchForm::CreateSubArtistNameText(Tizen::Ui::Controls::CustomItem* pItem, const Tizen::Base::String& ArtistName)
411 TextElement* pArtist = null;
412 EnrichedText* pArtistName = new (std::nothrow) EnrichedText();
413 pArtistName->Construct(Dimension(GetClientAreaBounds().width - X_GAP_THUMBNAIL, 50));
414 pArtistName->SetVerticalAlignment(TEXT_ALIGNMENT_MIDDLE);
415 pArtistName->SetHorizontalAlignment(TEXT_ALIGNMENT_LEFT);
416 font.Construct(FONT_STYLE_BOLD, SUB_TEXT_SIZE);
417 pArtist = new (std::nothrow) TextElement();
418 pArtist->Construct(ArtistName);
419 pArtist->SetFont(font);
420 pArtist->SetTextColor(COLOR_SUB_TEXT);
421 pArtistName->Add(*pArtist);
422 pItem->AddElement(Rectangle(X_GAP_THUMBNAIL, __itemHeight - 50, GetClientAreaBounds().width - X_GAP_THUMBNAIL, 50), IDA_SEARCH_ITEM_SUB_ELEMENT, *pArtistName);
423 pItem->SetElementTextVerticalAlignment(IDA_SEARCH_ITEM_SUB_ELEMENT, ALIGNMENT_TOP);
424 pArtistName->RemoveAllTextElements(true);
429 SearchForm::DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth)
431 AppLogDebug("ENTER");
438 SearchForm::UpdateItem(int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem)
440 AppLogDebug("ENTER");
445 SearchForm::GetDefaultItemHeight(void)
447 AppLogDebug("ENTER");
453 SearchForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView,
455 int elementId, Tizen::Ui::Controls::ListItemStatus status)
457 AppLogDebug("ENTER");
458 if (status != LIST_ITEM_STATUS_SELECTED)
463 if (index == __pPresentationModel->GetArtistIndex()
464 || index == __pPresentationModel->GetAlbumIndex()
465 || index == __pPresentationModel->GetSongIndex())
467 __pSearchBar->HideKeypad();
472 int albumIndex = __pPresentationModel->GetAlbumIndex();
473 int songIndex = __pPresentationModel->GetSongIndex();
475 ContentInformation* pContentInfo;
476 SceneManager* pSceneManager = SceneManager::GetInstance();
477 AppAssert(pSceneManager);
479 if (songIndex != -1 && index > songIndex) //song result
481 __pSearchBar->HideKeypad();
482 pContentInfo = __pPresentationModel->GetContentInfoN(index);
483 ArrayList* pPath = new (std::nothrow) ArrayList();
485 pPath->Add(*(new (std::nothrow) String(pContentInfo->ContentFilePath)));
487 ArrayList* pData = new (std::nothrow) ArrayList();
489 pData->Add(*(new (std::nothrow) String(MUSIC)));
490 pData->Add(*(new (std::nothrow) Integer(0)));
491 pData->Add(*(pPath));
493 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_PLAYER), pData);
495 else if (albumIndex != -1 && index > albumIndex)//album item
497 pContentInfo = __pPresentationModel->GetContentInfoN(index);
499 ArrayList* pData = new (std::nothrow) ArrayList();
501 pData->Add(*(new (std::nothrow) String(IDSCN_SEARCH)));
502 pData->Add(*(new (std::nothrow) String(pContentInfo->AlbumName)));
503 pData->Add(*(new (std::nothrow) Integer(index)));
505 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_CONTENT_LIST), pData);
509 pContentInfo = __pPresentationModel->GetContentInfoN(index);
511 ArrayList* pData = new (std::nothrow) ArrayList();
513 pData->Add(*(new (std::nothrow) String(IDSCN_ARTIST_LIST)));
514 pData->Add(*(new (std::nothrow) String(pContentInfo->ArtistName)));
516 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ARTIST_CONTENT_LIST), pData);
526 SearchForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
527 const Tizen::Ui::Scenes::SceneId& currentSceneId,
528 Tizen::Base::Collection::IList* pArgs)
530 AppLogDebug("ENTER");
531 if (__pSceneId == null)
533 __pSceneId = new (std::nothrow) String(previousSceneId);
536 if (__pPresentationModel->GetTotalContentCount() == 0)
538 FloatRectangle clientBounds = GetClientAreaBoundsF();
539 FloatRectangle searchBarBounds = __pSearchBar->GetBoundsF();
540 if (__pNoContentTextLabel == null)
542 __pNoContentTextLabel = new (std::nothrow) Label();
543 __pNoContentTextLabel->Construct(FloatRectangle(X_GAP,searchBarBounds.y+searchBarBounds.height,
544 GetWidth() - (X_GAP * 2),clientBounds.height - (searchBarBounds.height+searchBarBounds.y)),ResourceManager::GetString(L"IDS_COM_BODY_NO_ITEMS"));
545 __pNoContentTextLabel->SetTextConfig(SEARCH_FONT_SIZE, LABEL_TEXT_STYLE_BOLD);
546 AddControl(__pNoContentTextLabel);
550 __pNoContentTextLabel->SetBounds(FloatRectangle(X_GAP, (searchBarBounds.y+searchBarBounds.height),GetWidth() - (X_GAP * 2),clientBounds.height - (searchBarBounds.y+searchBarBounds.height)));
551 __pNoContentTextLabel->SetShowState(true);
556 pArgs->RemoveAll(true);
560 if (__pSearchBar->GetMode() != SEARCH_BAR_MODE_INPUT)
562 __pSearchBar->SetMode(SEARCH_BAR_MODE_INPUT);
569 if (__pNoContentTextLabel->GetShowState() == false)
572 __pNoContentTextLabel->SetShowState(false);
577 pArgs->RemoveAll(true);
584 SearchForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
585 const Tizen::Ui::Scenes::SceneId& nextSceneId)
587 AppLogDebug("ENTER");
589 if (__pSearchBar != null)
591 __pSearchBar->HideKeypad();
594 // __pPresentationModel->RemoveSearchResult();
595 // __pSearchTableView->UpdateTableView();
597 // if (__pSearchBar->GetKeypadAction() == true)
599 // __pSearchBar->HideKeypad();
602 // __pSearchBar->RemoveSearchBarEventListener(*this);
603 // __pSearchBar->RemoveKeypadEventListener(*this);
605 // __pSearchTableView->RemoveTableViewItemEventListener(*this);
606 // __pSearchTableView->RemoveTouchEventListener(*this);
607 // __pSearchTableView->RemoveScrollEventListener(*this);
612 SearchForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
614 AppLogDebug("ENTER");
615 SceneManager* pSceneManager = SceneManager::GetInstance();
616 AppAssert(pSceneManager);
617 AppLogDebug("OnActionPerformed : %d", actionId);
622 SearchForm::CreateGroupNameTableViewItem(Tizen::Ui::Controls::CustomItem* pItem, const Tizen::Base::String& GroupName)
624 AppLogDebug("ENTER");
625 result r = E_SUCCESS;
626 pItem->AddElement(Rectangle(10, 0, W_CLIENT_AREA, H_GROUP_NAME), IDA_GROUP_ITEM_ELEMENT, GroupName, MAIN_TEXT_SIZE, COLOR_GROUP_TEXT, COLOR_GROUP_TEXT, COLOR_GROUP_TEXT, true);
627 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, COLOR_GROUP_NAME_BG);
628 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_HIGHLIGHTED, COLOR_GROUP_NAME_BG);
629 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, COLOR_GROUP_NAME_BG);
630 pItem->SetElementTextHorizontalAlignment(IDA_GROUP_ITEM_ELEMENT, ALIGNMENT_LEFT);
631 pItem->SetElementSelectionEnabled(IDA_GROUP_ITEM_ELEMENT, false);
637 SearchForm::MakeQuery(const Tizen::Base::String& WhereExpr, const Tizen::Base::String& SearchName)
639 AppLogDebug("ENTER");
640 if (WhereExpr == null || SearchName == null)
645 String strMakeQuery = WhereExpr;
647 strMakeQuery.Append(L" like '%");
648 strMakeQuery.Append(SearchName);
649 strMakeQuery.Append(L"%'");
651 AppLogDebug("MakeQuery : %ls", strMakeQuery.GetPointer());
657 SearchForm::OnTouchDoublePressed (const Tizen::Ui::Control& source,
658 const Tizen::Graphics::Point& currentPosition,
659 const Tizen::Ui::TouchEventInfo& touchInfo)
661 AppLogDebug("ENTER");
666 SearchForm::OnTouchFocusIn (const Tizen::Ui::Control& source,
667 const Tizen::Graphics::Point& currentPosition,
668 const Tizen::Ui::TouchEventInfo& touchInfo)
670 AppLogDebug("ENTER");
675 SearchForm::OnTouchFocusOut (const Tizen::Ui::Control& source,
676 const Tizen::Graphics::Point& currentPosition,
677 const Tizen::Ui::TouchEventInfo& touchInfo)
679 AppLogDebug("ENTER");
684 SearchForm::OnTouchLongPressed (const Tizen::Ui::Control& source,
685 const Tizen::Graphics::Point& currentPosition,
686 const Tizen::Ui::TouchEventInfo& touchInfo)
688 AppLogDebug("ENTER");
693 SearchForm::OnTouchMoved (const Tizen::Ui::Control& source,
694 const Tizen::Graphics::Point& currentPosition,
695 const Tizen::Ui::TouchEventInfo& touchInfo)
697 AppLogDebug("ENTER");
702 SearchForm::OnTouchPressed (const Tizen::Ui::Control& source,
703 const Tizen::Graphics::Point& currentPosition,
704 const Tizen::Ui::TouchEventInfo& touchInfo)
706 AppLogDebug("ENTER");
711 SearchForm::OnTouchReleased (const Tizen::Ui::Control& source,
712 const Tizen::Graphics::Point& currentPosition,
713 const Tizen::Ui::TouchEventInfo& touchInfo)
715 AppLogDebug("ENTER");
720 SearchForm::OnScrollEndReached (Tizen::Ui::Control& source, Tizen::Ui::Controls::ScrollEndEvent type)
722 AppLogDebug( "ENTER");
723 AppLogDebug( "EXIT");
727 SearchForm::OnScrollPositionChanged (Tizen::Ui::Control& source, int scrollPos)
729 AppLogDebug( "ENTER");
730 AppLogDebug( "EXIT");
734 SearchForm::OnScrollStopped (Tizen::Ui::Control& source)
736 AppLogDebug( "ENTER");
737 AppLogDebug( "EXIT");
741 SearchForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
743 AppLogDebug("ENTER");
744 __pPresentationModel->RemoveSearchResult();
745 SceneManager* pSceneManager = SceneManager::GetInstance();
746 AppAssert(pSceneManager);
747 pSceneManager->GoForward(ForwardSceneTransition(__pSceneId->GetPointer(), SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY));
752 SearchForm::OnMusicContentUpdateCompleted(void)
754 AppLogDebug("ENTER");
755 if (__pSearchBar->GetText().GetLength() != INIT_VALUE)
757 __pPresentationModel->InitializeContentList(__pSearchBar->GetText());
761 __pPresentationModel->RemoveSearchResult();
764 if (__pSearchListView != null)
766 __pSearchListView->UpdateList();
767 __pSearchListView->ScrollToItem(INIT_VALUE);
773 SearchForm::OnFontSizeChanged(void)
775 __fontSizeValue = CommonUtil::GetFontSizeValue();
776 __itemHeight = CommonUtil::GetItemHeight(__fontSizeValue);
777 __fontSize = CommonUtil::GetFontSize(__fontSizeValue);
778 __pSearchListView->UpdateList();
782 SearchForm::OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction)
784 // Empty Implementation
788 SearchForm::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus status)
790 // Empty Implementation
794 SearchForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
796 FloatRectangle clientRect = GetClientAreaBoundsF();
797 __pSearchBar->SetBounds(Rectangle(0, 0, clientRect.width, H_SEARCH_BAR));
798 FloatRectangle searchBarBounds = CoordinateSystem::AlignToDevice(FloatRectangle(__pSearchBar->GetBoundsF()));
799 __pSearchBar->SetContentAreaSize(FloatDimension(clientRect.width, clientRect.height - searchBarBounds.height));
800 __pSearchListView->SetSize(FloatDimension(clientRect.width, clientRect.height - __pSearchBar->GetHeightF()));
801 if (__pNoContentTextLabel != null)
803 __pNoContentTextLabel->SetBounds(Rectangle(X_GAP,(searchBarBounds.y+searchBarBounds.height),GetWidth() - (X_GAP * 2),clientRect.height-(searchBarBounds.y+searchBarBounds.height)));