~unity-team/unity/libunity-7.0-breakage

3008.146.1 by Marco Trevisan (Treviño)
SessionManager: first skeleton implementation
1
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2
/*
3
* Copyright (C) 2013 Canonical Ltd
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 3 as
7
* published by the Free Software Foundation.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
*
17
* Authored by: Marco Trevisan (Treviño) <marco@ubuntu.com>
18
*/
19
20
#ifndef UNITY_GNOME_SESSION_MANAGER_IMPL_H
21
#define UNITY_GNOME_SESSION_MANAGER_IMPL_H
22
23
#include "GnomeSessionManager.h"
3008.146.2 by Marco Trevisan (Treviño)
SessionManager: add UPower and GnomeSession proxies, implement some method calls
24
#include "GLibDBusProxy.h"
3008.146.25 by Marco Trevisan (Treviño)
GnomeSessionManager: use glib::GDBusServer
25
#include "GLibDBusServer.h"
3008.146.1 by Marco Trevisan (Treviño)
SessionManager: first skeleton implementation
26
3008.146.2 by Marco Trevisan (Treviño)
SessionManager: add UPower and GnomeSession proxies, implement some method calls
27
namespace unity
28
{
3008.146.1 by Marco Trevisan (Treviño)
SessionManager: first skeleton implementation
29
namespace session
30
{
31
3008.146.12 by Marco Trevisan (Treviño)
GnomeManager: correctly handle the reboot and shutdown when requested by the Shell
32
namespace shell
33
{
34
  enum class Action : unsigned
35
  {
36
    LOGOUT = 0,
37
    SHUTDOWN,
38
    REBOOT,
39
    NONE
40
  };
41
}
42
3008.146.1 by Marco Trevisan (Treviño)
SessionManager: first skeleton implementation
43
struct GnomeManager::Impl
44
{
3008.146.29 by Marco Trevisan (Treviño)
GnomeManager: add TestMode support
45
  Impl(GnomeManager* parent, bool test_mode = false);
3008.146.3 by Marco Trevisan (Treviño)
GnomeSessionManager: implement an "org.gnome.Shell" server to catch the session events
46
  ~Impl();
3008.146.2 by Marco Trevisan (Treviño)
SessionManager: add UPower and GnomeSession proxies, implement some method calls
47
3008.146.21 by Marco Trevisan (Treviño)
SessionManager: Make public implementation simpler, just do all the tricks in the Impl
48
  void ConfirmLogout();
49
  void ConfirmReboot();
50
  void ConfirmShutdown();
51
  void CancelAction();
52
  void ClosedDialog();
3008.146.27 by Marco Trevisan (Treviño)
GnomeManager: adding EnsureCancelPendingAction utility function
53
  void EnsureCancelPendingAction();
3008.146.21 by Marco Trevisan (Treviño)
SessionManager: Make public implementation simpler, just do all the tricks in the Impl
54
3008.146.25 by Marco Trevisan (Treviño)
GnomeSessionManager: use glib::GDBusServer
55
  GVariant* OnShellMethodCall(std::string const& method, GVariant* parameters);
3008.146.23 by Marco Trevisan (Treviño)
GnomeSessionManager: don't keep the proxies opened, just create them when needed
56
  void CallGnomeSessionMethod(std::string const& method, GVariant* parameters = nullptr,
57
                              glib::DBusProxy::CallFinishedCallback const& cb = nullptr);
58
  void CallUPowerMethod(std::string const& method, glib::DBusProxy::ReplyCallback const& cb = nullptr);
3008.181.4 by Martin Pitt
Rework logind → ConsoleKit/upower fallback
59
  void CallLogindMethod(std::string const& method, GVariant* parameters = nullptr, glib::DBusProxy::CallFinishedCallback const& cb = nullptr);
3008.146.23 by Marco Trevisan (Treviño)
GnomeSessionManager: don't keep the proxies opened, just create them when needed
60
  void CallConsoleKitMethod(std::string const& method, GVariant* parameters = nullptr);
3008.146.45 by Marco Trevisan (Treviño)
GnomeSessionManager: check if we are in interactive mode or not
61
  bool InteractiveMode();
3008.146.23 by Marco Trevisan (Treviño)
GnomeSessionManager: don't keep the proxies opened, just create them when needed
62
3008.146.5 by Marco Trevisan (Treviño)
GnomeSessionManager: emit signals when the relative shell methods are called
63
  GnomeManager* manager_;
3008.146.29 by Marco Trevisan (Treviño)
GnomeManager: add TestMode support
64
  bool test_mode_;
3008.146.2 by Marco Trevisan (Treviño)
SessionManager: add UPower and GnomeSession proxies, implement some method calls
65
  bool can_shutdown_;
66
  bool can_suspend_;
67
  bool can_hibernate_;
68
3008.146.12 by Marco Trevisan (Treviño)
GnomeManager: correctly handle the reboot and shutdown when requested by the Shell
69
  shell::Action pending_action_;
3008.146.25 by Marco Trevisan (Treviño)
GnomeSessionManager: use glib::GDBusServer
70
  glib::DBusServer shell_server_;
71
  glib::DBusObject::Ptr shell_object_;
3008.146.1 by Marco Trevisan (Treviño)
SessionManager: first skeleton implementation
72
};
73
74
} // namespace session
3008.146.2 by Marco Trevisan (Treviño)
SessionManager: add UPower and GnomeSession proxies, implement some method calls
75
} // namespace unity
3008.146.1 by Marco Trevisan (Treviño)
SessionManager: first skeleton implementation
76
3008.146.7 by Marco Trevisan (Treviño)
SessionManager: use default constructor
77
#endif //UNITY_GNOME_SESSION_MANAGER_IMPL_H