summaryrefslogtreecommitdiff
path: root/lib-apps-common
diff options
context:
space:
mode:
authorEugene Kurzberg <i.kurtsberg@samsung.com>2017-02-27 13:42:23 +0200
committerAleksandr Sapozhnik <a.sapozhnik@samsung.com>2017-02-28 02:55:23 -0800
commit0e72a934e4787deed1cb67d2131bbebd5d652b38 (patch)
tree792a910f7f213c25f766a294e3172a8d3897e147 /lib-apps-common
parent53581f77a365f318d057077c914ea9732677a701 (diff)
downloadalarm-0e72a934e4787deed1cb67d2131bbebd5d652b38.tar.gz
alarm-0e72a934e4787deed1cb67d2131bbebd5d652b38.tar.bz2
alarm-0e72a934e4787deed1cb67d2131bbebd5d652b38.zip
TizenRefApp-8077 Implement screen reader functionality in the Input View
Change-Id: I55d17161458a2a893e2a6055517ad0d01ba72e68 Signed-off-by: Eugene Kurzberg <i.kurtsberg@samsung.com>
Diffstat (limited to 'lib-apps-common')
-rw-r--r--lib-apps-common/inc/Ui/Accessilibity.h43
-rw-r--r--lib-apps-common/src/Ui/Accessibility.cpp39
2 files changed, 82 insertions, 0 deletions
diff --git a/lib-apps-common/inc/Ui/Accessilibity.h b/lib-apps-common/inc/Ui/Accessilibity.h
new file mode 100644
index 0000000..8714c8b
--- /dev/null
+++ b/lib-apps-common/inc/Ui/Accessilibity.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 UI_ACCESSILIBITY_H
+#define UI_ACCESSILIBITY_H
+
+#include <Elementary.h>
+#include <tizen.h>
+
+namespace Ui
+{
+ /**
+ * @brief Create accessible object for layout part.
+ * @param[in] layout Layout containing the part
+ * @param[in] part Part to create accessible object for
+ * @return Accessible object.
+ */
+ EXPORT_API Evas_Object *createPartAccessObject(Evas_Object *layout, const char *part);
+
+ /**
+ * @brief Create accessible object for text part using text as its name.
+ * @param[in] layout Layout containing the part
+ * @param[in] part Text part to create accessible object for
+ * @param[in] domain Text domain to translate part text
+ * @return Accessible object.
+ */
+ EXPORT_API Evas_Object *createTextAccessObject(Evas_Object *layout, const char *part, const char *domain);
+}
+
+#endif /* UI_ACCESSILIBITY_H */
diff --git a/lib-apps-common/src/Ui/Accessibility.cpp b/lib-apps-common/src/Ui/Accessibility.cpp
new file mode 100644
index 0000000..a2891dd
--- /dev/null
+++ b/lib-apps-common/src/Ui/Accessibility.cpp
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 "Ui/Accessilibity.h"
+
+Evas_Object *Ui::createPartAccessObject(Evas_Object *layout, const char *part)
+{
+ Evas_Object *edje = elm_layout_edje_get(layout);
+ Evas_Object *obj = (Evas_Object *) edje_object_part_object_get(edje, part);
+ return elm_access_object_register(obj, layout);
+}
+
+Evas_Object *Ui::createTextAccessObject(Evas_Object *layout, const char *part, const char *domain)
+{
+ Evas_Object *obj = createPartAccessObject(layout, part);
+ const char *text = nullptr;
+ if (domain) {
+ elm_atspi_accessible_translation_domain_set(obj, domain);
+ text = elm_object_translatable_part_text_get(layout, part);
+ } else {
+ text = elm_object_part_text_get(layout, part);
+ }
+ elm_atspi_accessible_name_set(obj, text);
+ elm_atspi_accessible_reading_info_type_set(obj, ELM_ACCESSIBLE_READING_INFO_TYPE_NAME);
+ return obj;
+}