(KeyboardFocusManager) Fixed ConnectSignal handling & SVACE error
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / focus-manager / keyboard-focus-manager.h
index 3822fc6..457f222 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_KEYBOARD_FOCUS_MANAGER_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
@@ -31,6 +31,10 @@ namespace Internal DALI_INTERNAL
 {
 class KeyboardFocusManager;
 }
+/**
+ * @addtogroup dali_toolkit_managers
+ * @{
+ */
 
 /**
  * @brief Provides the functionality of handling keyboard navigation
@@ -40,20 +44,23 @@ class KeyboardFocusManager;
  * in four directions (i.e. Left, Right, Up and Down). It also draws a
  * highlight for the focused actor and emits a signal when the focus
  * is changed.
+ *
+ * Signals
+ * | %Signal Name                 | Method                             |
+ * |------------------------------|------------------------------------|
+ * | keyboardPreFocusChange       | @ref PreFocusChangeSignal()        |
+ * | keyboardFocusChanged         | @ref FocusChangedSignal()          |
+ * | keyboardFocusGroupChanged    | @ref FocusGroupChangedSignal()     |
+ * | keyboardFocusedActorEnterKey | @ref FocusedActorEnterKeySignal()  |
+ * @SINCE_1_0.0
  */
 class DALI_IMPORT_API KeyboardFocusManager : public BaseHandle
 {
-public:
-  //Signal Names
-  static const char* const SIGNAL_PRE_FOCUS_CHANGE; ///< name "keyboard-pre-focus-change"
-  static const char* const SIGNAL_FOCUS_CHANGED; ///< name "keyboard-focus-changed"
-  static const char* const SIGNAL_FOCUS_GROUP_CHANGED; ///< name "keyboard-focus-group-changed"
-  static const char* const SIGNAL_FOCUSED_ACTOR_ACTIVATED; ///< name "keyboard-focused-actor-activated"
 
 public:
 
   /// @brief Pre focus change signal
-  typedef Signal< Actor ( Actor, Actor, Control::KeyboardFocusNavigationDirection ) > PreFocusChangeSignalType;
+  typedef Signal< Actor ( Actor, Actor, Control::KeyboardFocus::Direction ) > PreFocusChangeSignalType;
 
   /// @brief Focus changed signal
   typedef Signal< void ( Actor, Actor ) > FocusChangedSignalType;
@@ -61,13 +68,14 @@ public:
   /// @brief Focus group changed signal
   typedef Signal< void ( Actor, bool ) > FocusGroupChangedSignalType;
 
-  /// @brief Focused actor activated signal
-  typedef Signal< void ( Actor ) > FocusedActorActivatedSignalType;
+  /// @brief Focused actor has the enter key pressed signal
+  typedef Signal< void ( Actor ) > FocusedActorEnterKeySignalType;
 
   /**
    * @brief Create a KeyboardFocusManager handle; this can be initialised with KeyboardFocusManager::New().
    *
    * Calling member functions with an uninitialised handle is not allowed.
+   * @SINCE_1_0.0
    */
   KeyboardFocusManager();
 
@@ -75,12 +83,14 @@ public:
    * @brief Destructor
    *
    * This is non-virtual since derived Handle types must not contain data or virtual methods.
+   * @SINCE_1_0.0
    */
   ~KeyboardFocusManager();
 
   /**
    * @brief Get the singleton of KeyboardFocusManager object.
    *
+   * @SINCE_1_0.0
    * @return A handle to the KeyboardFocusManager control.
    */
   static KeyboardFocusManager Get();
@@ -91,18 +101,20 @@ public:
    * Only one actor can be focused at the same time.  The actor must
    * be in the stage already and keyboard focusable.
    *
-   * @pre The KeyboardFocusManager has been initialized.
-   * @pre The Actor has been initialized.
+   * @SINCE_1_0.0
    * @param actor The actor to be focused
    * @return Whether the focus is successful or not
+   * @pre The KeyboardFocusManager has been initialized.
+   * @pre The Actor has been initialized.
    */
   bool SetCurrentFocusActor(Actor actor);
 
   /**
    * @brief Get the current focused actor.
    *
-   * @pre The KeyboardFocusManager has been initialized.
+   * @SINCE_1_0.0
    * @return A handle to the current focused actor or an empty handle if no actor is focused.
+   * @pre The KeyboardFocusManager has been initialized.
    */
   Actor GetCurrentFocusActor();
 
@@ -111,17 +123,19 @@ public:
    * chain in the given direction (according to the focus traversal
    * order).
    *
-   * @pre The KeyboardFocusManager has been initialized.
+   * @SINCE_1_0.0
    * @param direction The direction of focus movement
    * @return true if the movement was successful
+   * @pre The KeyboardFocusManager has been initialized.
    */
-  bool MoveFocus(Control::KeyboardFocusNavigationDirection direction);
+  bool MoveFocus(Control::KeyboardFocus::Direction direction);
 
   /**
    * @brief Clear the focus from the current focused actor if any, so
    * that no actor is focused in the focus chain.
    *
-   * It will emit focus changed signal without current focused actor
+   * It will emit focus changed signal without current focused actor.
+   * @SINCE_1_0.0
    * @pre The KeyboardFocusManager has been initialized.
    */
   void ClearFocus();
@@ -130,16 +144,18 @@ public:
    * @brief Set whether the focus movement should be looped within the same focus group.
    *
    * The focus movement is not looped by default.
-   * @pre The KeyboardFocusManager has been initialized.
+   * @SINCE_1_0.0
    * @param enabled Whether the focus movement should be looped
+   * @pre The KeyboardFocusManager has been initialized.
    */
   void SetFocusGroupLoop(bool enabled);
 
   /**
    * @brief Get whether the focus movement should be looped within the same focus group.
    *
-   * @pre The KeyboardFocusManager has been initialized.
+   * @SINCE_1_0.0
    * @return Whether the focus movement should be looped
+   * @pre The KeyboardFocusManager has been initialized.
    */
   bool GetFocusGroupLoop() const;
 
@@ -149,26 +165,29 @@ public:
    *
    * Layout controls set themselves as focus groups by default.
    *
-   * @pre The KeyboardFocusManager has been initialized.
-   * @pre The Actor has been initialized.
+   * @SINCE_1_0.0
    * @param actor The actor to be set as a focus group.
    * @param isFocusGroup Whether to set the actor as a focus group or not.
+   * @pre The KeyboardFocusManager has been initialized.
+   * @pre The Actor has been initialized.
    */
   void SetAsFocusGroup(Actor actor, bool isFocusGroup);
 
   /**
    * @brief Check whether the actor is set as a focus group or not.
    *
-   * @pre The KeyboardFocusManager has been initialized.
-   * @pre The Actor has been initialized.
+   * @SINCE_1_0.0
    * @param actor The actor to be checked.
    * @return Whether the actor is set as a focus group.
+   * @pre The KeyboardFocusManager has been initialized.
+   * @pre The Actor has been initialized.
    */
   bool IsFocusGroup(Actor actor) const;
 
   /**
    * @brief Returns the closest ancestor of the given actor that is a focus group.
    *
+   * @SINCE_1_0.0
    * @param actor The actor to be checked for its focus group
    * @return The focus group the given actor belongs to or an empty handle if the given actor
    * doesn't belong to any focus group
@@ -182,17 +201,19 @@ public:
    * KeyboardFocusManager and will be added to the focused actor as a
    * highlight.
    *
+   * @SINCE_1_0.0
+   * @param indicator The indicator actor to be added
    * @pre The KeyboardFocusManager has been initialized.
    * @pre The indicator actor has been initialized.
-   * @param indicator The indicator actor to be added
    */
   void SetFocusIndicatorActor(Actor indicator);
 
   /**
    * @brief Get the focus indicator actor.
    *
-   * @pre The KeyboardFocusManager has been initialized.
+   * @SINCE_1_0.0
    * @return A handle to the focus indicator actor
+   * @pre The KeyboardFocusManager has been initialized.
    */
   Actor GetFocusIndicatorActor();
 
@@ -212,10 +233,11 @@ public: // Signals
    *
    * A callback of the following type may be connected:
    * @code
-   *   Actor YourCallbackName(Actor currentFocusedActor, Actor proposedActorToFocus, Control::KeyboardFocusNavigationDirection direction);
+   *   Actor YourCallbackName(Actor currentFocusedActor, Actor proposedActorToFocus, Control::KeyboardFocus::Direction direction);
    * @endcode
-   * @pre The Object has been initialized.
+   * @SINCE_1_0.0
    * @return The signal to connect to.
+   * @pre The Object has been initialized.
    */
   PreFocusChangeSignalType& PreFocusChangeSignal();
 
@@ -226,8 +248,9 @@ public: // Signals
    * @code
    *   void YourCallbackName(Actor originalFocusedActor, Actor currentFocusedActor);
    * @endcode
-   * @pre The Object has been initialized.
+   * @SINCE_1_0.0
    * @return The signal to connect to.
+   * @pre The Object has been initialized.
    */
   FocusChangedSignalType& FocusChangedSignal();
 
@@ -243,34 +266,42 @@ public: // Signals
    * @code
    *   void YourCallbackName(Actor currentFocusedActor, bool forward);
    * @endcode
-   * @pre The Object has been initialized.
+   * @SINCE_1_0.0
    * @return The signal to connect to.
+   * @pre The Object has been initialized.
    */
   FocusGroupChangedSignalType& FocusGroupChangedSignal();
 
   /**
-   * @brief This signal is emitted when the current focused actor is activated.
+   * @brief This signal is emitted when the current focused actor has the enter key pressed on it.
    *
    * A callback of the following type may be connected:
    * @code
-   *   void YourCallbackName(Actor activatedActor);
+   *   void YourCallbackName(Actor enterPressedActor);
    * @endcode
-   * @pre The Object has been initialized.
+   * @SINCE_1_0.0
    * @return The signal to connect to.
+   * @pre The Object has been initialized.
    */
-  FocusedActorActivatedSignalType& FocusedActorActivatedSignal();
+  FocusedActorEnterKeySignalType& FocusedActorEnterKeySignal();
 
   // Not intended for application developers
 
+  /// @cond internal
   /**
    * @brief Creates a new handle from the implementation.
    *
+   * @SINCE_1_0.0
    * @param[in] impl A pointer to the object.
    */
   explicit DALI_INTERNAL KeyboardFocusManager(Internal::KeyboardFocusManager *impl);
+  /// @endcond
 
 }; // class KeyboardFocusManager
 
+/**
+ * @}
+ */
 } // namespace Toolkit
 
 } // namespace Dali