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
10namespace flutter {
11
12// Focus state of a View.
13// Must match ViewFocusState in ui/platform_dispatcher.dart.
14enum class ViewFocusState : int64_t {
15 kUnfocused = 0,
17};
18
19// Represents the direction of which the focus transitioned over
20// a FlutterView.
21// Must match ViewFocusDirection in ui/platform_dispatcher.dart.
22enum class ViewFocusDirection : int64_t {
23 kUndefined = 0,
26};
27
28// Event sent by the embedder to the engine indicating that native view focus
29// state has changed.
31 public:
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.
50 public:
54
55 int64_t view_id() const;
56 ViewFocusState state() const;
58
59 private:
60 ViewFocusChangeRequest() = delete;
61
62 int64_t view_id_ = 0;
65};
66
67} // namespace flutter
68
69#endif // FLUTTER_LIB_UI_WINDOW_VIEW_FOCUS_H_
ViewFocusState state() const
Definition view_focus.cc:16
ViewFocusDirection direction() const
Definition view_focus.cc:19
ViewFocusEvent(int64_t view_id, ViewFocusState state, ViewFocusDirection direction)
Definition view_focus.h:32
int64_t view_id() const
Definition view_focus.h:37
ViewFocusDirection direction() const
Definition view_focus.h:39
ViewFocusState state() const
Definition view_focus.h:38
ViewFocusDirection
Definition view_focus.h:22