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 MpCommonUtil.cpp
19 * @brief This is the implementation file for CommonUtil class.
22 #include <unique_ptr.h>
23 #include "MpCommonUtil.h"
25 using namespace Tizen::App;
26 using namespace Tizen::Base;
27 using namespace Tizen::Base::Collection;
28 using namespace Tizen::Base::Utility;
29 using namespace Tizen::Content;
30 using namespace Tizen::Graphics;
31 using namespace Tizen::Io;
32 using namespace Tizen::System;
33 using namespace Tizen::Ui;
34 using namespace Tizen::Ui::Controls;
35 using namespace Tizen::Ui::Scenes;
37 static const int H_CREATE_TABLE_VIEW_ITEM = 70;
38 static const int Y_CREATE_TABLE_VIEW_ITEM = 29;
39 static const int W_CREATE_TABLE_VIEW_ITEM_COUNT_LABEL_ITEM = 170;
40 static const int DEPTH = 3;
42 const wchar_t* SECTION_MUSIC_SETTING = L"MUSIC_SETTING";
43 const wchar_t* INITIAL_TAB = L"INITIAL_TAB"; // 0 - 7
44 const wchar_t* SONGS_TAB = L"SONGS_TAB"; // 0 - 1 (UNCHECKED, CHECKED)
45 const wchar_t* ALBUMS_TAB = L"ALBUMS_TAB"; // 0 - 1 (UNCHECKED, CHECKED)
46 const wchar_t* ARTISTS_TAB = L"ARTISTS_TAB"; // 0 - 1 (UNCHECKED, CHECKED)
47 const wchar_t* GENRES_TAB = L"GENRES_TAB"; // 0 - 1 (UNCHECKED, CHECKED)
48 const wchar_t* COMPOSERS_TAB = L"COMPOSERS_TAB"; // 0 - 1 (UNCHECKED, CHECKED)
49 const wchar_t* YEARS_TAB = L"YEARS_TAB"; // 0 - 1 (UNCHECKED, CHECKED)
50 const wchar_t* FOLDERS_TAB = L"FOLDERS_TAB"; // 0 - 1 (UNCHECKED, CHECKED)
51 const wchar_t* PLAYERLISTS_TAB = L"PLAYERLISTS_TAB"; // 0 - 1 (UNCHECKED, CHECKED)
52 const wchar_t* AUTO_OFF_LEVEL = L"AUTO_OFF_LEVEL"; // 0 - 5 (OFF, 15 MIN, 30 MIN, 1 HOUR, 1 HOUR 30 MIN, 2 HOURS)
53 const wchar_t* MOST_PLAYED = L"MOST_PLAYED"; // 0 - 1 (UNCHECKED, CHECKED)
54 const wchar_t* RECENTLY_PLAYED = L"RECENTLY_PLAYED"; // 0 - 1 (UNCHECKED, CHECKED)
55 const wchar_t* RECENTLY_ADD = L"RECENTLY_ADD"; // 0 - 1 (UNCHECKED, CHECKED)
56 const wchar_t* REPEAT_MODE = L"REPEAT_MODE"; // 0 - 2 (OFF, ONE, ALL)
57 const wchar_t* SHUFFLE_MODE = L"SHUFFLE_MODE"; // 0 - 1 (OFF, ON)
58 const wchar_t* VOLUME_LEVEL = L"VOLUME_LEVEL"; // 0 - 15
60 static const wchar_t* IDS_ORIGINAL_QUOTATION = L"'";
61 static const wchar_t* IDS_REPLACE_QUOTATION = L"\\'";
62 static const wchar_t* STRING_QUERY_PREFIX = L" ='";
63 static const wchar_t* STRING_QUERY_SUFFIX = L"'";
64 static const wchar_t* IDS_ORIGIONAL_PERCENTAGE = L"%";
65 static const wchar_t* IDS_REPLACE_PERCENTAGE = L"\\%";
66 static const wchar_t* IDS_ORIGIONAL_DOUBLESLASH = L"\\";
67 static const wchar_t* IDS_REPLACE_DOUBLESLASH = L"\\\\";
71 static bool __addToPlaylistState = false;
72 static Tizen::Base::String __AddToPlaylistName = null;
74 static const int Y_GAP_CONTENT_PIKER_ITEM = 16;
75 static const int W_SONG_TITLE_CONTENT_PIKER_ITEM = 440;
76 static const int H_SONG_TITLE_CONTENT_PIKER_ITEM = 88;
77 static const int W_SONG_TIME_CONTENT_PIKER_ITEM = 155;
79 Tizen::Graphics::Bitmap*
80 CommonUtil::GetContentAlbumArtN(Tizen::Base::String& path)
83 Tizen::Graphics::Bitmap* pBitmap = null;
85 AppLogDebug("path(%ls)", path.GetPointer());
86 Tizen::Content::AudioMetadata* pAudioMeta = Tizen::Content::ContentManagerUtil::GetAudioMetaN(path);
87 if (pAudioMeta == null)
93 pBitmap = pAudioMeta->GetAlbumArtN();
100 Tizen::Content::AudioContentInfo*
101 CommonUtil::GetAudioContentInfoN(const Tizen::Base::String& filePath)
103 AppLogDebug("ENTER");
104 ContentId contentId = GetContentId(filePath);
105 AppLogDebug("Audio ContentID = %ls for file = %ls", contentId.ToString().GetPointer(),filePath.GetPointer());
107 if (IsFailed(GetLastResult()))
109 AppLogDebug("filePath(%ls) failed", filePath.GetPointer());
110 SetLastResult(E_FAILURE);
114 ContentInfo* pContentInfo = GetContentInfoN(contentId);
115 if (pContentInfo == null || pContentInfo->GetContentType() != CONTENT_TYPE_AUDIO)
117 AppLogDebug("GetContentInfoN(%ls) failed", contentId.ToString().GetPointer());
119 SetLastResult(E_FAILURE);
124 return static_cast<AudioContentInfo*>(pContentInfo);
127 Tizen::Base::Collection::IList*
128 CommonUtil::ContentSearchResultListN(const Tizen::Base::String& contentFileName,
129 const Tizen::Base::String& ColumnName,
130 const Tizen::Base::String& sortColumn,
131 Tizen::Base::SortOrder sortOrder)
133 AppLogDebug("ENTER");
134 String WhereExpr = contentFileName;
135 WhereExpr.Replace(IDS_ORIGIONAL_DOUBLESLASH, IDS_REPLACE_DOUBLESLASH);
136 WhereExpr.Replace(IDS_ORIGINAL_QUOTATION, IDS_REPLACE_QUOTATION);
137 WhereExpr.Replace(IDS_ORIGIONAL_PERCENTAGE, IDS_REPLACE_PERCENTAGE);
138 //WhereExpr = CommonUtil::SpecialReplaceChange(contentFileName);
139 WhereExpr = CommonUtil::MakeQuery(ColumnName, WhereExpr);
141 Tizen::Base::Collection::IList* pSearchList = CommonUtil::SearchContentList(WhereExpr, sortColumn);
142 if (pSearchList == null)
144 SetLastResult(E_FAILURE);
145 AppLogDebug("CommonUtil::SearchContentList failed");
153 CommonUtil::FilePathToContentFileName(const Tizen::Base::String& filePath)
155 AppLogDebug("ENTER");
156 String tempWhereClause = filePath;
158 String contentFileName;
160 tempWhereClause.LastIndexOf(L"/", tempWhereClause.GetLength() - 1, indexOf);
161 tempWhereClause.SubString(indexOf + 1, contentFileName);
164 return contentFileName;
167 Tizen::Content::ContentId
168 CommonUtil::GetContentId(const Tizen::Base::String& filePath)
170 AppLogDebug("ENTER");
171 String contentFileName = FilePathToContentFileName(filePath);
172 AppLogDebug("filePath(%ls), contentFileName(%ls)",filePath.GetPointer(), contentFileName.GetPointer() );
173 IList* pContentSearchResultList = ContentSearchResultListN(contentFileName, STRING_SORT_FILE_NAME, STRING_SORT_TITLE);
174 if (pContentSearchResultList == null || pContentSearchResultList->GetCount() == 0)
176 SetLastResult(E_FAILURE);
177 delete pContentSearchResultList;
178 AppLogDebug("CommonUtil::ContentSearchResultListN(%ls) failed", filePath.GetPointer());
182 ContentSearchResult* pResult = null;
183 ContentInfo* pContentInfo = null;
185 IEnumerator* pEnum = pContentSearchResultList->GetEnumeratorN();
188 while (pEnum->MoveNext() == E_SUCCESS)
190 pResult = static_cast<ContentSearchResult*>(pEnum->GetCurrent());
191 ContentInfo* pTempContentInfo = pResult->GetContentInfo();
193 AppLogDebug("filePath(%ls), pTempContentInfo(%ls)", filePath.GetPointer(), pTempContentInfo->GetContentPath().GetPointer());
194 if (filePath.Equals(pTempContentInfo->GetContentPath()) == true)
196 pContentInfo = pTempContentInfo;
204 ContentId contentId = ContentId();
206 if (pContentInfo == null)
208 SetLastResult(E_FAILURE);
209 AppLogDebug("Content search failed");
213 contentId = pContentInfo->GetContentId();
216 pContentSearchResultList->RemoveAll(true);
217 delete pContentSearchResultList;
223 Tizen::Content::ContentInfo*
224 CommonUtil::GetContentInfoN(const Tizen::Content::ContentId& contentId)
226 AppLogDebug("ENTER");
227 ContentManager contentManager;
228 result r = contentManager.Construct();
231 AppLogDebug("contentManager.Construct() failed(%s)", GetErrorMessage(r));
235 ContentInfo* pContentInfo = contentManager.GetContentInfoN(contentId);
241 CommonUtil::StringToContentId(const Tizen::Base::String& contentIdString, Tizen::Content::ContentId& outContentId)
243 AppLogDebug("ENTER");
244 ContentId pcontentId;
246 result r = pcontentId.Parse(contentIdString, uuId);
249 AppLogDebug("pcontentId.Parse(%s, outContentId) failed", contentIdString.GetPointer());
259 CommonUtil::GetFormatDate(long dateValue)
261 // AppLogDebug("ENTER");
265 // fTime.Format(20, L"%02d:%02d:%02d", 0, 0, 0);
266 fTime.Format(20, L"%02d:%02d", 0, 0);
271 // dateTime.AddSeconds(dateValue / 1000);
272 // dateTime.SetValue(dateValue);
273 dateTime.AddMilliseconds(dateValue);
274 // fTime.Format(20, L"%02d:%02d:%02d", dateTime.GetHour(), dateTime.GetMinute(), dateTime.GetSecond());
275 if(dateTime.GetHour())
277 fTime.Format(20, L"%d:%02d:%02d",dateTime.GetHour(), dateTime.GetMinute(), dateTime.GetSecond());
281 fTime.Format(20, L"%02d:%02d",dateTime.GetMinute(), dateTime.GetSecond());
284 // AppLogDebug("EXIT");
289 CommonUtil::SpecialReplaceChange(const Tizen::Base::String& text)
291 AppLogDebug("ENTER");
295 retStr.Replace(IDS_ORIGIONAL_DOUBLESLASH, IDS_REPLACE_DOUBLESLASH);
296 retStr.Replace(IDS_ORIGINAL_QUOTATION, IDS_REPLACE_QUOTATION);
297 retStr.Replace(IDS_ORIGIONAL_PERCENTAGE, IDS_REPLACE_PERCENTAGE);
303 Tizen::Base::Collection::IList*
304 CommonUtil::SearchContentList(const Tizen::Base::String& whereExpr,
305 const Tizen::Base::String& sortColumn,
306 Tizen::Base::SortOrder sortOrder)
308 AppLogDebug("ENTER");
309 AppLogDebug("%ls, %ls", whereExpr.GetPointer(), sortColumn.GetPointer());
313 ContentSearch search;
314 search.Construct(CONTENT_TYPE_AUDIO);
315 IList* pSearchList = search.SearchN(SEARCH_PAGE_NO, SEARCH_COUNT_PER_PAGE, totalPage, totalCount, whereExpr, sortColumn, sortOrder);
316 if (pSearchList == null)
318 AppLogDebug("pSearchList is null");
322 AppLogDebug("%d", pSearchList->GetCount());
327 Tizen::Base::Collection::IList*
328 CommonUtil::SearchContentList(const Tizen::Base::String& columnName)
330 AppLogDebug("ENTER");
334 ContentSearch search;
335 search.Construct(CONTENT_TYPE_AUDIO);
337 IList* pSearchList = search.GetValueListN(SEARCH_PAGE_NO, SEARCH_COUNT_PER_PAGE, totalPage, totalCount, columnName, SORT_ORDER_ASCENDING);
338 if (pSearchList == null)
340 AppLogDebug("pSearchList is null");
349 CommonUtil::MakeQuery(const Tizen::Base::String& ColumnName,
350 const Tizen::Base::String& SerachName)
352 AppLogDebug("ENTER");
353 String makeQueryName;
354 result r = E_SUCCESS;
356 r = makeQueryName.Append(ColumnName);
357 TryCatch(r == E_SUCCESS, , "String::MakeQuery() fail[%s]", GetErrorMessage(r));
359 r = makeQueryName.Append(STRING_QUERY_PREFIX);
360 TryCatch(r == E_SUCCESS, , "String::MakeQuery() fail[%s]", GetErrorMessage(r));
362 r = makeQueryName.Append(SerachName);
363 TryCatch(r == E_SUCCESS, , "String::MakeQuery() fail[%s]", GetErrorMessage(r));
365 r = makeQueryName.Append(STRING_QUERY_SUFFIX);
366 TryCatch(r == E_SUCCESS, , "String::MakeQuery() fail[%s]", GetErrorMessage(r));
369 return makeQueryName;
372 makeQueryName.Clear();
373 return makeQueryName;
377 CommonUtil::GetValue(const Tizen::Base::String& entryName)
379 AppLogDebug("ENTER");
380 result r = E_SUCCESS;
382 AppRegistry* pAppRegistry = null;
383 pAppRegistry = UiApp::App::GetInstance()->GetAppRegistry();
384 TryCatch(pAppRegistry != null, , "Failed to Find AppRegistry!");
385 r = pAppRegistry->Get(entryName, value);
386 if (r == E_KEY_NOT_FOUND)
388 AppLogDebug("registry initialize.");
389 r = pAppRegistry->Add(MOST_PLAYED, 1);
390 r = pAppRegistry->Add(RECENTLY_PLAYED, 1);
391 r = pAppRegistry->Add(RECENTLY_ADD, 1);
392 r = pAppRegistry->Add(AUTO_OFF_LEVEL, 0);
393 r = pAppRegistry->Add(REPEAT_MODE, 2);
394 r = pAppRegistry->Add(SHUFFLE_MODE, 0);
395 r = pAppRegistry->Add(VOLUME_LEVEL, 5);
396 r = pAppRegistry->Save();
398 pAppRegistry->Get(entryName, value);
404 //AppLogDebug("CATCH : %s", GetErrorMessage(r));
409 CommonUtil::SetValue(const Tizen::Base::String& entryName, const int value)
411 AppLogDebug("ENTER");
412 result r = E_SUCCESS;
413 AppRegistry* pAppRegistry = null;
414 pAppRegistry = UiApp::App::GetInstance()->GetAppRegistry();
415 TryCatch(pAppRegistry != null, , "Failed to Find AppRegistry!");
416 r = pAppRegistry->Set(entryName, value);
417 if (r == E_KEY_NOT_FOUND)
419 AppLogDebug("registry initialize.");
420 r = pAppRegistry->Add(MOST_PLAYED, 1);
421 r = pAppRegistry->Add(RECENTLY_PLAYED, 1);
422 r = pAppRegistry->Add(RECENTLY_ADD, 1);
423 r = pAppRegistry->Add(AUTO_OFF_LEVEL, 0);
424 r = pAppRegistry->Add(REPEAT_MODE, 2);
425 r = pAppRegistry->Add(SHUFFLE_MODE, 0);
426 r = pAppRegistry->Add(VOLUME_LEVEL, 5);
427 r = pAppRegistry->Set(entryName, value);
428 r = pAppRegistry->Save();
432 pAppRegistry->Save();
438 //AppLogDebug("CATCH : %s", GetErrorMessage(r));
443 CommonUtil::ShowNowPlayPanel(Tizen::Ui::Controls::TableView& tableView,
444 const bool playStatus,
445 Tizen::Graphics::Rectangle clientBounds)
447 AppLogDebug("ENTER");
448 if (playStatus == true)
450 tableView.SetBounds(Rectangle(0, H_NOW_PLAY_BAR, clientBounds.width, clientBounds.height - H_NOW_PLAY_BAR));
451 tableView.Invalidate(true);
455 tableView.SetBounds(Rectangle(0, 0, clientBounds.width, clientBounds.height));
456 tableView.Invalidate(true);
462 CommonUtil::GetContentInfo(const ContentInformation& contentInfoStruct,
463 const Tizen::Base::String& SceneId)
465 AppLogDebug("ENTER");
468 if (SceneId.Equals(IDSCN_ALBUM_LIST, true) || SceneId.Equals(IDSCN_SEARCH, true))
470 retString = contentInfoStruct.AlbumName;
472 else if (SceneId.Equals(IDSCN_ARTIST_ALBUM_LIST, true))
474 retString = contentInfoStruct.AlbumName;
476 else if (SceneId.Equals(IDSCN_GENRE_LIST, true))
478 retString = contentInfoStruct.GenreName;
480 else if (SceneId.Equals(IDSCN_COMPOSER_LIST, true))
482 retString = contentInfoStruct.ComposerName;
484 else if (SceneId.Equals(IDSCN_YEAR_LIST, true))
486 retString = Integer::ToString(contentInfoStruct.ReleaseYear);;
487 if (retString.Equals(L"0", true))
489 retString = STRING_UNKNOWN;
492 else if (SceneId.Equals(IDSCN_FOLDER_LIST, true))
494 retString = contentInfoStruct.ContentFilePath;
496 else if (SceneId.Equals(IDSCN_PLAYLIST_LIST, true))
498 retString = contentInfoStruct.TitleName;
505 CommonUtil::SetSongsString(const int temp)
507 AppLogDebug("ENTER");
512 strSongs.Append(ResourceManager::GetString("IDS_GC_BODY_1_SONG"));
513 strFormat.Append(strSongs);
517 strSongs.Append(ResourceManager::GetString("IDS_GC_BODY_PD_SONGS"));
518 strFormat.Format(STRING_LENGTH, strSongs.GetPointer(), temp);
526 CommonUtil::ShowCheckedCountLabel(Tizen::Ui::Controls::Label& checkCountLabel, int itemCount, Tizen::Ui::Controls::TableView& tableView, const Tizen::Ui::Controls::Form& form)
528 AppLogDebug("ENTER");
531 int width = form.GetClientAreaBounds().width;
532 int height = form.GetClientAreaBounds().height;
534 if (itemCount == INIT_VALUE)
536 checkCountLabel.SetShowState(false);
537 checkCountLabel.Invalidate(true);
538 tableView.SetBounds(Rectangle(INIT_VALUE, H_SELECT_ALL_BUTTON, width, height - H_SELECT_ALL_BUTTON));
543 resSelect = ResourceManager::GetString("IDS_COM_BODY_SELECTED");
544 resSelect.Append(L"(%d)");
546 strSelectStr.Format(STRING_LENGTH, resSelect.GetPointer(), itemCount);
548 checkCountLabel.SetText(strSelectStr);
549 checkCountLabel.SetShowState(true);
550 checkCountLabel.Invalidate(true);
552 // tableView.SetBounds(Rectangle(INIT_VALUE, H_SELECT_ALL_BUTTON, width, height - H_SELECT_ALL_BUTTON - checkCountLabel.GetBounds().height));
553 tableView.Invalidate(true);
558 CommonUtil::ShowSelectAllCheckButton(Tizen::Ui::Controls::CheckButton& checkButton)
560 AppLogDebug("ENTER");
561 if (checkButton.IsEnabled() == true)
563 checkButton.SetSelected(false);
564 checkButton.Invalidate(true);
570 CommonUtil::SetAllCheckState(bool state,
571 Tizen::Ui::Controls::TableView& tableView,
574 AppLogDebug("ENTER");
576 for (int iCount = INIT_VALUE; iCount < totalCount; iCount++)
578 tableView.SetItemChecked(iCount, state);
580 tableView.Invalidate(true);
585 CommonUtil::SetFastScrollIndex(Tizen::Ui::Controls::TableView& tableview)
587 AppLogDebug("ENTER");
590 Tizen::System::SettingInfo::GetValue("http://tizen.org/setting/locale.country", retCountry);
592 if (retCountry.CompareTo("eng_GB") == 0)
594 indexText.Append(L"ABCDEFGHIJKLMNOPQRSTUVWXYZ");
596 else if(retCountry.CompareTo("kor_KR") == 0)
598 // indexText.Append(L"ㄱㄲㄴㄷㄸㄹㅁㅂㅃㅅㅆㅇㅈㅉㅊㅋㅌㅍㅎ");
599 indexText.Append(L"ABCDEFGHIJKLMNOPQRSTUVWXYZ#0");
602 indexText.Append(L"#");
603 indexText.Append(L"0");
605 tableview.SetFastScrollIndex(indexText, false);
612 CommonUtil::SetLayoutFitToContainer(const Tizen::Ui::Container& container, Tizen::Ui::Control& childControl)
614 AppLogDebug("ENTER");
615 RelativeLayout* pLayout = dynamic_cast<RelativeLayout*>(container.GetPortraitLayoutN());
618 pLayout->SetHorizontalFitPolicy(childControl, FIT_POLICY_PARENT);
619 pLayout->SetVerticalFitPolicy(childControl, FIT_POLICY_PARENT);
623 pLayout = dynamic_cast<RelativeLayout*>(container.GetLandscapeLayoutN());
626 pLayout->SetHorizontalFitPolicy(childControl, FIT_POLICY_PARENT);
627 pLayout->SetVerticalFitPolicy(childControl, FIT_POLICY_PARENT);
635 CommonUtil::SetFooterItemEnabled(Tizen::Ui::Controls::Footer& pFooter, bool enable)
637 AppLogDebug("ENTER");
638 for (int iCount = 0; iCount < pFooter.GetItemCount(); iCount++)
640 pFooter.SetItemEnabled(iCount, enable);
642 pFooter.Invalidate(true);
647 CommonUtil::SetTabHeaderStyle(Tizen::Ui::Controls::Header& pHeader)
649 AppLogDebug("ENTER");
650 pHeader.RemoveAllButtons();
651 pHeader.RemoveAllItems();
653 pHeader.SetStyle(HEADER_STYLE_TAB);
654 pHeader.SetTitleTextColor(COLOR_HEADER_TITLE_TEXT);
656 for (int iCount = 0; iCount < HEAD_ITEM_COUNT; iCount++)
658 HeaderItem pTabHeaderItem;
659 pTabHeaderItem.Construct(IDA_HEADER_BUTTON_SONG + iCount);
660 pTabHeaderItem.SetText(ResourceManager::GetString(TabNameId[iCount]));
662 pHeader.AddItem(pTabHeaderItem);
664 pHeader.SetTabEditModeEnabled(false);
669 CommonUtil::SetEditHeaderStyle(Tizen::Ui::Controls::Header& pHeader, const Tizen::Base::String& titleText)
671 AppLogDebug("ENTER");
672 pHeader.RemoveAllButtons();
673 pHeader.RemoveAllItems();
675 pHeader.SetStyle(HEADER_STYLE_TITLE);
676 pHeader.SetTitleText(titleText);
678 ButtonItem buttonItem;
679 buttonItem.Construct(BUTTON_ITEM_STYLE_ICON, IDA_HEADER_BUTTON_SELECTE_ALL);
681 Bitmap* normal = ResourceManager::GetBitmapN(L"00_icon_select_all_web.png");
682 buttonItem.SetIcon(BUTTON_ITEM_STATUS_NORMAL, normal);
684 Bitmap* pressed = ResourceManager::GetBitmapN(L"00_icon_select_all_press_web.png");
685 buttonItem.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pressed);
687 Bitmap* disable = ResourceManager::GetBitmapN(L"00_icon_select_all_dim_web.png");
688 buttonItem.SetIcon(BUTTON_ITEM_STATUS_DISABLED, disable);
690 pHeader.SetButton(BUTTON_POSITION_RIGHT, buttonItem);
691 pHeader.SetTitleTextColor(COLOR_HEADER_TITLE_TEXT);
700 CommonUtil::SetButtonItemUnCheckedIcon(Tizen::Ui::Controls::Header& header)
702 AppLogDebug("ENTER");
703 header.RemoveAllButtons();
704 ButtonItem buttonItem;
705 buttonItem.Construct(BUTTON_ITEM_STYLE_ICON, IDA_HEADER_BUTTON_CHECK_BOX_CHECKED_ICON);
707 Bitmap* pBgNormal = ResourceManager::GetBitmapN(L"00_check_bg.png");
708 buttonItem.SetBackgroundBitmap(BUTTON_ITEM_STATUS_NORMAL, pBgNormal);
710 Bitmap* pBgPressed = ResourceManager::GetBitmapN(L"00_check_bg_press.png");
711 buttonItem.SetBackgroundBitmap(BUTTON_ITEM_STATUS_PRESSED, pBgPressed);
713 Bitmap* pBgDisabled = ResourceManager::GetBitmapN(L"00_check_bg_press.png");
714 buttonItem.SetBackgroundBitmap(BUTTON_ITEM_STATUS_DISABLED, pBgDisabled);
716 header.SetButton(BUTTON_POSITION_RIGHT, buttonItem);
717 header.Invalidate(true);
726 CommonUtil::SetItemCheckedAll(bool isChecked, Tizen::Ui::Controls::TableView& tableView)
728 AppLogDebug("ENTER");
729 int totalCount = tableView.GetItemCount();
730 for (int iCount = INIT_VALUE; iCount < totalCount; iCount++)
732 tableView.SetItemChecked(iCount, isChecked);
734 tableView.Invalidate(true);
739 CommonUtil::SetButtonItemCheckedIcon(Tizen::Ui::Controls::Header& header)
741 AppLogDebug("ENTER");
742 header.RemoveAllButtons();
743 ButtonItem buttonItem;
744 buttonItem.Construct(BUTTON_ITEM_STYLE_ICON, IDA_HEADER_BUTTON_CHECK_BOX_UNCHECKED_ICON);
746 Bitmap* pBgNormal = ResourceManager::GetBitmapN(L"00_check_bg.png");
747 buttonItem.SetBackgroundBitmap(BUTTON_ITEM_STATUS_NORMAL, pBgNormal);
749 Bitmap* pBgPressed = ResourceManager::GetBitmapN(L"00_check_bg_press.png");
750 buttonItem.SetBackgroundBitmap(BUTTON_ITEM_STATUS_PRESSED, pBgPressed);
752 Bitmap* pBgDisabled = ResourceManager::GetBitmapN(L"00_check_bg_press.png");
753 buttonItem.SetBackgroundBitmap(BUTTON_ITEM_STATUS_DISABLED, pBgDisabled);
755 Bitmap* pIconChecked = ResourceManager::GetBitmapN(L"00_check_checking.png");
756 buttonItem.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pIconChecked);
757 buttonItem.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pIconChecked);
758 buttonItem.SetIcon(BUTTON_ITEM_STATUS_DISABLED, pIconChecked);
760 header.SetButton(BUTTON_POSITION_RIGHT, buttonItem);
761 header.Invalidate(true);
770 Tizen::Ui::Controls::Popup*
771 CommonUtil::CreateContentDeletePopup(Tizen::Ui::IActionEventListener& listener, int deleteActionId, int cancelActionId)
773 AppLogDebug("ENTER");
774 Popup* pDeletePopup = new (std::nothrow) Popup();
775 if (IsFailed(pDeletePopup->Construct(IDL_CONTENTS_DELETE_POPUP)))
778 AppLogDebug("Construct(IDL_CONTENTS_DELETE_POPUP))) failed(%s)", GetErrorMessage(GetLastResult()));
782 Button* pDeleteButton = static_cast<Button*>(pDeletePopup->GetControl(IDC_DELETE_BUTTON));
783 pDeleteButton->SetText(ResourceManager::GetString(L"IDS_MUSIC_OPT_DELETE"));
784 pDeleteButton->SetActionId(deleteActionId);
785 pDeleteButton->AddActionEventListener(listener);
787 Button* CancelButton = static_cast<Button*>(pDeletePopup->GetControl(IDC_CANCEL_BUTTON));
788 CancelButton->SetText(ResourceManager::GetString(L"IDS_COM_BODY_EDIT_CANCEL"));
789 CancelButton->SetActionId(cancelActionId);
790 CancelButton->AddActionEventListener(listener);
792 Label* pDeleteQustionLabel = static_cast<Label*>(pDeletePopup->GetControl(IDC_LABEL_DELETE_Q));
793 pDeleteQustionLabel->SetText(ResourceManager::GetString(L"IDS_MUSIC_POP_DELETE_Q"));
799 Tizen::Ui::Controls::TableViewContextItem*
800 CommonUtil::CreateTableViewContextItemN(Tizen::Ui::IActionEventListener& listener, int itemWidth, FlickMenuStyle menuStyle)
802 AppLogDebug("ENTER");
803 Panel* pItem = CommonUtil::CreateFlickMenuN(listener, menuStyle);
806 AppLogDebug("CommonUtil::CreateSweepMenuItemN failed");
810 TableViewContextItem* pTableViewContextItem = new (std::nothrow) TableViewContextItem();
811 String fontSizeValue = GetFontSizeValue();
812 int itemHeight = GetItemHeight(fontSizeValue);
814 if (IsFailed(pTableViewContextItem->Construct(Dimension(itemWidth, itemHeight))))
816 AppLogDebug("Construct(Dimension(GetWidth(), ITEM_HEIGHT) failed(%s)", GetErrorMessage(GetLastResult()));
818 delete pTableViewContextItem;
822 pTableViewContextItem->AddControl(pItem);
823 pTableViewContextItem->SetIndividualSelectionEnabled(pItem, true);
825 Form* pForm = dynamic_cast<Form*>(UiApp::GetInstance()->GetAppFrame()->GetFrame()->GetCurrentForm());
828 if (pForm->GetBounds().width == 1200 || pForm->GetBounds().height == 1200)
830 int controlCount = pItem->GetControlCount();
831 if (controlCount != INIT_VALUE)
833 Tizen::Ui::GridLayout* pGridLayout = dynamic_cast<Tizen::Ui::GridLayout*>(pItem->GetLandscapeLayoutN());
834 if (pGridLayout != null)
837 if (controlCount == 1)
842 pGridLayout->SetColumnSpacing(controlCount, margin);
843 pGridLayout->Update();
851 return pTableViewContextItem;
854 Tizen::Ui::Controls::Panel*
855 CommonUtil::CreateFlickMenuN(Tizen::Ui::IActionEventListener& listener, FlickMenuStyle menuStyle)
857 AppLogDebug("ENTER");
858 Panel* pFlickMenuPanel = new (std::nothrow) Panel();
859 String fontSizeValue = GetFontSizeValue();
861 if (menuStyle ==FLICK_MENU_STYLE_TYPE_01)
863 if (fontSizeValue.Equals(STRING_FONT_SIZE_GIANT, false))
865 if (IsFailed(pFlickMenuPanel->Construct(IDL_SWEEP_QUICK_MENU_ITEM_PANEL_FONT_SIZE_GIANT)))
867 AppLogDebug("Construct(IDL_SWEEP_QUICK_MENU_ITEM_PANEL_FONT_SIZE_GIANT) failed(%s)", GetErrorMessage(GetLastResult()));
871 else if (fontSizeValue.Equals(STRING_FONT_SIZE_HUGE, false))
873 if (IsFailed(pFlickMenuPanel->Construct(IDL_SWEEP_QUICK_MENU_ITEM_PANEL_FONT_SIZE_HUGE)))
875 AppLogDebug("Construct(IDL_SWEEP_QUICK_MENU_ITEM_PANEL_FONT_SIZE_HUGE) failed(%s)", GetErrorMessage(GetLastResult()));
879 else if (fontSizeValue.Equals(STRING_FONT_SIZE_LARGE, false))
881 if (IsFailed(pFlickMenuPanel->Construct(IDL_SWEEP_QUICK_MENU_ITEM_PANEL_FONT_SIZE_LARGE)))
883 AppLogDebug("Construct(IDL_SWEEP_QUICK_MENU_ITEM_PANEL_FONT_SIZE_LARGE) failed(%s)", GetErrorMessage(GetLastResult()));
889 if (IsFailed(pFlickMenuPanel->Construct(IDL_SWEEP_QUICK_MENU_ITEM_PANEL_DEFAULT)))
891 AppLogDebug("Construct(IDL_SWEEP_QUICK_MENU_ITEM_PANEL_DEFAULT) failed(%s)", GetErrorMessage(GetLastResult()));
896 else if (menuStyle == FLICK_MENU_STYLE_TYPE_02)
898 if (fontSizeValue.Equals(STRING_FONT_SIZE_GIANT, false))
900 if (IsFailed(pFlickMenuPanel->Construct(IDL_SWEEP_QUICK_ALBUM_PANEL_FONT_SIZE_GIANT)))
902 AppLogDebug("Construct(IDL_SWEEP_QUICK_ALBUM_PANEL_FONT_SIZE_GIANT) failed(%s)", GetErrorMessage(GetLastResult()));
906 else if (fontSizeValue.Equals(STRING_FONT_SIZE_HUGE, false))
908 if (IsFailed(pFlickMenuPanel->Construct(IDL_SWEEP_QUICK_ALBUM_PANEL_FONT_SIZE_HUGE)))
910 AppLogDebug("Construct(IDL_SWEEP_QUICK_MENU_ITEM_PANEL_FONT_SIZE_HUGE) failed(%s)", GetErrorMessage(GetLastResult()));
914 else if (fontSizeValue.Equals(STRING_FONT_SIZE_LARGE, false))
916 if (IsFailed(pFlickMenuPanel->Construct(IDL_SWEEP_QUICK_ALBUM_PANEL_FONT_SIZE_LARGE)))
918 AppLogDebug("Construct(IDL_SWEEP_QUICK_MENU_ITEM_PANEL_FONT_SIZE_LARGE) failed(%s)", GetErrorMessage(GetLastResult()));
924 if (IsFailed(pFlickMenuPanel->Construct(IDL_SWEEP_QUICK_ALBUM_PANEL_DEFAULT)))
926 AppLogDebug("Construct(IDL_SWEEP_QUICK_MENU_ITEM_PANEL_DEFAULT) failed(%s)", GetErrorMessage(GetLastResult()));
931 else if (menuStyle == FLICK_MENU_STYLE_TYPE_03)
933 if (fontSizeValue.Equals(STRING_FONT_SIZE_GIANT, false))
935 if (IsFailed(pFlickMenuPanel->Construct(IDL_SWEEP_QUICK_PLAYALL_ITEM_PANEL_FONT_SIZE_GIANT)))
937 AppLogDebug("Construct(IDL_SWEEP_QUICK_PLAYALL_ITEM_PANEL_FONT_SIZE_GIANT) failed(%s)", GetErrorMessage(GetLastResult()));
941 else if (fontSizeValue.Equals(STRING_FONT_SIZE_HUGE, false))
943 if (IsFailed(pFlickMenuPanel->Construct(IDL_SWEEP_QUICK_PLAYALL_ITEM_PANEL_FONT_SIZE_HUGE)))
945 AppLogDebug("Construct(IDL_SWEEP_QUICK_PLAYALL_ITEM_PANEL_FONT_SIZE_HUGE) failed(%s)", GetErrorMessage(GetLastResult()));
949 else if (fontSizeValue.Equals(STRING_FONT_SIZE_LARGE, false))
951 if (IsFailed(pFlickMenuPanel->Construct(IDL_SWEEP_QUICK_PLAYALL_ITEM_PANEL_FONT_SIZE_LARGE)))
953 AppLogDebug("Construct(IDL_SWEEP_QUICK_PLAYALL_ITEM_PANEL_FONT_SIZE_HUGE) failed(%s)", GetErrorMessage(GetLastResult()));
959 if (IsFailed(pFlickMenuPanel->Construct(IDL_SWEEP_QUICK_PLAYALL_ITEM_PANEL_DEFAULT)))
961 AppLogDebug("Construct(IDL_SWEEP_QUICK_PLAYALL_ITEM_PANEL_FONT_SIZE_HUGE) failed(%s)", GetErrorMessage(GetLastResult()));
966 else if (menuStyle == FLICK_MENU_STYLE_TYPE_04)
968 if (fontSizeValue.Equals(STRING_FONT_SIZE_GIANT, false))
970 if (IsFailed(pFlickMenuPanel->Construct(IDL_SWEEP_QUICK_ITEM2_PANEL_FONT_SIZE_GIANT)))
972 AppLogDebug("Construct(IDL_SWEEP_QUICK_ITEM2_PANEL_FONT_SIZE_GIANT) failed(%s)", GetErrorMessage(GetLastResult()));
976 else if (fontSizeValue.Equals(STRING_FONT_SIZE_HUGE, false))
978 if (IsFailed(pFlickMenuPanel->Construct(IDL_SWEEP_QUICK_ITEM2_PANEL_FONT_SIZE_HUGE)))
980 AppLogDebug("Construct(IDL_SWEEP_QUICK_ITEM2_PANEL_FONT_SIZE_GIANT) failed(%s)", GetErrorMessage(GetLastResult()));
984 else if (fontSizeValue.Equals(STRING_FONT_SIZE_LARGE, false))
986 if (IsFailed(pFlickMenuPanel->Construct(IDL_SWEEP_QUICK_ITEM2_PANEL_FONT_SIZE_LARGE)))
988 AppLogDebug("Construct(IDL_SWEEP_QUICK_ITEM2_PANEL_FONT_SIZE_GIANT) failed(%s)", GetErrorMessage(GetLastResult()));
994 if (IsFailed(pFlickMenuPanel->Construct(IDL_SWEEP_QUICK_ITEM2_PANEL_DEFAULT)))
996 AppLogDebug("Construct(IDL_SWEEP_QUICK_ITEM2_PANEL_FONT_SIZE_GIANT) failed(%s)", GetErrorMessage(GetLastResult()));
1003 AppLogDebug("EXIT");
1004 delete pFlickMenuPanel;
1008 if (menuStyle & FLICK_MENU_ITEM_SHARE)
1010 Button* pShareButton = static_cast<Button*>(pFlickMenuPanel->GetControl(IDC_SHARE_BUTTON));
1011 pShareButton->SetText(ResourceManager::GetString(L"IDS_MUSIC_BUTTON_SHARE"));
1012 pShareButton->SetActionId(IDA_FLICK_MENU_ITEM_SHARE);
1013 pShareButton->AddActionEventListener(listener);
1016 if (menuStyle & FLICK_MENU_ITEM_SET_AS)
1018 Button* pSetButton = static_cast<Button*>(pFlickMenuPanel->GetControl(IDC_SET_AS_BUTTON));
1019 pSetButton->SetText(ResourceManager::GetString(L"IDS_COM_SK_SET_AS"));
1020 pSetButton->SetActionId(IDA_FLICK_MENU_ITEM_SET_AS);
1021 pSetButton->AddActionEventListener(listener);
1024 if (menuStyle & FLICK_MENU_ITEM_ADDTO)
1026 Button* pAddToPlaylistButton = static_cast<Button*>(pFlickMenuPanel->GetControl(IDC_ADD_TO_BUTTON));
1027 pAddToPlaylistButton->SetText(ResourceManager::GetString(L"IDS_MUSIC_OPT_ADD_TO"));
1028 pAddToPlaylistButton->SetActionId(IDA_FLICK_MENU_ITEM_ADDTO);
1029 pAddToPlaylistButton->AddActionEventListener(listener);
1032 if (menuStyle & FLICK_MENU_ITEM_DELETE)
1034 Button* pDeleteButton = static_cast<Button*>(pFlickMenuPanel->GetControl(IDC_BUTTON_DELETE));
1035 pDeleteButton->SetText(ResourceManager::GetString("IDS_MUSIC_SK3_DELETE"));
1036 pDeleteButton->SetActionId(IDA_FLICK_MENU_ITEM_DELETE);
1037 pDeleteButton->AddActionEventListener(listener);
1040 if (menuStyle & FLICK_MENU_ITEM_PLAYALL)
1042 Button* pDeleteButton = static_cast<Button*>(pFlickMenuPanel->GetControl(IDC_PLAY_ALL_BUTTON));
1043 pDeleteButton->SetText(ResourceManager::GetString("IDS_MUSIC_OPT_MOREMENU_PLAY_ALL"));
1044 pDeleteButton->SetActionId(IDA_FLICK_MENU_ITEM_PLAYALL);
1045 pDeleteButton->AddActionEventListener(listener);
1048 AppLogDebug("EXIT");
1049 return pFlickMenuPanel;
1053 CommonUtil::GetStringItemSelected(int itemCount)
1055 AppLogDebug("ENTER");
1056 String strSelectStr;
1058 if (itemCount > INIT_VALUE)
1062 String ResSelect = ResourceManager::GetString("IDS_VR_POP_1_ITEM_SELECTED");
1063 strSelectStr.Format(STRING_LENGTH, ResSelect.GetPointer());
1067 String ResSelect = ResourceManager::GetString("IDS_VR_POP_PD_ITEMS_SELECTED");
1068 strSelectStr.Format(STRING_LENGTH, ResSelect.GetPointer(), itemCount);
1073 // StrSelectStr.Format(STRING_LENGTH, L"Select <Noun>s");//NEED STRING
1075 AppLogDebug("EXIT");
1076 return strSelectStr;
1080 CommonUtil::SetShowStateVariableHeightSizeControl(Tizen::Ui::Control& control, int controlHeight, bool isShow)
1082 AppLogDebug("ENTER");
1083 CommonUtil::SetShowStateControl(control, isShow);
1084 CommonUtil::SetVariableHeightSizeControl(control, controlHeight);
1085 control.Invalidate(true);
1086 AppLogDebug("EXIT");
1091 CommonUtil::SetVariableHeightSizeControl(Tizen::Ui::Control& control, int controlHeight)
1093 AppLogDebug("ENTER");
1094 if (control.GetHeight() != controlHeight)
1096 control.SetSize(control.GetWidth(), controlHeight);
1098 AppLogDebug("EXIT");
1101 Tizen::Ui::Controls::ContextMenu*
1102 CommonUtil::CreateContextMenuN(const Tizen::Ui::Control& source, Tizen::Ui::IActionEventListener& listener)
1104 AppLogDebug("ENTER");
1105 SceneManager* pSceneManager = SceneManager::GetInstance();
1106 AppAssert(pSceneManager);
1108 Scene* pScene = pSceneManager->GetCurrentScene();
1110 Form *pForm = pScene->GetForm();
1113 Point convertPosition = source.ConvertToScreenPosition(Point(source.GetWidth() / 2, INIT_VALUE));
1114 convertPosition.y = convertPosition.y + source.GetHeight();
1116 ContextMenuAnchorDirection direction = CONTEXT_MENU_ANCHOR_DIRECTION_DOWNWARD;
1117 if (convertPosition.y > pForm->GetHeight() / 2)
1119 convertPosition.y = convertPosition.y - source.GetHeight();
1120 direction = CONTEXT_MENU_ANCHOR_DIRECTION_UPWARD;
1123 ContextMenu* pContextMenu = new (std::nothrow) ContextMenu();
1124 pContextMenu->Construct(Point(INIT_VALUE, INIT_VALUE), CONTEXT_MENU_STYLE_LIST, direction);
1125 pContextMenu->SetName(L"IDC_CONTEXT_MENU");
1126 pContextMenu->AddActionEventListener(listener);
1127 pContextMenu->SetAnchorPosition(convertPosition);
1128 pContextMenu->SetMaxVisibleItemsCount(5);
1129 pContextMenu->SetShowState(true);
1131 AppLogDebug("EXIT");
1132 return pContextMenu;
1136 CommonUtil::AddContextMenuItem(Tizen::Ui::Controls::ContextMenu& contextMenu, unsigned int contextMenuItemStyle)
1138 AppLogDebug("ENTER");
1139 if (CONTEXT_MENU_ITEM_STYLE_CALL & contextMenuItemStyle)
1141 // IDA_CONTEXT_MENU_ITEM_CALL
1142 contextMenu.AddItem(ResourceManager::GetString(L"IDS_MUSIC_OPT_CALL_RINGTONE"), IDA_CONTEXT_MENU_ITEM_CALL);
1145 if (CONTEXT_MENU_ITEM_STYLE_SEARCH & contextMenuItemStyle)
1147 // IDA_CONTEXT_MENU_ITEM_SEARCH
1148 contextMenu.AddItem(ResourceManager::GetString(L"IDS_COM_BODY_SEARCH"), IDA_CONTEXT_MENU_ITEM_SEARCH);
1151 if (CONTEXT_MENU_ITEM_STYLE_BLUETOOTH & contextMenuItemStyle)
1153 // IDA_CONTEXT_MENU_ITEM_BLUETOOTH
1154 contextMenu.AddItem(L"Bluetooth", IDA_CONTEXT_MENU_ITEM_BLUETOOTH);//NEED STRING
1157 if (CONTEXT_MENU_ITEM_STYLE_MESSAGE & contextMenuItemStyle)
1159 // IDA_CONTEXT_MENU_ITEM_MESSAGE
1160 contextMenu.AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MESSAGE"), IDA_CONTEXT_MENU_ITEM_MESSAGE);
1163 if (CONTEXT_MENU_ITEM_STYLE_ALARM & contextMenuItemStyle)
1165 // IDA_CONTEXT_MENU_ITEM_ALARM
1166 contextMenu.AddItem(ResourceManager::GetString(L"IDS_MUSIC_OPT_SETAS_ALARM_TONE"), IDA_CONTEXT_MENU_ITEM_ALARM);
1169 if (CONTEXT_MENU_ITEM_STYLE_EMAIL & contextMenuItemStyle)
1171 // IDA_CONTEXT_MENU_ITEM_EMAIL
1172 contextMenu.AddItem(ResourceManager::GetString(L"IDS_COM_BODY_EMAIL"), IDA_CONTEXT_MENU_ITEM_EMAIL);
1175 if (CONTEXT_MENU_ITEM_STYLE_SETTINGS & contextMenuItemStyle)
1177 // IDA_CONTEXT_MENU_ITEM_SETTINGS
1178 contextMenu.AddItem(ResourceManager::GetString(L"IDS_COM_BODY_SETTINGS"), IDA_CONTEXT_MENU_ITEM_SETTINGS);
1181 if (CONTEXT_MENU_ITEM_STYLE_FOLDER_VIEW & contextMenuItemStyle)
1183 // IDA_CONTEXT_MENU_ITEM_FOLDER_VIEW
1184 contextMenu.AddItem(ResourceManager::GetString(L"IDS_MSGF_SK3_FOLDER_VIEW"), IDA_CONTEXT_MENU_ITEM_FOLDER_VIEW);
1187 if (CONTEXT_MENU_ITEM_STYLE_CREATE_PLAYLIST & contextMenuItemStyle)
1189 // IDA_CONTEXT_MENU_ITEM_CREATE_PLAYLIST
1190 contextMenu.AddItem(ResourceManager::GetString(L"IDS_MUSIC_OPT_CREATE_PLAYLIST"), IDA_CONTEXT_MENU_ITEM_CREATE_PLAYLIST);
1193 if (CONTEXT_MENU_ITEM_STYLE_SHARE_VIA & contextMenuItemStyle)
1195 // IDA_CONTEXT_MENU_ITEM_SHARE_VIA
1196 contextMenu.AddItem(ResourceManager::GetString(L"IDS_IV_BODY_SHARE_VIA"), IDA_CONTEXT_MENU_ITEM_SHARE_VIA);
1199 if (CONTEXT_MENU_ITEM_STYLE_EDIT & contextMenuItemStyle)
1201 // IDA_CONTEXT_MENU_ITEM_EDIT
1202 contextMenu.AddItem(ResourceManager::GetString(L"IDS_COM_BODY_EDIT"), IDA_CONTEXT_MENU_ITEM_EDIT);
1205 if (CONTEXT_MENU_ITEM_STYLE_CALLER & contextMenuItemStyle)
1207 // IDA_CONTEXT_MENU_ITEM_CALLER
1208 contextMenu.AddItem(ResourceManager::GetString(L"IDS_MUSIC_OPT_SETAS_CALLER_RINGTONE"), IDA_CONTEXT_MENU_ITEM_CALLER);
1211 if (CONTEXT_MENU_ITEM_STYLE_GO_TO_LIBARY & contextMenuItemStyle)
1213 // IDA_CONTEXT_MENU_ITEM_GO_TO_LIBARY
1214 contextMenu.AddItem(ResourceManager::GetString(L"IDS_MUSIC_OPT_GO_TO_LIBRARY"), IDA_CONTEXT_MENU_ITEM_GO_TO_LIBARY);
1217 if (CONTEXT_MENU_ITEM_STYLE_ADD & contextMenuItemStyle)
1219 // IDA_CONTEXT_MENU_ITEM_STYLE_ADD
1220 contextMenu.AddItem(ResourceManager::GetString(L"IDS_MUSIC_OPT_ADD"), IDA_CONTEXT_MENU_ITEM_STYLE_ADD);
1223 if (CONTEXT_MENU_ITEM_STYLE_ADD_TO_PLAYLIST & contextMenuItemStyle)
1225 // IDA_CONTEXT_MENU_ITEM_STYLE_ADD_TO_PLAYLIST
1226 contextMenu.AddItem(ResourceManager::GetString(L"IDS_MUSIC_BODY_ADD_TO_PLAYLIST"), IDA_CONTEXT_MENU_ITEM_STYLE_ADD_TO_PLAYLIST);
1229 if (CONTEXT_MENU_ITEM_STYLE_SET_AS & contextMenuItemStyle)
1231 // IDA_CONTEXT_MENU_ITEM_STYLE_SET_AS
1232 contextMenu.AddItem(ResourceManager::GetString(L"IDS_MUSIC_SK3_SET_AS"), IDA_CONTEXT_MENU_ITEM_STYLE_SET_AS);
1235 if (CONTEXT_MENU_ITEM_STYLE_DETAILS & contextMenuItemStyle)
1237 // IDA_CONTEXT_MENU_ITEM_STYLE_DETAILS
1238 contextMenu.AddItem(ResourceManager::GetString(L"IDS_COM_BODY_DETAILS"), IDA_CONTEXT_MENU_ITEM_STYLE_DETAILS);
1241 if (CONTEXT_MENU_ITEM_STYLE_SOUND_PATH & contextMenuItemStyle)
1243 // IDA_CONTEXT_MENU_ITEM_STYLE_SOUND_PATH
1244 contextMenu.AddItem(L"Sound Path", IDA_CONTEXT_MENU_ITEM_STYLE_SOUND_PATH);//NEED STRING
1246 contextMenu.SetFocusable(true);
1247 AppLogDebug("EXIT");
1250 Tizen::Ui::Controls::OptionMenu*
1251 CommonUtil::CreateOptionMenuN(const Tizen::Ui::Control& source, Tizen::Ui::IActionEventListener& listener)
1253 AppLogDebug("ENTER");
1255 OptionMenu* pOptionMenu = new (std::nothrow) OptionMenu();
1256 pOptionMenu->Construct();
1257 pOptionMenu->SetName(L"IDC_OPTION_MENU");
1258 pOptionMenu->AddActionEventListener(listener);
1259 pOptionMenu->SetMaxVisibleItemsCount(5);
1260 pOptionMenu->SetShowState(true);
1261 pOptionMenu->SetFocusable(true);
1262 AppLogDebug("EXIT");
1267 CommonUtil::AddOptionMenuItem(Tizen::Ui::Controls::OptionMenu& optionMenu, unsigned int optionMenuItemStyle)
1269 AppLogDebug("ENTER");
1270 if (CONTEXT_MENU_ITEM_STYLE_CALL & optionMenuItemStyle)
1272 // IDA_CONTEXT_MENU_ITEM_CALL
1273 optionMenu.AddItem(ResourceManager::GetString(L"IDS_MUSIC_OPT_CALL_RINGTONE"), IDA_CONTEXT_MENU_ITEM_CALL);
1276 if (CONTEXT_MENU_ITEM_STYLE_SEARCH & optionMenuItemStyle)
1278 // IDA_CONTEXT_MENU_ITEM_SEARCH
1279 optionMenu.AddItem(ResourceManager::GetString(L"IDS_COM_BODY_SEARCH"), IDA_CONTEXT_MENU_ITEM_SEARCH);
1282 if (CONTEXT_MENU_ITEM_STYLE_BLUETOOTH & optionMenuItemStyle)
1284 // IDA_CONTEXT_MENU_ITEM_BLUETOOTH
1285 optionMenu.AddItem(L"Bluetooth", IDA_CONTEXT_MENU_ITEM_BLUETOOTH);//NEED STRING
1288 if (CONTEXT_MENU_ITEM_STYLE_MESSAGE & optionMenuItemStyle)
1290 // IDA_CONTEXT_MENU_ITEM_MESSAGE
1291 optionMenu.AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MESSAGE"), IDA_CONTEXT_MENU_ITEM_MESSAGE);
1294 if (CONTEXT_MENU_ITEM_STYLE_ALARM & optionMenuItemStyle)
1296 // IDA_CONTEXT_MENU_ITEM_ALARM
1297 optionMenu.AddItem(ResourceManager::GetString(L"IDS_MUSIC_OPT_SETAS_ALARM_TONE"), IDA_CONTEXT_MENU_ITEM_ALARM);
1300 if (CONTEXT_MENU_ITEM_STYLE_EMAIL & optionMenuItemStyle)
1302 // IDA_CONTEXT_MENU_ITEM_EMAIL
1303 optionMenu.AddItem(ResourceManager::GetString(L"IDS_COM_BODY_EMAIL"), IDA_CONTEXT_MENU_ITEM_EMAIL);
1306 if (CONTEXT_MENU_ITEM_STYLE_SETTINGS & optionMenuItemStyle)
1308 // IDA_CONTEXT_MENU_ITEM_SETTINGS
1309 optionMenu.AddItem(ResourceManager::GetString(L"IDS_COM_BODY_SETTINGS"), IDA_CONTEXT_MENU_ITEM_SETTINGS);
1312 if (CONTEXT_MENU_ITEM_STYLE_FOLDER_VIEW & optionMenuItemStyle)
1314 // IDA_CONTEXT_MENU_ITEM_FOLDER_VIEW
1315 optionMenu.AddItem(ResourceManager::GetString(L"IDS_MSGF_SK3_FOLDER_VIEW"), IDA_CONTEXT_MENU_ITEM_FOLDER_VIEW);
1318 if (CONTEXT_MENU_ITEM_STYLE_CREATE_PLAYLIST & optionMenuItemStyle)
1320 // IDA_CONTEXT_MENU_ITEM_CREATE_PLAYLIST
1321 optionMenu.AddItem(ResourceManager::GetString(L"IDS_MUSIC_OPT_CREATE_PLAYLIST"), IDA_CONTEXT_MENU_ITEM_CREATE_PLAYLIST);
1324 if (CONTEXT_MENU_ITEM_STYLE_SHARE_VIA & optionMenuItemStyle)
1326 // IDA_CONTEXT_MENU_ITEM_SHARE_VIA
1327 optionMenu.AddItem(ResourceManager::GetString(L"IDS_IV_BODY_SHARE_VIA"), IDA_CONTEXT_MENU_ITEM_SHARE_VIA);
1330 if (CONTEXT_MENU_ITEM_STYLE_EDIT & optionMenuItemStyle)
1332 // IDA_CONTEXT_MENU_ITEM_EDIT
1333 optionMenu.AddItem(ResourceManager::GetString(L"IDS_COM_BODY_EDIT"), IDA_CONTEXT_MENU_ITEM_EDIT);
1336 if (CONTEXT_MENU_ITEM_STYLE_CALLER & optionMenuItemStyle)
1338 // IDA_CONTEXT_MENU_ITEM_CALLER
1339 optionMenu.AddItem(ResourceManager::GetString(L"IDS_MUSIC_OPT_SETAS_CALLER_RINGTONE"), IDA_CONTEXT_MENU_ITEM_CALLER);
1342 if (CONTEXT_MENU_ITEM_STYLE_GO_TO_LIBARY & optionMenuItemStyle)
1344 // IDA_CONTEXT_MENU_ITEM_GO_TO_LIBARY
1345 optionMenu.AddItem(ResourceManager::GetString(L"IDS_MUSIC_OPT_GO_TO_LIBRARY"), IDA_CONTEXT_MENU_ITEM_GO_TO_LIBARY);
1348 if (CONTEXT_MENU_ITEM_STYLE_ADD & optionMenuItemStyle)
1350 // IDA_CONTEXT_MENU_ITEM_STYLE_ADD
1351 optionMenu.AddItem(ResourceManager::GetString(L"IDS_MUSIC_OPT_ADD"), IDA_CONTEXT_MENU_ITEM_STYLE_ADD);
1354 if (CONTEXT_MENU_ITEM_STYLE_ADD_TO_PLAYLIST & optionMenuItemStyle)
1356 // IDA_CONTEXT_MENU_ITEM_STYLE_ADD_TO_PLAYLIST
1357 optionMenu.AddItem(ResourceManager::GetString(L"IDS_MUSIC_BODY_ADD_TO_PLAYLIST"), IDA_CONTEXT_MENU_ITEM_STYLE_ADD_TO_PLAYLIST);
1360 if (CONTEXT_MENU_ITEM_STYLE_SET_AS & optionMenuItemStyle)
1362 // IDA_CONTEXT_MENU_ITEM_STYLE_SET_AS
1363 optionMenu.AddItem(ResourceManager::GetString(L"IDS_MUSIC_SK3_SET_AS"), IDA_CONTEXT_MENU_ITEM_STYLE_SET_AS);
1366 if (CONTEXT_MENU_ITEM_STYLE_DETAILS & optionMenuItemStyle)
1368 // IDA_CONTEXT_MENU_ITEM_STYLE_DETAILS
1369 optionMenu.AddItem(ResourceManager::GetString(L"IDS_COM_BODY_DETAILS"), IDA_CONTEXT_MENU_ITEM_STYLE_DETAILS);
1372 if (CONTEXT_MENU_ITEM_STYLE_SOUND_PATH & optionMenuItemStyle)
1374 // IDA_CONTEXT_MENU_ITEM_STYLE_SOUND_PATH
1375 optionMenu.AddItem(L"Sound Path", IDA_CONTEXT_MENU_ITEM_STYLE_SOUND_PATH);//NEED STRING
1377 AppLogDebug("EXIT");
1381 CommonUtil::IsVaildContextMenuItemActionId(int actionId)
1383 AppLogDebug("ENTER");
1384 if (actionId >= IDA_CONTEXT_MENU_ITEM_BASE && actionId < IDA_CONTEXT_MENU_ITEM_MAX)
1388 AppLogDebug("EXIT");
1393 CommonUtil::IsVaildCommonPopupActionId(int actionId)
1395 AppLogDebug("ENTER");
1396 if (actionId >= IDA_COMMON_POPUP_BASE && actionId < IDA_COMMON_POPUP_MAX)
1400 AppLogDebug("EXIT");
1405 CommonUtil::ShowContextMenu(Tizen::Ui::Controls::ContextMenu& contextMenu, bool isShow)
1407 AppLogDebug("ENTER");
1408 CommonUtil::SetShowStateControl(contextMenu, isShow);
1413 AppLogDebug("EXIT");
1417 CommonUtil::ShowOptionMenu(Tizen::Ui::Controls::OptionMenu& optionMenu, bool isShow)
1419 AppLogDebug("ENTER");
1420 CommonUtil::SetShowStateControl(optionMenu, isShow);
1425 AppLogDebug("EXIT");
1429 CommonUtil::SetShowStateControl(Tizen::Ui::Control& control, bool isShow)
1431 AppLogDebug("ENTER");
1432 if (control.GetShowState() != isShow)
1434 control.SetShowState(isShow);
1435 control.Invalidate(true);
1439 AppLogDebug("EXIT");
1444 CommonUtil::SetSimpleTitleStyle(Tizen::Ui::Controls::Header& pHeader, const Tizen::Base::String& titleText)
1446 AppLogDebug("ENTER");
1447 pHeader.RemoveAllButtons();
1448 pHeader.RemoveAllItems();
1450 pHeader.SetStyle(HEADER_STYLE_TITLE);
1451 pHeader.SetTitleText(titleText);
1452 pHeader.SetTitleTextColor(COLOR_HEADER_TITLE_TEXT);
1453 pHeader.Invalidate(true);
1454 AppLogDebug("EXIT");
1458 CommonUtil::SetTitleWithSearchIconStyle(Tizen::Ui::Controls::Header& pHeader, const Tizen::Base::String& titleText,
1459 const Tizen::Base::String& descriptionText, int actionId)
1461 AppLogDebug("ENTER");
1462 pHeader.RemoveAllButtons();
1463 pHeader.RemoveAllItems();
1465 pHeader.SetStyle(HEADER_STYLE_TITLE);
1466 pHeader.SetTitleText(titleText);
1468 ButtonItem buttonItem;
1469 buttonItem.Construct(BUTTON_ITEM_STYLE_ICON, actionId);
1471 // CommonUtil::SetButtonItemIcon(buttonItem, L"T02_icon_search.png", L"T02_icon_search.png", L"T02_icon_search.png");
1472 pHeader.SetButton(BUTTON_POSITION_RIGHT, buttonItem);
1473 pHeader.SetTitleTextColor(COLOR_HEADER_TITLE_TEXT);
1474 AppLogDebug("EXIT");
1478 CommonUtil::SetTitleDescriptionWithIconStyle(Tizen::Ui::Controls::Header& pHeader, const Tizen::Base::String& titleText,
1479 Tizen::Base::String& descriptionText, int actionId, Tizen::Graphics::Bitmap* icon)
1481 AppLogDebug("ENTER");
1482 pHeader.RemoveAllButtons();
1483 pHeader.RemoveAllItems();
1485 pHeader.SetStyle(HEADER_STYLE_TITLE);
1486 pHeader.SetTitleText(titleText);
1487 pHeader.SetDescriptionText(descriptionText);
1489 ButtonItem buttonItem;
1490 buttonItem.Construct(BUTTON_ITEM_STYLE_ICON, actionId);
1492 // CommonUtil::SetIconButtonItem(buttonItem, icon, icon, null);
1493 // CommonUtil::SetButtonItemIcon(buttonItem, L"T02_icon_search.png", L"T02_icon_search.png", L"T02_icon_search.png");
1494 pHeader.SetButton(BUTTON_POSITION_RIGHT, buttonItem);
1496 pHeader.SetTitleTextColor(COLOR_HEADER_TITLE_TEXT);
1497 pHeader.SetDescriptionTextColor(COLOR_HEADER_DESCRIPTION_TEXT);
1498 AppLogDebug("EXIT");
1502 CommonUtil::SetTitleDescriptionStyle(Tizen::Ui::Controls::Header& pHeader, const Tizen::Base::String& titleText, const Tizen::Base::String& descriptionText)
1504 AppLogDebug("ENTER");
1505 pHeader.RemoveAllButtons();
1506 pHeader.RemoveAllItems();
1508 pHeader.SetStyle(HEADER_STYLE_TITLE);
1509 pHeader.SetTitleText(titleText);
1510 pHeader.SetDescriptionText(descriptionText);
1512 pHeader.SetTitleTextColor(COLOR_HEADER_TITLE_TEXT);
1513 pHeader.SetDescriptionTextColor(COLOR_HEADER_DESCRIPTION_TEXT);
1514 AppLogDebug("EXIT");
1517 Tizen::Ui::Controls::Footer*
1518 CommonUtil::CreateContentListFooter(const Tizen::Ui::Controls::Form& form)
1520 AppLogDebug("ENTER");
1521 Footer* pFooter = form.GetFooter();
1522 if (pFooter == null)
1524 AppLogDebug("EXIT");
1529 ButtonItem AddButtonItem;
1530 ButtonItem backButtonItem;
1531 FooterItem searchButtonItem;
1533 AddButtonItem.Construct(BUTTON_ITEM_STYLE_ICON, IDA_FOOTER_BUTTON_ADD_TO_PLAYLIST);
1534 AddButtonItem.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pAddButtonImage);
1536 backButtonItem.Construct(BUTTON_ITEM_STYLE_ICON, IDA_FOOTER_BUTTON_BACK);
1537 backButtonItem.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBackButtonImage);
1539 searchButtonItem.Construct(IDA_FOOTER_BUTTON_SEARCH);
1540 searchButtonItem.SetIcon(FOOTER_ITEM_STATUS_NORMAL, pSearchButtonImage);
1542 pFooter->SetStyle(FOOTER_STYLE_SEGMENTED_ICON);
1544 pFooter->SetButton(BUTTON_POSITION_LEFT, AddButtonItem);
1545 pFooter->SetButton(BUTTON_POSITION_RIGHT, backButtonItem);
1546 pFooter->AddItem(searchButtonItem);
1548 FooterItem AddButtonItem;
1549 FooterItem searchButtonItem;
1551 AddButtonItem.Construct(IDA_FOOTER_BUTTON_ADD_TO_PLAYLIST);
1552 AddButtonItem.SetText(ResourceManager::GetString(L"IDS_MUSIC_BODY_ADD_TO_PLAYLIST"));
1554 searchButtonItem.Construct(IDA_FOOTER_BUTTON_SEARCH);
1555 searchButtonItem.SetText(ResourceManager::GetString(L"IDS_COM_BODY_SEARCH"));
1557 pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON_TEXT);
1559 pFooter->AddItem(AddButtonItem);
1560 pFooter->AddItem(searchButtonItem);
1563 AppLogDebug("EXIT");
1567 Tizen::Ui::Controls::Footer*
1568 CommonUtil::CreatePlaylistEditFooter(const Tizen::Ui::Controls::Form& form)
1570 AppLogDebug("ENTER");
1571 Footer* pFooter = form.GetFooter();
1572 if (pFooter == null)
1574 AppLogDebug("EXIT");
1578 FooterItem deleteButtonItem;
1579 FooterItem cancelButtonItem;
1581 deleteButtonItem.Construct(IDA_FOOTER_BUTTON_DELETE);
1582 deleteButtonItem.SetText(ResourceManager::GetString(L"IDS_MUSIC_OPT_DELETE"));
1584 cancelButtonItem.Construct(IDA_FOOTER_BUTTON_CANCEL);
1585 cancelButtonItem.SetText(ResourceManager::GetString(L"IDS_COM_BODY_EDIT_CANCEL"));
1587 pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON_TEXT);
1589 pFooter->AddItem(deleteButtonItem);
1590 pFooter->AddItem(cancelButtonItem);
1592 AppLogDebug("EXIT");
1596 Tizen::Ui::Controls::Footer*
1597 CommonUtil::CreateDefaultPlaylistContentListFooter(const Tizen::Ui::Controls::Form& form)
1599 AppLogDebug("ENTER");
1600 Footer* pFooter = form.GetFooter();
1601 if (pFooter == null)
1603 AppLogDebug("EXIT");
1607 FooterItem editButtonItem;
1608 FooterItem createPlaylistButtonItem;
1609 FooterItem searchButtonItem;
1611 editButtonItem.Construct(IDA_FOOTER_BUTTON_EDIT);
1612 editButtonItem.SetText(ResourceManager::GetString(L"IDS_COM_BODY_EDIT"));
1613 createPlaylistButtonItem.Construct(IDA_FOOTER_BUTTON_CREATE_PLAYLIST);
1614 createPlaylistButtonItem.SetText(ResourceManager::GetString(L"IDS_MUSIC_BODY_CREATE_PLAYLIST"));
1616 searchButtonItem.Construct(IDA_FOOTER_BUTTON_SEARCH);
1617 searchButtonItem.SetText(ResourceManager::GetString(L"IDS_COM_BODY_SEARCH"));
1619 pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON_TEXT);
1621 pFooter->AddItem(editButtonItem);
1622 pFooter->AddItem(createPlaylistButtonItem);
1623 pFooter->AddItem(searchButtonItem);
1625 AppLogDebug("EXIT");
1629 Tizen::Ui::Controls::Footer*
1630 CommonUtil::CreateUserPlaylistContentListFooter(const Tizen::Ui::Controls::Form& form)
1632 AppLogDebug("ENTER");
1633 Footer* pFooter = form.GetFooter();
1634 if (pFooter == null)
1636 AppLogDebug("EXIT");
1640 FooterItem editButtonItem;
1641 FooterItem AddButtonItem;
1642 // FooterItem searchButtonItem;
1644 editButtonItem.Construct(IDA_FOOTER_BUTTON_EDIT);
1645 editButtonItem.SetText(ResourceManager::GetString(L"IDS_COM_BODY_EDIT"));
1647 AddButtonItem.Construct(IDA_FOOTER_BUTTON_ADD_TO_PLAYLIST);
1648 AddButtonItem.SetText(ResourceManager::GetString(L"IDS_MUSIC_BODY_ADD_TO_PLAYLIST"));
1650 // searchButtonItem.Construct(IDA_FOOTER_BUTTON_SEARCH);
1651 // searchButtonItem.SetText(ResourceManager::GetString(L"IDS_COM_BODY_SEARCH"));
1653 pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON_TEXT);
1655 pFooter->AddItem(editButtonItem);
1656 pFooter->AddItem(AddButtonItem);
1657 // pFooter->AddItem(searchButtonItem);
1659 AppLogDebug("EXIT");
1663 Tizen::Ui::Controls::Footer*
1664 CommonUtil::CreateAddtoPlaylistPickerFooter(const Tizen::Ui::Controls::Form& form)
1666 AppLogDebug("ENTER");
1667 Footer* pFooter = form.GetFooter();
1668 if (pFooter == null)
1670 AppLogDebug("EXIT");
1675 ButtonItem AddButtonItem;
1676 ButtonItem CancelButtonItem;
1678 AddButtonItem.Construct(BUTTON_ITEM_STYLE_ICON, IDA_FOOTER_BUTTON_ADD_TO_PLAYLIST);
1679 AddButtonItem.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pAddButtonImage);
1681 CancelButtonItem.Construct(BUTTON_ITEM_STYLE_ICON, IDA_FOOTER_BUTTON_CANCEL);
1682 CancelButtonItem.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pCancelButtonImage);
1684 pFooter->SetStyle(FOOTER_STYLE_SEGMENTED_ICON);
1686 pFooter->SetButton(BUTTON_POSITION_LEFT, AddButtonItem);
1687 pFooter->SetButton(BUTTON_POSITION_RIGHT, CancelButtonItem);
1689 FooterItem AddButtonItem;
1690 FooterItem CancelButtonItem;
1692 AddButtonItem.Construct(IDA_FOOTER_BUTTON_ADD_TO_PLAYLIST);
1693 AddButtonItem.SetText(ResourceManager::GetString(L"IDS_MUSIC_BODY_ADD_TO_PLAYLIST"));
1695 CancelButtonItem.Construct(IDA_FOOTER_BUTTON_CANCEL);
1696 CancelButtonItem.SetText(ResourceManager::GetString(L"IDS_COM_BODY_EDIT_CANCEL"));
1698 pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON_TEXT);
1700 pFooter->AddItem(AddButtonItem);
1701 pFooter->AddItem(CancelButtonItem);
1704 AppLogDebug("EXIT");
1708 Tizen::Ui::Controls::Footer*
1709 CommonUtil::CreateAddtoPlaylistFooter(const Tizen::Ui::Controls::Form& form)
1711 AppLogDebug("ENTER");
1712 Footer* pFooter = form.GetFooter();
1713 if (pFooter == null)
1715 AppLogDebug("EXIT");
1719 FooterItem AddButtonItem;
1721 AddButtonItem.Construct(IDA_FOOTER_BUTTON_ADD_TO_PLAYLIST);
1722 AddButtonItem.SetText(ResourceManager::GetString(L"IDS_MUSIC_BODY_ADD_TO_PLAYLIST"));
1723 pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON_TEXT);
1724 pFooter->AddItem(AddButtonItem);
1726 AppLogDebug("EXIT");
1730 Tizen::Ui::Controls::Footer*
1731 CommonUtil::CreateEditContentListFooter(const Tizen::Ui::Controls::Form& form)
1733 AppLogDebug("ENTER");
1734 Footer* pFooter = form.GetFooter();
1735 if (pFooter == null)
1737 AppLogDebug("EXIT");
1740 pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON_TEXT);
1742 FooterItem editButtonItem;
1743 FooterItem searchButtonItem;
1745 editButtonItem.Construct(IDA_FOOTER_BUTTON_EDIT);
1746 editButtonItem.SetText(ResourceManager::GetString(L"IDS_COM_BODY_EDIT"));
1748 searchButtonItem.Construct(IDA_FOOTER_BUTTON_SEARCH);
1749 searchButtonItem.SetText(ResourceManager::GetString(L"IDS_COM_BODY_SEARCH"));
1751 pFooter->AddItem(editButtonItem);
1752 pFooter->AddItem(searchButtonItem);
1754 AppLogDebug("EXIT");
1758 Tizen::Ui::Controls::Footer*
1759 CommonUtil::CreateEditFooter(const Tizen::Ui::Controls::Form& form)
1761 AppLogDebug("ENTER");
1762 Footer* pFooter = form.GetFooter();
1763 if (pFooter == null)
1765 AppLogDebug("EXIT");
1768 pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON_TEXT);
1770 FooterItem editButtonItem;
1771 editButtonItem.Construct(IDA_FOOTER_BUTTON_EDIT);
1772 editButtonItem.SetText(ResourceManager::GetString(L"IDS_COM_BODY_EDIT"));
1773 pFooter->AddItem(editButtonItem);
1775 AppLogDebug("EXIT");
1779 Tizen::Ui::Controls::Footer*
1780 CommonUtil::CreateDeleteFooter(const Tizen::Ui::Controls::Form& form)
1782 AppLogDebug("ENTER");
1783 Footer* pFooter = form.GetFooter();
1784 if (pFooter == null)
1786 AppLogDebug("EXIT");
1789 pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON_TEXT);
1791 FooterItem deleteFooterItem;
1792 deleteFooterItem.Construct(IDA_FOOTER_BUTTON_DELETE);
1793 deleteFooterItem.SetText(ResourceManager::GetString(L"IDS_MUSIC_SK3_DELETE"));
1795 FooterItem shareFooterItem;
1796 shareFooterItem.Construct(IDA_FOOTER_BUTTON_SHARE);
1797 shareFooterItem.SetText(ResourceManager::GetString(L"IDS_MUSIC_BUTTON_SHARE"));
1799 FooterItem addToPlaylistFooterItem;
1800 addToPlaylistFooterItem.Construct(IDA_FOOTER_BUTTON_ADD_TO_PLAYLIST);
1801 addToPlaylistFooterItem.SetText(ResourceManager::GetString(L"IDS_MUSIC_BUTTON2_ADD_TO_PLAYLIST"));
1803 FooterItem cancelFooterItem;
1804 cancelFooterItem.Construct(IDA_FOOTER_BUTTON_CANCEL);
1805 cancelFooterItem.SetText(ResourceManager::GetString(L"IDS_COM_BODY_EDIT_CANCEL"));
1807 pFooter->AddItem(deleteFooterItem);
1808 pFooter->AddItem(shareFooterItem);
1809 pFooter->AddItem(addToPlaylistFooterItem);
1810 pFooter->AddItem(cancelFooterItem);
1812 pFooter->SetItemEnabled(INDEX_FOOTER_DELETE, false);
1813 pFooter->SetItemEnabled(INDEX_FOOTER_SHARE, false);
1814 pFooter->SetItemEnabled(INDEX_FOOTER_ADDTOPLATLIST, false);
1816 AppLogDebug("EXIT");
1820 Tizen::Ui::Controls::Footer*
1821 CommonUtil::CreateCancelFooter(const Tizen::Ui::Controls::Form& form)
1823 AppLogDebug("ENTER");
1824 Footer* pFooter = form.GetFooter();
1825 if (pFooter == null)
1827 AppLogDebug("EXIT");
1831 pFooter->SetBackButton();
1832 AppLogDebug("EXIT");
1836 Tizen::Ui::Controls::Footer*
1837 CommonUtil::CreateBackButtonStyleFooter(const Tizen::Ui::Controls::Form& form, FooterButtonStyle style)
1839 AppLogDebug("ENTER");
1840 Footer* pFooter = form.GetFooter();
1841 if (pFooter == null)
1843 AppLogDebug("EXIT");
1846 pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON_TEXT);
1851 case STYLE_ADDTO_DELETE_ADD:
1853 FooterItem footerItemAddto;
1854 footerItemAddto.Construct(IDA_FOOTER_BUTTON_ADD_TO_PLAYLIST);
1855 footerItemAddto.SetText(ResourceManager::GetString(L"IDS_MUSIC_OPT_ADD_TO"));
1857 FooterItem footerItemDelete;
1858 footerItemDelete.Construct(IDA_FOOTER_BUTTON_DELETE);
1859 footerItemDelete.SetText(ResourceManager::GetString(L"IDS_MUSIC_SK3_DELETE"));
1861 pFooter->AddItem(footerItemAddto);
1862 pFooter->AddItem(footerItemDelete);
1866 case STYLE_SHARE_ADD:
1868 FooterItem footerItemShare;
1869 footerItemShare.Construct(IDA_FOOTER_BUTTON_SHARE);
1870 footerItemShare.SetText(ResourceManager::GetString(L"IDS_MUSIC_BUTTON_SHARE"));
1872 pFooter->AddItem(footerItemShare);
1876 case STYLE_DELETE_ADD:
1878 FooterItem footerItemDelete;
1879 footerItemDelete.Construct(IDA_FOOTER_BUTTON_DELETE);
1880 footerItemDelete.SetText(ResourceManager::GetString(L"IDS_MUSIC_SK3_DELETE"));
1882 pFooter->AddItem(footerItemDelete);
1888 FooterItem footerItemAdd;
1889 footerItemAdd.Construct(IDA_FOOTER_BUTTON_ADD);
1890 footerItemAdd.SetText(ResourceManager::GetString(L"IDS_MUSIC_SK_ADD_LITE"));
1892 pFooter->AddItem(footerItemAdd);
1899 AppLogDebug("EXIT");
1904 CommonUtil::SetBackButtonStyleFooter(Tizen::Ui::Controls::Footer& footer, FooterButtonStyle style)
1906 AppLogDebug("ENTER");
1907 footer.RemoveAllButtons();
1908 footer.RemoveAllItems();
1909 footer.SetStyle(FOOTER_STYLE_BUTTON_ICON_TEXT);
1912 case STYLE_ADDTO_DELETE_ADD:
1914 FooterItem footerItemAddto;
1915 footerItemAddto.Construct(IDA_FOOTER_BUTTON_ADD_TO_PLAYLIST);
1916 footerItemAddto.SetText(ResourceManager::GetString(L"IDS_MUSIC_OPT_ADD_TO"));
1917 FooterItem footerItemDelete;
1918 footerItemDelete.Construct(IDA_FOOTER_BUTTON_DELETE);
1919 footerItemDelete.SetText(ResourceManager::GetString(L"IDS_MUSIC_SK3_DELETE"));
1920 footer.AddItem(footerItemAddto);
1921 footer.AddItem(footerItemDelete);
1925 case STYLE_SHARE_ADD:
1927 FooterItem footerItemShare;
1928 footerItemShare.Construct(IDA_FOOTER_BUTTON_SHARE);
1929 footerItemShare.SetText(ResourceManager::GetString(L"IDS_MUSIC_BUTTON_SHARE"));
1930 footer.AddItem(footerItemShare);
1934 case STYLE_MORE_EDIT_ADD:
1936 footer.SetStyle(FOOTER_STYLE_BUTTON_ICON_TEXT);
1938 Bitmap* bitmapMore = ResourceManager::GetBitmapN(L"00_icon_more_web.png");
1939 Bitmap* bitmapMorePress = ResourceManager::GetBitmapN(L"00_icon_more_press_web.png");
1941 ButtonItem buttonItemMore;
1942 buttonItemMore.Construct(BUTTON_ITEM_STYLE_ICON, IDA_FOOTER_BUTTON_MORE);
1943 buttonItemMore.SetIcon(BUTTON_ITEM_STATUS_NORMAL, bitmapMore);
1944 buttonItemMore.SetIcon(BUTTON_ITEM_STATUS_PRESSED, bitmapMorePress);
1945 footer.SetButton(BUTTON_POSITION_LEFT,buttonItemMore);
1948 delete bitmapMorePress;
1950 FooterItem editButtonItem;
1951 editButtonItem.Construct(IDA_FOOTER_BUTTON_EDIT);
1952 editButtonItem.SetText(ResourceManager::GetString(L"IDS_COM_BODY_EDIT"));
1953 footer.AddItem(editButtonItem);
1960 AppLogDebug("EXIT");
1964 CommonUtil::GetContentInformationN(const Tizen::Content::AudioContentInfo& audioContentInfo)
1966 AppLogDebug("ENTER");
1967 ContentInformation* pContentInfoStruct = new (std::nothrow) ContentInformation();
1969 pContentInfoStruct->contentId = audioContentInfo.GetContentId();
1970 pContentInfoStruct->GenreName = audioContentInfo.GetGenre();
1971 pContentInfoStruct->ArtistName = audioContentInfo.GetArtist();
1972 pContentInfoStruct->ComposerName = audioContentInfo.GetComposer();
1973 pContentInfoStruct->AlbumName = audioContentInfo.GetAlbumName();
1974 pContentInfoStruct->TitleName = audioContentInfo.GetTitle();
1975 pContentInfoStruct->ContentFilePath = audioContentInfo.GetContentPath();
1977 pContentInfoStruct->ReleaseYear = audioContentInfo.GetReleaseYear();
1978 pContentInfoStruct->Duration = audioContentInfo.GetDuration();
1979 pContentInfoStruct->contentId = audioContentInfo.GetContentId();
1981 AppLogDebug("EXIT");
1982 return pContentInfoStruct;
1986 CommonUtil::CreateTableViewItem(Tizen::Ui::Container& parent,
1987 const Tizen::Graphics::Bitmap& thumbnail,
1988 const Tizen::Base::String& itemName,
1991 AppLogDebug("ENTER");
1993 int X_Gap = W_THUMBNAIL + (X_GAP_THUMBNAIL * 2);
1994 int W_Label = W_CLIENT_AREA - (X_Gap + W_CREATE_TABLE_VIEW_ITEM_COUNT_LABEL_ITEM);
1996 Label* pSongThumbnailLabel = new (std::nothrow) Label();
1997 pSongThumbnailLabel->Construct(Rectangle(X_GAP_THUMBNAIL, Y_GAP_THUMBNAIL, W_THUMBNAIL, H_THUMBNAIL), L"");
1998 pSongThumbnailLabel->SetBackgroundBitmap(thumbnail);
1999 pSongThumbnailLabel->SetName(L"pSongThumbnailLabel");
2001 parent.AddControl(pSongThumbnailLabel);
2003 Label* pSongNameLabel = new (std::nothrow) Label();
2004 pSongNameLabel->Construct(Rectangle(X_Gap, Y_CREATE_TABLE_VIEW_ITEM, W_Label, H_CREATE_TABLE_VIEW_ITEM), L"");
2005 pSongNameLabel->SetTextConfig(FONT_SIZE, LABEL_TEXT_STYLE_NORMAL);
2006 pSongNameLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
2007 pSongNameLabel->SetText(itemName);
2009 parent.AddControl(pSongNameLabel);
2011 Label* pSongTimeLabel = new (std::nothrow) Label();
2012 pSongTimeLabel->Construct(Rectangle(pSongNameLabel->GetWidth() + X_Gap, pSongNameLabel->GetY(), W_CREATE_TABLE_VIEW_ITEM_COUNT_LABEL_ITEM, H_CREATE_TABLE_VIEW_ITEM), L"");
2013 pSongTimeLabel->SetTextConfig(FONT_SIZE - 2, LABEL_TEXT_STYLE_NORMAL);
2014 pSongTimeLabel->SetTextHorizontalAlignment(ALIGNMENT_RIGHT);
2015 pSongTimeLabel->SetText(CommonUtil::SetSongsString(itemCount));
2017 parent.AddControl(pSongTimeLabel);
2018 AppLogDebug("EXIT");
2022 CommonUtil::CreateEditListTableViewItem(Tizen::Ui::Container& parent,
2023 const Tizen::Graphics::Bitmap& thumbnail,
2024 const Tizen::Base::String& itemName,
2027 AppLogDebug("ENTER");
2028 result r = E_SUCCESS;
2030 int W_Label = W_CLIENT_AREA - (W_TABLE_VIEW_MARK + W_THUMBNAIL + W_CREATE_TABLE_VIEW_ITEM_COUNT_LABEL_ITEM);
2032 Label* pSongThumbnailLabel = new (std::nothrow) Label();
2033 pSongThumbnailLabel->Construct(Rectangle(0, Y_GAP_THUMBNAIL, W_THUMBNAIL, H_THUMBNAIL), L"");
2034 pSongThumbnailLabel->SetBackgroundBitmap(thumbnail);
2035 pSongThumbnailLabel->SetName(L"pSongThumbnailLabel");
2037 Label* pSongNameLabel = new (std::nothrow) Label();
2038 pSongNameLabel->Construct(Rectangle(pSongThumbnailLabel->GetWidth(), Y_CREATE_TABLE_VIEW_ITEM, W_Label, H_CREATE_TABLE_VIEW_ITEM), L"");
2039 pSongNameLabel->SetTextConfig(FONT_SIZE + 2, LABEL_TEXT_STYLE_NORMAL);
2040 pSongNameLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
2041 pSongNameLabel->SetText(itemName);
2043 Label* pSongCountLabel = new (std::nothrow) Label();
2044 pSongCountLabel->Construct(Rectangle(pSongNameLabel->GetWidth() + W_THUMBNAIL, pSongNameLabel->GetY(), W_CREATE_TABLE_VIEW_ITEM_COUNT_LABEL_ITEM, H_CREATE_TABLE_VIEW_ITEM), L"");
2045 pSongCountLabel->SetTextConfig(FONT_SIZE - 2, LABEL_TEXT_STYLE_NORMAL);
2046 pSongCountLabel->SetTextHorizontalAlignment(ALIGNMENT_RIGHT);
2047 pSongCountLabel->SetText(CommonUtil::SetSongsString(itemCount));
2049 parent.AddControl(pSongThumbnailLabel);
2050 parent.AddControl(pSongNameLabel);
2051 parent.AddControl(pSongCountLabel);
2052 AppLogDebug("EXIT");
2057 CommonUtil::CreateTableViewContextItem(Tizen::Ui::Controls::TableViewContextItem& parent, Tizen::Ui::IActionEventListener& listener)
2059 AppLogDebug("ENTER");
2060 Button* pAddToPlaylistButton = new (std::nothrow) Button();
2061 pAddToPlaylistButton->Construct(Rectangle(X_GAP_CONTEXT_ITME, Y_GAP_CONTEXT_ITEM, parent.GetWidth() - (X_GAP_CONTEXT_ITME * 2), parent.GetHeight() - (Y_GAP_CONTEXT_ITEM * 2)));
2062 pAddToPlaylistButton->SetText(ResourceManager::GetString("IDS_MUSIC_BODY_ADD_TO_PLAYLIST"));
2063 pAddToPlaylistButton->SetTextSize(FONT_SIZE);
2064 pAddToPlaylistButton->SetActionId(IDA_FLICK_BUTTON_ADD_TO_PALYLIST);
2065 pAddToPlaylistButton->AddActionEventListener(listener);
2067 parent.SetIndividualSelectionEnabled(pAddToPlaylistButton, true);
2068 parent.AddControl(pAddToPlaylistButton);
2070 AppLogDebug("EXIT");
2074 Tizen::Ui::Controls::TableView*
2075 CommonUtil::CreateEditorTableView(int width, int height)
2077 AppLogDebug("ENTER");
2078 TableView* pTableView = new (std::nothrow) TableView();
2079 pTableView->Construct(Rectangle(INIT_VALUE, H_SELECT_ALL_BUTTON, width, height - H_SELECT_ALL_BUTTON),
2081 TABLE_VIEW_SCROLL_BAR_STYLE_FADE_OUT);
2082 AppLogDebug("EXIT");
2086 Tizen::Ui::Controls::TableView*
2087 CommonUtil::CreateTableView(int width, int height)
2089 AppLogDebug("ENTER");
2090 TableView* pTableView = new (std::nothrow) TableView();
2091 pTableView->Construct(Rectangle(0, 0, width, height), true, TABLE_VIEW_SCROLL_BAR_STYLE_FAST_SCROLL);
2096 Tizen::System::SettingInfo::GetValue("http://tizen.org/setting/locale.country", retCountry);
2097 if (retCountry.CompareTo("eng_GB") == 0)
2099 indexText.Append(L"ABCDEFGHIJKLMNOPQRSTUVWXYZ");
2101 else if(retCountry.CompareTo("kor_KR") == 0)
2103 // indexText.Append(L"ㄱㄲㄴㄷㄸㄹㅁㅂㅃㅅㅆㅇㅈㅉㅊㅋㅌㅍㅎ");
2104 indexText.Append(L"ABCDEFGHIJKLMNOPQRSTUVWXYZ");
2107 indexText.Append(L"#");
2108 indexText.Append(L"0");
2110 pTableView->SetFastScrollIndex(indexText, false);
2111 AppLogDebug("EXIT");
2116 CommonUtil::CreateContentPikerTableViewItem(Tizen::Ui::Controls::TableViewItem& parent, const Tizen::Base::String& songName, const Tizen::Base::String& songTime)
2118 AppLogDebug("ENTER");
2119 Label* pSongNameLabel = new (std::nothrow) Label();
2120 pSongNameLabel->Construct(Rectangle(0, Y_GAP_CONTENT_PIKER_ITEM, W_SONG_TITLE_CONTENT_PIKER_ITEM, H_SONG_TITLE_CONTENT_PIKER_ITEM), songName);
2121 pSongNameLabel->SetTextConfig(FONT_SIZE, LABEL_TEXT_STYLE_NORMAL);
2122 pSongNameLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
2124 Label* pSongTimeLabel = new (std::nothrow) Label();
2125 pSongTimeLabel->Construct(Rectangle(pSongNameLabel->GetWidth(), Y_GAP_CONTENT_PIKER_ITEM, W_SONG_TIME_CONTENT_PIKER_ITEM, pSongNameLabel->GetHeight()), songTime);
2126 pSongTimeLabel->SetTextConfig(FONT_SIZE, LABEL_TEXT_STYLE_NORMAL);
2127 pSongTimeLabel->SetTextHorizontalAlignment(ALIGNMENT_RIGHT);
2129 parent.AddControl(pSongNameLabel);
2130 parent.AddControl(pSongTimeLabel);
2132 AppLogDebug("EXIT");
2136 Tizen::Ui::Controls::CheckButton*
2137 CommonUtil::CreateSelectAllCheckedButton(int width)
2139 AppLogDebug("ENTER");
2140 CheckButton* pCheckButton = new (std::nothrow) CheckButton();
2141 pCheckButton->Construct(Rectangle(INIT_VALUE, INIT_VALUE, width, H_SELECT_ALL_BUTTON),
2142 CHECK_BUTTON_STYLE_MARK,
2143 BACKGROUND_STYLE_DEFAULT,
2145 ResourceManager::GetString("IDS_COM_BODY_SELECT_ALL"),
2146 GROUP_STYLE_BOTTOM);
2147 pCheckButton->SetActionId(IDA_CHECK_BUTTON, IDA_UNCHECK_BUTTON, INIT_VALUE);
2148 pCheckButton->SetColor(CHECK_BUTTON_STATUS_NORMAL, COLOR_SELECT_ALL);
2149 AppLogDebug("EXIT");
2150 return pCheckButton;
2153 Tizen::Ui::Controls::Label*
2154 CommonUtil::CreateCheckedCountLabel(int width, int height)
2156 AppLogDebug("ENTER");
2157 Label* pLabel = new (std::nothrow) Label();
2158 pLabel->Construct(Rectangle(INIT_VALUE, height - H_CHECKED_COUNT_LABEL, width, H_CHECKED_COUNT_LABEL), L"");
2159 pLabel->SetBackgroundColor(COLOR_SMALL_POPUP);
2160 pLabel->SetTextHorizontalAlignment(ALIGNMENT_CENTER);
2161 pLabel->SetText(FONT_SIZE);
2162 AppLogDebug("EXIT");
2167 CommonUtil::SetAddtoPlaylistState(bool state)
2169 AppLogDebug("ENTER");
2170 __addToPlaylistState = state;
2171 AppLogDebug("EXIT");
2175 CommonUtil::GetAddtoPlaylistState(void)
2177 AppLogDebug("ENTER");
2178 AppLogDebug("EXIT");
2179 return __addToPlaylistState;
2183 CommonUtil::SetAddtoPlaylistName(const Tizen::Base::String& addToPlayName)
2185 AppLogDebug("ENTER");
2186 __AddToPlaylistName = addToPlayName;
2187 AppLogDebug("EXIT");
2191 CommonUtil::GetAddtoPlaylistName(void)
2193 AppLogDebug("ENTER");
2194 AppLogDebug("EXIT");
2195 return __AddToPlaylistName;
2199 CommonUtil::SetButtonEnabled(const Tizen::Ui::Controls::Form& form, int checkedItemCount, int actionId)
2201 AppLogDebug("ENTER");
2202 Footer* pFooter = form.GetFooter();
2203 if (pFooter == null)
2208 if (actionId == IDA_CHECK_BUTTON
2209 || actionId == IDA_UNCHECK_BUTTON
2210 || actionId == IDA_FOOTER_BUTTON_ADD_TO_PLAYLIST
2211 || actionId == IDA_FOOTER_BUTTON_DELETE)
2213 bool buttonState = checkedItemCount == 0 ? false : true;
2214 for (int iCount = 0; iCount < pFooter->GetItemCount() - 1; iCount++)
2216 pFooter->SetItemEnabled(iCount, buttonState);
2217 pFooter->Invalidate(true);
2220 else if (actionId == IDA_FOOTER_BUTTON_CANCEL)
2222 for (int iCount = 0; iCount < pFooter->GetItemCount() - 1; iCount++)
2224 pFooter->SetItemEnabled(iCount, true);
2225 pFooter->Invalidate(true);
2228 AppLogDebug("EXIT");
2232 CommonUtil::SetButtonEnabled(const Tizen::Ui::Controls::Form& form, int checkedItemCount)
2234 AppLogDebug("ENTER");
2235 Footer* pFooter = form.GetFooter();
2236 if (pFooter == null)
2241 bool buttonState = checkedItemCount == 0 ? false : true;
2242 for (int iCount = 0; iCount < pFooter->GetItemCount() - 1; iCount++)
2244 pFooter->SetItemEnabled(iCount, buttonState);
2245 pFooter->Invalidate(true);
2247 AppLogDebug("EXIT");
2251 CommonUtil::GetColorizedBitmapN(const Tizen::Graphics::Bitmap& bitmap, const Tizen::Graphics::Color& color)
2253 AppLogDebug("ENTER");
2254 if (bitmap.GetPixelColorFormat() != BITMAP_PIXEL_FORMAT_ARGB8888)
2258 std::unique_ptr<Bitmap>pRet(new (std::nothrow) Bitmap());
2263 result r = pRet->Construct(bitmap, Rectangle(0, 0, bitmap.GetWidth(), bitmap.GetHeight()));
2271 typedef unsigned long Pixel;
2272 Pixel* pDst = static_cast<Pixel*>(bi.pPixels);
2273 int dstPadding = bi.pitch / sizeof(Pixel) - bi.width;
2274 Pixel replacing = color.GetRGB32() & 0x00FFFFFF;
2275 for (int y = 0; y < bi.height; y++)
2277 for (int x = 0; x < bi.width; x++)
2279 *pDst = (*pDst & 0xFF000000) | replacing;
2286 AppLogDebug("EXIT");
2287 return pRet.release();
2291 CommonUtil::SetNoContentImage(Tizen::Ui::Controls::Label& source, Tizen::Base::String& resourceName, Tizen::Base::String& text)
2293 AppLogDebug("ENTER");
2294 Bitmap* pNoContentImage = ResourceManager::GetBitmapN(resourceName);
2295 source.SetBackgroundBitmap(*pNoContentImage);
2296 delete pNoContentImage;
2297 source.SetText(text);
2298 source.Invalidate(false);
2299 AppLogDebug("EXIT");
2303 CommonUtil::SetHighDepthToEllipsisPath(const Tizen::Base::String& fullFilePath)
2305 AppLogDebug("ENTER");
2306 StringTokenizer stringTokenizer(fullFilePath, IDS_SEPARATOR_SLASH);
2307 int depthCount = stringTokenizer.GetTokenCount() - DEPTH;
2308 if (depthCount <= INIT_VALUE)
2310 AppLogDebug("EXIT");
2311 return fullFilePath;
2314 String folderPath(L".");
2316 while (stringTokenizer.HasMoreTokens())
2319 stringTokenizer.GetNextToken(token);
2320 if (iLoopCount >= depthCount)
2322 folderPath.Append(IDS_SEPARATOR_SLASH);
2323 folderPath.Append(token);
2328 AppLogDebug("EXIT");
2333 CommonUtil::GetFontSizeValue(void)
2335 AppLogDebug("ENTER");
2336 String fontSizeValue;
2337 SettingInfo::GetValue(PARAM_FONT_SIZE, fontSizeValue);
2338 AppLogDebug("EXIT");
2339 return fontSizeValue;
2343 CommonUtil::GetItemHeight(const Tizen::Base::String& fontSizeValue)
2347 if (fontSizeValue.Equals(STRING_FONT_SIZE_GIANT, false))
2349 itemHeight = ITEM_HEIGHT_MAIN_TEXT_GIANT;
2351 else if (fontSizeValue.Equals(STRING_FONT_SIZE_HUGE, false))
2353 itemHeight = ITEM_HEIGHT_MAIN_TEXT_HUGE;
2355 else if (fontSizeValue.Equals(STRING_FONT_SIZE_LARGE, false))
2357 itemHeight = ITEM_HEIGHT_MAIN_TEXT_LARGE;
2359 else if (fontSizeValue.Equals(L"medium", false))
2361 itemHeight = ITEM_HEIGHT_MAIN_TEXT_NORMAL;
2365 itemHeight = ITEM_HEIGHT_MAIN_TEXT_SMALL;
2371 CommonUtil::GetFontSize(const Tizen::Base::String& fontSizeValue)
2375 if (fontSizeValue.Equals(STRING_FONT_SIZE_GIANT, false))
2377 fontSize = FONT_MAIN_TEXT_SIZE_GIANT;
2379 else if (fontSizeValue.Equals(STRING_FONT_SIZE_HUGE, false))
2381 fontSize = FONT_MAIN_TEXT_SIZE_HUGE;
2383 else if (fontSizeValue.Equals(STRING_FONT_SIZE_LARGE, false))
2385 fontSize = FONT_MAIN_TEXT_SIZE_LARGE;
2387 else if (fontSizeValue.Equals(L"medium", false))
2389 fontSize = FONT_MAIN_TEXT_SIZE_NORMAL;
2393 fontSize = FONT_MAIN_TEXT_SIZE_SMALL;