source: filezilla/trunk/fuentes/src/dbus/dbushandler.h @ 130

Last change on this file since 130 was 130, checked in by jrpelegrina, 4 years ago

First release to xenial

File size: 1015 bytes
Line 
1#ifndef DBUSHANDLER_HEADER
2#define DBUSHANDLER_HEADER
3
4#include <wx/wx.h>
5
6#include <vector>
7
8class wxDBusConnection;
9class wxDBusConnectionEvent;
10class wxDBusMessage;
11
12class CDBusHandlerInterface
13{
14public:
15        virtual bool HandleReply(wxDBusMessage&) = 0;
16        virtual bool HandleSignal(wxDBusMessage&) = 0;
17};
18
19class CDBusHandler : public wxEvtHandler
20{
21private:
22        CDBusHandler();
23        virtual ~CDBusHandler();
24
25public:
26        bool ConfirmEndSession();
27        bool Unregister();
28
29        bool SendEvent(bool query, bool* veto = 0);
30
31        wxDBusConnection* Conn() { return m_pConnection; }
32
33        static CDBusHandler* AddRef(CDBusHandlerInterface* interface);
34        static void Unref(CDBusHandlerInterface* interface);
35
36        bool Debug() const { return m_debug; }
37
38private:
39        static int s_refCount;
40        static CDBusHandler* s_handler;
41        wxDBusConnection* m_pConnection;
42        bool m_debug;
43
44        std::vector<CDBusHandlerInterface*> m_interfaces;
45
46        DECLARE_EVENT_TABLE()
47        void OnSignal(wxDBusConnectionEvent& event);
48        void OnAsyncReply(wxDBusConnectionEvent& event);
49};
50
51#endif
Note: See TracBrowser for help on using the repository browser.