2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.0 (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 "GlSettingIntervalForm.h"
29 #include "GlSettingMainForm.h"
30 #include "GlSettingTransitionForm.h"
33 using namespace Tizen::Base;
34 using namespace Tizen::Ui;
35 using namespace Tizen::Ui::Controls;
36 using namespace Tizen::Ui::Scenes;
38 FormFactory::FormFactory(void)
41 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
44 FormFactory::~FormFactory(void)
47 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
51 FormFactory::CreateFormN(const String& formId, const SceneId& sceneId)
54 SceneManager* pSceneManager = SceneManager::GetInstance();
55 AppAssert(pSceneManager);
56 Form* pNewForm = null;
58 if (formId == IDC_FORM_ALBUM_LIST)
60 AlbumListForm* pForm = new (std::nothrow) AlbumListForm();
62 pSceneManager->AddSceneEventListener(sceneId, *pForm);
65 else if (formId == IDC_FORM_ALBUM_LIST_EDITOR)
67 AlbumListEditorForm* pForm = new (std::nothrow) AlbumListEditorForm();
69 pSceneManager->AddSceneEventListener(sceneId, *pForm);
72 else if (formId == IDC_FORM_ALBUM_NAME_EDITOR)
74 AlbumNameEditorForm* pForm = new (std::nothrow) AlbumNameEditorForm();
76 pSceneManager->AddSceneEventListener(sceneId, *pForm);
79 else if (formId == IDC_FORM_FILE_LIST)
81 FileListForm* pForm = new (std::nothrow) FileListForm();
85 else if (formId == IDC_FORM_FILE_LIST_EDITOR)
87 FileListEditorForm* pForm = new (std::nothrow) FileListEditorForm();
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_SETTING_INTERVAL)
100 SettingIntervalForm* pForm = new (std::nothrow) SettingIntervalForm();
102 pSceneManager->AddSceneEventListener(sceneId, *pForm);
105 else if (formId == IDC_FORM_SETTING_TRANSITION)
107 SettingTransitionForm* pForm = new (std::nothrow) SettingTransitionForm();
109 pSceneManager->AddSceneEventListener(sceneId, *pForm);
112 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));