objectpathhandler.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef DBUSOBJECTPATHHANDLER_H
00020 #define DBUSOBJECTPATHHANDLER_H
00021
00022 #include <dbus-cxx/messagehandler.h>
00023
00024 namespace DBus
00025 {
00026
00027 class Connection;
00028
00037 class ObjectPathHandler: public MessageHandler
00038 {
00039 protected:
00040 ObjectPathHandler(const std::string& path, PrimaryFallback pf);
00041
00042 public:
00043
00044 typedef DBusCxxPointer<ObjectPathHandler> pointer;
00045
00046 typedef DBusCxxWeakPointer<ObjectPathHandler> weak_pointer;
00047
00048 static pointer create(const std::string& path, PrimaryFallback pf=PRIMARY);
00049
00050 ~ObjectPathHandler();
00051
00053 const std::string& path();
00054
00056 PrimaryFallback is_primary_or_fallback();
00057
00059 DBusCxxPointer<Connection> connection() const;
00060
00062 virtual bool register_with_connection(DBusCxxPointer<Connection> conn);
00063
00065 bool unregister(DBusCxxPointer<Connection> conn);
00066
00068 sigc::signal<void,DBusCxxPointer<Connection> >& signal_registered();
00069
00073 sigc::signal<void,DBusCxxPointer<Connection> >& signal_unregistered();
00074
00075 protected:
00076
00077 DBusCxxPointer<Connection> m_connection;
00078
00079 std::string m_path;
00080
00081 PrimaryFallback m_primary_fallback;
00082
00083 sigc::signal<void,DBusCxxPointer<Connection> > m_signal_registered;
00084
00085 sigc::signal<void,DBusCxxPointer<Connection> > m_signal_unregistered;
00086
00087 static struct DBusObjectPathVTable m_dbus_vtable;
00088
00089 static DBusHandlerResult message_handler_callback(DBusConnection* connection, DBusMessage* message, void* user_data);
00090
00091 static void path_unregister_callback(DBusConnection* connection, void* user_data);
00092
00093 };
00094
00095 }
00096
00097 #endif