Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
accessibility
ax
platform
ax_unique_id.h
Go to the documentation of this file.
1
// Copyright 2017 The Chromium Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#ifndef UI_ACCESSIBILITY_PLATFORM_AX_UNIQUE_ID_H_
6
#define UI_ACCESSIBILITY_PLATFORM_AX_UNIQUE_ID_H_
7
8
#include <cstdint>
9
10
#include "
ax/ax_export.h
"
11
#include "
base/macros.h
"
12
13
namespace
ui
{
14
15
// AXUniqueID provides IDs for accessibility objects that are guaranteed to be
16
// unique for the entire Chrome instance. Instantiating the class is all that
17
// is required to generate the ID, and the ID is freed when the AXUniqueID is
18
// destroyed.
19
//
20
// The unique id that's guaranteed to be a positive number. Because some
21
// platforms want to negate it, we ensure the range is below the signed int max.
22
//
23
// These ids must not be conflated with the int id, that comes with web node
24
// data, which are only unique within their source frame.
25
class
AX_EXPORT
AXUniqueId
{
26
public
:
27
AXUniqueId
();
28
virtual
~AXUniqueId
();
29
30
int32_t
Get
()
const
{
return
id_; }
31
operator
int32_t()
const
{
return
id_; }
32
33
bool
operator==
(
const
AXUniqueId
& other)
const
;
34
bool
operator!=
(
const
AXUniqueId
& other)
const
;
35
36
protected
:
37
// Passing the max id is necessary for testing.
38
explicit
AXUniqueId
(
const
int32_t max_id);
39
40
private
:
41
int32_t GetNextAXUniqueId(
const
int32_t max_id);
42
43
bool
IsAssigned(int32_t)
const
;
44
45
int32_t id_;
46
47
BASE_DISALLOW_COPY_AND_ASSIGN
(
AXUniqueId
);
48
};
49
50
}
// namespace ui
51
52
#endif
// UI_ACCESSIBILITY_PLATFORM_AX_UNIQUE_ID_H_
operator!=
bool operator!=(const sk_sp< T > &a, const sk_sp< U > &b)
Definition
SkRefCnt.h:355
ax_export.h
AX_EXPORT
#define AX_EXPORT
Definition
ax_export.h:29
ui::AXUniqueId
Definition
ax_unique_id.h:25
ui::AXUniqueId::Get
int32_t Get() const
Definition
ax_unique_id.h:30
operator==
bool operator==(const FlutterPoint &a, const FlutterPoint &b)
Definition
embedder_assertions.h:23
ui
Definition
window_binding_handler.h:18
macros.h
BASE_DISALLOW_COPY_AND_ASSIGN
#define BASE_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition
macros.h:8
Generated on Fri Apr 26 2024 06:14:38 for Flutter Engine by
1.9.8