1 /* 2 ** Copyright 2002, Double Precision Inc. 3 ** 4 ** See COPYING for distribution information. 5 */ 6 #ifndef libmail_mboxopen_H 7 #define libmail_mboxopen_H 8 9 #include "libmail_config.h" 10 #include "mbox.H" 11 12 LIBMAIL_START 13 14 class file; 15 16 ///////////////////////////////////////////////////////////////////////// 17 // 18 // A couple of tasks that open the mboxAccount folder. 19 20 21 class mbox::OpenTask : public mbox::TimedTask { 22 23 std::string folder; 24 mail::callback::folder *openCallback; 25 26 bool scan(file &scanFile, 27 file *saveFile, 28 bool skipDeleted); 29 30 protected: 31 virtual void opened(const char *okmsg, mail::callback &callback); 32 33 public: 34 OpenTask(mbox &mboxAccount, 35 std::string folderArg, mail::callback &callbackArg, 36 mail::callback::folder *openCallbackArg 37 // Not NULL - this is mail::account::Open(), and here's the new 38 // folder callback. 39 // NULL - opening the folder for some other reason 40 ); 41 42 ~OpenTask(); 43 44 bool doit(); 45 }; 46 47 // 48 // Subclass OpenTask to implement a new mail check. 49 50 class mbox::CheckNewMailTask : public mbox::OpenTask { 51 52 void opened(const char *okmsg, mail::callback &callback); 53 54 public: 55 CheckNewMailTask(mbox &mboxAccount, 56 std::string folderArg, mail::callback &callbackArg, 57 mail::callback::folder *openCallbackArg); 58 ~CheckNewMailTask(); 59 }; 60 61 LIBMAIL_END 62 63 #endif 64