1885b47fbSopenharmony_ci/*
2885b47fbSopenharmony_ci * Copyright (C) 2022-2024 Huawei Device Co., Ltd.
3885b47fbSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4885b47fbSopenharmony_ci * you may not use this file except in compliance with the License.
5885b47fbSopenharmony_ci * You may obtain a copy of the License at
6885b47fbSopenharmony_ci *
7885b47fbSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8885b47fbSopenharmony_ci *
9885b47fbSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10885b47fbSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11885b47fbSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12885b47fbSopenharmony_ci * See the License for the specific language governing permissions and
13885b47fbSopenharmony_ci * limitations under the License.
14885b47fbSopenharmony_ci */
15885b47fbSopenharmony_ci
16885b47fbSopenharmony_ci#ifndef ACCESSIBILITY_EVENT_INFO_H
17885b47fbSopenharmony_ci#define ACCESSIBILITY_EVENT_INFO_H
18885b47fbSopenharmony_ci
19885b47fbSopenharmony_ci#include <vector>
20885b47fbSopenharmony_ci#include "accessibility_def.h"
21885b47fbSopenharmony_ci#include "accessibility_element_info.h"
22885b47fbSopenharmony_ci
23885b47fbSopenharmony_cinamespace OHOS {
24885b47fbSopenharmony_cinamespace Accessibility {
25885b47fbSopenharmony_ci/*
26885b47fbSopenharmony_ci* The class supply the content information about the event.
27885b47fbSopenharmony_ci* The SetXxx() API is almost supplied to ACE to set the information.
28885b47fbSopenharmony_ci* Parts of SetXxx() API is called by AAMS, such as: SetConnectId().
29885b47fbSopenharmony_ci* The GetXxx() API is almost supplied to AA to get the information.
30885b47fbSopenharmony_ci*/
31885b47fbSopenharmony_ciclass AccessibilityMemo {
32885b47fbSopenharmony_cipublic:
33885b47fbSopenharmony_ci    /**
34885b47fbSopenharmony_ci     * @brief Construct
35885b47fbSopenharmony_ci     * @since 3
36885b47fbSopenharmony_ci     * @sysCap Accessibility
37885b47fbSopenharmony_ci     */
38885b47fbSopenharmony_ci    AccessibilityMemo() {}
39885b47fbSopenharmony_ci
40885b47fbSopenharmony_ci    /**
41885b47fbSopenharmony_ci     * @brief Set the component of the event related.
42885b47fbSopenharmony_ci     * @param componentId The id of component.
43885b47fbSopenharmony_ci     * @since 3
44885b47fbSopenharmony_ci     * @sysCap Accessibility
45885b47fbSopenharmony_ci     */
46885b47fbSopenharmony_ci    void SetSource(const int64_t componentId);
47885b47fbSopenharmony_ci
48885b47fbSopenharmony_ci    /**
49885b47fbSopenharmony_ci     * @brief Gets the view(component) ID associated with the accessibility event.
50885b47fbSopenharmony_ci     * @return The view(component) ID associated with the accessibility event.
51885b47fbSopenharmony_ci     * @since 3
52885b47fbSopenharmony_ci     * @sysCap Accessibility
53885b47fbSopenharmony_ci     */
54885b47fbSopenharmony_ci    int64_t GetViewId() const;
55885b47fbSopenharmony_ci
56885b47fbSopenharmony_ci    /**
57885b47fbSopenharmony_ci     * @brief Gets the accessibility ID of the component.
58885b47fbSopenharmony_ci     * @return The accessibility ID of the component.
59885b47fbSopenharmony_ci     * @since 3
60885b47fbSopenharmony_ci     * @sysCap Accessibility
61885b47fbSopenharmony_ci     */
62885b47fbSopenharmony_ci    int64_t GetAccessibilityId() const;
63885b47fbSopenharmony_ci
64885b47fbSopenharmony_ci    /**
65885b47fbSopenharmony_ci     * @brief Set the window ID associated with the accessibility event.
66885b47fbSopenharmony_ci     * @param windowId The window ID associated with the accessibility event.
67885b47fbSopenharmony_ci     * @since 3
68885b47fbSopenharmony_ci     * @sysCap Accessibility
69885b47fbSopenharmony_ci     */
70885b47fbSopenharmony_ci    void SetWindowId(const int32_t windowId);
71885b47fbSopenharmony_ci
72885b47fbSopenharmony_ci    /**
73885b47fbSopenharmony_ci     * @brief Gets the window ID associated with the accessibility event.
74885b47fbSopenharmony_ci     * @return The window ID associated with the accessibility event.
75885b47fbSopenharmony_ci     * @since 3
76885b47fbSopenharmony_ci     * @sysCap Accessibility
77885b47fbSopenharmony_ci     */
78885b47fbSopenharmony_ci
79885b47fbSopenharmony_ci    int32_t GetWindowId() const;
80885b47fbSopenharmony_ci
81885b47fbSopenharmony_ci    /**
82885b47fbSopenharmony_ci     * @brief Gets the current index of listed items or text position associated with the current event.
83885b47fbSopenharmony_ci     * @return The current index of listed items or text position associated with the current event.
84885b47fbSopenharmony_ci     * @since 3
85885b47fbSopenharmony_ci     * @sysCap Accessibility
86885b47fbSopenharmony_ci     */
87885b47fbSopenharmony_ci    int32_t GetCurrentIndex() const;
88885b47fbSopenharmony_ci
89885b47fbSopenharmony_ci    /**
90885b47fbSopenharmony_ci     * @brief Sets the current index of listed items or text position associated with the current event.
91885b47fbSopenharmony_ci     * @param index The current index of listed items or text position associated with the current event.
92885b47fbSopenharmony_ci     * @since 3
93885b47fbSopenharmony_ci     * @sysCap Accessibility
94885b47fbSopenharmony_ci     */
95885b47fbSopenharmony_ci    void SetCurrentIndex(const int32_t index);
96885b47fbSopenharmony_ci
97885b47fbSopenharmony_ci    /**
98885b47fbSopenharmony_ci     * @brief Gets the start index of listed items on the screen.
99885b47fbSopenharmony_ci     * @return The start index of listed items. It is unique value for the listed items.
100885b47fbSopenharmony_ci     * @since 3
101885b47fbSopenharmony_ci     * @sysCap Accessibility
102885b47fbSopenharmony_ci     */
103885b47fbSopenharmony_ci    int32_t GetBeginIndex() const;
104885b47fbSopenharmony_ci
105885b47fbSopenharmony_ci    /**
106885b47fbSopenharmony_ci     * @brief Sets the start index of listed items on the screen.
107885b47fbSopenharmony_ci     * @param index The start index of listed items. It is unique value for the listed items.
108885b47fbSopenharmony_ci     * @since 3
109885b47fbSopenharmony_ci     * @sysCap Accessibility
110885b47fbSopenharmony_ci     */
111885b47fbSopenharmony_ci    void SetBeginIndex(const int32_t index);
112885b47fbSopenharmony_ci
113885b47fbSopenharmony_ci    /**
114885b47fbSopenharmony_ci     * @brief Gets the number items on the screen.
115885b47fbSopenharmony_ci     * @return The number of items.
116885b47fbSopenharmony_ci     * @since 3
117885b47fbSopenharmony_ci     * @sysCap Accessibility
118885b47fbSopenharmony_ci     */
119885b47fbSopenharmony_ci    int32_t GetItemCounts() const;
120885b47fbSopenharmony_ci
121885b47fbSopenharmony_ci    /**
122885b47fbSopenharmony_ci     * @brief Sets the number items on the screen.
123885b47fbSopenharmony_ci     * @param ItemCounts The number of items.
124885b47fbSopenharmony_ci     * @since 3
125885b47fbSopenharmony_ci     * @sysCap Accessibility
126885b47fbSopenharmony_ci     */
127885b47fbSopenharmony_ci    void SetItemCounts(const int32_t itemCounts);
128885b47fbSopenharmony_ci
129885b47fbSopenharmony_ci    /**
130885b47fbSopenharmony_ci     * @brief Gets the end index of listed items on the screen.
131885b47fbSopenharmony_ci     * @return The end index of listed items on the screen.
132885b47fbSopenharmony_ci     * @since 3
133885b47fbSopenharmony_ci     * @sysCap Accessibility
134885b47fbSopenharmony_ci     */
135885b47fbSopenharmony_ci    int32_t GetEndIndex() const;
136885b47fbSopenharmony_ci
137885b47fbSopenharmony_ci    /**
138885b47fbSopenharmony_ci     * @brief Sets the end index of listed items on the screen.
139885b47fbSopenharmony_ci     * @param index The end index of listed items on the screen.
140885b47fbSopenharmony_ci     * @since 3
141885b47fbSopenharmony_ci     * @sysCap Accessibility
142885b47fbSopenharmony_ci     */
143885b47fbSopenharmony_ci    void SetEndIndex(const int32_t index);
144885b47fbSopenharmony_ci
145885b47fbSopenharmony_ci    /**
146885b47fbSopenharmony_ci     * @brief Gets the class(component type) name.
147885b47fbSopenharmony_ci     * @return The class(component type) name.
148885b47fbSopenharmony_ci     * @since 3
149885b47fbSopenharmony_ci     * @sysCap Accessibility
150885b47fbSopenharmony_ci     */
151885b47fbSopenharmony_ci    const std::string &GetComponentType() const;
152885b47fbSopenharmony_ci
153885b47fbSopenharmony_ci    /**
154885b47fbSopenharmony_ci     * @brief Sets the class(component type) name.
155885b47fbSopenharmony_ci     * @param className The class(component type) name.
156885b47fbSopenharmony_ci     * @since 3
157885b47fbSopenharmony_ci     * @sysCap Accessibility
158885b47fbSopenharmony_ci     */
159885b47fbSopenharmony_ci    void SetComponentType(const std::string &className);
160885b47fbSopenharmony_ci
161885b47fbSopenharmony_ci    /**
162885b47fbSopenharmony_ci     * @brief Gets the before text changed of the component.
163885b47fbSopenharmony_ci     * @return The before text changed of the component.
164885b47fbSopenharmony_ci     * @since 3
165885b47fbSopenharmony_ci     * @sysCap Accessibility
166885b47fbSopenharmony_ci     */
167885b47fbSopenharmony_ci    const std::string &GetBeforeText() const;
168885b47fbSopenharmony_ci
169885b47fbSopenharmony_ci    /**
170885b47fbSopenharmony_ci     * @brief Set the before text changed of the component.
171885b47fbSopenharmony_ci     * @param beforeText The before text changed of the component.
172885b47fbSopenharmony_ci     * @since 3
173885b47fbSopenharmony_ci     * @sysCap Accessibility
174885b47fbSopenharmony_ci     */
175885b47fbSopenharmony_ci    void SetBeforeText(const std::string &beforeText);
176885b47fbSopenharmony_ci
177885b47fbSopenharmony_ci    /**
178885b47fbSopenharmony_ci     * @brief Adds an text to the content list.
179885b47fbSopenharmony_ci     * @param content Indicates the text to add.
180885b47fbSopenharmony_ci     * @since 3
181885b47fbSopenharmony_ci     * @sysCap Accessibility
182885b47fbSopenharmony_ci     */
183885b47fbSopenharmony_ci    void AddContent(const std::string &content);
184885b47fbSopenharmony_ci
185885b47fbSopenharmony_ci    /**
186885b47fbSopenharmony_ci     * @brief Get the content list in the event.
187885b47fbSopenharmony_ci     * @return The content list in the event.
188885b47fbSopenharmony_ci     * @since 3
189885b47fbSopenharmony_ci     * @sysCap Accessibility
190885b47fbSopenharmony_ci     */
191885b47fbSopenharmony_ci    const std::vector<std::string> &GetContentList() const;
192885b47fbSopenharmony_ci
193885b47fbSopenharmony_ci    /**
194885b47fbSopenharmony_ci     * @brief Gets the last content of the component(The text of changed after).
195885b47fbSopenharmony_ci     * @return The last content of the component(The text of changed after).
196885b47fbSopenharmony_ci     * @since 3
197885b47fbSopenharmony_ci     * @sysCap Accessibility
198885b47fbSopenharmony_ci     */
199885b47fbSopenharmony_ci    const std::string &GetLatestContent() const;
200885b47fbSopenharmony_ci
201885b47fbSopenharmony_ci    /**
202885b47fbSopenharmony_ci     * @brief Sets the last content of the component.
203885b47fbSopenharmony_ci     * @param content The last content of component.
204885b47fbSopenharmony_ci     * @since 3
205885b47fbSopenharmony_ci     * @sysCap Accessibility
206885b47fbSopenharmony_ci     */
207885b47fbSopenharmony_ci    void SetLatestContent(const std::string &content);
208885b47fbSopenharmony_ci
209885b47fbSopenharmony_ci    /**
210885b47fbSopenharmony_ci     * @brief Gets the accessibility event description.
211885b47fbSopenharmony_ci     * @return The accessibility event description
212885b47fbSopenharmony_ci     * @since 3
213885b47fbSopenharmony_ci     * @sysCap Accessibility
214885b47fbSopenharmony_ci     */
215885b47fbSopenharmony_ci    const std::string &GetDescription() const;
216885b47fbSopenharmony_ci
217885b47fbSopenharmony_ci    /**
218885b47fbSopenharmony_ci     * @brief Sets the accessibility event description.
219885b47fbSopenharmony_ci     * @param contentDescription The accessibility event description
220885b47fbSopenharmony_ci     * @since 3
221885b47fbSopenharmony_ci     * @sysCap Accessibility
222885b47fbSopenharmony_ci     */
223885b47fbSopenharmony_ci    void SetDescription(const std::string &contentDescription);
224885b47fbSopenharmony_ci
225885b47fbSopenharmony_ciprotected:
226885b47fbSopenharmony_ci    int64_t componentId_ = 0;
227885b47fbSopenharmony_ci    int32_t windowId_ = 0;
228885b47fbSopenharmony_ci    int32_t currentIndex_ = 0;
229885b47fbSopenharmony_ci    int32_t beginIndex_ = 0;
230885b47fbSopenharmony_ci    int32_t endIndex_ = 0;
231885b47fbSopenharmony_ci    std::vector<std::string> contents_ {};
232885b47fbSopenharmony_ci    std::string componentType_ = "";
233885b47fbSopenharmony_ci    std::string description_ = "";
234885b47fbSopenharmony_ci    std::string beforeText_ = "";
235885b47fbSopenharmony_ci    std::string latestContent_ = "";
236885b47fbSopenharmony_ci    int64_t elementId_ = 0;
237885b47fbSopenharmony_ci    int32_t itemCounts_ = 0;
238885b47fbSopenharmony_ci};
239885b47fbSopenharmony_ci
240885b47fbSopenharmony_ci/*
241885b47fbSopenharmony_ci* The class define the event types and supply the api to
242885b47fbSopenharmony_ci* get/set the property of event. and it triggered by UI
243885b47fbSopenharmony_ci* changed and sent to AA. According to the event property,
244885b47fbSopenharmony_ci* AA can get event properties, such as: action triggered
245885b47fbSopenharmony_ci* the event and the source.
246885b47fbSopenharmony_ci*/
247885b47fbSopenharmony_ciclass AccessibilityEventInfo : public AccessibilityMemo {
248885b47fbSopenharmony_cipublic:
249885b47fbSopenharmony_ci    /**
250885b47fbSopenharmony_ci     * @brief Construct
251885b47fbSopenharmony_ci     * @since 3
252885b47fbSopenharmony_ci     * @sysCap Accessibility
253885b47fbSopenharmony_ci     */
254885b47fbSopenharmony_ci    AccessibilityEventInfo() {}
255885b47fbSopenharmony_ci
256885b47fbSopenharmony_ci    /**
257885b47fbSopenharmony_ci     * @brief Construct
258885b47fbSopenharmony_ci     * @param eventType the type of event info
259885b47fbSopenharmony_ci     * @since 3
260885b47fbSopenharmony_ci     * @sysCap Accessibility
261885b47fbSopenharmony_ci     */
262885b47fbSopenharmony_ci    AccessibilityEventInfo(EventType eventType);
263885b47fbSopenharmony_ci
264885b47fbSopenharmony_ci    /**
265885b47fbSopenharmony_ci     * @brief Construct
266885b47fbSopenharmony_ci     * @param windowId The id of window
267885b47fbSopenharmony_ci     * @param windowChangeTypes the window change type
268885b47fbSopenharmony_ci     * @since 3
269885b47fbSopenharmony_ci     * @sysCap Accessibility
270885b47fbSopenharmony_ci     */
271885b47fbSopenharmony_ci    AccessibilityEventInfo(int32_t windowId, WindowUpdateType windowChangeTypes);
272885b47fbSopenharmony_ci
273885b47fbSopenharmony_ci    /**
274885b47fbSopenharmony_ci     * @brief Get the type of the accessibility event.
275885b47fbSopenharmony_ci     * @return The type of the accessibility event.
276885b47fbSopenharmony_ci     * @since 3
277885b47fbSopenharmony_ci     * @sysCap Accessibility
278885b47fbSopenharmony_ci     */
279885b47fbSopenharmony_ci    EventType GetEventType() const;
280885b47fbSopenharmony_ci
281885b47fbSopenharmony_ci    /**
282885b47fbSopenharmony_ci     * @brief Get the window content changed types
283885b47fbSopenharmony_ci     * @return The window content changed types. Refer to "WindowsContentChangeTypes"
284885b47fbSopenharmony_ci     * @since 3
285885b47fbSopenharmony_ci     * * @sysCap Accessibility
286885b47fbSopenharmony_ci     */
287885b47fbSopenharmony_ci    WindowsContentChangeTypes GetWindowContentChangeTypes() const;
288885b47fbSopenharmony_ci
289885b47fbSopenharmony_ci    /**
290885b47fbSopenharmony_ci     * @brief Set the window content changed types
291885b47fbSopenharmony_ci     * @param changeTypes The window content changed types. Refer to "WindowsContentChangeTypes"
292885b47fbSopenharmony_ci     * @since 3
293885b47fbSopenharmony_ci     * @sysCap Accessibility
294885b47fbSopenharmony_ci     */
295885b47fbSopenharmony_ci    void SetWindowContentChangeTypes(const WindowsContentChangeTypes changeTypes);
296885b47fbSopenharmony_ci
297885b47fbSopenharmony_ci    /**
298885b47fbSopenharmony_ci     * @brief Get the window changed types
299885b47fbSopenharmony_ci     * @return The window changed types.refer to WindowUpdateType
300885b47fbSopenharmony_ci     * @since 3
301885b47fbSopenharmony_ci     * @sysCap Accessibility
302885b47fbSopenharmony_ci     */
303885b47fbSopenharmony_ci    WindowUpdateType GetWindowChangeTypes() const;
304885b47fbSopenharmony_ci
305885b47fbSopenharmony_ci    /**
306885b47fbSopenharmony_ci     * @brief Set the window changed types
307885b47fbSopenharmony_ci     * @param changeTypes The window changed types.refer to WindowUpdateType
308885b47fbSopenharmony_ci     * @since 3
309885b47fbSopenharmony_ci     * @sysCap Accessibility
310885b47fbSopenharmony_ci     */
311885b47fbSopenharmony_ci    void SetWindowChangeTypes(const WindowUpdateType changeTypes);
312885b47fbSopenharmony_ci
313885b47fbSopenharmony_ci    /**
314885b47fbSopenharmony_ci     * @brief Sets the type of an accessibility event.
315885b47fbSopenharmony_ci     * @note It is same to setAccessibilityEventType​(int32_t accessibilityEventType)
316885b47fbSopenharmony_ci     * @param eventType The type of an accessibility event. Refer to "EventType"
317885b47fbSopenharmony_ci     * @since 3
318885b47fbSopenharmony_ci     * @sysCap Accessibility
319885b47fbSopenharmony_ci     */
320885b47fbSopenharmony_ci    void SetEventType(const EventType eventType);
321885b47fbSopenharmony_ci
322885b47fbSopenharmony_ci    /**
323885b47fbSopenharmony_ci     * @brief AA get the time of accessibility event is sent from ASAC.
324885b47fbSopenharmony_ci     * @return The time of accessibility event is sent from ASAC
325885b47fbSopenharmony_ci     * @since 3
326885b47fbSopenharmony_ci     * @sysCap Accessibility
327885b47fbSopenharmony_ci     */
328885b47fbSopenharmony_ci    int64_t GetTimeStamp() const;
329885b47fbSopenharmony_ci
330885b47fbSopenharmony_ci    /**
331885b47fbSopenharmony_ci     * @brief ASAC set the time of accessibility is sent to AA
332885b47fbSopenharmony_ci     * @param timeStamp The time of accessibility event is sent from ASAC
333885b47fbSopenharmony_ci     * @since 3
334885b47fbSopenharmony_ci     * @sysCap Accessibility
335885b47fbSopenharmony_ci     */
336885b47fbSopenharmony_ci    void SetTimeStamp(int64_t timeStamp);  // Remained:for send event timestamp
337885b47fbSopenharmony_ci
338885b47fbSopenharmony_ci    /**
339885b47fbSopenharmony_ci     * @brief Gets the bundle name of the event source, that is, the bundle name of the target application.
340885b47fbSopenharmony_ci     * @return Returns the bundle name of the event source.
341885b47fbSopenharmony_ci     * @since 3
342885b47fbSopenharmony_ci     * @sysCap Accessibility
343885b47fbSopenharmony_ci     */
344885b47fbSopenharmony_ci    const std::string &GetBundleName() const;
345885b47fbSopenharmony_ci
346885b47fbSopenharmony_ci    /**
347885b47fbSopenharmony_ci     * @brief Set the bundle name of the event source, that is, the bundle name of the target application.
348885b47fbSopenharmony_ci     * @param bundleName The bundle name of the event source.
349885b47fbSopenharmony_ci     * @since 3
350885b47fbSopenharmony_ci     * @sysCap Accessibility
351885b47fbSopenharmony_ci     */
352885b47fbSopenharmony_ci    void SetBundleName(const std::string &bundleName);
353885b47fbSopenharmony_ci
354885b47fbSopenharmony_ci    /**
355885b47fbSopenharmony_ci     * @brief Get the notification content of the event source.
356885b47fbSopenharmony_ci     * @return Return the notification content of the event source.
357885b47fbSopenharmony_ci     * @since 3
358885b47fbSopenharmony_ci     * @sysCap Accessibility
359885b47fbSopenharmony_ci     */
360885b47fbSopenharmony_ci    const std::string &GetNotificationContent() const;
361885b47fbSopenharmony_ci
362885b47fbSopenharmony_ci    /**
363885b47fbSopenharmony_ci     * @brief Set the notification content of the event source.
364885b47fbSopenharmony_ci     * @param notificationContent The notification content of the event source.
365885b47fbSopenharmony_ci     * @since 3
366885b47fbSopenharmony_ci     * @sysCap Accessibility
367885b47fbSopenharmony_ci     */
368885b47fbSopenharmony_ci    void SetNotificationContent(const std::string &notificationContent);
369885b47fbSopenharmony_ci
370885b47fbSopenharmony_ci    /**
371885b47fbSopenharmony_ci     * @brief Set the move granularity of the text
372885b47fbSopenharmony_ci     * @param granularity The move granularity of the text. Refer to "AccessibilityElementInfo.TextMoveUnit"
373885b47fbSopenharmony_ci     * @since 3
374885b47fbSopenharmony_ci     * @sysCap Accessibility
375885b47fbSopenharmony_ci     */
376885b47fbSopenharmony_ci    void SetTextMovementStep(const TextMoveUnit granularity);
377885b47fbSopenharmony_ci
378885b47fbSopenharmony_ci    /**
379885b47fbSopenharmony_ci     * @brief Get the move granularity of the text
380885b47fbSopenharmony_ci     * @return The move granularity of the text. Refer to "AccessibilityElementInfo.TextMoveUnit"
381885b47fbSopenharmony_ci     * @since 3
382885b47fbSopenharmony_ci     * @sysCap Accessibility
383885b47fbSopenharmony_ci     */
384885b47fbSopenharmony_ci    TextMoveUnit GetTextMovementStep() const;
385885b47fbSopenharmony_ci
386885b47fbSopenharmony_ci    /**
387885b47fbSopenharmony_ci     * @brief Sets the action that triggers the accessibility event.
388885b47fbSopenharmony_ci     * @param action The operation of the event. Refer to "AccessibilityElementInfo.ActionType"
389885b47fbSopenharmony_ci     * @since 3
390885b47fbSopenharmony_ci     * @sysCap Accessibility
391885b47fbSopenharmony_ci     */
392885b47fbSopenharmony_ci    void SetTriggerAction(const ActionType action);
393885b47fbSopenharmony_ci
394885b47fbSopenharmony_ci    /**
395885b47fbSopenharmony_ci     * @brief Gets the action that triggers the accessibility event.
396885b47fbSopenharmony_ci     * @return The operation of the event. Refer to "AccessibilityElementInfo.ActionType"
397885b47fbSopenharmony_ci     * @since 3
398885b47fbSopenharmony_ci     * @sysCap Accessibility
399885b47fbSopenharmony_ci     */
400885b47fbSopenharmony_ci    ActionType GetTriggerAction() const;
401885b47fbSopenharmony_ci
402885b47fbSopenharmony_ci    /**
403885b47fbSopenharmony_ci     * @brief Set the information of accessibility event of [TYPE_NOTIFICATION_UPDATE_EVENT]
404885b47fbSopenharmony_ci     * @param category Refer to [NotificationCategory], It maybe changed from APP
405885b47fbSopenharmony_ci     * @since 3
406885b47fbSopenharmony_ci     * @sysCap Accessibility
407885b47fbSopenharmony_ci     */
408885b47fbSopenharmony_ci    void SetNotificationInfo(const NotificationCategory category);
409885b47fbSopenharmony_ci
410885b47fbSopenharmony_ci    /**
411885b47fbSopenharmony_ci     * @brief Get the information of accessibility event of [TYPE_NOTIFICATION_UPDATE_EVENT]
412885b47fbSopenharmony_ci     * @return Refer to [NotificationCategory], It maybe changed from APP
413885b47fbSopenharmony_ci     * @since 3
414885b47fbSopenharmony_ci     * @sysCap Accessibility
415885b47fbSopenharmony_ci     */
416885b47fbSopenharmony_ci    NotificationCategory GetNotificationInfo() const;
417885b47fbSopenharmony_ci
418885b47fbSopenharmony_ci    /**
419885b47fbSopenharmony_ci     * @brief Set the customize gesture type of accessibility event of [TYPE_GESTURE_EVENT]
420885b47fbSopenharmony_ci     * @param category Refer to [GestureType], It maybe changed from APP
421885b47fbSopenharmony_ci     * @since 3
422885b47fbSopenharmony_ci     * @sysCap Accessibility
423885b47fbSopenharmony_ci     */
424885b47fbSopenharmony_ci    void SetGestureType(const GestureType gestureType);
425885b47fbSopenharmony_ci
426885b47fbSopenharmony_ci    /**
427885b47fbSopenharmony_ci     * @brief Get the customize gesture type of accessibility event of [TYPE_GESTURE_EVENT]
428885b47fbSopenharmony_ci     * @return Refer to [GestureType], It maybe changed from APP
429885b47fbSopenharmony_ci     * @since 3
430885b47fbSopenharmony_ci     * @sysCap Accessibility
431885b47fbSopenharmony_ci     */
432885b47fbSopenharmony_ci    GestureType GetGestureType() const;
433885b47fbSopenharmony_ci
434885b47fbSopenharmony_ci    /**
435885b47fbSopenharmony_ci     * @brief Set the page ID associated with the accessibility event.
436885b47fbSopenharmony_ci     * @param pageId The page ID associated with the accessibility event.
437885b47fbSopenharmony_ci     * @since 3
438885b47fbSopenharmony_ci     * @sysCap Accessibility
439885b47fbSopenharmony_ci     */
440885b47fbSopenharmony_ci    void SetPageId(const int32_t pageId);
441885b47fbSopenharmony_ci
442885b47fbSopenharmony_ci    /**
443885b47fbSopenharmony_ci     * @brief Gets the page ID associated with the accessibility event.
444885b47fbSopenharmony_ci     * @return The page ID associated with the accessibility event.
445885b47fbSopenharmony_ci     * @since 3
446885b47fbSopenharmony_ci     * @sysCap Accessibility
447885b47fbSopenharmony_ci     */
448885b47fbSopenharmony_ci    int32_t GetPageId() const;
449885b47fbSopenharmony_ci
450885b47fbSopenharmony_ci    /**
451885b47fbSopenharmony_ci     * @brief Set the element info associated with the accessibility event.
452885b47fbSopenharmony_ci     * @param elementInfo The element info associated with the accessibility event.
453885b47fbSopenharmony_ci     * @since 12
454885b47fbSopenharmony_ci     * @sysCap Accessibility
455885b47fbSopenharmony_ci     */
456885b47fbSopenharmony_ci    void SetElementInfo(const AccessibilityElementInfo &elementInfo);
457885b47fbSopenharmony_ci
458885b47fbSopenharmony_ci    /**
459885b47fbSopenharmony_ci     * @brief Get the element info pointer associated with the accessibility event.
460885b47fbSopenharmony_ci     * @return The element info associated with the accessibility event.
461885b47fbSopenharmony_ci     * @since 12
462885b47fbSopenharmony_ci     * @sysCap Accessibility
463885b47fbSopenharmony_ci     */
464885b47fbSopenharmony_ci    const AccessibilityElementInfo &GetElementInfo() const;
465885b47fbSopenharmony_ci
466885b47fbSopenharmony_ci    /**
467885b47fbSopenharmony_ci     * @brief Get the text to announce.
468885b47fbSopenharmony_ci     * @return Return the text to announce.
469885b47fbSopenharmony_ci     * @since 12
470885b47fbSopenharmony_ci     * @sysCap Accessibility
471885b47fbSopenharmony_ci     */
472885b47fbSopenharmony_ci    const std::string &GetTextAnnouncedForAccessibility() const;
473885b47fbSopenharmony_ci
474885b47fbSopenharmony_ci    /**
475885b47fbSopenharmony_ci     * @brief Set the text to announce of the event.
476885b47fbSopenharmony_ci     * @param textAnnouncedForAccessibility The text to announce.
477885b47fbSopenharmony_ci     * @since 12
478885b47fbSopenharmony_ci     * @sysCap Accessibility
479885b47fbSopenharmony_ci     */
480885b47fbSopenharmony_ci    void SetTextAnnouncedForAccessibility(const std::string &textAnnouncedForAccessibility);
481885b47fbSopenharmony_ci
482885b47fbSopenharmony_ci    /**
483885b47fbSopenharmony_ci     * @brief Get the inspectorKey.
484885b47fbSopenharmony_ci     * @return Return the inspectorKey.
485885b47fbSopenharmony_ci     * @since 12
486885b47fbSopenharmony_ci     * @sysCap Accessibility
487885b47fbSopenharmony_ci     */
488885b47fbSopenharmony_ci    const std::string &GetInspectorKey() const;
489885b47fbSopenharmony_ci
490885b47fbSopenharmony_ci    /**
491885b47fbSopenharmony_ci     * @brief Set the inspectorKey of the event.
492885b47fbSopenharmony_ci     * @param inspectorKey The inspectorKey.
493885b47fbSopenharmony_ci     * @since 12
494885b47fbSopenharmony_ci     * @sysCap Accessibility
495885b47fbSopenharmony_ci     */
496885b47fbSopenharmony_ci    void SetInspectorKey(const std::string &inspectorKey);
497885b47fbSopenharmony_ci
498885b47fbSopenharmony_ci    /**
499885b47fbSopenharmony_ci     * @brief Set the request focus elementId.
500885b47fbSopenharmony_ci     * @param requestFocusElementId The elementId to focus.
501885b47fbSopenharmony_ci     * @since 12
502885b47fbSopenharmony_ci     * @sysCap Accessibility
503885b47fbSopenharmony_ci     */
504885b47fbSopenharmony_ci    void SetRequestFocusElementId(const int32_t requestFocusElementId);
505885b47fbSopenharmony_ci
506885b47fbSopenharmony_ci    /**
507885b47fbSopenharmony_ci     * @brief Gets the request focus elementId.
508885b47fbSopenharmony_ci     * @return The elementId to focus.
509885b47fbSopenharmony_ci     * @since 12
510885b47fbSopenharmony_ci     * @sysCap Accessibility
511885b47fbSopenharmony_ci     */
512885b47fbSopenharmony_ci    int32_t GetRequestFocusElementId() const;
513885b47fbSopenharmony_ci
514885b47fbSopenharmony_ciprotected:
515885b47fbSopenharmony_ci    EventType eventType_ = TYPE_VIEW_INVALID;
516885b47fbSopenharmony_ci    std::string bundleName_ = "";
517885b47fbSopenharmony_ci    ActionType triggerAction_ = ACCESSIBILITY_ACTION_INVALID;
518885b47fbSopenharmony_ci    int64_t timeStamp_ = 0;
519885b47fbSopenharmony_ci    TextMoveUnit textMoveStep_ = STEP_CHARACTER;
520885b47fbSopenharmony_ci    WindowsContentChangeTypes windowContentChangeTypes_ = CONTENT_CHANGE_TYPE_INVALID;
521885b47fbSopenharmony_ci    WindowUpdateType windowChangeTypes_ = WINDOW_UPDATE_INVALID;
522885b47fbSopenharmony_ci    GestureType gestureType_ = GESTURE_INVALID;
523885b47fbSopenharmony_ci    NotificationCategory category_ = CATEGORY_INVALID;
524885b47fbSopenharmony_ci    int32_t pageId_ = 0;
525885b47fbSopenharmony_ci    std::string notificationContent_ = "";
526885b47fbSopenharmony_ci    AccessibilityElementInfo elementInfo_ {};
527885b47fbSopenharmony_ci    std::string textAnnouncedForAccessibility_ = "";
528885b47fbSopenharmony_ci    std::string inspectorKey_ = "";
529885b47fbSopenharmony_ci    int32_t requestFocusElementId_ = 0;
530885b47fbSopenharmony_ci};
531885b47fbSopenharmony_ci} // namespace Accessibility
532885b47fbSopenharmony_ci} // namespace OHOS
533885b47fbSopenharmony_ci#endif // ACCESSIBILITY_EVENT_INFO_H
534