Revert "[Tizen] Add Finalize api for imf-manager"
[platform/core/uifw/dali-adaptor.git] / adaptors / devel-api / adaptor-framework / imf-manager.h
index 8123b9d..2780d9a 100644 (file)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/signals/dali-signal.h>
+#include "input-method-options.h"
 
 namespace Dali
 {
@@ -43,6 +44,15 @@ class DALI_IMPORT_API ImfManager : public BaseHandle
 public:
 
   /**
+  * @brief The direction of text.
+  */
+  enum TextDirection
+  {
+    LeftToRight,
+    RightToLeft,
+  };
+
+  /**
    * @brief Events that are generated by the IMF.
    */
   enum ImfEvent
@@ -51,7 +61,28 @@ public:
     PREEDIT,             ///< Pre-Edit changed
     COMMIT,              ///< Commit recieved
     DELETESURROUNDING,   ///< Event to delete a range of characters from the string
-    GETSURROUNDING       ///< Event to query string and cursor position
+    GETSURROUNDING,      ///< Event to query string and cursor position
+    PRIVATECOMMAND       ///< Private command sent from the input panel
+  };
+
+  /**
+   * @brief Enumeration for state of the input panel.
+   */
+  enum State
+  {
+    DEFAULT = 0,   ///< Unknown state
+    SHOW,          ///< Input panel is shown
+    HIDE,          ///< Input panel is hidden
+    WILL_SHOW      ///< Input panel in process of being shown
+  };
+
+  /**
+   * @brief Enumeration for the type of Keyboard.
+   */
+  enum KeyboardType
+  {
+    SOFTWARE_KEYBOARD,  ///< Software keyboard (Virtual keyboard) is default
+    HARDWARE_KEYBOARD   ///< Hardware keyboard
   };
 
   /**
@@ -132,6 +163,9 @@ public:
 
   typedef Signal< void (ImfManager&) > ImfManagerSignalType; ///< Keyboard actived signal
   typedef Signal< ImfCallbackData ( ImfManager&, const ImfEventData& ) > ImfEventSignalType; ///< keyboard events
+  typedef Signal< void () > VoidSignalType;
+  typedef Signal< void (bool) > StatusSignalType;
+  typedef Signal< void (KeyboardType) > KeyboardTypeSignalType; ///< keyboard type
 
 public:
 
@@ -218,6 +252,91 @@ public:
  */
   void NotifyTextInputMultiLine( bool multiLine );
 
+  /**
+   * @brief Returns text direction of the keyboard's current input language.
+   * @return The direction of the text.
+   */
+  TextDirection GetTextDirection();
+
+  /**
+   * @brief Provides size and position of keyboard.
+   *
+   * Position is relative to whether keyboard is visible or not.
+   * If keyboard is not visible then position will be off the screen.
+   * If keyboard is not being shown when this method is called the keyboard is partially setup (IMFContext) to get
+   * the values then taken down.  So ideally GetInputMethodArea() should be called after Show().
+   * @return rect which is keyboard panel x, y, width, height
+   */
+  Dali::Rect<int> GetInputMethodArea();
+
+  /**
+   * @brief Set one or more of the Input Method options
+   * @param[in] options The options to be applied
+   */
+  void ApplyOptions( const InputMethodOptions& options );
+
+  /**
+   * @brief Sets up the input-panel specific data.
+   * @param[in] data The specific data to be set to the input panel
+   */
+  void SetInputPanelData( const std::string& data );
+
+  /**
+   * @brief Gets the specific data of the current active input panel.
+   *
+   * Input Panel Data is not always the data which is set by SetInputPanelData().
+   * Data can be changed internally in the input panel.
+   * It is just used to get a specific data from the input panel to an application.
+   * @param[in] data The specific data to be got from the input panel
+   */
+  void GetInputPanelData( std::string& data );
+
+  /**
+   * @brief Gets the state of the current active input panel.
+   * @return The state of the input panel.
+   */
+  State GetInputPanelState();
+
+  /**
+   * @brief Sets the return key on the input panel to be visible or invisible.
+   *
+   * The default is true.
+   * @param[in] visible True if the return key is visible(enabled), false otherwise.
+   */
+  void SetReturnKeyState( bool visible );
+
+  /**
+   * @brief Enable to show the input panel automatically when focused.
+   * @param[in] enabled If true, the input panel will be shown when focused
+   */
+  void AutoEnableInputPanel( bool enabled );
+
+  /**
+   * @brief Shows the input panel.
+   */
+  void ShowInputPanel();
+
+  /**
+   * @brief Hides the input panel.
+   */
+  void HideInputPanel();
+
+  /**
+   * @brief Gets the keyboard type.
+   *
+   * The default keyboard type is SOFTWARE_KEYBOARD.
+   * @return The keyboard type
+   */
+  KeyboardType GetKeyboardType();
+
+  /**
+   * @brief Gets the current language locale of the input panel.
+   *
+   * ex) en_US, en_GB, en_PH, fr_FR, ...
+   * @return The current language locale of the input panel
+   */
+  std::string GetInputPanelLocale();
+
 public:
 
   // Signals
@@ -236,6 +355,55 @@ public:
    */
   ImfEventSignalType& EventReceivedSignal();
 
+  /**
+   * @brief Connect to this signal to be notified when the virtual keyboard is shown or hidden.
+   *
+   * A callback of the following type may be connected:
+   * @code
+   *   void YourCallbackName(bool keyboardShown);
+   * @endcode
+   * If the parameter keyboardShown is true, then the keyboard has just shown, if it is false, then it
+   * has just been hidden.
+   * @return The signal to connect to.
+   */
+  StatusSignalType& StatusChangedSignal();
+
+  /**
+   * @brief Connect to this signal to be notified when the virtual keyboard is resized.
+   *
+   * A callback of the following type may be connected:
+   * @code
+   *   void YourCallbackName();
+   * @endcode
+   * User can get changed size by using GetInputMethodArea() in the callback
+   * @return The signal to connect to.
+   */
+  VoidSignalType& ResizedSignal();
+
+  /**
+   * @brief Connect to this signal to be notified when the virtual keyboard's language is changed.
+   *
+   * A callback of the following type may be connected:
+   * @code
+   *   void YourCallbackName();
+   * @endcode
+   * User can get the text direction of the language by calling GetTextDirection() in the callback.
+   * @return The signal to connect to.
+   */
+  VoidSignalType& LanguageChangedSignal();
+
+  /**
+   * @brief Connect to this signal to be notified when the keyboard type is changed.
+   *
+   * A callback of the following type may be connected:
+   * @code
+   *   void YourCallbackName( KeyboardType keyboard );
+   * @endcode
+   *
+   * @return The signal to connect to.
+   */
+  KeyboardTypeSignalType& KeyboardTypeChangedSignal();
+
   // Construction & Destruction
 
   /**