DALi Version 1.0.33
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / focus-manager / focus-manager-impl.h
index aefd0f6..3c3b027 100644 (file)
@@ -1,27 +1,32 @@
 #ifndef __DALI_TOOLKIT_INTERNAL_FOCUS_MANAGER_H__
 #define __DALI_TOOLKIT_INTERNAL_FOCUS_MANAGER_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.
+ *
+ */
 
 // EXTERNAL INCLUDES
 #include <string>
+#include <dali/public-api/adaptor-framework/accessibility-action-handler.h>
+#include <dali/public-api/adaptor-framework/accessibility-gesture-handler.h>
+#include <dali/public-api/common/map-wrapper.h>
+#include <dali/public-api/object/base-object.h>
+#include <dali/integration-api/events/pan-gesture-event.h>
 
 // INTERNAL INCLUDES
-#include <dali/dali.h>
 #include <dali-toolkit/public-api/focus-manager/focus-manager.h>
 
 namespace Dali
@@ -189,17 +194,17 @@ public:
   /**
    * @copydoc Toolkit::FocusManager::FocusChangedSignal()
    */
-  Toolkit::FocusManager::FocusChangedSignalV2& FocusChangedSignal();
+  Toolkit::FocusManager::FocusChangedSignalType& FocusChangedSignal();
 
   /**
    * @copydoc Toolkit::FocusManager::FocusOvershotSignal()
    */
-  Toolkit::FocusManager::FocusOvershotSignalV2& FocusOvershotSignal();
+  Toolkit::FocusManager::FocusOvershotSignalType& FocusOvershotSignal();
 
   /**
    * @copydoc Toolkit::FocusManager::FocusedActorActivatedSignal()
    */
-  Toolkit::FocusManager::FocusedActorActivatedSignalV2& FocusedActorActivatedSignal();
+  Toolkit::FocusManager::FocusedActorActivatedSignalType& FocusedActorActivatedSignal();
 
   /**
    * Connects a callback function with the object's signals.
@@ -293,27 +298,31 @@ private:
 
   /**
    * Perform the accessibility action to move focus to the previous focusable actor (by one finger flick up).
+   * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
    * @return whether the accessibility action is performed or not.
    */
-  virtual bool AccessibilityActionPrevious();
+  virtual bool AccessibilityActionPrevious(bool allowEndFeedback);
 
   /**
    * Perform the accessibility action to move focus to the next focusable actor (by one finger flick down).
+   * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
    * @return whether the accessibility action is performed or not.
    */
-  virtual bool AccessibilityActionNext();
+  virtual bool AccessibilityActionNext(bool allowEndFeedback);
 
   /**
    * Perform the accessibility action to move focus to the previous focusable actor (by one finger flick left).
+   * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
    * @return whether the accessibility action is performed or not.
    */
-  virtual bool AccessibilityActionReadPrevious();
+  virtual bool AccessibilityActionReadPrevious(bool allowEndFeedback);
 
   /**
    * Perform the accessibility action to move focus to the next focusable actor (by one finger flick right).
+   * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
    * @return whether the accessibility action is performed or not.
    */
-  virtual bool AccessibilityActionReadNext();
+  virtual bool AccessibilityActionReadNext(bool allowEndFeedback);
 
   /**
    * Perform the accessibility action to focus and read the actor (by one finger tap or move).
@@ -349,6 +358,13 @@ private:
    */
   virtual bool AccessibilityActionBack();
 
+  /**
+   * Perform the accessibility action to mouse move (by one finger tap & hold and move).
+   * @param touchEvent touch event structure
+   * @return whether the accessibility action is performed or not.
+   */
+  virtual bool AccessibilityActionTouch(const TouchEvent& touchEvent);
+
 private:
 
   // Undefined
@@ -358,20 +374,26 @@ private:
 
 private:
 
-  Toolkit::FocusManager::FocusChangedSignalV2 mFocusChangedSignalV2; ///< The signal to notify the focus change
-  Toolkit::FocusManager::FocusOvershotSignalV2 mFocusOvershotSignalV2; ///< The signal to notify the focus overshooted
-  Toolkit::FocusManager::FocusedActorActivatedSignalV2 mFocusedActorActivatedSignalV2; ///< The signal to notify the activation of focused actor
+  Toolkit::FocusManager::FocusChangedSignalType mFocusChangedSignal; ///< The signal to notify the focus change
+  Toolkit::FocusManager::FocusOvershotSignalType mFocusOvershotSignal; ///< The signal to notify the focus overshooted
+  Toolkit::FocusManager::FocusedActorActivatedSignalType mFocusedActorActivatedSignal; ///< The signal to notify the activation of focused actor
 
   bool mIsWrapped; ///< Whether the focus movement is wrapped around or not
   bool mIsFocusWithinGroup; ///< Whether the focus movement is limited to the current focus group or not
 
+  bool mIsEndcapFeedbackEnabled; ///< Whether the endcap feedback need to be played when the focus leaves the end or vice versa
+  bool mIsEndcapFeedbackPlayed; ///< Whether the endcap feedback was played or not
+
   FocusIDContainer mFocusIDContainer; ///< The container to look up actor ID by focus order
   IDAdditionalInfoContainer mIDAdditionalInfoContainer; ///< The container to look up additional information by actor ID
 
   FocusIDPair mCurrentFocusActor; ///< The focus order and actor ID of current focused actor
+  Actor mCurrentGesturedActor; ///< The actor that will handle the gesture
 
   Actor mFocusIndicatorActor; ///< The focus indicator actor shared by all the focusable actors for highlight
 
+  Vector2 mPreviousPosition; ///< The previous pan position; useful for calculating velocity for Gesture::Finished events
+
   unsigned int mRecursiveFocusMoveCounter; ///< The counter to count the number of recursive focus movement attempted before the focus movement is successful.
 
   bool mIsAccessibilityTtsEnabled; ///< Whether accessibility feature(screen-reader) turned on/off