lastactivity.h

00001 /*
00002   Copyright (c) 2005-2006 by Jakob Schroeter <js@camaya.net>
00003   This file is part of the gloox library. http://camaya.net/gloox
00004 
00005   This software is distributed under a license. The full license
00006   agreement can be found in the file LICENSE in this distribution.
00007   This software may not be copied, modified, sold or distributed
00008   other than expressed in the named license agreement.
00009 
00010   This software is distributed without any warranty.
00011 */
00012 
00013 
00014 #ifndef LASTACTIVITY_H__
00015 #define LASTACTIVITY_H__
00016 
00017 #include "iqhandler.h"
00018 
00019 #include <time.h>
00020 
00021 namespace gloox
00022 {
00023 
00024   class JID;
00025   class ClientBase;
00026   class Disco;
00027   class LastActivityHandler;
00028 
00037   class GLOOX_API LastActivity : public IqHandler
00038   {
00039     public:
00044       LastActivity( ClientBase *parent, Disco *disco );
00045 
00049       virtual ~LastActivity();
00050 
00056       void query( const JID& jid );
00057 
00063       void registerLastActivityHandler( LastActivityHandler *lah ) { m_lastActivityHandler = lah; };
00064 
00068       void removeLastActivityHandler() { m_lastActivityHandler = 0; };
00069 
00074       void resetIdleTimer();
00075 
00076       // reimplemented from IqHandler
00077       virtual bool handleIqID( Stanza *stanza, int context );
00078 
00079       // reimplemented from IqHandler
00080       virtual bool handleIq( Stanza *stanza );
00081 
00082     private:
00083       LastActivityHandler *m_lastActivityHandler;
00084       ClientBase *m_parent;
00085       Disco *m_disco;
00086 
00087       time_t m_active;
00088 
00089   };
00090 
00091 }
00092 
00093 #endif // LASTACTIVITY_H__

Generated on Tue May 1 14:20:20 2007 for gloox by  doxygen 1.5.1