Merge "Removed On(...)Event()" into devel/master
[platform/core/uifw/dali-core.git] / dali / public-api / actors / custom-actor-impl.cpp
index d96ccfd..19f03e9 100644 (file)
@@ -1,18 +1,19 @@
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2016 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 // CLASS HEADER
 #include <dali/public-api/actors/custom-actor-impl.h>
 #include <dali/public-api/common/dali-common.h>
 #include <dali/internal/event/actors/custom-actor-internal.h>
 
-using namespace std;
-
 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)
+CustomActorImpl::CustomActorImpl( ActorFlags flags )
 : mOwner(NULL),
-  mRequiresTouchEvents(requiresTouchEvents),
-  mRequiresMouseWheelEvents(false)
+  mFlags( flags )
+{
+}
+
+CustomActorImpl::~CustomActorImpl()
 {
 }
 
@@ -58,19 +56,34 @@ Internal::CustomActor* CustomActorImpl::GetOwner() const
   return mOwner;
 }
 
-bool CustomActorImpl::RequiresTouchEvents() const
+bool CustomActorImpl::IsRelayoutEnabled() const
+{
+  return ( mFlags & DISABLE_SIZE_NEGOTIATION ) == 0;
+}
+
+void CustomActorImpl::RelayoutRequest()
+{
+  mOwner->RelayoutRequest();
+}
+
+float CustomActorImpl::GetHeightForWidthBase( float width )
+{
+  return mOwner->GetHeightForWidthBase( width );
+}
+
+float CustomActorImpl::GetWidthForHeightBase( float height )
 {
-  return mRequiresTouchEvents;
+  return mOwner->GetWidthForHeightBase( height );
 }
 
-bool CustomActorImpl::RequiresMouseWheelEvents() const
+float CustomActorImpl::CalculateChildSizeBase( const Dali::Actor& child, Dimension::Type dimension )
 {
-  return mRequiresMouseWheelEvents;
+  return mOwner->CalculateChildSizeBase( child, dimension );
 }
 
-void CustomActorImpl::SetRequiresMouseWheelEvents(bool requiresMouseWheelEvents)
+bool CustomActorImpl::RelayoutDependentOnChildrenBase( Dimension::Type dimension )
 {
-  mRequiresMouseWheelEvents = requiresMouseWheelEvents;
+  return mOwner->RelayoutDependentOnChildrenBase( dimension );
 }
 
 } // namespace Dali