virtual void EmitMovedOutOfScreen(Accessible* obj, ScreenRelativeMoveType type) = 0;
/**
+ * @brief Emits "org.a11y.atspi.Socket.Available" event on AT-SPI bus.
+ *
+ * @param obj Accessible object
+ */
+ virtual void EmitSocketAvailable(Accessible* obj) = 0;
+
+ /**
* @brief Emits state-changed event on at-spi bus.
*
* @param[in] obj The accessible object
#include <dali/devel-api/atspi-interfaces/hyperlink.h>
#include <dali/devel-api/atspi-interfaces/hypertext.h>
#include <dali/devel-api/atspi-interfaces/selection.h>
+#include <dali/devel-api/atspi-interfaces/socket.h>
#include <dali/devel-api/atspi-interfaces/text.h>
#include <dali/devel-api/atspi-interfaces/value.h>
#include <dali/internal/adaptor/common/adaptor-impl.h>
interfaces[AtspiInterface::HYPERLINK] = dynamic_cast<const Hyperlink*>(this);
interfaces[AtspiInterface::HYPERTEXT] = dynamic_cast<const Hypertext*>(this);
interfaces[AtspiInterface::SELECTION] = dynamic_cast<const Selection*>(this);
+ interfaces[AtspiInterface::SOCKET] = dynamic_cast<const Socket*>(this);
interfaces[AtspiInterface::TEXT] = dynamic_cast<const Text*>(this);
interfaces[AtspiInterface::VALUE] = dynamic_cast<const Value*>(this);
void EmitMovedOutOfScreen(ScreenRelativeMoveType type);
/**
+ * @brief Emits "org.a11y.atspi.Socket.Available" signal.
+ */
+ // This belongs to Dali::Accessibility::Socket. However, all Emit*() helpers
+ // are here in Accessible, regardless of what interface they belong to (perhaps
+ // to spare a dynamic_cast if used like this: Accessible::Get()->Emit*(...)).
+ void EmitSocketAvailable();
+
+ /**
* @brief Emits "highlighted" event.
*
* @param[in] event The enumerated window event
virtual std::vector<Relation> GetRelationSet() = 0;
/**
- * @brief Gets internal Actor to be saved before.
+ * @brief Gets the Actor associated with this Accessible (if there is one).
*
* @return The internal Actor
*/
--- /dev/null
+#ifndef DALI_ADAPTOR_ATSPI_SOCKET_H
+#define DALI_ADAPTOR_ATSPI_SOCKET_H
+
+/*
+ * Copyright (c) 2022 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/devel-api/atspi-interfaces/accessible.h>
+
+namespace Dali::Accessibility
+{
+/**
+ * @brief A Socket is the root of the AT-SPI tree that can be embedded as a subtree
+ * in the tree belonging to another process (the Plug). The Plug initiates the Plug-Socket
+ * connection by calling Embed() and terminates it by calling Unembed().
+ *
+ * See AT_SPI2_CORE/xml/Socket.xml for a description of this interface in XML format.
+ */
+class DALI_ADAPTOR_API Socket : public virtual Accessible
+{
+public:
+ /**
+ * @brief Establishes the Plug-Socket connection.
+ *
+ * @param plug Address of the Plug (remote parent)
+ * @return Address of the Socket
+ */
+ virtual Address Embed(Address plug) = 0;
+
+ /**
+ * @brief Terminates the Plug-Socket connection.
+ *
+ * @param plug Address of the Plug (remote parent)
+ */
+ virtual void Unembed(Address plug) = 0;
+
+ /**
+ * @brief Downcasts an Accessible to a Socket.
+ *
+ * @param obj The Accessible
+ * @return A Socket or null
+ *
+ * @see Dali::Accessibility::Accessible::DownCast()
+ */
+ static inline Socket* DownCast(Accessible* obj);
+};
+
+namespace Internal
+{
+template<>
+struct AtspiInterfaceTypeHelper<AtspiInterface::SOCKET>
+{
+ using Type = Socket;
+};
+} // namespace Internal
+
+inline Socket* Socket::DownCast(Accessible* obj)
+{
+ return Accessible::DownCast<AtspiInterface::SOCKET>(obj);
+}
+
+} // namespace Dali::Accessibility
+
+#endif // DALI_ADAPTOR_ATSPI_SOCKET_H
${adaptor_devel_api_dir}/atspi-interfaces/hyperlink.h
${adaptor_devel_api_dir}/atspi-interfaces/hypertext.h
${adaptor_devel_api_dir}/atspi-interfaces/selection.h
+ ${adaptor_devel_api_dir}/atspi-interfaces/socket.h
${adaptor_devel_api_dir}/atspi-interfaces/text.h
${adaptor_devel_api_dir}/atspi-interfaces/value.h
)
//INTERNAL INCLUDES
#include <dali/devel-api/atspi-interfaces/accessible.h>
#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
+#include <dali/devel-api/atspi-interfaces/socket.h>
#include <dali/internal/accessibility/bridge/accessibility-common.h>
#include <third-party/libunibreak/linebreak.h>
#include <third-party/libunibreak/wordbreak.h>
}
}
+void Accessible::EmitSocketAvailable()
+{
+ DALI_ASSERT_DEBUG(Socket::DownCast(this));
+
+ if(auto bridgeData = GetBridgeData())
+ {
+ bridgeData->mBridge->EmitSocketAvailable(this);
+ }
+}
+
void Accessible::Emit(WindowEvent event, unsigned int detail)
{
if(auto bridgeData = GetBridgeData())
#include <dali/internal/accessibility/bridge/bridge-hyperlink.h>
#include <dali/internal/accessibility/bridge/bridge-object.h>
#include <dali/internal/accessibility/bridge/bridge-selection.h>
+#include <dali/internal/accessibility/bridge/bridge-socket.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>
public BridgeSelection,
public BridgeApplication,
public BridgeHypertext,
- public BridgeHyperlink
+ public BridgeHyperlink,
+ public BridgeSocket
{
DBus::DBusClient mAccessibilityStatusClient;
DBus::DBusClient mRegistryClient;
BridgeApplication::RegisterInterfaces();
BridgeHypertext::RegisterInterfaces();
BridgeHyperlink::RegisterInterfaces();
+ BridgeSocket::RegisterInterfaces();
RegisterOnBridge(&mApplication);
{0},
{"", "root"});
}
+
+void BridgeObject::EmitSocketAvailable(Accessible* obj)
+{
+ if(!IsUp() || obj->IsHidden())
+ {
+ return;
+ }
+
+ mDbusServer.emit2<Address, Address>(
+ GetAccessiblePath(obj),
+ Accessible::GetInterfaceName(AtspiInterface::SOCKET),
+ "Available",
+ obj->GetAddress(),
+ {"", "root"});
+}
*/
void EmitMovedOutOfScreen(Dali::Accessibility::Accessible* obj, Dali::Accessibility::ScreenRelativeMoveType type) override;
+ /**
+ * @copydoc Dali::Accessibility::Bridge::EmitSocketAvailable()
+ */
+ void EmitSocketAvailable(Dali::Accessibility::Accessible* obj) override;
+
protected:
DBus::DBusInterfaceDescription::SignalId mStateChanged;
};
--- /dev/null
+/*
+ * Copyright (c) 2022 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.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/accessibility/bridge/bridge-socket.h>
+
+using namespace Dali::Accessibility;
+
+void BridgeSocket::RegisterInterfaces()
+{
+ DBus::DBusInterfaceDescription desc{Accessible::GetInterfaceName(AtspiInterface::SOCKET)};
+
+ AddFunctionToInterface(desc, "Embed", &BridgeSocket::Embed);
+ AddFunctionToInterface(desc, "Unembed", &BridgeSocket::Unembed);
+
+ mDbusServer.addInterface("/", desc, true);
+}
+
+Socket* BridgeSocket::FindSelf() const
+{
+ return FindCurrentObjectWithInterface<Dali::Accessibility::AtspiInterface::SOCKET>();
+}
+
+DBus::ValueOrError<Address> BridgeSocket::Embed(Address plug)
+{
+ return FindSelf()->Embed(plug);
+}
+
+DBus::ValueOrError<void> BridgeSocket::Unembed(Address plug)
+{
+ FindSelf()->Unembed(plug);
+ return {};
+}
--- /dev/null
+#ifndef DALI_INTERNAL_ACCESSIBILITY_BRIDGE_SOCKET_H
+#define DALI_INTERNAL_ACCESSIBILITY_BRIDGE_SOCKET_H
+
+/*
+ * Copyright (c) 2022 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/devel-api/atspi-interfaces/socket.h>
+#include <dali/internal/accessibility/bridge/bridge-base.h>
+
+/**
+ * @brief The BridgeSocket class contains glue code for Accessibility::Socket.
+ */
+class BridgeSocket : public virtual BridgeBase
+{
+protected:
+ BridgeSocket() = default;
+
+ /**
+ * @brief Registers Socket methods as a DBus interface.
+ */
+ void RegisterInterfaces();
+
+ /**
+ * @brief Returns the Socket object of the currently executed DBus method call.
+ *
+ * @return The Socket object
+ */
+ Dali::Accessibility::Socket* FindSelf() const;
+
+public:
+ /**
+ * @copydoc Dali::Accessibility::Socket::Embed()
+ */
+ DBus::ValueOrError<Dali::Accessibility::Address> Embed(Dali::Accessibility::Address plug);
+
+ /**
+ * @copydoc Dali::Accessibility::Socket::Unembed()
+ */
+ DBus::ValueOrError<void> Unembed(Dali::Accessibility::Address plug);
+};
+
+#endif // DALI_INTERNAL_ACCESSIBILITY_BRIDGE_SOCKET_H
{
}
+void Accessibility::Accessible::EmitSocketAvailable()
+{
+}
+
void Accessibility::Accessible::FindWordSeparationsUtf8(const utf8_t* string, size_t length, const char* language, char* breaks)
{
}
{
}
+ void EmitSocketAvailable(Accessibility::Accessible* obj) override
+ {
+ }
+
void EmitStateChanged(Accessibility::Accessible* obj, Accessibility::State state, int newValue, int reserved) override
{
}
${adaptor_accessibility_dir}/bridge/bridge-impl.cpp
${adaptor_accessibility_dir}/bridge/bridge-object.cpp
${adaptor_accessibility_dir}/bridge/bridge-selection.cpp
+ ${adaptor_accessibility_dir}/bridge/bridge-socket.cpp
${adaptor_accessibility_dir}/bridge/bridge-text.cpp
${adaptor_accessibility_dir}/bridge/bridge-value.cpp
${adaptor_accessibility_dir}/bridge/component.cpp