--- /dev/null
+/*
+ * 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.
+ *
+ */
+
+#ifndef AtspiAccessibleInterface_h_
+#define AtspiAccessibleInterface_h_
+
+#include "LangUtils.h"
+#include "Config.h"
+#include <Elementary.h>
+
+namespace Msg
+{
+ /**
+ * @brief Wrapper for Elm_Interface_Atspi_Accessible interface (Screen reader)
+ */
+ class AtspiAccessibleInterface
+ {
+ public:
+ AtspiAccessibleInterface(Elm_Interface_Atspi_Accessible *obj);
+ void wrap(Elm_Interface_Atspi_Accessible *obj);
+ Elm_Interface_Atspi_Accessible *getEo() const;
+ operator Elm_Interface_Atspi_Accessible *() const;
+
+ void setDescription(const char *text);
+ void setDescription(const std::string &text);
+ void setName(const char *text);
+ void setName(const std::string &text);
+ void setRole(Elm_Atspi_Role role);
+ void setReadingInfo(Elm_Accessible_Reading_Info_Type type);
+ void appendRelationship(Elm_Atspi_Relation_Type type, const Elm_Interface_Atspi_Accessible *obj);
+ void removeRelationship(Elm_Atspi_Relation_Type type, const Elm_Interface_Atspi_Accessible *obj);
+ void canHighlight(bool canHighlight);
+
+ // TODO: impl. other methods if needed
+
+ private:
+ Elm_Interface_Atspi_Accessible *m_pEo;
+ };
+
+ inline AtspiAccessibleInterface::AtspiAccessibleInterface(Elm_Interface_Atspi_Accessible *obj)
+ : m_pEo(obj)
+ {
+ }
+
+ inline void AtspiAccessibleInterface::wrap(Elm_Interface_Atspi_Accessible *obj)
+ {
+ m_pEo = obj;
+ }
+
+ inline Elm_Interface_Atspi_Accessible *AtspiAccessibleInterface::getEo() const
+ {
+ return m_pEo;
+ }
+
+ inline AtspiAccessibleInterface::operator Elm_Interface_Atspi_Accessible *() const
+ {
+ return getEo();
+ }
+
+ inline void AtspiAccessibleInterface::setDescription(const char *text)
+ {
+ elm_atspi_accessible_description_set(m_pEo, text);
+ elm_atspi_accessible_translation_domain_set(m_pEo, PACKAGE_NAME);
+ }
+
+ inline void AtspiAccessibleInterface::setDescription(const std::string &text)
+ {
+ setDescription(text.c_str());
+ }
+
+ inline void AtspiAccessibleInterface::setName(const char *text)
+ {
+ elm_atspi_accessible_name_set(m_pEo, (char*)text);
+ }
+
+ inline void AtspiAccessibleInterface::setName(const std::string &text)
+ {
+ setName(text.c_str());
+ }
+
+ inline void AtspiAccessibleInterface::setRole(Elm_Atspi_Role role)
+ {
+ elm_atspi_accessible_role_set(m_pEo, role);
+ }
+
+ inline void AtspiAccessibleInterface::setReadingInfo(Elm_Accessible_Reading_Info_Type type)
+ {
+ elm_atspi_accessible_reading_info_type_set(m_pEo, type);
+ }
+
+ inline void AtspiAccessibleInterface::appendRelationship(Elm_Atspi_Relation_Type type, const Elm_Interface_Atspi_Accessible *obj)
+ {
+ elm_atspi_accessible_relationship_append(m_pEo, type, obj);
+ }
+
+ inline void AtspiAccessibleInterface::removeRelationship(Elm_Atspi_Relation_Type type, const Elm_Interface_Atspi_Accessible *obj)
+ {
+ elm_atspi_accessible_relationship_remove(m_pEo, type, obj);
+ }
+
+ inline void AtspiAccessibleInterface::canHighlight(bool canHighlight)
+ {
+ elm_atspi_accessible_can_highlight_set(m_pEo, canHighlight);
+ }
+}
+
+#endif /* AtspiAccessibleInterface_h_ */
#include "BaseView.h"
#include "LangUtils.h"
#include "CallbackAssist.h"
+#include "AtspiAccessibleInterface.h"
#include <Evas.h>
#include <Elementary.h>
*/
Evas_Object *getEdje() const;
+ /**
+ * @brief Gets AtspiAccessibleInterface wrapper
+ * @return wrapper to AtspiAccessibleInterface
+ */
+ AtspiAccessibleInterface getAtspi() const;
+
static void setText(Evas_Object *obj, const TText &text, const char *part = nullptr);
static Evas_Object *addLayout(Evas_Object *parent, const std::string &edjePath, const std::string &group);
{
setMirrored(getEo(), mirrored);
}
+
+ inline AtspiAccessibleInterface View::getAtspi() const
+ {
+ return AtspiAccessibleInterface(m_pEo);
+ }
}
#endif /* View_h_ */