Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Attributes | List of all members
ui::AXMode Class Reference

#include <ax_mode.h>

Public Member Functions

constexpr AXMode ()
 
constexpr AXMode (uint32_t flags)
 
bool has_mode (uint32_t flag) const
 
void set_mode (uint32_t flag, bool value)
 
uint32_t mode () const
 
bool operator== (AXMode rhs) const
 
bool is_mode_off () const
 
bool operator!= (AXMode rhs) const
 
AXModeoperator|= (const AXMode &rhs)
 
std::string ToString () const
 

Static Public Attributes

static constexpr uint32_t kFirstModeFlag = 1 << 0
 
static constexpr uint32_t kNativeAPIs = 1 << 0
 
static constexpr uint32_t kWebContents = 1 << 1
 
static constexpr uint32_t kInlineTextBoxes = 1 << 2
 
static constexpr uint32_t kScreenReader = 1 << 3
 
static constexpr uint32_t kHTML = 1 << 4
 
static constexpr uint32_t kLabelImages = 1 << 5
 
static constexpr uint32_t kPDF = 1 << 6
 
static constexpr uint32_t kLastModeFlag = 1 << 6
 

Detailed Description

Definition at line 16 of file ax_mode.h.

Constructor & Destructor Documentation

◆ AXMode() [1/2]

constexpr ui::AXMode::AXMode ( )
inlineconstexpr

Definition at line 70 of file ax_mode.h.

70: flags_(0) {}

◆ AXMode() [2/2]

constexpr ui::AXMode::AXMode ( uint32_t  flags)
inlineconstexpr

Definition at line 71 of file ax_mode.h.

71: flags_(flags) {}
FlutterSemanticsFlag flags

Member Function Documentation

◆ has_mode()

bool ui::AXMode::has_mode ( uint32_t  flag) const
inline

Definition at line 73 of file ax_mode.h.

73{ return (flags_ & flag) > 0; }
FlutterSemanticsFlag flag

◆ is_mode_off()

bool ui::AXMode::is_mode_off ( ) const
inline

Definition at line 83 of file ax_mode.h.

83{ return flags_ == 0; }

◆ mode()

uint32_t ui::AXMode::mode ( ) const
inline

Definition at line 79 of file ax_mode.h.

79{ return flags_; }

◆ operator!=()

bool ui::AXMode::operator!= ( AXMode  rhs) const
inline

Definition at line 85 of file ax_mode.h.

85{ return !(*this == rhs); }

◆ operator==()

bool ui::AXMode::operator== ( AXMode  rhs) const
inline

Definition at line 81 of file ax_mode.h.

81{ return flags_ == rhs.flags_; }

◆ operator|=()

AXMode & ui::AXMode::operator|= ( const AXMode rhs)
inline

Definition at line 87 of file ax_mode.h.

87 {
88 flags_ |= rhs.flags_;
89 return *this;
90 }

◆ set_mode()

void ui::AXMode::set_mode ( uint32_t  flag,
bool  value 
)
inline

Definition at line 75 of file ax_mode.h.

75 {
76 flags_ = value ? (flags_ | flag) : (flags_ & ~flag);
77 }
uint8_t value

◆ ToString()

std::string ui::AXMode::ToString ( ) const

Definition at line 18 of file ax_mode.cc.

18 {
19 std::vector<std::string> tokens;
20
21 // Written as a loop with a switch so that this crashes if a new
22 // mode flag is added without adding support for logging it.
23 for (uint32_t mode_flag = AXMode::kFirstModeFlag;
24 mode_flag <= AXMode::kLastModeFlag; mode_flag = mode_flag << 1) {
25 const char* flag_name = nullptr;
26 switch (mode_flag) {
28 flag_name = "kNativeAPIs";
29 break;
31 flag_name = "kWebContents";
32 break;
34 flag_name = "kInlineTextBoxes";
35 break;
37 flag_name = "kScreenReader";
38 break;
39 case AXMode::kHTML:
40 flag_name = "kHTML";
41 break;
43 flag_name = "kLabelImages";
44 break;
45 case AXMode::kPDF:
46 flag_name = "kPDF";
47 break;
48 }
49
50 BASE_DCHECK(flag_name);
51
52 if (has_mode(mode_flag))
53 tokens.push_back(flag_name);
54 }
55
56 return base::JoinString(tokens, " | ");
57}
bool has_mode(uint32_t flag) const
Definition: ax_mode.h:73
static constexpr uint32_t kInlineTextBoxes
Definition: ax_mode.h:45
static constexpr uint32_t kScreenReader
Definition: ax_mode.h:52
static constexpr uint32_t kLastModeFlag
Definition: ax_mode.h:68
static constexpr uint32_t kFirstModeFlag
Definition: ax_mode.h:18
static constexpr uint32_t kPDF
Definition: ax_mode.h:63
static constexpr uint32_t kNativeAPIs
Definition: ax_mode.h:25
static constexpr uint32_t kLabelImages
Definition: ax_mode.h:59
static constexpr uint32_t kHTML
Definition: ax_mode.h:56
static constexpr uint32_t kWebContents
Definition: ax_mode.h:36
std::string JoinString(std::vector< std::string > tokens, std::string delimiter)
#define BASE_DCHECK(condition)
Definition: logging.h:63

Member Data Documentation

◆ kFirstModeFlag

constexpr uint32_t ui::AXMode::kFirstModeFlag = 1 << 0
staticconstexpr

Definition at line 18 of file ax_mode.h.

◆ kHTML

constexpr uint32_t ui::AXMode::kHTML = 1 << 4
staticconstexpr

Definition at line 56 of file ax_mode.h.

◆ kInlineTextBoxes

constexpr uint32_t ui::AXMode::kInlineTextBoxes = 1 << 2
staticconstexpr

Definition at line 45 of file ax_mode.h.

◆ kLabelImages

constexpr uint32_t ui::AXMode::kLabelImages = 1 << 5
staticconstexpr

Definition at line 59 of file ax_mode.h.

◆ kLastModeFlag

constexpr uint32_t ui::AXMode::kLastModeFlag = 1 << 6
staticconstexpr

Definition at line 68 of file ax_mode.h.

◆ kNativeAPIs

constexpr uint32_t ui::AXMode::kNativeAPIs = 1 << 0
staticconstexpr

Definition at line 25 of file ax_mode.h.

◆ kPDF

constexpr uint32_t ui::AXMode::kPDF = 1 << 6
staticconstexpr

Definition at line 63 of file ax_mode.h.

◆ kScreenReader

constexpr uint32_t ui::AXMode::kScreenReader = 1 << 3
staticconstexpr

Definition at line 52 of file ax_mode.h.

◆ kWebContents

constexpr uint32_t ui::AXMode::kWebContents = 1 << 1
staticconstexpr

Definition at line 36 of file ax_mode.h.


The documentation for this class was generated from the following files: