Add a callback for navigation policy in web engine.
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / atspi-interfaces / selection.h
1 #ifndef DALI_ADAPTOR_ATSPI_SELECTION_H
2 #define DALI_ADAPTOR_ATSPI_SELECTION_H
3
4 /*
5  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  */
19
20 // INTERNAL INCLUDES
21 #include <dali/devel-api/atspi-interfaces/accessible.h>
22
23 namespace Dali::Accessibility
24 {
25 /**
26  * @brief Interface representing objects which can store a set of selected items.
27  */
28 class DALI_ADAPTOR_API Selection : public virtual Accessible
29 {
30 public:
31   /**
32    * @brief Gets the number of selected children.
33    *
34    * @return The number of selected children (zero if none)
35    */
36   virtual int GetSelectedChildrenCount() = 0;
37
38   /**
39    * @brief Gets a specific selected child.
40    *
41    * @param selectedChildIndex The index of the selected child
42    *
43    * @note @p selectedChildIndex refers to the list of selected children,
44    * not the list of all children
45    *
46    * @return The selected child or nullptr if index is invalid
47    */
48   virtual Accessible* GetSelectedChild(int selectedChildIndex) = 0;
49
50   /**
51    * @brief Selects a child.
52    *
53    * @param childIndex The index of the child
54    *
55    * @return true on success, false otherwise
56    */
57   virtual bool SelectChild(int childIndex) = 0;
58
59   /**
60    * @brief Deselects a selected child.
61    *
62    * @param selectedChildIndex The index of the selected child
63    *
64    * @note @p selectedChildIndex refers to the list of selected children,
65    * not the list of all children
66    *
67    * @return true on success, false otherwise
68    *
69    * @see Dali::Accessibility::Selection::DeselectChild
70    */
71   virtual bool DeselectSelectedChild(int selectedChildIndex) = 0;
72
73   /**
74    * @brief Checks whether a child is selected.
75    *
76    * @param childIndex The index of the child
77    *
78    * @return true if given child is selected, false otherwise
79    */
80   virtual bool IsChildSelected(int childIndex) = 0;
81
82   /**
83    * @brief Selects all children.
84    *
85    * @return true on success, false otherwise
86    */
87   virtual bool SelectAll() = 0;
88
89   /**
90    * @brief Deselects all children.
91    *
92    * @return true on success, false otherwise
93    */
94   virtual bool ClearSelection() = 0;
95
96   /**
97    * @brief Deselects a child.
98    *
99    * @param childIndex The index of the child.
100    *
101    * @return true on success, false otherwise
102    *
103    * @see Dali::Accessibility::Selection::DeselectSelectedChild
104    */
105   virtual bool DeselectChild(int childIndex) = 0;
106 };
107
108 } // namespace Dali::Accessibility
109
110 #endif // DALI_ADAPTOR_ATSPI_SELECTION_H