Tizen 2.0 Release
[apps/osp/Phone.git] / src / PhnTabContacts.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        PhnTabContacts.cpp
19  * @brief       The contacts Tab
20  */
21
22 #include "PhnTabContacts.h"
23
24 using namespace Tizen::Base::Collection;
25 using namespace Tizen::Graphics;
26 using namespace Tizen::Ui;
27 using namespace Tizen::Ui::Controls;
28 using namespace Tizen::Ui::Scenes;
29
30 static const wchar_t* IDL_PANEL_CONTACTS = L"IDL_PANEL_CONTACTS";
31
32 DialTabContacts::DialTabContacts(void)
33 {
34 }
35
36 DialTabContacts::~DialTabContacts(void)
37 {
38 }
39
40 bool
41 DialTabContacts::Initialize(void)
42 {
43         result r = Construct(IDL_PANEL_CONTACTS);
44         if (IsFailed(r))
45                 return false;
46
47         return true;
48 }
49
50 result
51 DialTabContacts::OnInitializing(void)
52 {
53         result r = E_SUCCESS;
54
55         // Layout setting
56         const Form* pForm = dynamic_cast<Form*>(GetParent());
57         if (pForm != null)
58         {
59                 RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(pForm->GetLandscapeLayoutN());
60                 if (pRelativeLayout != null)
61                 {
62                         pRelativeLayout->SetHorizontalFitPolicy(*this, FIT_POLICY_PARENT);
63                         pRelativeLayout->SetVerticalFitPolicy(*this, FIT_POLICY_PARENT);
64                         delete pRelativeLayout;
65                 }
66                 pRelativeLayout = dynamic_cast<RelativeLayout*>(pForm->GetPortraitLayoutN());
67                 if (pRelativeLayout != null)
68                 {
69                         pRelativeLayout->SetHorizontalFitPolicy(*this, FIT_POLICY_PARENT);
70                         pRelativeLayout->SetVerticalFitPolicy(*this, FIT_POLICY_PARENT);
71                         delete pRelativeLayout;
72                 }
73         }
74         return r;
75 }
76
77 result
78 DialTabContacts::OnTerminating(void)
79 {
80         result r = E_SUCCESS;
81         return r;
82 }
83
84 void
85 DialTabContacts::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
86 {
87 }
88
89 void
90 DialTabContacts::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
91 {
92 }