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 CtPanelFactory.cpp
19 * @brief This is the implementation file for the PanelFactory class.
22 #include "CtContactListEditorPanel.h"
23 #include "CtContactListPanel.h"
24 #include "CtFavoriteListEditorPanel.h"
25 #include "CtFavoriteListPanel.h"
26 #include "CtGroupListPanel.h"
27 #include "CtGroupListEditorPanel.h"
28 #include "CtPanelFactory.h"
31 using namespace Tizen::Ui::Controls;
32 using namespace Tizen::Ui::Scenes;
34 PanelFactory::PanelFactory(void)
38 PanelFactory::~PanelFactory(void)
42 Tizen::Ui::Controls::Panel*
43 PanelFactory::CreatePanelN(const Tizen::Base::String& panelId, const Tizen::Ui::Scenes::SceneId& sceneId)
47 Panel* pNewPanel= null;
48 SceneManager* pSceneManager = SceneManager::GetInstance();
50 if (panelId == IDC_PANEL_CONTACT_LIST)
52 ContactListPanel* pPanel = new (std::nothrow) ContactListPanel();
55 r = pSceneManager->AddSceneEventListener(sceneId, *pPanel);
56 TryCatch(r == E_SUCCESS, delete pPanel, "[%s] Unable to add scene event listener", GetErrorMessage(r));
60 else if (panelId == IDC_PANEL_CONTACT_LIST_EDITOR)
62 ContactListEditorPanel* pPanel = new (std::nothrow) ContactListEditorPanel();
65 r = pSceneManager->AddSceneEventListener(sceneId, *pPanel);
66 TryCatch(r == E_SUCCESS, delete pPanel, "[%s] Unable to add scene event listener", GetErrorMessage(r));
70 else if (panelId == IDC_PANEL_GROUP_LIST)
72 GroupListPanel* pPanel = new (std::nothrow) GroupListPanel();
75 r = pSceneManager->AddSceneEventListener(sceneId, *pPanel);
76 TryCatch(r == E_SUCCESS, delete pPanel, "[%s] Unable to add scene event listener", GetErrorMessage(r));
80 else if (panelId == IDC_PANEL_GROUP_LIST_EDITOR)
82 GroupListEditorPanel* pPanel = new (std::nothrow) GroupListEditorPanel();
85 r = pSceneManager->AddSceneEventListener(sceneId, *pPanel);
86 TryCatch(r == E_SUCCESS, delete pPanel, "[%s] Unable to add scene event listener", GetErrorMessage(r));
90 else if (panelId == IDC_PANEL_FAVORITE_LIST)
92 FavoriteListPanel* pPanel = new (std::nothrow) FavoriteListPanel();
95 r = pSceneManager->AddSceneEventListener(sceneId, *pPanel);
96 TryCatch(r == E_SUCCESS, delete pPanel, "[%s] Unable to add scene event listener", GetErrorMessage(r));
100 else if (panelId == IDC_PANEL_FAVORITE_LIST_EDITOR)
102 FavoriteListEditorPanel* pPanel = new (std::nothrow) FavoriteListEditorPanel();
103 pPanel->Initialize();
105 r = pSceneManager->AddSceneEventListener(sceneId, *pPanel);
106 TryCatch(r == E_SUCCESS, delete pPanel, "[%s] Unable to add scene event listener", GetErrorMessage(r));