Merge "Set the input hint when IME layout is password" into devel/master
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Thu, 16 May 2019 04:36:06 +0000 (04:36 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Thu, 16 May 2019 04:36:06 +0000 (04:36 +0000)
15 files changed:
dali/devel-api/adaptor-framework/input-method-context.cpp
dali/devel-api/adaptor-framework/input-method-context.h
dali/devel-api/adaptor-framework/web-engine-plugin.h
dali/devel-api/adaptor-framework/web-engine.cpp
dali/devel-api/adaptor-framework/web-engine.h
dali/internal/graphics/gles/egl-implementation.cpp
dali/internal/input/common/input-method-context-impl.h
dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp
dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.h
dali/internal/input/ubuntu-x11/input-method-context-impl-x.cpp
dali/internal/input/ubuntu-x11/input-method-context-impl-x.h
dali/internal/input/windows/input-method-context-impl-win.cpp
dali/internal/input/windows/input-method-context-impl-win.h
dali/internal/web-engine/common/web-engine-impl.cpp
dali/internal/web-engine/common/web-engine-impl.h

index 427ae6c..a63c3e2 100755 (executable)
@@ -196,6 +196,17 @@ bool InputMethodContext::IsTextPredictionAllowed() const
   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).IsTextPredictionAllowed();
 }
 
+void InputMethodContext::SetInputPanelLanguage( Dali::InputMethodContext::InputPanelLanguage language )
+{
+  Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetInputPanelLanguage( language );
+}
+
+Dali::InputMethodContext::InputPanelLanguage InputMethodContext::GetInputPanelLanguage() const
+{
+  return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelLanguage();
+}
+
+// Signals
 InputMethodContext::ActivatedSignalType& InputMethodContext::ActivatedSignal()
 {
   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).ActivatedSignal();
index be9c81e..15666ff 100755 (executable)
@@ -2,7 +2,7 @@
 #define __DALI_INPUT_METHOD_CONTEXT_H__
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -88,6 +88,12 @@ public:
     HARDWARE_KEYBOARD   ///< Hardware keyboard
   };
 
+  enum class InputPanelLanguage
+  {
+    AUTOMATIC,    ///< IME Language automatically set depending on the system display
+    ALPHABET      ///< Latin alphabet at all times
+  };
+
   /**
    * @brief This structure is used to pass on data from the InputMethodContext regarding predictive text.
    */
@@ -411,6 +417,22 @@ public:
    * @return Whether the IM allow text prediction or not.
    */
   bool IsTextPredictionAllowed() const;
+
+  /**
+   * @brief Sets the language of the input panel.
+   *
+   * This method can be used when you want to show the English keyboard.
+   * @param[in] language The language to be set to the input panel
+   */
+  void SetInputPanelLanguage( InputPanelLanguage language );
+
+  /**
+   * @brief Gets the language of the input panel.
+   *
+   * @return The language of the input panel
+   */
+  InputPanelLanguage GetInputPanelLanguage() const;
+
 public:
 
   // Signals
index 68cdd90..b8d6379 100644 (file)
@@ -37,7 +37,57 @@ class WebEnginePlugin
 {
 public:
 
-  typedef Signal< void( const std::string& ) > WebEngineSignalType;
+  /**
+   * @brief WebEngine signal type related with page loading.
+   */
+  typedef Signal< void( const std::string& ) > WebEnginePageLoadSignalType;
+
+  /**
+   * @brief WebView signal type related with page loading error.
+   */
+  typedef Signal< void( const std::string&, int ) > WebEnginePageLoadErrorSignalType;
+
+  /**
+   * @brief Enumeration for cache model options.
+   */
+  enum class CacheModel
+  {
+    /**
+     * @brief Use the smallest cache capacity.
+     */
+    DOCUMENT_VIEWER,
+
+    /**
+     * @brief Use the bigger cache capacity than DocumentBrowser.
+     */
+    DOCUMENT_BROWSER,
+
+    /**
+     * @brief Use the biggest cache capacity.
+     */
+    PRIMARY_WEB_BROWSER
+  };
+
+  /**
+   * @brief Enumeration for the cookies accept policies.
+   */
+  enum class CookieAcceptPolicy
+  {
+    /**
+     * @brief Accepts every cookie sent from any page.
+     */
+    ALWAYS,
+
+    /**
+     * @brief Rejects all the cookies.
+     */
+    NEVER,
+
+    /**
+     * @brief Accepts only cookies set by the main document that is loaded.
+     */
+    NO_THIRD_PARTY
+  };
 
   /**
    * @brief Constructor.
@@ -105,6 +155,16 @@ public:
   virtual void StopLoading() = 0;
 
   /**
+   * @brief Suspends the operation associated with the view.
+   */
+  virtual void Suspend() = 0;
+
+  /**
+   * @brief Resumes the operation associated with the view object after calling Suspend().
+   */
+  virtual void Resume() = 0;
+
+  /**
    * @brief Returns whether forward is possible.
    *
    * @return True if forward is possible, false otherwise
@@ -132,8 +192,9 @@ public:
    * @brief Evaluates JavaScript code represented as a string.
    *
    * @param[in] script The JavaScript code
+   * @param[in] resultHandler The callback function to be called by the JavaScript runtime. This carries evaluation result.
    */
-  virtual void EvaluateJavaScript( const std::string& script ) = 0;
+  virtual void EvaluateJavaScript( const std::string& script, std::function< void( const std::string& ) > resultHandler ) = 0;
 
   /**
    * @brief Add a message handler into JavaScript.
@@ -154,6 +215,109 @@ public:
   virtual void ClearCache() = 0;
 
   /**
+   * @brief Clears all the cookies of Web.
+   */
+  virtual void ClearCookies() = 0;
+
+  /**
+   * @brief Get cache model option. The default is DOCUMENT_VIEWER.
+   *
+   * @return The cache model option
+   */
+  virtual CacheModel GetCacheModel() const = 0;
+
+  /**
+   * @brief Set cache model option. The default is DOCUMENT_VIEWER.
+   *
+   * @param[in] cacheModel The cache model option
+   */
+  virtual void SetCacheModel( CacheModel cacheModel ) = 0;
+
+  /**
+   * @brief Gets the cookie acceptance policy. The default is NO_THIRD_PARTY.
+   *
+   * @return The cookie acceptance policy
+   */
+  virtual CookieAcceptPolicy GetCookieAcceptPolicy() const = 0;
+
+  /**
+   * @brief Sets the cookie acceptance policy. The default is NO_THIRD_PARTY.
+   *
+   * @param[in] policy The cookie acceptance policy
+   */
+  virtual void SetCookieAcceptPolicy( CookieAcceptPolicy policy ) = 0;
+
+  /**
+   * @brief Get user agent string.
+   *
+   * @return The string value of user agent
+   */
+  virtual const std::string& GetUserAgent() const = 0;
+
+  /**
+   * @brief Set user agent string.
+   *
+   * @param[in] userAgent The string value of user agent
+   */
+  virtual void SetUserAgent( const std::string& userAgent ) = 0;
+
+  /**
+   * @brief Returns whether JavaScript can be executable. The default is true.
+   *
+   * @return true if JavaScript executing is enabled, false otherwise
+   */
+  virtual bool IsJavaScriptEnabled() const = 0;
+
+  /**
+   * @brief Enables/disables JavaScript executing. The default is enabled.
+   *
+   * @param[in] enabled True if JavaScript executing is enabled, false otherwise
+   */
+  virtual void EnableJavaScript( bool enabled ) = 0;
+
+  /**
+   * @brief Returns whether images can be loaded automatically. The default is true.
+   *
+   * @return true if images are loaded automatically, false otherwise
+   */
+  virtual bool AreImagesAutomaticallyLoaded() const = 0;
+
+  /**
+   * @brief Enables/disables auto loading of images. The default is enabled.
+   *
+   * @param[in] automatic True if images are loaded automatically, false otherwise
+   */
+  virtual void LoadImagesAutomatically( bool automatic ) = 0;
+
+  /**
+   * @brief Gets the default text encoding name (e.g. UTF-8).
+   *
+   * @return The default text encoding name
+   */
+  virtual const std::string& GetDefaultTextEncodingName() const = 0;
+
+  /**
+   * @brief Sets the default text encoding name (e.g. UTF-8).
+   *
+   * @param[in] defaultTextEncodingName The default text encoding name
+   */
+  virtual void SetDefaultTextEncodingName( const std::string& defaultTextEncodingName ) = 0;
+
+  /**
+   * @brief Returns the default font size in pixel. The default value is 16.
+   *
+   * @return The default font size
+   */
+  virtual int GetDefaultFontSize() const = 0;
+
+  /**
+   * @brief Sets the default font size in pixel. The default value is 16.
+   *
+   * @param[in] defaultFontSize A new default font size to set
+   */
+  virtual void SetDefaultFontSize( int defaultFontSize ) = 0;
+
+  /**
    * @brief Sets size of Web Page.
    */
   virtual void SetSize( int width, int height ) = 0;
@@ -173,14 +337,21 @@ public:
    *
    * @return A signal object to connect with.
    */
-  virtual WebEngineSignalType& PageLoadStartedSignal() = 0;
+  virtual WebEnginePageLoadSignalType& PageLoadStartedSignal() = 0;
 
   /**
    * @brief Connects to this signal to be notified when page loading is finished.
    *
    * @return A signal object to connect with.
    */
-  virtual WebEngineSignalType& PageLoadFinishedSignal() = 0;
+  virtual WebEnginePageLoadSignalType& PageLoadFinishedSignal() = 0;
+
+  /**
+   * @brief Connects to this signal to be notified when an error occurs in page loading.
+   *
+   * @return A signal object to connect with.
+   */
+  virtual WebEnginePageLoadErrorSignalType& PageLoadErrorSignal() = 0;
 
 };
 
index 9233f28..04a7368 100644 (file)
@@ -103,6 +103,16 @@ void WebEngine::StopLoading()
   GetImplementation( *this ).StopLoading();
 }
 
+void WebEngine::Suspend()
+{
+  GetImplementation( *this ).Suspend();
+}
+
+void WebEngine::Resume()
+{
+  GetImplementation( *this ).Resume();
+}
+
 bool WebEngine::CanGoForward()
 {
   return GetImplementation( *this ).CanGoForward();
@@ -123,9 +133,9 @@ void WebEngine::GoBack()
   GetImplementation( *this ).GoBack();
 }
 
-void WebEngine::EvaluateJavaScript( const std::string& script )
+void WebEngine::EvaluateJavaScript( const std::string& script, std::function< void( const std::string& ) > resultHandler )
 {
-  GetImplementation( *this ).EvaluateJavaScript( script );
+  GetImplementation( *this ).EvaluateJavaScript( script, resultHandler );
 }
 
 void WebEngine::AddJavaScriptMessageHandler( const std::string& exposedObjectName, std::function< void( const std::string& ) > handler )
@@ -143,6 +153,81 @@ void WebEngine::ClearCache()
   return GetImplementation( *this ).ClearCache();
 }
 
+void WebEngine::ClearCookies()
+{
+  return GetImplementation( *this ).ClearCookies();
+}
+
+Dali::WebEnginePlugin::CacheModel WebEngine::GetCacheModel() const
+{
+  return GetImplementation( *this ).GetCacheModel();
+}
+
+void WebEngine::SetCacheModel( Dali::WebEnginePlugin::CacheModel cacheModel )
+{
+  GetImplementation( *this ).SetCacheModel( cacheModel );
+}
+
+Dali::WebEnginePlugin::CookieAcceptPolicy WebEngine::GetCookieAcceptPolicy() const
+{
+  return GetImplementation( *this ).GetCookieAcceptPolicy();
+}
+
+void WebEngine::SetCookieAcceptPolicy( Dali::WebEnginePlugin::CookieAcceptPolicy policy )
+{
+  GetImplementation( *this ).SetCookieAcceptPolicy( policy );
+}
+
+const std::string& WebEngine::GetUserAgent() const
+{
+  return GetImplementation( *this ).GetUserAgent();
+}
+
+void WebEngine::SetUserAgent( const std::string& userAgent )
+{
+  GetImplementation( *this ).SetUserAgent( userAgent );
+}
+
+bool WebEngine::IsJavaScriptEnabled() const
+{
+  return GetImplementation( *this ).IsJavaScriptEnabled();
+}
+
+void WebEngine::EnableJavaScript( bool enabled )
+{
+  GetImplementation( *this ).EnableJavaScript( enabled );
+}
+
+bool WebEngine::AreImagesAutomaticallyLoaded() const
+{
+  return GetImplementation( *this ).AreImagesAutomaticallyLoaded();
+}
+
+void WebEngine::LoadImagesAutomatically( bool automatic )
+{
+  GetImplementation( *this ).LoadImagesAutomatically( automatic );
+}
+
+const std::string& WebEngine::GetDefaultTextEncodingName() const
+{
+  return GetImplementation( *this ).GetDefaultTextEncodingName();
+}
+
+void WebEngine::SetDefaultTextEncodingName( const std::string& defaultTextEncodingName )
+{
+  GetImplementation( *this ).SetDefaultTextEncodingName( defaultTextEncodingName );
+}
+
+int WebEngine::GetDefaultFontSize() const
+{
+  return GetImplementation( *this ).GetDefaultFontSize();
+}
+
+void WebEngine::SetDefaultFontSize( int defaultFontSize )
+{
+  GetImplementation( *this ).SetDefaultFontSize( defaultFontSize );
+}
+
 void WebEngine::SetSize( int width, int height )
 {
   return GetImplementation( *this ).SetSize( width, height );
@@ -158,15 +243,20 @@ bool WebEngine::SendKeyEvent( const KeyEvent& event )
   return GetImplementation( *this ).SendKeyEvent( event );
 }
 
-Dali::WebEnginePlugin::WebEngineSignalType& WebEngine::PageLoadStartedSignal()
+Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadStartedSignal()
 {
   return GetImplementation( *this ).PageLoadStartedSignal();
 }
 
-Dali::WebEnginePlugin::WebEngineSignalType& WebEngine::PageLoadFinishedSignal()
+Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadFinishedSignal()
 {
   return GetImplementation( *this ).PageLoadFinishedSignal();
 }
 
+Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType& WebEngine::PageLoadErrorSignal()
+{
+  return GetImplementation( *this ).PageLoadErrorSignal();
+}
+
 } // namespace Dali;
 
index ca0e686..e9b604e 100644 (file)
@@ -139,6 +139,16 @@ public:
   void StopLoading();
 
   /**
+   * @brief Suspends the operation associated with the view.
+   */
+  void Suspend();
+
+  /**
+   * @brief Resumes the operation associated with the view object after calling Suspend().
+   */
+  void Resume();
+
+  /**
    * @brief Returns whether forward is possible.
    *
    * @return True if forward is possible, false otherwise
@@ -166,8 +176,9 @@ public:
    * @brief Evaluates JavaScript code represented as a string.
    *
    * @param[in] script The JavaScript code
+   * @param[in] resultHandler The callback function to be called by the JavaScript runtime. This carries evaluation result.
    */
-  void EvaluateJavaScript( const std::string& script );
+  void EvaluateJavaScript( const std::string& script, std::function< void( const std::string& ) > resultHandler );
 
   /**
    * @brief Add a message handler into JavaScript.
@@ -188,6 +199,109 @@ public:
   void ClearCache();
 
   /**
+   * @brief Clears all the cookies of Web.
+   */
+  void ClearCookies();
+
+  /**
+   * @brief Get cache model option. The default is DOCUMENT_VIEWER.
+   *
+   * @return The cache model option
+   */
+  Dali::WebEnginePlugin::CacheModel GetCacheModel() const;
+
+  /**
+   * @brief Set cache model option. The default is DOCUMENT_VIEWER.
+   *
+   * @param[in] cacheModel The cache model option
+   */
+  void SetCacheModel( Dali::WebEnginePlugin::CacheModel cacheModel );
+
+  /**
+   * @brief Gets the cookie acceptance policy. The default is NO_THIRD_PARTY.
+   *
+   * @return The cookie acceptance policy
+   */
+  Dali::WebEnginePlugin::CookieAcceptPolicy GetCookieAcceptPolicy() const;
+
+  /**
+   * @brief Sets the cookie acceptance policy. The default is NO_THIRD_PARTY.
+   *
+   * @param[in] policy The cookie acceptance policy
+   */
+  void SetCookieAcceptPolicy( Dali::WebEnginePlugin::CookieAcceptPolicy policy );
+
+  /**
+   * @brief Get user agent string.
+   *
+   * @return The string value of user agent
+   */
+  const std::string& GetUserAgent() const;
+
+  /**
+   * @brief Set user agent string.
+   *
+   * @param[in] userAgent The string value of user agent
+   */
+  void SetUserAgent( const std::string& userAgent );
+
+  /**
+   * @brief Returns whether JavaScript can be executable. The default is true.
+   *
+   * @return true if JavaScript executing is enabled, false otherwise
+   */
+  bool IsJavaScriptEnabled() const;
+
+  /**
+   * @brief Enables/disables JavaScript executing. The default is enabled.
+   *
+   * @param[in] enabled True if JavaScript executing is enabled, false otherwise
+   */
+  void EnableJavaScript( bool enabled );
+
+  /**
+   * @brief Returns whether JavaScript can be executable. The default is true.
+   *
+   * @return true if images are loaded automatically, false otherwise
+   */
+  bool AreImagesAutomaticallyLoaded() const;
+
+  /**
+   * @brief Enables/disables auto loading of images. The default is enabled.
+   *
+   * @param[in] automatic True if images are loaded automatically, false otherwise
+   */
+  void LoadImagesAutomatically( bool automatic );
+
+  /**
+   * @brief Gets the default text encoding name.
+   *
+   * @return The default text encoding name
+   */
+  const std::string& GetDefaultTextEncodingName() const;
+
+  /**
+   * @brief Sets the default text encoding name.
+   *
+   * @param[in] defaultTextEncodingName The default text encoding name
+   */
+  void SetDefaultTextEncodingName( const std::string& defaultTextEncodingName );
+
+  /**
+   * @brief Returns the default font size in pixel. The default value is 16.
+   *
+   * @return The default font size
+   */
+  int GetDefaultFontSize() const;
+
+  /**
+   * @brief Sets the default font size in pixel. The default value is 16.
+   *
+   * @param[in] defaultFontSize A new default font size to set
+   */
+  void SetDefaultFontSize( int defaultFontSize );
+
+  /**
    * @brief Sets the size of Web Pages.
    */
   void SetSize( int width, int height );
@@ -207,14 +321,21 @@ public:
    *
    * @return A signal object to connect with.
    */
-  Dali::WebEnginePlugin::WebEngineSignalType& PageLoadStartedSignal();
+  Dali::WebEnginePlugin::WebEnginePageLoadSignalType& PageLoadStartedSignal();
 
   /**
    * @brief Connects to this signal to be notified when page loading is finished.
    *
    * @return A signal object to connect with.
    */
-  Dali::WebEnginePlugin::WebEngineSignalType& PageLoadFinishedSignal();
+  Dali::WebEnginePlugin::WebEnginePageLoadSignalType& PageLoadFinishedSignal();
+
+  /**
+   * @brief Connects to this signal to be notified when an error occurs in page loading.
+   *
+   * @return A signal object to connect with.
+   */
+  Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType& PageLoadErrorSignal();
 
 private: // Not intended for application developers
 
index 91d4fab..2172e37 100755 (executable)
@@ -401,7 +401,10 @@ bool EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth )
 #endif // DALI_PROFILE_UBUNTU
   configAttribs.PushBack( EGL_NONE );
 
-  if ( eglChooseConfig( mEglDisplay, &(configAttribs[0]), &mEglConfig, 1, &numConfigs ) != EGL_TRUE )
+  // Ensure number of configs is set to 1 as on some drivers,
+  // eglChooseConfig succeeds but does not actually create a proper configuration.
+  if ( ( eglChooseConfig( mEglDisplay, &(configAttribs[0]), &mEglConfig, 1, &numConfigs ) != EGL_TRUE ) ||
+       ( numConfigs != 1 ) )
   {
     if( mGlesVersion >= 30 )
     {
@@ -410,6 +413,13 @@ bool EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth )
       return false;
     }
 
+    if ( numConfigs != 1 )
+    {
+      DALI_LOG_ERROR("No configurations found.\n");
+
+      TEST_EGL_ERROR("eglChooseConfig");
+    }
+
     EGLint error = eglGetError();
     switch (error)
     {
@@ -460,13 +470,6 @@ bool EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth )
   }
   mContextAttribs.PushBack( EGL_NONE );
 
-  if ( numConfigs != 1 )
-  {
-    DALI_LOG_ERROR("No configurations found.\n");
-
-    TEST_EGL_ERROR("eglChooseConfig");
-  }
-
   return true;
 }
 
index a46cdb5..7890b1c 100755 (executable)
@@ -245,6 +245,17 @@ public:
    * @copydoc Dali::InputMethodContext::IsTextPredictionAllowed()
    */
   virtual bool IsTextPredictionAllowed() const { return false; }
+
+  /**
+   * @copydoc Dali::InputMethodContext::SetInputPanelLanguage()
+   */
+  virtual void SetInputPanelLanguage( Dali::InputMethodContext::InputPanelLanguage language ) {}
+
+  /**
+   * @copydoc Dali::InputMethodContext::GetInputPanelLanguage()
+   */
+  virtual Dali::InputMethodContext::InputPanelLanguage GetInputPanelLanguage() const { return Dali::InputMethodContext::InputPanelLanguage(); }
+
 public:  // Signals
 
   /**
index 19adce8..9af492e 100755 (executable)
@@ -947,6 +947,52 @@ bool InputMethodContextEcoreWl::IsTextPredictionAllowed() const
   return prediction;
 }
 
+void InputMethodContextEcoreWl::SetInputPanelLanguage( Dali::InputMethodContext::InputPanelLanguage language )
+{
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextEcoreWl::SetInputPanelLanguage\n" );
+  if( mIMFContext )
+  {
+    switch (language)
+    {
+      case Dali::InputMethodContext::InputPanelLanguage::AUTOMATIC:
+      {
+        ecore_imf_context_input_panel_language_set( mIMFContext, ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC );
+        break;
+      }
+      case Dali::InputMethodContext::InputPanelLanguage::ALPHABET:
+      {
+        ecore_imf_context_input_panel_language_set( mIMFContext, ECORE_IMF_INPUT_PANEL_LANG_ALPHABET );
+        break;
+      }
+    }
+  }
+}
+
+Dali::InputMethodContext::InputPanelLanguage InputMethodContextEcoreWl::GetInputPanelLanguage() const
+{
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextEcoreWl::GetInputPanelLanguage\n" );
+  if( mIMFContext )
+  {
+    int value;
+    value =  ecore_imf_context_input_panel_language_get( mIMFContext );
+
+    switch (value)
+    {
+      case ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC:
+      {
+        return Dali::InputMethodContext::InputPanelLanguage::AUTOMATIC;
+        break;
+      }
+      case ECORE_IMF_INPUT_PANEL_LANG_ALPHABET:
+      {
+        return Dali::InputMethodContext::InputPanelLanguage::ALPHABET;
+        break;
+      }
+    }
+  }
+  return Dali::InputMethodContext::InputPanelLanguage::AUTOMATIC;
+}
+
 bool InputMethodContextEcoreWl::ProcessEventKeyDown( const KeyEvent& keyEvent )
 {
   bool eventHandled( false );
index eca83cd..ad7117c 100755 (executable)
@@ -235,6 +235,17 @@ public:
    * @copydoc Dali::InputMethodContext::IsTextPredictionAllowed()
    */
   bool IsTextPredictionAllowed() const override;
+
+  /**
+   * @copydoc Dali::InputMethodContext::SetInputPanelLanguage()
+   */
+  void SetInputPanelLanguage( Dali::InputMethodContext::InputPanelLanguage language ) override;
+
+  /**
+   * @copydoc Dali::InputMethodContext::GetInputPanelLanguage()
+   */
+  Dali::InputMethodContext::InputPanelLanguage GetInputPanelLanguage() const override;
+
 private:
   /**
    * Context created the first time and kept until deleted.
index add026d..d398555 100755 (executable)
@@ -745,6 +745,52 @@ bool InputMethodContextX::IsTextPredictionAllowed() const
   return prediction;
 }
 
+void InputMethodContextX::SetInputPanelLanguage( Dali::InputMethodContext::InputPanelLanguage language )
+{
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextX::SetInputPanelLanguage\n" );
+  if( mIMFContext )
+  {
+    switch (language)
+    {
+      case Dali::InputMethodContext::InputPanelLanguage::AUTOMATIC:
+      {
+        ecore_imf_context_input_panel_language_set( mIMFContext, ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC );
+        break;
+      }
+      case Dali::InputMethodContext::InputPanelLanguage::ALPHABET:
+      {
+        ecore_imf_context_input_panel_language_set( mIMFContext, ECORE_IMF_INPUT_PANEL_LANG_ALPHABET );
+        break;
+      }
+    }
+  }
+}
+
+Dali::InputMethodContext::InputPanelLanguage InputMethodContextX::GetInputPanelLanguage() const
+{
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextX::GetInputPanelLanguage\n" );
+  if( mIMFContext )
+  {
+    int value;
+    value =  ecore_imf_context_input_panel_language_get( mIMFContext );
+
+    switch (value)
+    {
+      case ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC:
+      {
+        return Dali::InputMethodContext::InputPanelLanguage::AUTOMATIC;
+        break;
+      }
+      case ECORE_IMF_INPUT_PANEL_LANG_ALPHABET:
+      {
+        return Dali::InputMethodContext::InputPanelLanguage::ALPHABET;
+        break;
+      }
+    }
+  }
+  return Dali::InputMethodContext::InputPanelLanguage::AUTOMATIC;
+}
+
 bool InputMethodContextX::ProcessEventKeyDown( const KeyEvent& keyEvent )
 {
   bool eventHandled( false );
index c12d777..4c2b1b5 100755 (executable)
@@ -240,6 +240,17 @@ public:
    * @copydoc Dali::InputMethodContext::IsTextPredictionAllowed()
    */
   bool IsTextPredictionAllowed() const override;
+
+  /**
+   * @copydoc Dali::InputMethodContext::SetInputPanelLanguage()
+   */
+  void SetInputPanelLanguage( Dali::InputMethodContext::InputPanelLanguage language ) override;
+
+  /**
+   * @copydoc Dali::InputMethodContext::GetInputPanelLanguage()
+   */
+  Dali::InputMethodContext::InputPanelLanguage GetInputPanelLanguage() const override;
+
 private:
   /**
    * Context created the first time and kept until deleted.
index 16df1a5..6bbfac1 100755 (executable)
@@ -355,6 +355,17 @@ bool InputMethodContextWin::FilterEventKey( const Dali::KeyEvent& keyEvent )
   return eventHandled;\r
 }\r
 \r
+void InputMethodContextWin::SetInputPanelLanguage( Dali::InputMethodContext::InputPanelLanguage language )\r
+{\r
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::SetInputPanelLanguage\n" );\r
+}\r
+\r
+Dali::InputMethodContext::InputPanelLanguage InputMethodContextWin::GetInputPanelLanguage() const\r
+{\r
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::GetInputPanelLanguage\n" );\r
+  return Dali::InputMethodContext::InputPanelLanguage::AUTOMATIC;\r
+}\r
+\r
 bool InputMethodContextWin::ProcessEventKeyDown( const KeyEvent& keyEvent )\r
 {\r
   bool eventHandled( false );\r
index a2f71f3..d2a03fc 100755 (executable)
@@ -229,6 +229,16 @@ public:
    */\r
   bool FilterEventKey( const Dali::KeyEvent& keyEvent ) override;\r
 \r
+  /**\r
+   * @copydoc Dali::InputMethodContext::SetInputPanelLanguage()\r
+   */\r
+  void SetInputPanelLanguage( Dali::InputMethodContext::InputPanelLanguage language ) override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::GetInputPanelLanguage()\r
+   */\r
+  Dali::InputMethodContext::InputPanelLanguage GetInputPanelLanguage() const override;\r
+\r
 private:\r
   /**\r
    * Context created the first time and kept until deleted.\r
index 526926a..a8c40b5 100644 (file)
@@ -67,17 +67,15 @@ Dali::TypeRegistration type( typeid( Dali::WebEngine ), typeid( Dali::BaseHandle
 
 WebEnginePtr WebEngine::New()
 {
-  WebEnginePtr ptr;
-  WebEngine* engine = new WebEngine();
+  WebEngine* instance = new WebEngine();
 
-  if ( !engine->Initialize() )
+  if( !instance->Initialize() )
   {
-    delete engine;
-    engine = nullptr;
+    delete instance;
+    return nullptr;
   }
 
-  ptr = engine;
-  return ptr;
+  return instance;
 }
 
 WebEngine::WebEngine()
@@ -104,15 +102,15 @@ WebEngine::~WebEngine()
 
 bool WebEngine::InitializePluginHandle()
 {
-  if ( pluginName.length() == 0 )
+  if( pluginName.length() == 0 )
   {
     // pluginName is not initialized yet.
     const char* name = EnvironmentVariable::GetEnvironmentVariable( DALI_ENV_WEB_ENGINE_NAME );
-    if ( name )
+    if( name )
     {
       pluginName = MakePluginName( name );
       mHandle = dlopen( pluginName.c_str(), RTLD_LAZY );
-      if ( mHandle )
+      if( mHandle )
       {
         return true;
       }
@@ -121,7 +119,7 @@ bool WebEngine::InitializePluginHandle()
   }
 
   mHandle = dlopen( pluginName.c_str(), RTLD_LAZY );
-  if ( !mHandle )
+  if( !mHandle )
   {
     DALI_LOG_ERROR( "Can't load %s : %s\n", pluginName.c_str(), dlerror() );
     return false;
@@ -134,7 +132,7 @@ bool WebEngine::Initialize()
 {
   char* error = NULL;
 
-  if ( !InitializePluginHandle() )
+  if( !InitializePluginHandle() )
   {
     return false;
   }
@@ -146,20 +144,19 @@ bool WebEngine::Initialize()
     return false;
   }
 
-  mPlugin = mCreateWebEnginePtr();
+  mDestroyWebEnginePtr = reinterpret_cast< DestroyWebEngineFunction >( dlsym( mHandle, "DestroyWebEnginePlugin" ) );
 
-  if( mPlugin == NULL )
+  if( mDestroyWebEnginePtr == NULL )
   {
-    DALI_LOG_ERROR( "Can't create the WebEnginePlugin object\n" );
+    DALI_LOG_ERROR( "Can't load symbol DestroyWebEnginePlugin(), error: %s\n", error );
     return false;
   }
 
-  mDestroyWebEnginePtr = reinterpret_cast< DestroyWebEngineFunction >( dlsym( mHandle, "DestroyWebEnginePlugin" ) );
+  mPlugin = mCreateWebEnginePtr();
 
-  if( mDestroyWebEnginePtr == NULL )
+  if( mPlugin == NULL )
   {
-
-    DALI_LOG_ERROR( "Can't load symbol DestroyWebEnginePlugin(), error: %s\n", error );
+    DALI_LOG_ERROR( "Can't create the WebEnginePlugin object\n" );
     return false;
   }
 
@@ -168,18 +165,12 @@ bool WebEngine::Initialize()
 
 void WebEngine::Create( int width, int height, const std::string& locale, const std::string& timezoneId )
 {
-  if( mPlugin != NULL )
-  {
-    mPlugin->Create( width, height, locale, timezoneId );
-  }
+  mPlugin->Create( width, height, locale, timezoneId );
 }
 
 void WebEngine::Destroy()
 {
-  if( mPlugin != NULL )
-  {
-    mPlugin->Destroy();
-  }
+  mPlugin->Destroy();
 }
 
 Dali::NativeImageInterfacePtr WebEngine::GetNativeImageSource()
@@ -189,138 +180,184 @@ Dali::NativeImageInterfacePtr WebEngine::GetNativeImageSource()
 
 void WebEngine::LoadUrl( const std::string& url )
 {
-  if( mPlugin != NULL )
-  {
-    mPlugin->LoadUrl( url );
-  }
+  mPlugin->LoadUrl( url );
 }
 
 const std::string& WebEngine::GetUrl()
 {
-  static std::string emptyUrl;
-  return mPlugin ? mPlugin->GetUrl() : emptyUrl;
+  return mPlugin->GetUrl();
 }
 
 void WebEngine::LoadHTMLString( const std::string& htmlString )
 {
-  if( mPlugin != NULL )
-  {
-    mPlugin->LoadHTMLString( htmlString );
-  }
+  mPlugin->LoadHTMLString( htmlString );
 }
 
 void WebEngine::Reload()
 {
-  if( mPlugin != NULL )
-  {
-    mPlugin->Reload();
-  }
+  mPlugin->Reload();
 }
 
 void WebEngine::StopLoading()
 {
-  if( mPlugin != NULL )
-  {
-    mPlugin->StopLoading();
-  }
+  mPlugin->StopLoading();
+}
+
+void WebEngine::Suspend()
+{
+  mPlugin->Suspend();
+}
+
+void WebEngine::Resume()
+{
+  mPlugin->Resume();
 }
 
 bool WebEngine::CanGoForward()
 {
-  return mPlugin ? mPlugin->CanGoForward() : false;
+  return mPlugin->CanGoForward();
 }
 
 void WebEngine::GoForward()
 {
-  if( mPlugin != NULL )
-  {
-    mPlugin->GoForward();
-  }
+  mPlugin->GoForward();
 }
 
 bool WebEngine::CanGoBack()
 {
-  return mPlugin ? mPlugin->CanGoBack() : false;
+  return mPlugin->CanGoBack();
 }
 
 void WebEngine::GoBack()
 {
-  if( mPlugin != NULL )
-  {
-    mPlugin->GoBack();
-  }
+  mPlugin->GoBack();
 }
 
-void WebEngine::EvaluateJavaScript( const std::string& script )
+void WebEngine::EvaluateJavaScript( const std::string& script, std::function< void( const std::string& ) > resultHandler )
 {
-  if( mPlugin != NULL )
-  {
-    mPlugin->EvaluateJavaScript( script );
-  }
+  mPlugin->EvaluateJavaScript( script, resultHandler );
 }
 
 void WebEngine::AddJavaScriptMessageHandler( const std::string& exposedObjectName, std::function< void(const std::string&) > handler )
 {
-  if( mPlugin != NULL )
-  {
-    mPlugin->AddJavaScriptMessageHandler( exposedObjectName, handler );
-  }
+  mPlugin->AddJavaScriptMessageHandler( exposedObjectName, handler );
 }
 
 void WebEngine::ClearHistory()
 {
-  if( mPlugin != NULL )
-  {
-    mPlugin->ClearHistory();
-  }
+  mPlugin->ClearHistory();
 }
 
 void WebEngine::ClearCache()
 {
-  if( mPlugin != NULL )
-  {
-    mPlugin->ClearCache();
-  }
+  mPlugin->ClearCache();
+}
+
+void WebEngine::ClearCookies()
+{
+  mPlugin->ClearCookies();
+}
+
+Dali::WebEnginePlugin::CacheModel WebEngine::GetCacheModel() const
+{
+  return mPlugin->GetCacheModel();
+}
+
+void WebEngine::SetCacheModel( Dali::WebEnginePlugin::CacheModel cacheModel )
+{
+  mPlugin->SetCacheModel( cacheModel );
+}
+
+Dali::WebEnginePlugin::CookieAcceptPolicy WebEngine::GetCookieAcceptPolicy() const
+{
+  return mPlugin->GetCookieAcceptPolicy();
+}
+
+void WebEngine::SetCookieAcceptPolicy( Dali::WebEnginePlugin::CookieAcceptPolicy policy )
+{
+  mPlugin->SetCookieAcceptPolicy( policy );
+}
+
+const std::string& WebEngine::GetUserAgent() const
+{
+  return mPlugin->GetUserAgent();
+}
+
+void WebEngine::SetUserAgent( const std::string& userAgent )
+{
+  mPlugin->SetUserAgent( userAgent );
+}
+
+bool WebEngine::IsJavaScriptEnabled() const
+{
+  return mPlugin->IsJavaScriptEnabled();
+}
+
+void WebEngine::EnableJavaScript( bool enabled )
+{
+  mPlugin->EnableJavaScript( enabled );
+}
+
+bool WebEngine::AreImagesAutomaticallyLoaded() const
+{
+  return mPlugin->AreImagesAutomaticallyLoaded();
+}
+
+void WebEngine::LoadImagesAutomatically( bool automatic )
+{
+  mPlugin->LoadImagesAutomatically( automatic );
+}
+
+const std::string& WebEngine::GetDefaultTextEncodingName() const
+{
+  return mPlugin->GetDefaultTextEncodingName();
+}
+
+void WebEngine::SetDefaultTextEncodingName( const std::string& defaultTextEncodingName )
+{
+  mPlugin->SetDefaultTextEncodingName( defaultTextEncodingName );
+}
+
+int WebEngine::GetDefaultFontSize() const
+{
+  return mPlugin->GetDefaultFontSize();
+}
+
+void WebEngine::SetDefaultFontSize( int defaultFontSize )
+{
+  mPlugin->SetDefaultFontSize( defaultFontSize );
 }
 
 void WebEngine::SetSize( int width, int height )
 {
-  if( mPlugin != NULL )
-  {
-    mPlugin->SetSize( width, height );
-  }
+  mPlugin->SetSize( width, height );
 }
 
 bool WebEngine::SendTouchEvent( const Dali::TouchData& touch )
 {
-  if( mPlugin != NULL )
-  {
-    return mPlugin->SendTouchEvent( touch );
-  }
-
-  return false;
+  return mPlugin->SendTouchEvent( touch );
 }
 
 bool WebEngine::SendKeyEvent( const Dali::KeyEvent& event )
 {
-  if( mPlugin != NULL )
-  {
-    return mPlugin->SendKeyEvent( event );
-  }
-
-  return false;
+  return mPlugin->SendKeyEvent( event );
 }
 
-Dali::WebEnginePlugin::WebEngineSignalType& WebEngine::PageLoadStartedSignal()
+Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadStartedSignal()
 {
   return mPlugin->PageLoadStartedSignal();
 }
 
-Dali::WebEnginePlugin::WebEngineSignalType& WebEngine::PageLoadFinishedSignal()
+Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadFinishedSignal()
 {
   return mPlugin->PageLoadFinishedSignal();
 }
 
+Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType& WebEngine::PageLoadErrorSignal()
+{
+  return mPlugin->PageLoadErrorSignal();
+}
+
 } // namespace Adaptor;
 } // namespace Internal;
 } // namespace Dali;
index 6f0a933..bf64b23 100644 (file)
@@ -93,6 +93,16 @@ public:
   void StopLoading();
 
   /**
+   * @copydoc Dali::WebEngine::Suspend()
+   */
+  void Suspend();
+
+  /**
+   * @copydoc Dali::WebEngine::Resume()
+   */
+  void Resume();
+
+  /**
    * @copydoc Dali::WebEngine::CanGoForward()
    */
   bool CanGoForward();
@@ -115,7 +125,7 @@ public:
   /**
    * @copydoc Dali::WebEngine::EvaluateJavaScript()
    */
-  void EvaluateJavaScript( const std::string& script );
+  void EvaluateJavaScript( const std::string& script, std::function< void(const std::string&) > resultHandler );
 
   /**
    * @copydoc Dali::WebEngine::AddJavaScriptMessageHandler()
@@ -133,6 +143,81 @@ public:
   void ClearCache();
 
   /**
+   * @copydoc Dali::WebEngine::ClearCookies()
+   */
+  void ClearCookies();
+
+  /**
+   * @copydoc Dali::WebEngine::GetCacheModel()
+   */
+  Dali::WebEnginePlugin::CacheModel GetCacheModel() const;
+
+  /**
+   * @copydoc Dali::WebEngine::SetCacheModel()
+   */
+  void SetCacheModel( Dali::WebEnginePlugin::CacheModel cacheModel );
+
+  /**
+   * @copydoc Dali::WebEngine::GetCookieAcceptPolicy()
+   */
+  Dali::WebEnginePlugin::CookieAcceptPolicy GetCookieAcceptPolicy() const;
+
+  /**
+   * @copydoc Dali::WebEngine::SetCookieAcceptPolicy()
+   */
+  void SetCookieAcceptPolicy( Dali::WebEnginePlugin::CookieAcceptPolicy policy );
+
+  /**
+   * @copydoc Dali::WebEngine::GetUserAgent()
+   */
+  const std::string& GetUserAgent() const;
+
+  /**
+   * @copydoc Dali::WebEngine::SetUserAgent()
+   */
+  void SetUserAgent( const std::string& userAgent );
+
+  /**
+   * @copydoc Dali::WebEngine::IsJavaScriptEnabled()
+   */
+  bool IsJavaScriptEnabled() const;
+
+  /**
+   * @copydoc Dali::WebEngine::EnableJavaScript()
+   */
+  void EnableJavaScript( bool enabled );
+
+  /**
+   * @copydoc Dali::WebEngine::AreImagesAutomaticallyLoaded()
+   */
+  bool AreImagesAutomaticallyLoaded() const;
+
+  /**
+   * @copydoc Dali::WebEngine::LoadImagesAutomatically()
+   */
+  void LoadImagesAutomatically( bool automatic );
+
+  /**
+   * @copydoc Dali::WebEngine::GetDefaultTextEncodingName()
+   */
+  const std::string& GetDefaultTextEncodingName() const;
+
+  /**
+   * @copydoc Dali::WebEngine::SetDefaultTextEncodingName()
+   */
+  void SetDefaultTextEncodingName( const std::string& defaultTextEncodingName );
+
+  /**
+   * @copydoc Dali::WebEngine::GetDefaultFontSize()
+   */
+  int GetDefaultFontSize() const;
+
+  /**
+   * @copydoc Dali::WebEngine::SetDefaultFontSize()
+   */
+  void SetDefaultFontSize( int defaultFontSize );
+
+  /**
    * @copydoc Dali::WebEngine::SetSize()
    */
   void SetSize( int width, int height );
@@ -150,12 +235,17 @@ public:
   /**
    * @copydoc Dali::WebEngine::PageLoadStartedSignal()
    */
-  Dali::WebEnginePlugin::WebEngineSignalType& PageLoadStartedSignal();
+  Dali::WebEnginePlugin::WebEnginePageLoadSignalType& PageLoadStartedSignal();
 
   /**
    * @copydoc Dali::WebEngine::PageLoadFinishedSignal()
    */
-  Dali::WebEnginePlugin::WebEngineSignalType& PageLoadFinishedSignal();
+  Dali::WebEnginePlugin::WebEnginePageLoadSignalType& PageLoadFinishedSignal();
+
+  /**
+   * @copydoc Dali::WebEngine::PageLoadErrorSignal()
+   */
+  Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType& PageLoadErrorSignal();
 
 private:
 
@@ -191,14 +281,13 @@ private:
 
 private:
 
-  Dali::WebEnginePlugin* mPlugin; ///< WebEnginePlugin instance
-  void* mHandle; ///< Handle for the loaded library
-
   typedef Dali::WebEnginePlugin* (*CreateWebEngineFunction)();
   typedef void (*DestroyWebEngineFunction)( Dali::WebEnginePlugin* plugin );
 
-  CreateWebEngineFunction mCreateWebEnginePtr;
-  DestroyWebEngineFunction mDestroyWebEnginePtr;
+  Dali::WebEnginePlugin*                                  mPlugin; ///< WebEnginePlugin instance
+  void*                                                   mHandle; ///< Handle for the loaded library
+  CreateWebEngineFunction                                 mCreateWebEnginePtr;  ///< Function to create plugin instance
+  DestroyWebEngineFunction                                mDestroyWebEnginePtr; ///< Function to destroy plugin instance
 };
 
 } // namespace Adaptor