DALi Version 1.2.31
[platform/core/uifw/dali-adaptor.git] / adaptors / x11 / imf-manager-impl-x.cpp
index 57ffb35..3a2f913 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
@@ -27,6 +27,7 @@
 #include <adaptor.h>
 #include <window-render-surface.h>
 #include <adaptor-impl.h>
+#include <locale-utils.h>
 #include <singleton-service-impl.h>
 #include <virtual-keyboard-impl.h>
 #include "ecore-virtual-keyboard.h"
@@ -215,12 +216,12 @@ void ImfManager::CreateContext( Ecore_X_Window ecoreXwin )
     }
     else
     {
-      DALI_LOG_WARNING("IMF Unable to get IMF Context\n");
+      DALI_LOG_INFO( gLogFilter, Debug::General, "IMF Unable to get IMF Context\n");
     }
   }
   else
   {
-    DALI_LOG_WARNING("IMF Unable to get IMF Context\n");
+    DALI_LOG_INFO( gLogFilter, Debug::General, "IMF Unable to get IMF Context\n");
   }
 }
 
@@ -516,6 +517,75 @@ const std::string& ImfManager::GetSurroundingText() const
   return mSurroundingText;
 }
 
+void ImfManager::NotifyTextInputMultiLine( bool multiLine )
+{
+}
+
+Dali::ImfManager::TextDirection ImfManager::GetTextDirection()
+{
+  Dali::ImfManager::TextDirection direction ( Dali::ImfManager::LeftToRight );
+
+  if ( ImfManager::IsAvailable() /* We do not want to create an instance of ImfManager */ )
+  {
+    if ( mIMFContext )
+    {
+      char* locale( NULL );
+      ecore_imf_context_input_panel_language_locale_get( mIMFContext, &locale );
+
+      if ( locale )
+      {
+        direction = Locale::GetTextDirection( std::string( locale ) );
+        free( locale );
+      }
+    }
+  }
+  return direction;
+}
+
+Rect<int> ImfManager::GetInputMethodArea()
+{
+  int xPos, yPos, width, height;
+
+  width = height = xPos = yPos = 0;
+
+  if( mIMFContext )
+  {
+    ecore_imf_context_input_panel_geometry_get( mIMFContext, &xPos, &yPos, &width, &height );
+  }
+  else
+  {
+    DALI_LOG_WARNING("VKB Unable to get IMF Context so GetSize unavailable\n");
+  }
+
+  return Rect<int>(xPos,yPos,width,height);
+}
+
+void ImfManager::ApplyOptions( const InputMethodOptions& options )
+{
+  using namespace Dali::InputMethod::Category;
+
+  int index;
+
+  if (mIMFContext == NULL)
+  {
+    DALI_LOG_WARNING("VKB Unable to excute ApplyOptions with Null ImfContext\n");
+    return;
+  }
+
+  if ( mOptions.CompareAndSet(PANEL_LAYOUT, options, index) )
+  {
+  }
+  if ( mOptions.CompareAndSet(AUTO_CAPITALISE, options, index) )
+  {
+  }
+  if ( mOptions.CompareAndSet(ACTION_BUTTON_TITLE, options, index) )
+  {
+  }
+  if ( mOptions.CompareAndSet(VARIATION, options, index) )
+  {
+  }
+}
+
 } // Adaptor
 
 } // Internal