Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
mock_im_context.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_LINUX_TESTING_MOCK_IM_CONTEXT_H_
6#define FLUTTER_SHELL_PLATFORM_LINUX_TESTING_MOCK_IM_CONTEXT_H_
7
8#include <gtk/gtk.h>
9
10#include "gmock/gmock.h"
11
12namespace flutter {
13namespace testing {
14
16 public:
18
19 // This was an existing use of operator overloading. It's against our style
20 // guide but enabling clang tidy on header files is a higher priority than
21 // fixing this.
22 // NOLINTNEXTLINE(google-explicit-constructor)
23 operator GtkIMContext*();
24
26 gtk_im_context_set_client_window,
27 (GtkIMContext * context, GdkWindow* window));
29 gtk_im_context_get_preedit_string,
30 (GtkIMContext * context,
31 gchar** str,
32 PangoAttrList** attrs,
33 gint* cursor_pos));
34 MOCK_METHOD(gboolean,
35 gtk_im_context_filter_keypress,
36 (GtkIMContext * context, GdkEventKey* event));
37 MOCK_METHOD(gboolean, gtk_im_context_focus_in, (GtkIMContext * context));
38 MOCK_METHOD(void, gtk_im_context_focus_out, (GtkIMContext * context));
39 MOCK_METHOD(void, gtk_im_context_reset, (GtkIMContext * context));
41 gtk_im_context_set_cursor_location,
42 (GtkIMContext * context, GdkRectangle* area));
44 gtk_im_context_set_use_preedit,
45 (GtkIMContext * context, gboolean use_preedit));
47 void,
48 gtk_im_context_set_surrounding,
49 (GtkIMContext * context, const gchar* text, gint len, gint cursor_index));
50 MOCK_METHOD(gboolean,
51 gtk_im_context_get_surrounding,
52 (GtkIMContext * context, gchar** text, gint* cursor_index));
53
54 private:
55 GtkIMContext* instance_ = nullptr;
56};
57
58} // namespace testing
59} // namespace flutter
60
61#endif // FLUTTER_SHELL_PLATFORM_LINUX_TESTING_MOCK_IM_CONTEXT_H_
MOCK_METHOD(void, gtk_im_context_set_surrounding,(GtkIMContext *context, const gchar *text, gint len, gint cursor_index))
MOCK_METHOD(gboolean, gtk_im_context_filter_keypress,(GtkIMContext *context, GdkEventKey *event))
MOCK_METHOD(gboolean, gtk_im_context_focus_in,(GtkIMContext *context))
MOCK_METHOD(void, gtk_im_context_set_client_window,(GtkIMContext *context, GdkWindow *window))
MOCK_METHOD(void, gtk_im_context_reset,(GtkIMContext *context))
MOCK_METHOD(gboolean, gtk_im_context_get_surrounding,(GtkIMContext *context, gchar **text, gint *cursor_index))
MOCK_METHOD(void, gtk_im_context_get_preedit_string,(GtkIMContext *context, gchar **str, PangoAttrList **attrs, gint *cursor_pos))
MOCK_METHOD(void, gtk_im_context_set_cursor_location,(GtkIMContext *context, GdkRectangle *area))
MOCK_METHOD(void, gtk_im_context_set_use_preedit,(GtkIMContext *context, gboolean use_preedit))
MOCK_METHOD(void, gtk_im_context_focus_out,(GtkIMContext *context))
GLFWwindow * window
Definition main.cc:45
FlKeyEvent * event
std::u16string text