2
* Copyright (C) 2016 Canonical, Ltd.
4
* This program is free software: you can redistribute it and/or modify it under
5
* the terms of the GNU Lesser General Public License version 3, as published by
6
* the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but WITHOUT
9
* ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10
* SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
* Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
#ifndef MOCK_MIR_SHELL_SHELL_H
18
#define MOCK_MIR_SHELL_SHELL_H
20
#include <mir/shell/shell.h>
22
#include <mir/scene/prompt_session_creation_parameters.h>
23
#include <mir/scene/surface_creation_parameters.h>
24
#include <mir/shell/surface_specification.h>
26
#include <gmock/gmock.h>
31
class MockShell : public Shell
35
// From mir::shell::Shell
37
MOCK_METHOD3(open_session, std::shared_ptr<scene::Session>(
39
std::string const& name,
40
std::shared_ptr<frontend::EventSink> const& sink));
42
MOCK_METHOD1(close_session, void(std::shared_ptr<scene::Session> const& session));
44
MOCK_METHOD2(start_prompt_session_for, std::shared_ptr<scene::PromptSession>(
45
std::shared_ptr<scene::Session> const& session,
46
scene::PromptSessionCreationParameters const& params));
48
MOCK_METHOD2(add_prompt_provider_for, void (
49
std::shared_ptr<scene::PromptSession> const& prompt_session,
50
std::shared_ptr<scene::Session> const& session));
52
MOCK_METHOD1(stop_prompt_session, void (std::shared_ptr<scene::PromptSession> const& prompt_session));
54
MOCK_METHOD3(create_surface, frontend::SurfaceId (
55
std::shared_ptr<scene::Session> const& session,
56
scene::SurfaceCreationParameters const& params,
57
std::shared_ptr<frontend::EventSink> const& sink));
59
MOCK_METHOD3(modify_surface, void (
60
std::shared_ptr<scene::Session> const& session,
61
std::shared_ptr<scene::Surface> const& surface,
62
shell::SurfaceSpecification const& modifications));
64
MOCK_METHOD2(destroy_surface, void (std::shared_ptr<scene::Session> const& session, frontend::SurfaceId surface));
66
MOCK_METHOD4(set_surface_attribute, int (
67
std::shared_ptr<scene::Session> const& session,
68
std::shared_ptr<scene::Surface> const& surface,
69
MirSurfaceAttrib attrib,
72
MOCK_METHOD2(get_surface_attribute, int (
73
std::shared_ptr<scene::Surface> const& surface,
74
MirSurfaceAttrib attrib));
76
MOCK_METHOD3(raise_surface, void (
77
std::shared_ptr<scene::Session> const& session,
78
std::shared_ptr<scene::Surface> const& surface,
81
// From mir::shell::FocusController
83
MOCK_METHOD0(focus_next_session, void ());
85
MOCK_CONST_METHOD0(focused_session, std::shared_ptr<scene::Session>());
87
MOCK_METHOD2(set_focus_to, void (
88
std::shared_ptr<scene::Session> const& focus_session,
89
std::shared_ptr<scene::Surface> const& focus_surface));
91
MOCK_CONST_METHOD0(focused_surface, std::shared_ptr<scene::Surface>());
93
MOCK_CONST_METHOD1(surface_at, std::shared_ptr<scene::Surface> (geometry::Point cursor));
95
MOCK_METHOD1(raise, void (SurfaceSet const& surfaces));
97
// From mir::input::EventFilter
99
MOCK_METHOD1(handle, bool (MirEvent const& event));
101
// From mir::compositor::DisplayListener
103
MOCK_METHOD1(add_display, void (geometry::Rectangle const& area));
105
MOCK_METHOD1(remove_display, void (geometry::Rectangle const& area));
111
#endif // MOCK_MIR_SHELL_SHELL_H