2
* Copyright 2014 Canonical Ltd.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 3, as published
6
* by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranties of
10
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11
* PURPOSE. See the GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License along
14
* with this program. If not, see <http://www.gnu.org/licenses/>.
17
* Charles Kerr <charles.kerr@canonical.com>
20
#ifndef INDICATOR_TRANSFER_EXPORTER_H
21
#define INDICATOR_TRANSFER_EXPORTER_H
23
#include <transfer/gactions.h>
24
#include <transfer/menu.h>
26
#include <core/signal.h>
28
#include <gio/gio.h> // GActionGroup
30
#include <memory> // std::shared_ptr
38
* \brief Exports actions and menus to DBus.
46
core::Signal<> name_lost;
48
void publish(const std::shared_ptr<GActions>& actions,
49
const std::vector<std::shared_ptr<Menu>>& menus);
52
static void on_bus_acquired(GDBusConnection*, const gchar* name, gpointer gthis);
53
void on_bus_acquired(GDBusConnection*, const gchar* name);
55
static void on_name_lost(GDBusConnection*, const gchar* name, gpointer gthis);
56
void on_name_lost(GDBusConnection*, const gchar* name);
58
std::set<guint> m_exported_menu_ids;
60
guint m_exported_actions_id = 0;
61
GDBusConnection * m_dbus_connection = nullptr;
62
std::shared_ptr<GActions> m_gactions;
63
std::vector<std::shared_ptr<Menu>> m_menus;
65
// we've got raw pointers and gsignal tags in here, so disable copying
66
Exporter(const Exporter&) =delete;
67
Exporter& operator=(const Exporter&) =delete;
70
} // namespace transfer
71
} // namespace indicator
74
#endif // INDICATOR_TRANSFER_EXPORTER_H