1 #ifndef DALI_ADAPTOR_ATSPI_ACTION_H
2 #define DALI_ADAPTOR_ATSPI_ACTION_H
5 * Copyright (c) 2021 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.
24 #include <dali/devel-api/atspi-interfaces/accessible.h>
26 namespace Dali::Accessibility
29 * @brief Interface enabling to perform provided actions.
31 class DALI_ADAPTOR_API Action : public virtual Accessible
35 * @brief Gets name of action with given index.
37 * @param[in] index The index of action
39 * @return The string with name of action
41 virtual std::string GetActionName(std::size_t index) const = 0;
44 * @brief Gets translated name of action with given index.
46 * @param[in] index The index of action
48 * @return The string with name of action translated according to current translation domain
50 * @note The translation is not supported in this version
52 virtual std::string GetLocalizedActionName(std::size_t index) const = 0;
55 * @brief Gets description of action with given index.
57 * @param[in] index The index of action
59 * @return The string with description of action
61 virtual std::string GetActionDescription(std::size_t index) const = 0;
64 * @brief Gets key code binded to action with given index.
66 * @param[in] index The index of action
68 * @return The string with key name
70 virtual std::string GetActionKeyBinding(std::size_t index) const = 0;
73 * @brief Gets number of provided actions.
75 * @return The number of actions
77 virtual std::size_t GetActionCount() const = 0;
80 * @brief Performs an action with given index.
82 * @param index The index of action
84 * @return true on success, false otherwise
86 virtual bool DoAction(std::size_t index) = 0;
89 * @brief Performs an action with given name.
91 * @param name The name of action
93 * @return true on success, false otherwise
95 virtual bool DoAction(const std::string& name) = 0;
98 * @brief Downcasts an Accessible to an Action.
100 * @param obj The Accessible
101 * @return An Action or null
103 * @see Dali::Accessibility::Accessible::DownCast()
105 static inline Action* DownCast(Accessible* obj);
111 struct AtspiInterfaceTypeHelper<AtspiInterface::ACTION>
115 } // namespace Internal
117 inline Action* Action::DownCast(Accessible* obj)
119 return Accessible::DownCast<AtspiInterface::ACTION>(obj);
122 } // namespace Dali::Accessibility
124 #endif // DALI_ADAPTOR_ATSPI_ACTION_H