Updates after the use of const refs in gesture callbacks
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / internal / controls / buttons / button-impl.h
index 076777a..166f315 100644 (file)
@@ -1,24 +1,24 @@
 #ifndef __DALI_TOOLKIT_INTERNAL_BUTTON_H__
 #define __DALI_TOOLKIT_INTERNAL_BUTTON_H__
 
-//
-// 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.
+ *
+ */
 
 // INTERNAL INCLUDES
-#include <dali/dali.h>
 #include <dali-toolkit/public-api/controls/buttons/button.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include "button-painter-impl.h"
@@ -129,6 +129,12 @@ private:
    */
   virtual float OnAnimationTimeRequested() const;
 
+  /**
+   * This method is called when the button is removed from the stage.
+   * Could be reimplemented in subclasses to provide specific behaviour.
+   */
+  virtual void OnButtonStageDisconnection() { }
+
 public:
 
   /**
@@ -137,6 +143,11 @@ public:
   Toolkit::Button::ClickedSignalV2& ClickedSignal();
 
   /**
+   * @copydoc Dali::Toolkit::Button::ToggledSignal()
+   */
+  Toolkit::Button::ToggledSignalV2& ToggledSignal();
+
+  /**
    * Connects a callback function with the object's signals.
    * @param[in] object The object providing the signal.
    * @param[in] tracker Used to disconnect the signal.
@@ -184,6 +195,12 @@ private: // From Control
    */
   virtual void OnControlSizeSet( const Vector3& targetSize );
 
+  /**
+   * Callback received when the button is disconnected from the stage.
+   * It resets the button status.
+   */
+  void OnControlStageDisconnection();
+
 private:
 
   /**
@@ -194,15 +211,7 @@ private:
    * @param[in]  actor  The tapped actor.
    * @param[in]  tap    The tap gesture.
    */
-  void OnTap(Actor actor, TapGesture tap);
-
-private:
-
-  /**
-   * Callback received when the button is disconected from the stage.
-   * It resets the button status.
-   */
-  void OnStageDisconnection();
+  void OnTap(Actor actor, const TapGesture& tap);
 
 private:
 
@@ -227,6 +236,7 @@ protected: // Signals
   ButtonPainterPtr mPainter;              ///< Pointer to a ButtonPainter base class.
 
   Toolkit::Button::ClickedSignalV2 mClickedSignalV2; ///< Signal emitted when the button is clicked.
+  Toolkit::Button::ToggledSignalV2 mToggledSignalV2; ///< Signal emitted when the button is toggled.
 
   TapGestureDetector mTapDetector;
 };