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 "GlSettingMainForm.h"
31 using namespace Tizen::Base;
32 using namespace Tizen::Ui;
33 using namespace Tizen::Ui::Controls;
34 using namespace Tizen::Ui::Scenes;
36 FormFactory::FormFactory(void)
39 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
42 FormFactory::~FormFactory(void)
45 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
49 FormFactory::CreateFormN(const String& formId, const SceneId& sceneId)
52 SceneManager* pSceneManager = SceneManager::GetInstance();
53 AppAssert(pSceneManager);
54 Form* pNewForm = null;
56 if (formId == IDC_FORM_ALBUM_LIST)
58 AlbumListForm* pForm = new (std::nothrow) AlbumListForm();
60 pSceneManager->AddSceneEventListener(sceneId, *pForm);
63 else if (formId == IDC_FORM_ALBUM_LIST_EDITOR)
65 AlbumListEditorForm* pForm = new (std::nothrow) AlbumListEditorForm();
67 pSceneManager->AddSceneEventListener(sceneId, *pForm);
70 else if (formId == IDC_FORM_ALBUM_NAME_EDITOR)
72 AlbumNameEditorForm* pForm = new (std::nothrow) AlbumNameEditorForm();
74 pSceneManager->AddSceneEventListener(sceneId, *pForm);
77 else if (formId == IDC_FORM_FILE_LIST)
79 FileListForm* pForm = new (std::nothrow) FileListForm();
83 else if (formId == IDC_FORM_FILE_LIST_EDITOR)
85 FileListEditorForm* pForm = new (std::nothrow) FileListEditorForm();
87 pSceneManager->AddSceneEventListener(sceneId, *pForm);
90 else if (formId == IDC_FORM_SETTING_MAIN)
92 SettingMainForm* pForm = new (std::nothrow) SettingMainForm();
94 pSceneManager->AddSceneEventListener(sceneId, *pForm);
98 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));