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
00040 class ObjectPathHandler: public MessageHandler
00041 {
00042 protected:
00043 ObjectPathHandler(const std::string& path, PrimaryFallback pf);
00044
00045 public:
00046
00047 typedef DBusCxxPointer<ObjectPathHandler> pointer;
00048
00049 typedef DBusCxxWeakPointer<ObjectPathHandler> weak_pointer;
00050
00051 static pointer create(const std::string& path, PrimaryFallback pf=PRIMARY);
00052
00053 virtual ~ObjectPathHandler();
00054
00056 const Path& path() const;
00057
00059 PrimaryFallback is_primary_or_fallback();
00060
00062 DBusCxxPointer<Connection> connection() const;
00063
00065 virtual bool register_with_connection(DBusCxxPointer<Connection> conn);
00066
00068 bool unregister(DBusCxxPointer<Connection> conn);
00069
00071 sigc::signal<void,DBusCxxPointer<Connection> >& signal_registered();
00072
00076 sigc::signal<void,DBusCxxPointer<Connection> >& signal_unregistered();
00077
00078 protected:
00079
00080 DBusCxxPointer<Connection> m_connection;
00081
00082 Path m_path;
00083
00084 PrimaryFallback m_primary_fallback;
00085
00086 sigc::signal<void,DBusCxxPointer<Connection> > m_signal_registered;
00087
00088 sigc::signal<void,DBusCxxPointer<Connection> > m_signal_unregistered;
00089
00090 static struct DBusObjectPathVTable m_dbus_vtable;
00091
00092 static DBusHandlerResult message_handler_callback(DBusConnection* connection, DBusMessage* message, void* user_data);
00093
00094 static void path_unregister_callback(DBusConnection* connection, void* user_data);
00095
00096 };
00097
00098 }
00099
00100 #endif