Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
host_window_dialog.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_SHELL_PLATFORM_WINDOWS_HOST_WINDOW_DIALOG_H_
6#define FLUTTER_SHELL_PLATFORM_WINDOWS_HOST_WINDOW_DIALOG_H_
7
8#include <optional>
9
10#include "host_window_sized.h"
11
12namespace flutter {
14 public:
15 // Creates a dialog window.
16 //
17 // If |owner_window| is not null, the dialog will be modal to the owner.
18 // This also affects the dialog window's styling.
19 //
20 // If |sized_to_content| is true, the window is initially sized to the
21 // minimum of |constraints| and will automatically resize to its rendered
22 // content after each frame. If |resizable| is false, the window will
23 // continue to track content size and its resize border is removed.
24 // If |resizable| is true, the user may resize the window after the initial
25 // content-based sizing.
26 //
27 // If |sized_to_content| is false, the window is created with the size
28 // specified in |preferred_size|.
29 HostWindowDialog(WindowManager* window_manager,
31 const WindowSizeRequest& preferred_size,
32 const BoxConstraints& constraints,
33 LPCWSTR title,
34 std::optional<HWND> const& owner_window,
35 bool sized_to_content,
36 bool resizable);
37
38 void SetFullscreen(bool fullscreen,
39 std::optional<FlutterEngineDisplayId> display_id) override;
40 bool GetFullscreen() const override;
41
42 protected:
43 LRESULT HandleMessage(HWND hwnd,
45 WPARAM wparam,
46 LPARAM lparam) override;
47
48 private:
49 // Enforces modal behavior. This favors enabling most recently created
50 // modal window higest up in the window hierarchy.
51 void UpdateModalState();
52
53 static DWORD GetWindowStyleForDialog(std::optional<HWND> const& owner_window,
54 bool resizable);
55 static DWORD GetExtendedWindowStyleForDialog(
56 std::optional<HWND> const& owner_window);
57 static Rect GetInitialRect(FlutterWindowsEngine* engine,
58 const WindowSizeRequest& preferred_size,
59 const BoxConstraints& constraints,
60 std::optional<HWND> const& owner_window,
61 bool sized_to_content,
62 bool resizable);
63};
64} // namespace flutter
65
66#endif // FLUTTER_SHELL_PLATFORM_WINDOWS_HOST_WINDOW_DIALOG_H_
bool GetFullscreen() const override
void SetFullscreen(bool fullscreen, std::optional< FlutterEngineDisplayId > display_id) override
LRESULT HandleMessage(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) override
FlutterEngine engine
Definition main.cc:84
const char * message
LONG_PTR LRESULT
unsigned int UINT
LONG_PTR LPARAM
UINT_PTR WPARAM
unsigned long DWORD