apply Pre-ACR result, add _LiveboxPopupProviderImpl
[platform/framework/native/shell.git] / src / FShell_LiveboxProviderImpl.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 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        FShell_LiveboxProviderImpl.cpp
20  * @brief       This is the implementation for the _LiveboxProviderImpl class.
21  */
22
23 #include <FBase.h>
24 #include <FShellLiveboxFrame.h>
25
26 #include "FShell_LiveboxProviderImpl.h"
27 #include "FShell_LiveboxFrameImpl.h"
28
29 namespace Tizen { namespace Shell
30 {
31
32 using namespace Tizen::Base;
33
34 _LiveboxProviderImpl::_LiveboxProviderImpl(const String& instanceId)
35         :__instanceId(instanceId)
36         ,__pLiveboxFrame(null)
37 {
38
39 }
40
41 _LiveboxProviderImpl::~_LiveboxProviderImpl()
42 {
43
44 }
45
46 const String&
47 _LiveboxProviderImpl::GetInstanceId() const
48 {
49         return __instanceId;
50 }
51
52 result
53 _LiveboxProviderImpl::SetLiveboxFrame(LiveboxFrame* pLiveboxFrame)
54 {
55         SysTryReturnResult(NID_APP, (pLiveboxFrame != null && __pLiveboxFrame == pLiveboxFrame), E_OBJ_ALREADY_EXIST, "");
56
57         __pLiveboxFrame = pLiveboxFrame;
58
59         if( pLiveboxFrame == null)
60         {
61                 return E_SUCCESS;
62         }
63
64         _LiveboxFrameImpl* pLiveboxFrameImpl = _LiveboxFrameImpl::GetInstance(*pLiveboxFrame);
65 //      SysAssertf(pLiveboxFrameImpl != null, "Not-yet constructed! Construct() should be called before use.");
66         SysTryReturnResult(NID_APP, pLiveboxFrameImpl, E_INVALID_OPERATION, "Not-yet constructed! LiveboxFrame::Construct() should be called before use.");
67
68         pLiveboxFrameImpl->SetProviderId(GetInstanceId());
69
70         return E_SUCCESS;
71 }
72
73 LiveboxFrame*
74 _LiveboxProviderImpl::GetLiveboxFrame() const
75 {
76         return __pLiveboxFrame;
77 }
78
79 }} // Tizen::Shell