1 #ifndef DALI_ADAPTOR_ATSPI_SELECTION_H
2 #define DALI_ADAPTOR_ATSPI_SELECTION_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.
21 #include <dali/devel-api/atspi-interfaces/accessible.h>
23 namespace Dali::Accessibility
26 * @brief Interface representing objects which can store a set of selected items.
28 class DALI_ADAPTOR_API Selection : public virtual Accessible
32 * @brief Gets the number of selected children.
34 * @return The number of selected children (zero if none)
36 virtual int GetSelectedChildrenCount() = 0;
39 * @brief Gets a specific selected child.
41 * @param selectedChildIndex The index of the selected child
43 * @note @p selectedChildIndex refers to the list of selected children,
44 * not the list of all children
46 * @return The selected child or nullptr if index is invalid
48 virtual Accessible* GetSelectedChild(int selectedChildIndex) = 0;
51 * @brief Selects a child.
53 * @param childIndex The index of the child
55 * @return true on success, false otherwise
57 virtual bool SelectChild(int childIndex) = 0;
60 * @brief Deselects a selected child.
62 * @param selectedChildIndex The index of the selected child
64 * @note @p selectedChildIndex refers to the list of selected children,
65 * not the list of all children
67 * @return true on success, false otherwise
69 * @see Dali::Accessibility::Selection::DeselectChild
71 virtual bool DeselectSelectedChild(int selectedChildIndex) = 0;
74 * @brief Checks whether a child is selected.
76 * @param childIndex The index of the child
78 * @return true if given child is selected, false otherwise
80 virtual bool IsChildSelected(int childIndex) = 0;
83 * @brief Selects all children.
85 * @return true on success, false otherwise
87 virtual bool SelectAll() = 0;
90 * @brief Deselects all children.
92 * @return true on success, false otherwise
94 virtual bool ClearSelection() = 0;
97 * @brief Deselects a child.
99 * @param childIndex The index of the child.
101 * @return true on success, false otherwise
103 * @see Dali::Accessibility::Selection::DeselectSelectedChild
105 virtual bool DeselectChild(int childIndex) = 0;
108 } // namespace Dali::Accessibility
110 #endif // DALI_ADAPTOR_ATSPI_SELECTION_H