Flutter Engine
Loading...
Searching...
No Matches
view_focus.h
Go to the documentation of this file.
1
// Copyright 2013 The Flutter 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 FLUTTER_LIB_UI_WINDOW_VIEW_FOCUS_H_
6
#define FLUTTER_LIB_UI_WINDOW_VIEW_FOCUS_H_
7
8
#include <cstdint>
9
10
namespace
flutter
{
11
12
// Focus state of a View.
13
// Must match ViewFocusState in ui/platform_dispatcher.dart.
14
enum class
ViewFocusState
: int64_t {
15
kUnfocused
= 0,
16
kFocused
,
17
};
18
19
// Represents the direction of which the focus transitioned over
20
// a FlutterView.
21
// Must match ViewFocusDirection in ui/platform_dispatcher.dart.
22
enum class
ViewFocusDirection
: int64_t {
23
kUndefined
= 0,
24
kForward
,
25
kBackward
,
26
};
27
28
// Event sent by the embedder to the engine indicating that native view focus
29
// state has changed.
30
class
ViewFocusEvent
{
31
public
:
32
ViewFocusEvent
(int64_t
view_id
,
33
ViewFocusState
state
,
34
ViewFocusDirection
direction
)
35
: view_id_(
view_id
), state_(
state
), direction_(
direction
) {}
36
37
int64_t
view_id
()
const
{
return
view_id_; }
38
ViewFocusState
state
()
const
{
return
state_; }
39
ViewFocusDirection
direction
()
const
{
return
direction_; }
40
41
private
:
42
int64_t view_id_;
43
ViewFocusState
state_;
44
ViewFocusDirection
direction_;
45
};
46
47
// Request sent by the engine to the embedder indicating that the FlutterView
48
// focus state has changed and the native view should be updated.
49
class
ViewFocusChangeRequest
{
50
public
:
51
ViewFocusChangeRequest
(int64_t
view_id
,
52
ViewFocusState
state
,
53
ViewFocusDirection
direction
);
54
55
int64_t
view_id
()
const
;
56
ViewFocusState
state
()
const
;
57
ViewFocusDirection
direction
()
const
;
58
59
private
:
60
ViewFocusChangeRequest
() =
delete
;
61
62
int64_t view_id_ = 0;
63
ViewFocusState
state_ =
ViewFocusState::kUnfocused
;
64
ViewFocusDirection
direction_ =
ViewFocusDirection::kUndefined
;
65
};
66
67
}
// namespace flutter
68
69
#endif
// FLUTTER_LIB_UI_WINDOW_VIEW_FOCUS_H_
flutter::ViewFocusChangeRequest
Definition
view_focus.h:49
flutter::ViewFocusChangeRequest::state
ViewFocusState state() const
Definition
view_focus.cc:16
flutter::ViewFocusChangeRequest::direction
ViewFocusDirection direction() const
Definition
view_focus.cc:19
flutter::ViewFocusChangeRequest::view_id
int64_t view_id() const
Definition
view_focus.cc:13
flutter::ViewFocusEvent
Definition
view_focus.h:30
flutter::ViewFocusEvent::ViewFocusEvent
ViewFocusEvent(int64_t view_id, ViewFocusState state, ViewFocusDirection direction)
Definition
view_focus.h:32
flutter::ViewFocusEvent::view_id
int64_t view_id() const
Definition
view_focus.h:37
flutter::ViewFocusEvent::direction
ViewFocusDirection direction() const
Definition
view_focus.h:39
flutter::ViewFocusEvent::state
ViewFocusState state() const
Definition
view_focus.h:38
flutter
Definition
asset_manager.cc:10
flutter::ViewFocusState
ViewFocusState
Definition
view_focus.h:14
flutter::ViewFocusState::kFocused
@ kFocused
flutter::ViewFocusState::kUnfocused
@ kUnfocused
flutter::ViewFocusDirection
ViewFocusDirection
Definition
view_focus.h:22
flutter::ViewFocusDirection::kBackward
@ kBackward
flutter::ViewFocusDirection::kUndefined
@ kUndefined
flutter::ViewFocusDirection::kForward
@ kForward
lib
ui
window
view_focus.h
Generated on Wed Nov 5 2025 21:33:14 for Flutter Engine by
1.9.8