2
* Copyright 2013 Canonical Ltd.
5
* Charles Kerr <charles.kerr@canonical.com>
7
* This program is free software: you can redistribute it and/or modify it
8
* under the terms of the GNU General Public License version 3, as published
9
* by the Free Software Foundation.
11
* This program is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranties of
13
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
14
* PURPOSE. See the GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License along
17
* with this program. If not, see <http://www.gnu.org/licenses/>.
20
#ifndef MOCK_CONSOLEKIT_MANAGER_H
21
#define MOCK_CONSOLEKIT_MANAGER_H
25
#include "mock-object.h"
26
#include "backend-dbus/dbus-consolekit-manager.h"
28
class MockConsoleKitSession;
29
class MockConsoleKitSeat;
31
class MockConsoleKitManager: public MockObject
35
MockConsoleKitManager (GMainLoop * loop,
36
GDBusConnection * bus_connection);
37
virtual ~MockConsoleKitManager ();
39
void add_seat (MockConsoleKitSeat * seat);
41
MockConsoleKitSession * current_session ();
45
enum Action { None, Shutdown, Restart };
47
Action last_action () const { return my_last_action; }
49
void clear_last_action () { my_last_action = None; }
53
typedef std::set<MockConsoleKitSeat*> seats_t;
56
ConsoleKitManager * my_skeleton;
58
std::string my_current_ssid;
60
Action my_last_action;
62
static gboolean on_get_current_session (ConsoleKitManager *,
63
GDBusMethodInvocation *,
65
static gboolean on_get_seats (ConsoleKitManager *,
66
GDBusMethodInvocation *,
68
static gboolean handle_restart (ConsoleKitManager *,
69
GDBusMethodInvocation *,
71
static gboolean handle_stop (ConsoleKitManager *,
72
GDBusMethodInvocation *,
77
#endif // #ifndef MOCK_CONSOLEKIT_MANAGER_H