summaryrefslogtreecommitdiff
path: root/daemon/accessibility.c
diff options
context:
space:
mode:
authorhoejoo lee <hoejoo.lee@samsung.com>2015-06-11 14:48:48 +0900
committerhoejoo lee <hoejoo.lee@samsung.com>2015-06-12 16:29:32 +0900
commitf0f2a70519e109c7999adc84036d98dc13269d7e (patch)
tree03c73e5e1b80310277af5dab7c6f5dc7a84e43d7 /daemon/accessibility.c
parent783b89c3d7b9270781c2bd3e1196c1f49d0e3809 (diff)
downloadquickpanel-f0f2a70519e109c7999adc84036d98dc13269d7e.tar.gz
quickpanel-f0f2a70519e109c7999adc84036d98dc13269d7e.tar.bz2
quickpanel-f0f2a70519e109c7999adc84036d98dc13269d7e.zip
Change-Id: I2408a20ba7ce2de87ec104341cdb6cb2923017e8
Diffstat (limited to 'daemon/accessibility.c')
-rw-r--r--daemon/accessibility.c114
1 files changed, 114 insertions, 0 deletions
diff --git a/daemon/accessibility.c b/daemon/accessibility.c
new file mode 100644
index 0000000..a85bebb
--- /dev/null
+++ b/daemon/accessibility.c
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2009-2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ *
+ */
+
+
+#include <stdio.h>
+#include "common.h"
+#include "quickpanel-ui.h"
+#include "accessibility.h"
+
+HAPI Evas_Object *
+quickpanel_accessibility_screen_reader_object_get(void *obj, screen_reader_object_type_e type, const char *part, Evas_Object *parent)
+{
+ Evas_Object *to = NULL;
+ Evas_Object *ao = NULL;
+
+ retif(obj == NULL, NULL, "invalid parameter");
+ retif(type == SCREEN_READER_OBJ_TYPE_EDJ_OBJECT && !part, NULL, "invalid parameter");
+
+ switch (type) {
+ case SCREEN_READER_OBJ_TYPE_ELM_OBJECT:
+ if (part != NULL) {
+ to = (Evas_Object *)elm_object_part_content_get(obj, part);
+ ao = (Evas_Object *)to;
+ } else {
+ ao = (Evas_Object *)obj;
+ }
+ break;
+
+ case SCREEN_READER_OBJ_TYPE_EDJ_OBJECT:
+ to = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get((Evas_Object *)obj), part);
+ break;
+
+ default:// evas, icon
+ to = (Evas_Object *)obj;
+ }
+
+ if (!ao && to && parent) { // edj, evas, icon, elm_object_item
+ ao = elm_access_object_get(to);
+ if (ao == NULL) {
+ ao = elm_access_object_register(to, parent);
+ }
+ }
+
+ return ao;
+}
+
+HAPI Evas_Object *quickpanel_accessibility_ui_get_focus_object(Evas_Object *parent)
+{
+ Evas_Object *focus = elm_button_add(parent);
+ retif(focus == NULL, NULL, "failed to create focus object");
+
+ elm_object_style_set(focus, "focus");
+
+ elm_access_info_set(focus, ELM_ACCESS_INFO, "");
+ elm_access_info_set(focus, ELM_ACCESS_TYPE, "");
+
+ return focus;
+}
+
+HAPI char *quickpanel_accessibility_info_cb(void *data, Evas_Object *obj)
+{
+ char *str = NULL;
+ retif(data == NULL, NULL, "invalid parameter");
+
+ str = _((const char *)data);
+ if (str != NULL) {
+ return strdup(str);
+ }
+
+ return NULL;
+}
+
+HAPI char *quickpanel_accessibility_info_cb_s(void *data, Evas_Object *obj)
+{
+ char *str = NULL;
+ retif(data == NULL, NULL, "invalid parameter");
+
+ // system string is not supported. data should be DID from application po files.
+ str = _(data);
+ if (str != NULL) {
+ return strdup(str);
+ }
+
+ return NULL;
+}
+
+HAPI void
+quickpanel_accessibility_screen_reader_data_set(Evas_Object *view, const char *part, char *type, char *info)
+{
+ Evas_Object *ao = NULL;
+ retif(view == NULL, , "invalid parameter");
+ retif(part == NULL, , "invalid parameter");
+
+ ao = quickpanel_accessibility_screen_reader_object_get(view,
+ SCREEN_READER_OBJ_TYPE_ELM_OBJECT, part, view);
+ if (ao != NULL) {
+ elm_access_info_set(ao, ELM_ACCESS_TYPE, type);
+ elm_access_info_set(ao, ELM_ACCESS_INFO, info);
+ }
+}