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 GlPanelFactory.cpp
19 * @brief This is the implementation file for PanelFactory class.
22 #include "GlAllListEditorPanel.h"
23 #include "GlAllListPanel.h"
24 #include "GlAllListSelectionPanel.h"
25 #include "GlImageListEditorPanel.h"
26 #include "GlImageListPanel.h"
27 #include "GlPanelFactory.h"
28 #include "GlVideoListEditorPanel.h"
29 #include "GlVideoListPanel.h"
32 using namespace Tizen::Base;
33 using namespace Tizen::Ui::Controls;
34 using namespace Tizen::Ui::Scenes;
36 PanelFactory::PanelFactory()
39 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
42 PanelFactory::~PanelFactory()
45 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
49 PanelFactory::CreatePanelN(const String& panelId, const SceneId& sceneId)
52 Panel* pNewPanel = null;
53 SceneManager* pSceneManager = SceneManager::GetInstance();
54 AppAssert(pSceneManager);
56 if (panelId == IDC_PANEL_ALL_LIST)
58 AllListPanel* pPanel = new (std::nothrow) AllListPanel();
60 pSceneManager->AddSceneEventListener(sceneId, *pPanel);
63 else if (panelId == IDC_PANEL_IMAGE_LIST)
65 ImageListPanel* pPanel = new (std::nothrow) ImageListPanel();
67 pSceneManager->AddSceneEventListener(sceneId, *pPanel);
70 else if (panelId == IDC_PANEL_VIDEO_LIST)
72 VideoListPanel* pPanel = new (std::nothrow) VideoListPanel();
74 pSceneManager->AddSceneEventListener(sceneId, *pPanel);
77 else if (panelId == IDC_PANEL_ALL_LIST_EDITOR)
79 AllListEditorPanel* pPanel = new (std::nothrow) AllListEditorPanel();
81 pSceneManager->AddSceneEventListener(sceneId, *pPanel);
84 else if (panelId == IDC_PANEL_IMAGE_LIST_EDITOR)
86 ImageListEditorPanel* pPanel = new (std::nothrow) ImageListEditorPanel();
88 pSceneManager->AddSceneEventListener(sceneId, *pPanel);
91 else if (panelId == IDC_PANEL_VIDEO_LIST_EDITOR)
93 VideoListEditorPanel* pPanel = new (std::nothrow) VideoListEditorPanel();
95 pSceneManager->AddSceneEventListener(sceneId, *pPanel);
98 else if (panelId == IDC_PANEL_ALL_LIST_SELECTION)
100 AllListSelectionPanel* pPanel = new (std::nothrow) AllListSelectionPanel();
101 pPanel->Initialize();
102 pSceneManager->AddSceneEventListener(sceneId, *pPanel);
105 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));