Fork for IVI: mesa fixing
[profile/ivi/uifw.git] / src / app / FApp_AppFrame.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 /**
19  * @file        FApp_AppFrame.cpp
20  * @brief       This is the implementation for the _AppFrame class.
21  */
22
23 #include <FUiCtrlFrame.h>
24
25 #include <FBaseSysLog.h>
26
27 #include "FApp_AppFrame.h"
28
29 using namespace Tizen::Graphics;
30 using namespace Tizen::Ui;
31 using namespace Tizen::Ui::Controls;
32
33 namespace Tizen { namespace App
34 {
35
36
37 _AppFrame::_AppFrame(void)
38         : __pFrame(null)
39 {
40 }
41
42
43 _AppFrame::_AppFrame(Frame& frame)
44         : __pFrame(&frame)
45 {
46 }
47
48
49 _AppFrame::~_AppFrame(void)
50 {
51 }
52
53
54 result
55 _AppFrame::Construct(void)
56 {
57         result r = E_SUCCESS;
58
59         return r;
60 }
61
62
63 result
64 _AppFrame::SetFrame(Frame* pFrame)
65 {
66         result r = E_SUCCESS;
67
68         __pFrame = pFrame;
69
70         return r;
71 }
72
73
74 Canvas*
75 _AppFrame::GetCanvasN(void) const
76 {
77         Canvas* pCanvas = null;
78
79         SysTryCatch(NID_APP, __pFrame != null, , E_INVALID_STATE, "[E_INVALID_STATE] Frame instance must not be null.");
80
81         pCanvas = __pFrame->GetCanvasN();
82         SysTryCatch(NID_APP, pCanvas != null, , E_INVALID_STATE, "[E_SYSTEM] Failed while fetching the canvas.");
83
84 CATCH:
85         return pCanvas;
86 }
87
88
89 result
90 _AppFrame::AddKeyEventListener(IKeyEventListener& listener)
91 {
92         SysTryReturn(NID_APP, __pFrame != null, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Frame instance must not be null.");
93
94         __pFrame->AddKeyEventListener(listener);
95
96         return E_SUCCESS;
97 }
98
99
100 result
101 _AppFrame::RemoveKeyEventListener(IKeyEventListener& listener)
102 {
103         SysTryReturnResult(NID_APP, __pFrame != null, E_INVALID_STATE, "Frame instance must not be null.");
104
105         __pFrame->RemoveKeyEventListener(listener);
106
107         return E_SUCCESS;
108 }
109
110
111 result
112 _AppFrame::AddTouchEventListener(ITouchEventListener& listener)
113 {
114         SysTryReturnResult(NID_APP, __pFrame != null, E_INVALID_STATE, "Frame instance must not be null.");
115
116         __pFrame->AddTouchEventListener(listener);
117
118         return E_SUCCESS;
119 }
120
121
122 result
123 _AppFrame::RemoveTouchEventListener(ITouchEventListener& listener)
124 {
125         SysTryReturnResult(NID_APP, __pFrame != null, E_INVALID_STATE, "Frame instance must not be null.");
126
127         __pFrame->RemoveTouchEventListener(listener);
128
129         return E_SUCCESS;
130 }
131
132
133 result
134 _AppFrame::AddWindowEventListener(IWindowEventListener& listener)
135 {
136         SysTryReturnResult(NID_APP, __pFrame != null, E_INVALID_STATE, "Frame instance must not be null.");
137
138         __pFrame->AddWindowEventListener(listener);
139
140         return E_SUCCESS;
141 }
142
143
144 result
145 _AppFrame::RemoveWindowEventListener(IWindowEventListener& listener)
146 {
147         SysTryReturnResult(NID_APP, __pFrame != null, E_INVALID_STATE, "Frame instance must not be null.");
148
149         __pFrame->RemoveWindowEventListener(listener);
150
151         return E_SUCCESS;
152 }
153
154
155 Frame*
156 _AppFrame::GetFrame(void)
157 {
158         return __pFrame;
159 }
160
161
162 } } // Tizen::App