2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include "widget-impl.h"
22 #include <dali/public-api/adaptor-framework/window.h>
23 #include <dali/internal/system/common/widget-controller.h>
34 WidgetPtr Widget::New()
46 if( mImpl != nullptr )
52 void Widget::OnCreate( const std::string& contentInfo, Dali::Window window )
56 void Widget::OnTerminate( const std::string& contentInfo, Dali::Widget::Termination type )
60 void Widget::OnPause()
64 void Widget::OnResume()
68 void Widget::OnResize( Dali::Window window )
72 void Widget::OnUpdate( const std::string& contentInfo, int force )
76 void Widget::SignalConnected( SlotObserver* slotObserver, CallbackBase* callback )
78 mImpl->SignalConnected( slotObserver, callback );
81 void Widget::SignalDisconnected( SlotObserver* slotObserver, CallbackBase* callback )
83 mImpl->SignalDisconnected( slotObserver, callback );
86 void Widget::SetContentInfo( const std::string& contentInfo )
88 if( mImpl != nullptr )
90 mImpl->SetContentInfo( contentInfo );
94 void Widget::SetImpl( Impl* impl )
99 Internal::Adaptor::Widget& GetImplementation(Dali::Widget& widget)
101 DALI_ASSERT_ALWAYS(widget && "widget handle is empty");
103 BaseObject& handle = widget.GetBaseObject();
105 return static_cast<Internal::Adaptor::Widget&>(handle);
108 const Internal::Adaptor::Widget& GetImplementation(const Dali::Widget& widget)
110 const BaseObject& handle = widget.GetBaseObject();
112 return static_cast<const Internal::Adaptor::Widget&>(handle);