modify license, permission and remove ^M char
[platform/framework/native/uifw.git] / src / ui / FUi_CardLayoutImpl.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an ”AS IS” BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 /**
18  * @file                FUi_CardLayoutImpl.cpp
19  * @brief       This is the implementation file for _CardLayoutImpl class.
20  *
21  * This file contains the implementation of _CardLayoutImpl class.
22  */
23
24 #include "FUi_CardLayoutImpl.h"
25
26 namespace Tizen { namespace Ui
27 {
28
29 // _CardLayoutImpl implementation
30 _CardLayoutImpl::_CardLayoutImpl(CardLayout* pPublicLayout, _Layout::AbsoluteLayout* pCoreLayout)
31         : _LayoutImpl(pPublicLayout, pCoreLayout)
32 {
33 }
34
35 _CardLayoutImpl::~_CardLayoutImpl(void)
36 {
37 }
38
39 Tizen::Ui::LayoutType
40 _CardLayoutImpl::GetLayoutType(void) const
41 {
42         return LAYOUT_CARD;
43 }
44
45 _CardLayoutImpl*
46 _CardLayoutImpl::CreateCardLayoutImplN(CardLayout* pPublicLayout)
47 {
48         ClearLastResult();
49
50         _Layout::AbsoluteLayout* pCoreLayout = null;
51         _CardLayoutImpl* pImplLayout = null;
52         result r = E_SUCCESS;
53
54         pCoreLayout = _Layout::AbsoluteLayout::CreateAbsoluteLayoutN(true);
55         r = GetLastResult();
56         SysTryReturn(NID_UI, pCoreLayout != null, null, r, "[%s] Propagating.", GetErrorMessage(r));
57
58         pImplLayout = new (std::nothrow) _CardLayoutImpl(pPublicLayout, pCoreLayout);
59         r = CheckConstruction(pCoreLayout, pImplLayout);
60         SysTryReturn(NID_UI, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
61
62         return pImplLayout;
63 }
64
65 const char*
66 _CardLayoutImpl::GetPublicClassName(void) const
67 {
68         return "Tizen::Ui::CardLayout";
69 }
70
71 const CardLayout&
72 _CardLayoutImpl::GetPublic(void) const
73 {
74         return static_cast <const CardLayout&>(_LayoutImpl::GetPublic());
75 }
76
77 CardLayout&
78 _CardLayoutImpl::GetPublic(void)
79 {
80         return static_cast <CardLayout&>(_LayoutImpl::GetPublic());
81 }
82
83 const _Layout::AbsoluteLayout&
84 _CardLayoutImpl::GetCore(void) const
85 {
86         return static_cast <const _Layout::AbsoluteLayout&>(_LayoutImpl::GetCore());
87 }
88
89 _Layout::AbsoluteLayout&
90 _CardLayoutImpl::GetCore(void)
91 {
92         return static_cast <_Layout::AbsoluteLayout&>(_LayoutImpl::GetCore());
93 }
94
95 const _CardLayoutImpl*
96 _CardLayoutImpl::GetInstance(const CardLayout& layout)
97 {
98         return static_cast<const _CardLayoutImpl*>(_LayoutImpl::GetInstance(layout));
99 }
100
101 _CardLayoutImpl*
102 _CardLayoutImpl::GetInstance(CardLayout& layout)
103 {
104         return static_cast<_CardLayoutImpl*>(_LayoutImpl::GetInstance(layout));
105 }
106
107 }} // Tizen::Ui