1 /* 2 ** Copyright 2003, Double Precision Inc. 3 ** 4 ** See COPYING for distribution information. 5 */ 6 7 #ifndef libmail_smapidle_H 8 #define libmail_smapidle_H 9 10 #include "libmail_config.h" 11 12 #include "mail.H" 13 #include "smap.H" 14 15 #include <time.h> 16 17 LIBMAIL_START 18 19 class smapIdleHandler : public smapHandler { 20 21 bool idleOnOff; 22 23 bool idling; 24 bool shouldTerminate; 25 bool terminating; 26 27 bool waiting; 28 struct timeval waitingUntil; 29 30 void terminateIdle(imap &); 31 32 const char *getName(); 33 void timedOut(const char *errmsg); 34 35 36 bool getTimeout(imap &, int &ioTimeout); 37 38 public: 39 smapIdleHandler(bool idleOnOffArg, mail::callback *callbackArg); 40 41 ~smapIdleHandler(); 42 43 void installed(imap &); 44 45 virtual bool ok(std::string); 46 47 void anotherHandlerInstalled(imap &imapAccount); 48 }; 49 50 51 LIBMAIL_END 52 #endif 53