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 <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()
46 void CustomActorImpl::Initialize(Internal::CustomActor& owner)
48 DALI_ASSERT_DEBUG(mOwner == NULL); // should not already be owned
53 Internal::CustomActor* CustomActorImpl::GetOwner() const
58 bool CustomActorImpl::IsRelayoutEnabled() const
60 return (mFlags & DISABLE_SIZE_NEGOTIATION) == 0;
63 void CustomActorImpl::RelayoutRequest()
65 mOwner->RelayoutRequest();
68 float CustomActorImpl::GetHeightForWidthBase(float width)
70 return mOwner->GetHeightForWidthBase(width);
73 float CustomActorImpl::GetWidthForHeightBase(float height)
75 return mOwner->GetWidthForHeightBase(height);
78 float CustomActorImpl::CalculateChildSizeBase(const Dali::Actor& child, Dimension::Type dimension)
80 return mOwner->CalculateChildSizeBase(child, dimension);
83 bool CustomActorImpl::RelayoutDependentOnChildrenBase(Dimension::Type dimension)
85 return mOwner->RelayoutDependentOnChildrenBase(dimension);