/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/public-api/actors/custom-actor-impl.h>
// INTERNAL INCLUDES
-#include <dali/public-api/common/dali-common.h>
#include <dali/internal/event/actors/custom-actor-internal.h>
+#include <dali/public-api/common/dali-common.h>
namespace Dali
{
-
-CustomActorImpl::~CustomActorImpl()
-{
-}
-
CustomActor CustomActorImpl::Self() const
{
return CustomActor(mOwner);
}
-void CustomActorImpl::OnPropertySet( Property::Index index, Property::Value propertyValue )
+void CustomActorImpl::OnPropertySet(Property::Index index, const Property::Value& propertyValue)
{
}
-CustomActorImpl::CustomActorImpl(bool requiresTouchEvents)
-: mOwner(NULL),
- mRequiresTouchEvents(requiresTouchEvents),
- mRequiresHoverEvents(false),
- mRequiresMouseWheelEvents(false)
+CustomActorImpl::CustomActorImpl(ActorFlags flags)
+: mOwner(nullptr),
+ mFlags(flags)
{
}
+CustomActorImpl::~CustomActorImpl() = default;
+
void CustomActorImpl::Initialize(Internal::CustomActor& owner)
{
DALI_ASSERT_DEBUG(mOwner == NULL); // should not already be owned
return mOwner;
}
-bool CustomActorImpl::RequiresTouchEvents() const
+bool CustomActorImpl::IsRelayoutEnabled() const
{
- return mRequiresTouchEvents;
+ return (mFlags & DISABLE_SIZE_NEGOTIATION) == 0;
}
-bool CustomActorImpl::RequiresHoverEvents() const
-{
- return mRequiresHoverEvents;
-}
-
-void CustomActorImpl::SetRequiresHoverEvents(bool requiresHoverEvents)
-{
- mRequiresHoverEvents = requiresHoverEvents;
-}
-
-bool CustomActorImpl::RequiresMouseWheelEvents() const
+void CustomActorImpl::RelayoutRequest()
{
- return mRequiresMouseWheelEvents;
+ mOwner->RelayoutRequest();
}
-void CustomActorImpl::SetRequiresMouseWheelEvents(bool requiresMouseWheelEvents)
+float CustomActorImpl::GetHeightForWidthBase(float width)
{
- mRequiresMouseWheelEvents = requiresMouseWheelEvents;
+ return mOwner->GetHeightForWidthBase(width);
}
-void CustomActorImpl::RelayoutRequest()
+float CustomActorImpl::GetWidthForHeightBase(float height)
{
- mOwner->RelayoutRequest();
+ return mOwner->GetWidthForHeightBase(height);
}
-float CustomActorImpl::CalculateChildSizeBase( const Dali::Actor& child, Dimension dimension )
+float CustomActorImpl::CalculateChildSizeBase(const Dali::Actor& child, Dimension::Type dimension)
{
- return mOwner->CalculateChildSizeBase( child, dimension );
+ return mOwner->CalculateChildSizeBase(child, dimension);
}
-bool CustomActorImpl::RelayoutDependentOnChildrenBase( Dimension dimension )
+bool CustomActorImpl::RelayoutDependentOnChildrenBase(Dimension::Type dimension)
{
- return mOwner->RelayoutDependentOnChildrenBase( dimension );
+ return mOwner->RelayoutDependentOnChildrenBase(dimension);
}
} // namespace Dali