1 #ifndef DALI_ADAPTOR_ATSPI_SOCKET_H
2 #define DALI_ADAPTOR_ATSPI_SOCKET_H
5 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 #include <dali/devel-api/atspi-interfaces/accessible.h>
23 namespace Dali::Accessibility
26 * @brief A Socket is the root of the AT-SPI tree that can be embedded as a subtree
27 * in the tree belonging to another process (the Plug). The Plug initiates the Plug-Socket
28 * connection by calling Embed() and terminates it by calling Unembed().
30 * See AT_SPI2_CORE/xml/Socket.xml for a description of this interface in XML format.
32 class DALI_ADAPTOR_API Socket : public virtual Accessible
36 * @brief Establishes the Plug-Socket connection.
38 * @param plug Address of the Plug (remote parent)
39 * @return Address of the Socket
41 virtual Address Embed(Address plug) = 0;
44 * @brief Terminates the Plug-Socket connection.
46 * @param plug Address of the Plug (remote parent)
48 virtual void Unembed(Address plug) = 0;
51 * @brief Set the offset (position information).
53 * @param[in] x Horizontal offset
54 * @param[in] y Vertical offset
56 virtual void SetOffset(std::int32_t x, std::int32_t y) = 0;
59 * @brief Downcasts an Accessible to a Socket.
61 * @param obj The Accessible
62 * @return A Socket or null
64 * @see Dali::Accessibility::Accessible::DownCast()
66 static inline Socket* DownCast(Accessible* obj);
72 struct AtspiInterfaceTypeHelper<AtspiInterface::SOCKET>
76 } // namespace Internal
78 inline Socket* Socket::DownCast(Accessible* obj)
80 return Accessible::DownCast<AtspiInterface::SOCKET>(obj);
83 } // namespace Dali::Accessibility
85 #endif // DALI_ADAPTOR_ATSPI_SOCKET_H