class DALI_ADAPTOR_API Component;
class DALI_ADAPTOR_API Collection;
class DALI_ADAPTOR_API Action;
+class DALI_ADAPTOR_API Application;
/**
* @brief Base class for different accessibility bridges.
};
/**
+ * @brief An interface identifying the root object
+ * associated with a running application.
+ *
+ * @note Provides global properties describing
+ * application's runtime environment.
+ */
+class Application : public virtual Accessible
+{
+public:
+ /**
+ * @brief Gets name of graphic user interface framework used by an application.
+ *
+ * @return String with name
+ */
+ virtual std::string GetToolkitName() = 0;
+
+ /**
+ * @brief Gets version of graphic user interface framework used by an application.
+ *
+ * @return String with version
+ */
+ virtual std::string GetVersion() = 0;
+};
+
+/**
* @brief Interface enabling advanced quering of accessibility objects.
*
* @note since all mathods can be implemented inside bridge,
--- /dev/null
+/*
+ * Copyright (c) 2021 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.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <string>
+
+// INTERNAL INCLUDES
+#include <dali/internal/accessibility/bridge/bridge-application.h>
+
+using namespace Dali::Accessibility;
+
+void BridgeApplication::RegisterInterfaces()
+{
+ DBus::DBusInterfaceDescription desc{AtspiDbusInterfaceApplication};
+ AddGetPropertyToInterface(desc, "ToolkitName", &BridgeApplication::GetToolkitName);
+ AddGetPropertyToInterface(desc, "Version", &BridgeApplication::GetVersion);
+ dbusServer.addInterface("/", desc, true);
+}
+
+Application* BridgeApplication::FindSelf() const
+{
+ auto self = BridgeBase::FindSelf();
+ assert(self);
+ auto appInterface = dynamic_cast<Application*>(self);
+ if(!appInterface)
+ {
+ throw std::domain_error{"object " + self->GetAddress().ToString() + " doesn't have Application interface"};
+ }
+ return appInterface;
+}
+
+std::string BridgeApplication::GetToolkitName()
+{
+ return FindSelf()->GetToolkitName();
+}
+
+std::string BridgeApplication::GetVersion()
+{
+ return FindSelf()->GetVersion();
+}
--- /dev/null
+#ifndef DALI_INTERNAL_ACCESSIBILITY_BRIDGE_APPLICATION_H
+#define DALI_INTERNAL_ACCESSIBILITY_BRIDGE_APPLICATION_H
+
+/*
+ * Copyright (c) 2021 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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/accessibility/bridge/bridge-base.h>
+
+/*
+ * Implementation of org.a11y.atspi.Application interface
+ */
+
+class BridgeApplication : public virtual BridgeBase
+{
+protected:
+ BridgeApplication() = default;
+
+ void RegisterInterfaces();
+
+ Dali::Accessibility::Application* FindSelf() const;
+
+public:
+ /**
+ * @brief Gets name of graphic user interface framework used by an application.
+ *
+ * @return String with name
+ */
+ std::string GetToolkitName();
+
+ /**
+ * @brief Gets version of graphic user interface framework used by an application.
+ *
+ * @return String with version
+ */
+ std::string GetVersion();
+};
+
+#endif // DALI_INTERNAL_ACCESSIBILITY_BRIDGE_APPLICATION_H
*/
// EXTERNAL INCLUDES
+#include <dali/public-api/dali-adaptor-version.h>
#include <dali/public-api/signals/connection-tracker.h>
#include <memory>
// INTERNAL INCLUDES
#include <dali/internal/accessibility/bridge/accessibility-common.h>
-class AppAccessible : public virtual Dali::Accessibility::Accessible, public virtual Dali::Accessibility::Collection
+class AppAccessible : public virtual Dali::Accessibility::Accessible, public virtual Dali::Accessibility::Collection, public virtual Dali::Accessibility::Application
{
public:
Dali::Accessibility::EmptyAccessibleWithAddress parent;
{
return {"", "root"};
}
+
+ std::string GetToolkitName() override
+ {
+ return {"dali"};
+ }
+
+ std::string GetVersion() override
+ {
+ return std::to_string(Dali::ADAPTOR_MAJOR_VERSION) + "." + std::to_string(Dali::ADAPTOR_MINOR_VERSION);
+ }
};
enum class FilteredEvents
#include <dali/internal/accessibility/bridge/bridge-selection.h>
#include <dali/internal/accessibility/bridge/bridge-text.h>
#include <dali/internal/accessibility/bridge/bridge-value.h>
+#include <dali/internal/accessibility/bridge/bridge-application.h>
#include <dali/internal/accessibility/bridge/dummy-atspi.h>
#include <dali/internal/adaptor/common/adaptor-impl.h>
#include <dali/internal/system/common/environment-variables.h>
public BridgeValue,
public BridgeText,
public BridgeEditableText,
- public BridgeSelection
+ public BridgeSelection,
+ public BridgeApplication
{
DBus::DBusClient listenOnAtspiEnabledSignalClient;
DBus::DBusClient registryClient, directReadingClient;
BridgeText::RegisterInterfaces();
BridgeEditableText::RegisterInterfaces();
BridgeSelection::RegisterInterfaces();
+ BridgeApplication::RegisterInterfaces();
RegisterOnBridge(&application);
${adaptor_accessibility_dir}/bridge/accessible.cpp
${adaptor_accessibility_dir}/bridge/bridge-accessible.cpp
${adaptor_accessibility_dir}/bridge/bridge-action.cpp
+ ${adaptor_accessibility_dir}/bridge/bridge-application.cpp
${adaptor_accessibility_dir}/bridge/bridge-base.cpp
${adaptor_accessibility_dir}/bridge/bridge-collection.cpp
${adaptor_accessibility_dir}/bridge/bridge-component.cpp