class InteractionTracker

Defined at line 41 of file ../../src/ui/a11y/lib/gesture_manager/arena_v2/gesture_arena_v2.h

Helper class for |GestureArenaV2|.

Tracks the "decision status" of the current contest -- meaning whether or not

the contest will eventually result in a unique winner, or in all losers.

* As soon as at least one recognizer tries to claim a win, the status is

"accept".

* If all recognizers decide to reject, then the status is "reject".

(Note the subtle difference between this and the notion of a contest being

completely "resolved"!)

This also tracks "open" interactions. An interaction is considered open if

it has no `REMOVE` or `CANCEL` event yet; otherwise we say it is closed.

Lastly, this tracks interactions that are "on hold". We say that an

interaction is on hold if the current contest was undecided when that

interaction became closed. In this case, the interaction stays on hold until

the current contest is decided, at which point we fire a callback for that

interaction, and it is longer on hold.

Public Methods

void InteractionTracker (HeldInteractionCallback callback)

Defined at line 29 of file ../../src/ui/a11y/lib/gesture_manager/arena_v2/gesture_arena_v2.cc

void Reset ()

Resets the current contest's consumption status; should be called after a

contest ends.

Defined at line 34 of file ../../src/ui/a11y/lib/gesture_manager/arena_v2/gesture_arena_v2.cc

void AcceptInteractions ()

Set the consumption status to "accept", and notify all interactions that

were on hold.

Defined at line 42 of file ../../src/ui/a11y/lib/gesture_manager/arena_v2/gesture_arena_v2.cc

void RejectInteractions ()

Set the consumption status to "reject", and notify all interactions that

were on hold.

Defined at line 48 of file ../../src/ui/a11y/lib/gesture_manager/arena_v2/gesture_arena_v2.cc

bool OnEvent (const fuchsia::ui::pointer::augment::TouchEventWithLocalHit & event)

Handle a new touch event, keeping track of which interactions are "open" or

"on hold".

Return `true` if this event is "valid". That is, either:

* it is an ADD event, or

* it is an event for a currently open interaction.

It's possible to receive "stale" (not valid) events for rejected

interactions from past contests, because of the batching done in the

TouchSource API.

Defined at line 59 of file ../../src/ui/a11y/lib/gesture_manager/arena_v2/gesture_arena_v2.cc

ConsumptionStatus Status ()

What is the consumption status of the current contest?

Defined at line 100 of file ../../src/ui/a11y/lib/gesture_manager/arena_v2/gesture_arena_v2.cc

bool HasOpenInteractions ()

Are there any open interactions?

Defined at line 102 of file ../../src/ui/a11y/lib/gesture_manager/arena_v2/gesture_arena_v2.cc

Enumerations

enum ConsumptionStatus
Name Value
kUndecided 0
kAccept 1
kReject 2

The "decision status" of the current contest. If it's certain there will

eventually be a winner, the status is "accept". If all recognizers dropped

out, the status is "reject".

Defined at line 46 of file ../../src/ui/a11y/lib/gesture_manager/arena_v2/gesture_arena_v2.h