summaryrefslogtreecommitdiffstats
path: root/src/Daemon/CommLayerServerDBus.h
blob: eda21964e40dc7a58ec9348397c41242d0d52685 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef COMMLAYERSERVERDBUS_H_
#define COMMLAYERSERVERDBUS_H_

#include <dbus-c++/dbus.h>
#include <dbus-c++/glib-integration.h>
#include "CommLayerServer.h"

class CCommLayerServerDBus
: public CCommLayerServer,
  public DBus::InterfaceAdaptor,
//  public DBus::IntrospectableAdaptor,
  public DBus::ObjectAdaptor
{
    private:
        DBus::Connection *m_pConn;
        static DBus::Connection *init_dbus(CCommLayerServerDBus *self);

    public:
        CCommLayerServerDBus();
        virtual ~CCommLayerServerDBus();

        /* DBus call handlers */
    private:
        DBus::Message _GetCrashInfos_stub(const DBus::CallMessage &call);
        DBus::Message _CreateReport_stub(const DBus::CallMessage &call);
        DBus::Message _Report_stub(const DBus::CallMessage &call);
        DBus::Message _DeleteDebugDump_stub(const DBus::CallMessage &call);
        DBus::Message _GetJobResult_stub(const DBus::CallMessage &call);
        DBus::Message _GetPluginsInfo_stub(const DBus::CallMessage &call);
        DBus::Message _GetPluginSettings_stub(const DBus::CallMessage &call);
        DBus::Message _SetPluginSettings_stub(const DBus::CallMessage &call);
        DBus::Message _RegisterPlugin_stub(const DBus::CallMessage &call);
        DBus::Message _UnRegisterPlugin_stub(const DBus::CallMessage &call);

        /* DBus signal senders */
    public:
        virtual void Crash(const std::string& progname, const std::string& uid);
        virtual void AnalyzeComplete(const map_crash_report_t& arg1);
        virtual void Error(const std::string& arg1);
        virtual void Update(const std::string& pMessage, uint64_t pJobID);
        //the job id should be enough in jobdone
        virtual void JobDone(const std::string& pDest, uint64_t pJobID);
        virtual void JobStarted(const std::string& pDest, uint64_t pJobID);
        virtual void Warning(const std::string& pMessage);
        virtual void Warning(const std::string& pMessage, uint64_t pJobID);
};

/*
 * This must be done before instances of CCommLayerServerDBus are created
 * (otherwise "new DBus::Connection(DBus::Connection::SystemBus())" fails)
 */
void attach_dbus_dispatcher_to_glib_main_context();

#endif