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 MpFormFactory.cpp
19 * @brief This is the implementation file for FormFactory class.
22 #include "MpFormFactory.h"
24 using namespace Tizen::Ui::Scenes;
26 const wchar_t* IDC_PLAYER_FORM = L"PlayForm";
27 const wchar_t* IDC_MUSIC_SETTING_FORM = L"SettingForm";
28 const wchar_t* IDC_SEARCH_FORM = L"Search";
29 const wchar_t* IDC_CONTENT_FORM = L"ContentForm";
30 const wchar_t* IDC_CONTENT_PICKER_FORM = L"ContentPickerForm";
31 const wchar_t* IDC_CONTENT_EDIT_FORM = L"ContentEditForm";
32 const wchar_t* IDC_ALBUM_CONTENT_LIST_FORM = L"AlbumContentListForm";
33 const wchar_t* IDC_ARTIST_CONTENT_LIST_FORM = L"ArtistContentListForm";
34 const wchar_t* IDC_GENRE_CONTENT_LIST_FORM = L"GenreContentListForm";
35 const wchar_t* IDC_COMPOSER_CONTENT_LIST_FORM = L"ComposerContentListForm";
36 const wchar_t* IDC_YEAR_CONTENT_LIST_FORM = L"YearContentListForm";
37 const wchar_t* IDC_FOLDER_CONTENT_LIST_FORM = L"FolderContentListForm";
38 const wchar_t* IDC_PLAYLIST_CONTENT_LIST_FORM = L"PlayListContentListForm";
39 const wchar_t* IDC_PLAYLIST_CREATOR_FORM = L"PlaylistCreatorForm";
40 const wchar_t* IDC_PLAYLIST_RENAME_FORM = L"PlaylistReNameForm";
41 const wchar_t* IDC_USER_PLAYLIST_CONTENT_LIST_FORM = L"UserPlaylistContentListForm";
42 const wchar_t* IDC_CONTENT_DETAIL_FORM = L"ContentDetailForm";
43 const wchar_t* IDC_ARTIST_ALBUM_LIST_FORM = L"ArtistAlbumListForm";
44 const wchar_t* IDC_ARTIST_ALBUM_LIST_SEARCH_FORM = L"ArtistAlbumListSearchForm";
45 const wchar_t* IDC_ARTIST_ALBUM_LIST_EDIT_FORM = L"ArtistAlbumListEditorForm";
46 const wchar_t* IDC_ARTIST_ALL_SONG_LIST_FORM = L"ArtistAllSongListForm";
48 FormFactory::FormFactory(void)
54 FormFactory::~FormFactory(void)
60 Tizen::Ui::Controls::Form*
61 FormFactory::CreateFormN(const Tizen::Base::String& formId, const Tizen::Ui::Scenes::SceneId& sceneId)
64 Tizen::Ui::Controls::Form* pNewForm = null;
65 SceneManager* pSceneManager = SceneManager::GetInstance();
66 AppAssert(pSceneManager);
68 if (formId == IDC_PLAYER_FORM)
70 PlayerForm* pForm = new (std::nothrow) PlayerForm();
77 pSceneManager->AddSceneEventListener(sceneId, *pForm);
80 else if (formId == IDC_MUSIC_SETTING_FORM)
82 SettingForm* pForm = new (std::nothrow) SettingForm();
89 pSceneManager->AddSceneEventListener(sceneId, *pForm);
92 else if (formId == IDC_CONTENT_FORM)
94 ContentForm* pForm = new (std::nothrow) ContentForm();
103 else if (formId == IDC_CONTENT_PICKER_FORM)
105 ContentForm* pForm = new (std::nothrow) ContentForm();
114 else if (formId == IDC_SEARCH_FORM)
116 SearchForm* pForm = new (std::nothrow) SearchForm();
123 pSceneManager->AddSceneEventListener(sceneId, *pForm);
126 else if (formId == IDC_ALBUM_CONTENT_LIST_FORM)
128 AlbumContentListForm* pForm = new (std::nothrow) AlbumContentListForm();
135 pSceneManager->AddSceneEventListener(sceneId, *pForm);
138 else if (formId == IDC_ARTIST_CONTENT_LIST_FORM)
140 ArtistContentListForm* pForm = new (std::nothrow) ArtistContentListForm();
147 pSceneManager->AddSceneEventListener(sceneId, *pForm);
150 // else if (formId == IDC_GENRE_CONTENT_LIST_FORM)
152 // GenreContentListForm* pForm = new (std::nothrow) GenreContentListForm();
153 // if (pForm == null)
155 // AppLogDebug("EXIT");
158 // pForm->Initialize();
159 // pSceneManager->AddSceneEventListener(sceneId, *pForm);
162 // else if (formId == IDC_COMPOSER_CONTENT_LIST_FORM)
164 // ComposerContentListForm* pForm = new (std::nothrow) ComposerContentListForm();
165 // if (pForm == null)
167 // AppLogDebug("EXIT");
170 // pForm->Initialize();
171 // pSceneManager->AddSceneEventListener(sceneId, *pForm);
174 // else if (formId == IDC_YEAR_CONTENT_LIST_FORM)
176 // YearContentListForm* pForm = new (std::nothrow) YearContentListForm();
177 // if (pForm == null)
179 // AppLogDebug("EXIT");
182 // pForm->Initialize();
183 // pSceneManager->AddSceneEventListener(sceneId, *pForm);
186 else if (formId == IDC_FOLDER_CONTENT_LIST_FORM)
188 FolderContentListForm* pForm = new (std::nothrow) FolderContentListForm();
195 pSceneManager->AddSceneEventListener(sceneId, *pForm);
198 else if (formId == IDC_PLAYLIST_CONTENT_LIST_FORM)
200 PlaylistContentListForm* pForm = new (std::nothrow) PlaylistContentListForm();
207 pSceneManager->AddSceneEventListener(sceneId, *pForm);
210 else if (formId == IDC_PLAYLIST_CREATOR_FORM)
212 PlaylistCreatorForm* pForm = new (std::nothrow) PlaylistCreatorForm();
219 pSceneManager->AddSceneEventListener(sceneId, *pForm);
222 else if (formId == IDC_PLAYLIST_RENAME_FORM)
224 PlaylistReNameForm* pForm = new (std::nothrow) PlaylistReNameForm();
231 pSceneManager->AddSceneEventListener(sceneId, *pForm);
234 else if (formId == IDC_CONTENT_DETAIL_FORM)
236 ContentDetailForm* pForm = new (std::nothrow) ContentDetailForm();
243 pSceneManager->AddSceneEventListener(sceneId, *pForm);
246 // else if (formId == IDC_ARTIST_ALBUM_LIST_FORM)
248 // ArtistAlbumListForm* pForm = new (std::nothrow) ArtistAlbumListForm();
249 // if (pForm == null)
251 // AppLogDebug("EXIT");
254 // pForm->Initialize();
255 // pSceneManager->AddSceneEventListener(sceneId, *pForm);
258 // else if (formId == IDC_ARTIST_ALBUM_LIST_SEARCH_FORM)
260 // ArtistAlbumListForm* pForm = new (std::nothrow) ArtistAlbumListForm();
261 // if (pForm == null)
263 // AppLogDebug("EXIT");
266 // pForm->Initialize();
267 // pSceneManager->AddSceneEventListener(sceneId, *pForm);
270 // else if (formId == IDC_ARTIST_ALBUM_LIST_EDIT_FORM)
272 // ArtistAlbumListEditorForm* pForm = new (std::nothrow) ArtistAlbumListEditorForm();
273 // if (pForm == null)
275 // AppLogDebug("EXIT");
278 // pForm->Initialize();
279 // pSceneManager->AddSceneEventListener(sceneId, *pForm);
282 // else if (formId == IDC_ARTIST_ALL_SONG_LIST_FORM)
284 // ArtistAllSongListForm* pForm = new (std::nothrow) ArtistAllSongListForm();
285 // if (pForm == null)
287 // AppLogDebug("EXIT");
290 // pForm->Initialize();
291 // pSceneManager->AddSceneEventListener(sceneId, *pForm);
294 else if (formId == IDC_USER_PLAYLIST_CONTENT_LIST_FORM)
296 UserPlaylistContentListForm* pForm = new (std::nothrow) UserPlaylistContentListForm();
303 pSceneManager->AddSceneEventListener(sceneId, *pForm);