Add ImfManager KeyboardResizedSignalType and LanguageChangedSignalType
[platform/core/uifw/dali-adaptor.git] / adaptors / ecore / common / ecore-virtual-keyboard.cpp
index ffb603b..ca137c1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 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.
@@ -24,6 +24,9 @@
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
+// Ecore is littered with C style cast
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wold-style-cast"
 #include "ecore-virtual-keyboard.h"
 #include <adaptor.h>
 #include <locale-utils.h>
@@ -133,6 +136,8 @@ void DisconnectCallbacks( Ecore_IMF_Context *imfContext )
 
 void Show()
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: Show() is deprecated and will be removed from next release. Use ImfManager.Activate() instead.\n" );
+
   Dali::ImfManager imfManager = ImfManager::Get(); // Create ImfManager instance (if required) to show the keyboard
 
   if( imfManager )
@@ -148,6 +153,8 @@ void Show()
 
 void Hide()
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: Hide() is deprecated and will be removed from next release. Use ImfManager.Deactivate() instead.\n" );
+
   if( ImfManager::IsAvailable() /* We do not want to create an ImfManager instance*/ )
   {
     Dali::ImfManager imfManager = ImfManager::Get();
@@ -162,6 +169,8 @@ void Hide()
 
 bool IsVisible()
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: IsVisible() is deprecated and will be removed from next release.\n" );
+
   if( ImfManager::IsAvailable() /* We do not want to create an ImfManager instance */ )
   {
     DALI_LOG_INFO( gLogFilter, Debug::General, "IMF IsVisible\n" );
@@ -250,6 +259,8 @@ Rect<int> GetSizeAndPosition()
 {
   int xPos, yPos, width, height;
 
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetSizeAndPosition() is deprecated and will be removed from next release. Use ImfManager.GetInputMethodArea() instead.\n" );
+
   width = height = xPos = yPos = 0;
   Dali::ImfManager imfManager = ImfManager::Get(); // Create ImfManager instance (if required) as we may need to do some size related setup in the application
 
@@ -273,17 +284,26 @@ Rect<int> GetSizeAndPosition()
 
 Dali::VirtualKeyboard::StatusSignalType& StatusChangedSignal()
 {
-  return gKeyboardStatusSignal;
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: StatusChangedSignal() is deprecated and will be removed from next release. Use ImfManager.StatusChangedSignal() instead.\n" );
+
+  Dali::ImfManager imfManager = ImfManager::Get();
+  return imfManager.StatusChangedSignal();
 }
 
-Dali::VirtualKeyboard::VoidSignalType& ResizedSignal()
+Dali::VirtualKeyboard::KeyboardResizedSignalType& ResizedSignal()
 {
-  return gKeyboardResizeSignal;
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: ResizedSignal() is deprecated and will be removed from next release. Use ImfManager.ResizedSignal() instead.\n" );
+
+  Dali::ImfManager imfManager = ImfManager::Get();
+  return imfManager.ResizedSignal();
 }
 
-Dali::VirtualKeyboard::VoidSignalType& LanguageChangedSignal()
+Dali::VirtualKeyboard::LanguageChangedSignalType& LanguageChangedSignal()
 {
-  return gKeyboardLanguageChangedSignal;
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: LanguageChangedSignal() is deprecated and will be removed from next release. Use ImfManager.LanguageChangedSignal() instead.\n" );
+
+  Dali::ImfManager imfManager = ImfManager::Get();
+  return imfManager.LanguageChangedSignal();
 }
 
 Dali::VirtualKeyboard::TextDirection GetTextDirection()
@@ -305,7 +325,7 @@ Dali::VirtualKeyboard::TextDirection GetTextDirection()
 
         if ( locale )
         {
-          direction = Locale::GetTextDirection( std::string( locale ) );
+          direction = static_cast< Dali::VirtualKeyboard::TextDirection >( Locale::GetDirection( std::string( locale ) ) );
           free( locale );
         }
       }
@@ -321,3 +341,5 @@ Dali::VirtualKeyboard::TextDirection GetTextDirection()
 } // namespace Internal
 
 } // namespace Dali
+
+#pragma GCC diagnostic pop