00001 /*************************************************************************** 00002 * Copyright (C) 2007,2008,2009 by Rick L. Vinyard, Jr. * 00003 * rvinyard@cs.nmsu.edu * 00004 * * 00005 * This file is part of the dbus-cxx library. * 00006 * * 00007 * The dbus-cxx library is free software; you can redistribute it and/or * 00008 * modify it under the terms of the GNU General Public License * 00009 * version 3 as published by the Free Software Foundation. * 00010 * * 00011 * The dbus-cxx library is distributed in the hope that it will be * 00012 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * 00013 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00014 * General Public License for more details. * 00015 * * 00016 * You should have received a copy of the GNU General Public License * 00017 * along with this software. If not see <http://www.gnu.org/licenses/>. * 00018 ***************************************************************************/ 00019 #ifndef __DBUSXX_PENDING_CALL_H 00020 #define __DBUSXX_PENDING_CALL_H 00021 00022 #include <dbus/dbus.h> 00023 #include <sigc++/sigc++.h> 00024 #include <dbus-cxx/message.h> 00025 #include <dbus-cxx/pointer.h> 00026 00027 namespace DBus 00028 { 00029 00037 class PendingCall: public sigc::trackable 00038 { 00039 protected: 00040 00041 PendingCall( DBusPendingCall* cobj = NULL ); 00042 00043 PendingCall( const PendingCall& ); 00044 00045 public: 00046 00047 typedef DBusCxxPointer<PendingCall> pointer; 00048 00049 static pointer create( DBusPendingCall* cobj = NULL ); 00050 00051 static pointer create( const PendingCall& ); 00052 00053 virtual ~PendingCall(); 00054 00055 PendingCall& operator=( const PendingCall& other ); 00056 00057 void cancel(); 00058 00059 bool completed(); 00060 00061 Message::pointer steal_reply(); 00062 00063 void block(); 00064 00065 sigc::signal<void> signal_notify(); 00066 00067 DBusPendingCall* cobj(); 00068 00069 private: 00070 00071 DBusPendingCall* m_cobj; 00072 00073 sigc::signal<void> m_signal_notify; 00074 00075 static void notify_callback( DBusPendingCall* pending, void* data ); 00076 }; 00077 00078 } 00079 00080 #endif