/** * @file pendingupdates.h * @brief <---> * @author Andreas Aardal Hanssen * @date 2002-2005 */ #ifndef pendingupdates_h_included #define pendingupdates_h_included #include #include #include namespace Binc { class Mailbox; class PendingUpdates { public: enum { EXPUNGE = 0x01, FLAGS = 0x02, EXISTS = 0x04, RECENT = 0x08 }; class expunged_const_iterator { private: std::vector::iterator internal; public: unsigned int operator*() const; void operator++(); bool operator!=(expunged_const_iterator) const; bool operator==(expunged_const_iterator) const; expunged_const_iterator(); expunged_const_iterator(std::vector::iterator i); }; expunged_const_iterator beginExpunged(); expunged_const_iterator endExpunged(); class flagupdates_const_iterator { private: std::map::iterator internal; std::map *sqnrtouid; std::map> *sqnrtocflags; public: unsigned int first() const; unsigned int second() const; std::vector getCustomFlags() const; unsigned int getUID() const; void operator++(); bool operator!=(flagupdates_const_iterator) const; flagupdates_const_iterator(); flagupdates_const_iterator(std::map::iterator i, std::map> *, std::map *); }; flagupdates_const_iterator beginFlagUpdates(); flagupdates_const_iterator endFlagUpdates(); void addExpunged(unsigned int uid); void addFlagUpdates(unsigned int sqnr, unsigned int uid, unsigned int flags, const std::vector &cflags); void setExists(unsigned int n); void setRecent(unsigned int n); unsigned int getExists() const; unsigned int getRecent() const; bool newExists() const; bool newRecent() const; PendingUpdates(); ~PendingUpdates(); private: std::vector expunges; std::map flagupdates; std::map sqnrtouid; std::map> sqnrtocflags; unsigned int exists; unsigned int recent; bool newexists; bool newrecent; }; bool pendingUpdates(Mailbox *, int type, bool rescan, bool showAll = false, bool forceScan = false, bool uidfetchflags = false); } #endif