Revert "[Tizen] Add DALi Autofill implementation"
[platform/core/uifw/dali-adaptor.git] / dali / public-api / adaptor-framework / 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/internal/system/common/widget-controller.h>
23
24 namespace Dali
25 {
26
27 namespace Internal
28 {
29
30 namespace Adaptor
31 {
32
33 WidgetPtr Widget::New()
34 {
35   return new Widget();
36 }
37
38 Widget::Widget()
39 : mImpl( nullptr )
40 {
41 }
42
43 Widget::~Widget()
44 {
45   if( mImpl != nullptr )
46   {
47     delete mImpl;
48   }
49 }
50
51 void Widget::OnCreate( const std::string& contentInfo, Dali::Window window )
52 {
53 }
54
55 void Widget::OnTerminate( const std::string& contentInfo, Dali::Widget::Termination type )
56 {
57 }
58
59 void Widget::OnPause()
60 {
61 }
62
63 void Widget::OnResume()
64 {
65 }
66
67 void Widget::OnResize( Dali::Window window )
68 {
69 }
70
71 void Widget::OnUpdate( const std::string& contentInfo, int force )
72 {
73 }
74
75 void Widget::SignalConnected( SlotObserver* slotObserver, CallbackBase* callback )
76 {
77   mImpl->SignalConnected( slotObserver, callback );
78 }
79
80 void Widget::SignalDisconnected( SlotObserver* slotObserver, CallbackBase* callback )
81 {
82   mImpl->SignalDisconnected( slotObserver, callback );
83 }
84
85 void Widget::SetContentInfo( const std::string& contentInfo )
86 {
87   if( mImpl != nullptr )
88   {
89     mImpl->SetContentInfo( contentInfo );
90   }
91 }
92
93 void Widget::SetImpl( Impl* impl )
94 {
95   mImpl = impl;
96 }
97
98 Internal::Adaptor::Widget& GetImplementation(Dali::Widget& widget)
99 {
100   DALI_ASSERT_ALWAYS(widget && "widget handle is empty");
101
102   BaseObject& handle = widget.GetBaseObject();
103
104   return static_cast<Internal::Adaptor::Widget&>(handle);
105 }
106
107 const Internal::Adaptor::Widget& GetImplementation(const Dali::Widget& widget)
108 {
109   const BaseObject& handle = widget.GetBaseObject();
110
111   return static_cast<const Internal::Adaptor::Widget&>(handle);
112 }
113
114 } // Adaptor
115
116 } // Internal
117
118 } // Dali