Revert "[Tizen] Implement WebEngineLite interface and plugin for Minimized Web Engine"
[platform/core/uifw/dali-adaptor.git] / dali / internal / system / common / widget-impl.cpp
1 /*
2  * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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 // CLASS HEADER
19 #include "widget-impl.h"
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/adaptor-framework/window.h>
23 #include <dali/internal/system/common/widget-controller.h>
24
25 namespace Dali
26 {
27
28 namespace Internal
29 {
30
31 namespace Adaptor
32 {
33
34 WidgetPtr Widget::New()
35 {
36   return new Widget();
37 }
38
39 Widget::Widget()
40 : mImpl( nullptr )
41 {
42 }
43
44 Widget::~Widget()
45 {
46   if( mImpl != nullptr )
47   {
48     delete mImpl;
49   }
50 }
51
52 void Widget::OnCreate( const std::string& contentInfo, Dali::Window window )
53 {
54 }
55
56 void Widget::OnTerminate( const std::string& contentInfo, Dali::Widget::Termination type )
57 {
58 }
59
60 void Widget::OnPause()
61 {
62 }
63
64 void Widget::OnResume()
65 {
66 }
67
68 void Widget::OnResize( Dali::Window window )
69 {
70 }
71
72 void Widget::OnUpdate( const std::string& contentInfo, int force )
73 {
74 }
75
76 void Widget::SignalConnected( SlotObserver* slotObserver, CallbackBase* callback )
77 {
78   mImpl->SignalConnected( slotObserver, callback );
79 }
80
81 void Widget::SignalDisconnected( SlotObserver* slotObserver, CallbackBase* callback )
82 {
83   mImpl->SignalDisconnected( slotObserver, callback );
84 }
85
86 void Widget::SetContentInfo( const std::string& contentInfo )
87 {
88   if( mImpl != nullptr )
89   {
90     mImpl->SetContentInfo( contentInfo );
91   }
92 }
93
94 void Widget::SetImpl( Impl* impl )
95 {
96   mImpl = impl;
97 }
98
99 Internal::Adaptor::Widget& GetImplementation(Dali::Widget& widget)
100 {
101   DALI_ASSERT_ALWAYS(widget && "widget handle is empty");
102
103   BaseObject& handle = widget.GetBaseObject();
104
105   return static_cast<Internal::Adaptor::Widget&>(handle);
106 }
107
108 const Internal::Adaptor::Widget& GetImplementation(const Dali::Widget& widget)
109 {
110   const BaseObject& handle = widget.GetBaseObject();
111
112   return static_cast<const Internal::Adaptor::Widget&>(handle);
113 }
114
115 } // Adaptor
116
117 } // Internal
118
119 } // Dali