2 * Copyright (c) 2021 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 <dali/public-api/actors/custom-actor-impl.h>
22 #include <dali/internal/event/actors/custom-actor-internal.h>
23 #include <dali/public-api/common/dali-common.h>
27 CustomActor CustomActorImpl::Self() const
29 return CustomActor(mOwner);
32 void CustomActorImpl::OnPropertySet(Property::Index index, const Property::Value& propertyValue)
36 CustomActorImpl::CustomActorImpl(ActorFlags flags)
42 CustomActorImpl::~CustomActorImpl() = default;
44 void CustomActorImpl::Initialize(Internal::CustomActor& owner)
46 DALI_ASSERT_DEBUG(mOwner == NULL); // should not already be owned
51 Internal::CustomActor* CustomActorImpl::GetOwner() const
56 bool CustomActorImpl::IsRelayoutEnabled() const
58 return (mFlags & DISABLE_SIZE_NEGOTIATION) == 0;
61 void CustomActorImpl::RelayoutRequest()
63 mOwner->RelayoutRequest();
66 float CustomActorImpl::GetHeightForWidthBase(float width)
68 return mOwner->GetHeightForWidthBase(width);
71 float CustomActorImpl::GetWidthForHeightBase(float height)
73 return mOwner->GetWidthForHeightBase(height);
76 float CustomActorImpl::CalculateChildSizeBase(const Dali::Actor& child, Dimension::Type dimension)
78 return mOwner->CalculateChildSizeBase(child, dimension);
81 bool CustomActorImpl::RelayoutDependentOnChildrenBase(Dimension::Type dimension)
83 return mOwner->RelayoutDependentOnChildrenBase(dimension);
86 void CustomActorImpl::SetTransparent(bool transparent)
88 mOwner->SetTransparent(transparent);
91 bool CustomActorImpl::GetTransparent() const
93 return mOwner->GetTransparent();