[dali_1.0.42] Merge branch 'tizen'
[platform/core/uifw/dali-core.git] / dali / internal / event / events / long-press-gesture-detector-impl.cpp
index 020b96f..69ce40b 100644 (file)
@@ -1,22 +1,26 @@
-//
-// 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) 2014 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 "long-press-gesture-detector-impl.h"
 
+// EXTERNAL INCLUDES
+#include <cstring> // for strcmp
+
 // INTERNAL INCLUDES
 #include <dali/public-api/events/long-press-gesture.h>
 #include <dali/public-api/object/type-registry.h>
@@ -30,6 +34,11 @@ namespace Internal
 
 namespace
 {
+
+// Signals
+
+const char* const SIGNAL_LONG_PRESS_DETECTED = "long-press-detected";
+
 BaseHandle Create()
 {
   return Dali::LongPressGestureDetector::New();
@@ -37,7 +46,7 @@ BaseHandle Create()
 
 TypeRegistration mType( typeid(Dali::LongPressGestureDetector), typeid(Dali::GestureDetector), Create );
 
-SignalConnectorType signalConnector1( mType, Dali::LongPressGestureDetector::SIGNAL_LONG_PRESS_DETECTED, &LongPressGestureDetector::DoConnectSignal );
+SignalConnectorType signalConnector1( mType, SIGNAL_LONG_PRESS_DETECTED, &LongPressGestureDetector::DoConnectSignal );
 
 }
 
@@ -128,7 +137,7 @@ void LongPressGestureDetector::EmitLongPressGestureSignal(Dali::Actor pressedAct
   // Guard against destruction during signal emission
   Dali::LongPressGestureDetector handle( this );
 
-  mDetectedSignalV2.Emit( pressedActor, longPress );
+  mDetectedSignal.Emit( pressedActor, longPress );
 }
 
 bool LongPressGestureDetector::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
@@ -136,7 +145,7 @@ bool LongPressGestureDetector::DoConnectSignal( BaseObject* object, ConnectionTr
   bool connected( true );
   LongPressGestureDetector* gesture = dynamic_cast<LongPressGestureDetector*>(object);
 
-  if ( Dali::LongPressGestureDetector::SIGNAL_LONG_PRESS_DETECTED == signalName )
+  if ( 0 == strcmp( signalName.c_str(), SIGNAL_LONG_PRESS_DETECTED ) )
   {
     gesture->DetectedSignal().Connect( tracker, functor );
   }