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 GlFormFactory.cpp
19 * @brief This is the implementation file for FormFactory class.
22 #include "GlAlbumListEditorForm.h"
23 #include "GlAlbumListForm.h"
24 #include "GlAlbumNameEditorForm.h"
25 #include "GlFileListEditorForm.h"
26 #include "GlFileListForm.h"
27 #include "GlFormFactory.h"
28 #include "GlImageCropForm.h"
29 #include "GlSettingMainForm.h"
32 using namespace Tizen::Base;
33 using namespace Tizen::Ui;
34 using namespace Tizen::Ui::Controls;
35 using namespace Tizen::Ui::Scenes;
37 FormFactory::FormFactory(void)
40 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
43 FormFactory::~FormFactory(void)
46 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
50 FormFactory::CreateFormN(const String& formId, const SceneId& sceneId)
53 SceneManager* pSceneManager = SceneManager::GetInstance();
54 AppAssert(pSceneManager);
55 Form* pNewForm = null;
57 if (formId == IDC_FORM_ALBUM_LIST)
59 AlbumListForm* pForm = new (std::nothrow) AlbumListForm();
61 pSceneManager->AddSceneEventListener(sceneId, *pForm);
64 else if (formId == IDC_FORM_ALBUM_LIST_EDITOR)
66 AlbumListEditorForm* pForm = new (std::nothrow) AlbumListEditorForm();
68 pSceneManager->AddSceneEventListener(sceneId, *pForm);
71 else if (formId == IDC_FORM_ALBUM_NAME_EDITOR)
73 AlbumNameEditorForm* pForm = new (std::nothrow) AlbumNameEditorForm();
75 pSceneManager->AddSceneEventListener(sceneId, *pForm);
78 else if (formId == IDC_FORM_FILE_LIST)
80 FileListForm* pForm = new (std::nothrow) FileListForm();
84 else if (formId == IDC_FORM_FILE_LIST_EDITOR)
86 FileListEditorForm* pForm = new (std::nothrow) FileListEditorForm();
88 pSceneManager->AddSceneEventListener(sceneId, *pForm);
91 else if (formId == IDC_FORM_SETTING_MAIN)
93 SettingMainForm* pForm = new (std::nothrow) SettingMainForm();
95 pSceneManager->AddSceneEventListener(sceneId, *pForm);
98 else if (formId == IDC_FORM_IMAGE_CROP)
100 ImageCropForm* pForm = new (std::nothrow) ImageCropForm();
102 pSceneManager->AddSceneEventListener(sceneId, *pForm);
106 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));