DALi signals refactor to remove V2 naming
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit-internal / utc-Dali-PushButton.cpp
index 19ca1e7..a117a5d 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) 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.
+ *
+ */
 
 #include <iostream>
 
@@ -72,9 +73,9 @@ class TETButton : public Button
 {
 public:
   // PushButton Pressed
-  typedef SignalV2< bool ( Button ) > PressedSignalV2;
+  typedef Signal< bool ( Button ) > PressedSignalType;
 
-  PressedSignalV2& PressedSignal();
+  PressedSignalType& PressedSignal();
 
   /**
    * Default constructor.
@@ -141,7 +142,7 @@ public:
   /**
    * @return the pressed signal.
    */
-  Toolkit::TETButton::PressedSignalV2& PressedSignal();
+  Toolkit::TETButton::PressedSignalType& PressedSignal();
 
   /**
    * Callback called when an interrupt events is received.
@@ -153,7 +154,7 @@ public:
    */
   void OnButtonDown();
 
-  Toolkit::TETButton::PressedSignalV2 mPressedSignal;   ///< Signal emitted when the button is pressed.
+  Toolkit::TETButton::PressedSignalType mPressedSignal;   ///< Signal emitted when the button is pressed.
 };
 
 } // namespace Internal
@@ -186,7 +187,7 @@ TETButton TETButton::DownCast( BaseHandle handle )
   return Control::DownCast<TETButton, Internal::TETButton>(handle);
 }
 
-TETButton::PressedSignalV2& TETButton::PressedSignal()
+TETButton::PressedSignalType& TETButton::PressedSignal()
 {
   TETButton button( *this );
   DALI_ASSERT_ALWAYS( button );
@@ -234,7 +235,7 @@ Toolkit::TETButton TETButton::New()
   return tetButton;
 }
 
-Toolkit::TETButton::PressedSignalV2& TETButton::PressedSignal()
+Toolkit::TETButton::PressedSignalType& TETButton::PressedSignal()
 {
   return mPressedSignal;
 }
@@ -678,7 +679,7 @@ int UtcDaliPushButtonProperties(void)
     DALI_TEST_EQUALS( "IMAGE_PATH_1", button.GetProperty( PushButton::PROPERTY_NORMAL_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
 
     Property::Map map;
-    map.push_back( Property::StringValuePair( "type", "ImageActor" ) );
+    map[ "type" ] = "ImageActor";
 
     button.SetProperty( PushButton::PROPERTY_NORMAL_STATE_ACTOR, map );
     DALI_TEST_EQUALS( "ImageActor", button.GetProperty( PushButton::PROPERTY_NORMAL_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
@@ -690,7 +691,7 @@ int UtcDaliPushButtonProperties(void)
     DALI_TEST_EQUALS( "IMAGE_PATH_2", button.GetProperty( PushButton::PROPERTY_PRESSED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
 
     Property::Map map;
-    map.push_back( Property::StringValuePair( "type", "Actor" ) );
+    map[ "type" ] = "Actor";
 
     button.SetProperty( PushButton::PROPERTY_PRESSED_STATE_ACTOR, map );
     DALI_TEST_EQUALS( "Actor", button.GetProperty( PushButton::PROPERTY_PRESSED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
@@ -703,7 +704,7 @@ int UtcDaliPushButtonProperties(void)
     DALI_TEST_EQUALS( "IMAGE_PATH_3", button.GetProperty( PushButton::PROPERTY_DIMMED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
 
     Property::Map map;
-    map.push_back( Property::StringValuePair( "type", "Actor" ) );
+    map[ "type" ] = "Actor";
 
     button.SetProperty( PushButton::PROPERTY_DIMMED_STATE_ACTOR, map );
     DALI_TEST_EQUALS( "Actor", button.GetProperty( PushButton::PROPERTY_DIMMED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
@@ -715,7 +716,7 @@ int UtcDaliPushButtonProperties(void)
     DALI_TEST_EQUALS( "TextView", button.GetProperty( PushButton::PROPERTY_LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
 
     Property::Map map;
-    map.push_back( Property::StringValuePair( "type", "Actor" ) );
+    map[ "type" ] = "Actor";
 
     button.SetProperty( PushButton::PROPERTY_LABEL_ACTOR, map );
     DALI_TEST_EQUALS( "Actor", button.GetProperty( PushButton::PROPERTY_LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );