Tizen 2.0 Release
[apps/osp/Phone.git] / src / PhnPanelFactory.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://floralicense.org/license/
9 //
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.
15 //
16
17 /**
18  * @file    PhnPanelFactory.cpp
19  * @brief   The Panel factory for Dial application
20  */
21
22 #include "PhnPanelFactory.h"
23 #include "PhnTabDialer.h"
24 #include "PhnTabContacts.h"
25 #include "PhnTabLogs.h"
26 #include "PhnTabFavorites.h"
27
28 using namespace Tizen::Base;
29 using namespace Tizen::Ui::Controls;
30 using namespace Tizen::Ui::Scenes;
31
32
33
34 PanelFactory::PanelFactory(void)
35 {
36 }
37
38 PanelFactory::~PanelFactory(void)
39 {
40 }
41
42 Panel*
43 PanelFactory::CreatePanelN(const String& panelId, const SceneId& sceneId)
44 {
45         SceneManager* pSceneManager = SceneManager::GetInstance();
46         AppAssert(pSceneManager);
47         Panel* pNewPanel = null;
48
49         if (panelId == PANEL_DIALER)
50         {
51                 DialTabDialer* pPanel = new DialTabDialer();
52                 pPanel->Initialize();
53                 pSceneManager->AddSceneEventListener(sceneId, *pPanel);
54                 pNewPanel = pPanel;
55         }
56         else if (panelId == PANEL_LOGS)
57         {
58                 DialTabLogs* pPanel = new DialTabLogs();
59                 pPanel->Initialize();
60                 pSceneManager->AddSceneEventListener(sceneId, *pPanel);
61                 pNewPanel = pPanel;
62         }
63         return pNewPanel;
64 }