Flutter Windows Embedder
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 "host_window.h"
9 
10 namespace flutter {
11 class HostWindowDialog : public HostWindow {
12  public:
13  // Creates a dialog window.
14  //
15  // If |owner_window| is not null, the dialog will be modal to the owner.
16  // This also affects the dialog window's styling.
17  HostWindowDialog(WindowManager* window_manager,
18  FlutterWindowsEngine* engine,
19  const WindowSizeRequest& preferred_size,
20  const BoxConstraints& constraints,
21  LPCWSTR title,
22  std::optional<HWND> const& owner_window);
23 
24  void SetFullscreen(bool fullscreen,
25  std::optional<FlutterEngineDisplayId> display_id) override;
26  bool GetFullscreen() const override;
27 
28  protected:
29  LRESULT HandleMessage(HWND hwnd,
30  UINT message,
31  WPARAM wparam,
32  LPARAM lparam) override;
33 
34  private:
35  // Enforces modal behavior. This favors enabling most recently created
36  // modal window higest up in the window hierarchy.
37  void UpdateModalState();
38 
39  static Rect GetInitialRect(FlutterWindowsEngine* engine,
40  const WindowSizeRequest& preferred_size,
41  const BoxConstraints& constraints,
42  std::optional<HWND> const& owner_window);
43 };
44 } // namespace flutter
45 
46 #endif // FLUTTER_SHELL_PLATFORM_WINDOWS_HOST_WINDOW_DIALOG_H_
HostWindowDialog(WindowManager *window_manager, FlutterWindowsEngine *engine, const WindowSizeRequest &preferred_size, const BoxConstraints &constraints, LPCWSTR title, std::optional< HWND > const &owner_window)
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
Win32Message message