[Tizen](ATSPI) Add getState(), say(), say_callback(), pauseResume() 99/210899/3 submit/tizen/20190917.102651 submit/tizen/20190917.223923
authordongsug.song <dongsug.song@samsung.com>
Fri, 26 Jul 2019 00:16:47 +0000 (09:16 +0900)
committerdongsug.song <dongsug.song@samsung.com>
Tue, 17 Sep 2019 09:11:58 +0000 (18:11 +0900)
Change-Id: If8eed01d23b35f48bb6538c89913f465e746a237
Signed-off-by: dongsug.song <dongsug.song@samsung.com>
dali-csharp-binder/file.list
dali-csharp-binder/src/atspi.cpp [new file with mode: 0755]

index 5714fb7..5494d0e 100755 (executable)
@@ -37,7 +37,8 @@ dali_csharp_binder_tizen_src_files = \
   ${dali_csharp_binder_dir}/src/widget_view_manager.cpp \
   ${dali_csharp_binder_dir}/src/font-client.cpp \
   ${dali_csharp_binder_dir}/src/transition-effects.cpp \
-  ${dali_csharp_binder_dir}/src/actor-devel.cpp
+  ${dali_csharp_binder_dir}/src/actor-devel.cpp \
+  ${dali_csharp_binder_dir}/src/atspi.cpp
 
 # module: csharp-binder, backend: tizen-wearable
 dali_csharp_binder_tizen_wearable_src_files = \
diff --git a/dali-csharp-binder/src/atspi.cpp b/dali-csharp-binder/src/atspi.cpp
new file mode 100755 (executable)
index 0000000..e1eb973
--- /dev/null
@@ -0,0 +1,109 @@
+/** 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.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+#ifndef CSHARP_ATSPI
+#define CSHARP_ATSPI
+#endif
+
+#include "common.h"
+#include <dali/devel-api/adaptor-framework/accessibility.h>
+#include <dali/integration-api/debug.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+SWIGEXPORT bool SWIGSTDCALL csharp_dali_accessibility_get_status(void *jarg1) {
+  Dali::Toolkit::Control *arg1 = 0 ;
+  arg1 = (Dali::Toolkit::Control *)jarg1;
+  if (!arg1) {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Toolkit::Control is null", 0);
+    return false;
+  }
+
+  //temporal fix
+  return false;
+
+  // auto states = arg1->AccessibilityGetStates();
+  // auto ret = states[ Dali::Accessibility::State::ACTIVE ];
+  // DALI_LOG_ERROR("csharp_dali_accessibility_get_status() states=%d ", states[ Dali::Accessibility::State::ACTIVE ]);
+
+  // if(ret) {
+  //   return true;
+  // }
+  // else {
+  //   return false;
+  // }
+}
+
+
+using callbackFuncType = void(*)(int);
+callbackFuncType callBack;
+void sayTestCallback(std::string result) {
+       DALI_LOG_ERROR("sayTestCallback() result=%s ", result.c_str());
+  if(callBack) {
+    if(result == "ReadingCancelled") {
+      callBack(1);
+    }
+    else if(result == "ReadingStopped"){
+      callBack(2);
+    }
+    else if(result == "ReadingSkipped"){
+      callBack(3);
+    }
+    else {
+      callBack(-1);
+    }
+  }
+}
+
+SWIGEXPORT void SWIGSTDCALL csharp_dali_accessibility_say(void *jarg1, char* jarg2, bool jarg3, void *jarg4) {
+  Dali::Toolkit::Control *arg1 = 0 ;
+  arg1 = (Dali::Toolkit::Control *)jarg1;
+  std::string arg2(jarg2);
+  bool arg3 = jarg3;
+  callBack = (callbackFuncType)jarg4;
+
+  if (!arg1) {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Toolkit::Control is null", 0);
+    return;
+  }
+
+  Dali::Accessibility::Say(arg2, jarg3, sayTestCallback);
+  //Dali::Accessibility::Say(arg2, arg3, arg4);
+
+  DALI_LOG_ERROR("csharp_dali_accessibility_say() arg3=%d", arg3);
+}
+
+SWIGEXPORT void SWIGSTDCALL csharp_dali_accessibility_pause_resume(void *jarg1, bool jarg2) {
+  Dali::Toolkit::Control *arg1 = 0 ;
+  arg1 = (Dali::Toolkit::Control *)jarg1;
+  bool arg2 = jarg2;
+
+  if (!arg1) {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Toolkit::Control is null", 0);
+    return;
+  }
+
+  Dali::Accessibility::PauseResume(arg2);
+
+  DALI_LOG_ERROR("csharp_dali_accessibility_pause_resume() arg2=%d", arg2);
+}
+
+
+#ifdef __cplusplus
+}
+#endif
\ No newline at end of file