Flutter Engine
flutter::testing::MockWin32Window Class Reference

Mock for the |WindowWin32| base class. More...

#include <mock_window_win32.h>

Inheritance diagram for flutter::testing::MockWin32Window:
flutter::WindowWin32 flutter::testing::MockMessageQueue

Public Member Functions

 MockWin32Window ()
 
virtual ~MockWin32Window ()
 
 MockWin32Window (MockWin32Window const &)=delete
 
MockWin32Windowoperator= (MockWin32Window const &)=delete
 
UINT GetDpi ()
 
LRESULT InjectWindowMessage (UINT const message, WPARAM const wparam, LPARAM const lparam)
 
 MOCK_METHOD1 (OnDpiScale, void(unsigned int))
 
 MOCK_METHOD2 (OnResize, void(unsigned int, unsigned int))
 
 MOCK_METHOD4 (OnPointerMove, void(double, double, FlutterPointerDeviceKind, int32_t))
 
 MOCK_METHOD5 (OnPointerDown, void(double, double, FlutterPointerDeviceKind, int32_t, UINT))
 
 MOCK_METHOD5 (OnPointerUp, void(double, double, FlutterPointerDeviceKind, int32_t, UINT))
 
 MOCK_METHOD2 (OnPointerLeave, void(FlutterPointerDeviceKind, int32_t))
 
 MOCK_METHOD0 (OnSetCursor, void())
 
 MOCK_METHOD1 (OnText, void(const std::u16string &))
 
 MOCK_METHOD6 (OnKey, bool(int, int, int, char32_t, bool, bool))
 
 MOCK_METHOD4 (OnScroll, void(double, double, FlutterPointerDeviceKind, int32_t))
 
 MOCK_METHOD0 (OnComposeBegin, void())
 
 MOCK_METHOD0 (OnComposeCommit, void())
 
 MOCK_METHOD0 (OnComposeEnd, void())
 
 MOCK_METHOD2 (OnComposeChange, void(const std::u16string &, int))
 
- Public Member Functions inherited from flutter::WindowWin32
 WindowWin32 ()
 
virtual ~WindowWin32 ()
 
void InitializeChild (const char *title, unsigned int width, unsigned int height)
 
HWND GetWindowHandle ()
 
- Public Member Functions inherited from flutter::testing::MockMessageQueue
void InjectMessageList (int count, const Win32Message *messages)
 
BOOL Win32PeekMessage (LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg)
 

Protected Member Functions

LRESULT Win32DefWindowProc (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 
LRESULT Win32SendMessage (HWND hWnd, UINT const message, WPARAM const wparam, LPARAM const lparam) override
 
- Protected Member Functions inherited from flutter::WindowWin32
std::wstring NarrowToWide (const char *source)
 
WNDCLASS RegisterWindowClass (std::wstring &title)
 
LRESULT HandleMessage (UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept
 
LRESULT HandleDpiChange (HWND hWnd, WPARAM wParam, LPARAM lParam, bool top_level)
 
virtual void OnDpiScale (UINT dpi)=0
 
virtual void OnResize (UINT width, UINT height)=0
 
virtual void OnPointerMove (double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id)=0
 
virtual void OnPointerDown (double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, UINT button)=0
 
virtual void OnPointerUp (double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, UINT button)=0
 
virtual void OnPointerLeave (FlutterPointerDeviceKind device_kind, int32_t device_id)=0
 
virtual void OnSetCursor ()=0
 
virtual void OnText (const std::u16string &text)=0
 
virtual bool OnKey (int key, int scancode, int action, char32_t character, bool extended, bool was_down)=0
 
virtual void OnComposeBegin ()=0
 
virtual void OnComposeCommit ()=0
 
virtual void OnComposeEnd ()=0
 
virtual void OnComposeChange (const std::u16string &text, int cursor_pos)=0
 
void OnImeSetContext (UINT const message, WPARAM const wparam, LPARAM const lparam)
 
void OnImeStartComposition (UINT const message, WPARAM const wparam, LPARAM const lparam)
 
void OnImeComposition (UINT const message, WPARAM const wparam, LPARAM const lparam)
 
void OnImeEndComposition (UINT const message, WPARAM const wparam, LPARAM const lparam)
 
void OnImeRequest (UINT const message, WPARAM const wparam, LPARAM const lparam)
 
virtual void AbortImeComposing ()
 
virtual void UpdateCursorRect (const Rect &rect)
 
virtual void OnScroll (double delta_x, double delta_y, FlutterPointerDeviceKind device_kind, int32_t device_id)=0
 
UINT GetCurrentDPI ()
 
UINT GetCurrentWidth ()
 
UINT GetCurrentHeight ()
 
virtual BOOL Win32PeekMessage (LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg)
 
virtual uint32_t Win32MapVkToChar (uint32_t virtual_key)
 

Additional Inherited Members

- Static Protected Member Functions inherited from flutter::WindowWin32
static LRESULT CALLBACK WndProc (HWND const window, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept
 
- Protected Attributes inherited from flutter::testing::MockMessageQueue
std::list< Win32Message_pending_messages
 

Detailed Description

Mock for the |WindowWin32| base class.

Definition at line 18 of file mock_window_win32.h.

Constructor & Destructor Documentation

◆ MockWin32Window() [1/2]

flutter::testing::MockWin32Window::MockWin32Window ( )

Definition at line 10 of file mock_window_win32.cc.

References ~MockWin32Window().

◆ ~MockWin32Window()

flutter::testing::MockWin32Window::~MockWin32Window ( )
virtualdefault

Referenced by MockWin32Window().

◆ MockWin32Window() [2/2]

flutter::testing::MockWin32Window::MockWin32Window ( MockWin32Window const &  )
delete

Member Function Documentation

◆ GetDpi()

UINT flutter::testing::MockWin32Window::GetDpi ( )

Definition at line 14 of file mock_window_win32.cc.

References flutter::WindowWin32::GetCurrentDPI().

Referenced by flutter::testing::TEST().

14  {
15  return GetCurrentDPI();
16 }

◆ InjectWindowMessage()

LRESULT flutter::testing::MockWin32Window::InjectWindowMessage ( UINT const  message,
WPARAM const  wparam,
LPARAM const  lparam 
)

Definition at line 25 of file mock_window_win32.cc.

References flutter::WindowWin32::HandleMessage().

Referenced by flutter::testing::TEST().

27  {
28  return HandleMessage(message, wparam, lparam);
29 }
LRESULT HandleMessage(UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept

◆ MOCK_METHOD0() [1/4]

flutter::testing::MockWin32Window::MOCK_METHOD0 ( OnSetCursor  ,
void()   
)

◆ MOCK_METHOD0() [2/4]

flutter::testing::MockWin32Window::MOCK_METHOD0 ( OnComposeBegin  ,
void()   
)

◆ MOCK_METHOD0() [3/4]

flutter::testing::MockWin32Window::MOCK_METHOD0 ( OnComposeCommit  ,
void()   
)

◆ MOCK_METHOD0() [4/4]

flutter::testing::MockWin32Window::MOCK_METHOD0 ( OnComposeEnd  ,
void()   
)

◆ MOCK_METHOD1() [1/2]

flutter::testing::MockWin32Window::MOCK_METHOD1 ( OnDpiScale  ,
void(unsigned int)   
)

◆ MOCK_METHOD1() [2/2]

flutter::testing::MockWin32Window::MOCK_METHOD1 ( OnText  ,
void(const std::u16string &)   
)

◆ MOCK_METHOD2() [1/3]

flutter::testing::MockWin32Window::MOCK_METHOD2 ( OnResize  ,
void(unsigned int, unsigned int)   
)

◆ MOCK_METHOD2() [2/3]

flutter::testing::MockWin32Window::MOCK_METHOD2 ( OnPointerLeave  ,
void(FlutterPointerDeviceKind, int32_t)   
)

◆ MOCK_METHOD2() [3/3]

flutter::testing::MockWin32Window::MOCK_METHOD2 ( OnComposeChange  ,
void(const std::u16string &, int)   
)

◆ MOCK_METHOD4() [1/2]

flutter::testing::MockWin32Window::MOCK_METHOD4 ( OnPointerMove  ,
void(double, double, FlutterPointerDeviceKind, int32_t)   
)

◆ MOCK_METHOD4() [2/2]

flutter::testing::MockWin32Window::MOCK_METHOD4 ( OnScroll  ,
void(double, double, FlutterPointerDeviceKind, int32_t)   
)

◆ MOCK_METHOD5() [1/2]

flutter::testing::MockWin32Window::MOCK_METHOD5 ( OnPointerDown  ,
void(double, double, FlutterPointerDeviceKind, int32_t, UINT  
)

◆ MOCK_METHOD5() [2/2]

flutter::testing::MockWin32Window::MOCK_METHOD5 ( OnPointerUp  ,
void(double, double, FlutterPointerDeviceKind, int32_t, UINT  
)

◆ MOCK_METHOD6()

flutter::testing::MockWin32Window::MOCK_METHOD6 ( OnKey  ,
bool(int, int, int, char32_t, bool, bool)   
)

◆ operator=()

MockWin32Window& flutter::testing::MockWin32Window::operator= ( MockWin32Window const &  )
delete

◆ Win32DefWindowProc()

LRESULT flutter::testing::MockWin32Window::Win32DefWindowProc ( HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)
protectedvirtual

Reimplemented from flutter::WindowWin32.

Definition at line 18 of file mock_window_win32.cc.

References flutter::testing::kWmResultDefault.

21  {
22  return kWmResultDefault;
23 }
constexpr LRESULT kWmResultDefault
Definition: wm_builders.h:16

◆ Win32SendMessage()

LRESULT flutter::testing::MockWin32Window::Win32SendMessage ( HWND  hWnd,
UINT const  message,
WPARAM const  wparam,
LPARAM const  lparam 
)
overrideprotectedvirtual

Implements flutter::testing::MockMessageQueue.

Definition at line 31 of file mock_window_win32.cc.

References flutter::WindowWin32::HandleMessage().

34  {
35  return HandleMessage(message, wparam, lparam);
36 }
LRESULT HandleMessage(UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept

The documentation for this class was generated from the following files: