lastactivity.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
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 LastActivityHandler;
00027
00037 class GLOOX_API LastActivity : public IqHandler
00038 {
00039 public:
00044 LastActivity( ClientBase *parent );
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
00077 virtual bool handleIqID( Stanza *stanza, int context );
00078
00079
00080 virtual bool handleIq( Stanza *stanza );
00081
00082 private:
00083 LastActivityHandler *m_lastActivityHandler;
00084 ClientBase *m_parent;
00085
00086 time_t m_active;
00087
00088 };
00089
00090 }
00091
00092 #endif // LASTACTIVITY_H__