2 * Copyright (c) 2020 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/internal/system/common/widget-controller.h>
30 WidgetPtr Widget::New()
48 void Widget::OnCreate(const std::string& contentInfo, Dali::Window window)
52 void Widget::OnTerminate(const std::string& contentInfo, Dali::Widget::Termination type)
56 void Widget::OnPause()
60 void Widget::OnResume()
64 void Widget::OnResize(Dali::Window window)
68 void Widget::OnUpdate(const std::string& contentInfo, int force)
72 void Widget::SignalConnected(SlotObserver* slotObserver, CallbackBase* callback)
74 mImpl->SignalConnected(slotObserver, callback);
77 void Widget::SignalDisconnected(SlotObserver* slotObserver, CallbackBase* callback)
79 mImpl->SignalDisconnected(slotObserver, callback);
82 void Widget::SetContentInfo(const std::string& contentInfo)
86 mImpl->SetContentInfo(contentInfo);
90 bool Widget::IsKeyEventUsing() const
94 return mImpl->IsKeyEventUsing();
97 //if mImpl is null, return default value
101 void Widget::SetUsingKeyEvent(bool flag)
105 mImpl->SetUsingKeyEvent(flag);
109 void Widget::SetImpl(Impl* impl)
115 void Widget::SetInformation(Dali::Window window, const std::string& widgetId)
119 mImpl->SetInformation(window, widgetId);
123 Dali::Window Widget::GetWindow() const
127 return mImpl->GetWindow();
130 return Dali::Window();
133 std::string Widget::GetWidgetId() const
137 return mImpl->GetWidgetId();
140 return std::string();
143 Internal::Adaptor::Widget& GetImplementation(Dali::Widget& widget)
145 DALI_ASSERT_ALWAYS(widget && "widget handle is empty");
147 BaseObject& handle = widget.GetBaseObject();
149 return static_cast<Internal::Adaptor::Widget&>(handle);
152 const Internal::Adaptor::Widget& GetImplementation(const Dali::Widget& widget)
154 const BaseObject& handle = widget.GetBaseObject();
156 return static_cast<const Internal::Adaptor::Widget&>(handle);
159 } // namespace Adaptor
161 } // namespace Internal