1 #ifndef __MAILSYNC_STORE__ 2 3 #include <stdio.h> 4 #include <string> 5 #include <map> 6 #include <set> 7 #include "c-client-header.h" 8 #include "types.h" 9 #include "msgid.h" 10 11 ////////////////////////////////////////////////////////////////////////// 12 // 13 class Store 14 // 15 // Structure that holds the pattern for _one_ set of mailboxes to sync 16 // 17 ////////////////////////////////////////////////////////////////////////// 18 { 19 public: 20 string name, server, prefix; 21 string ref, pat; 22 Passwd passwd; 23 int isremote; // I.e. allows OP_HALFOPEN 24 int delim; 25 MAILSTREAM* stream; // c-client mailstream through which the 26 // store can be reached 27 MailboxMap boxes; // boxes with their properties 28 29 void clear(); 30 Store()31 Store(): 32 boxes(), name(), server(), prefix(), ref(), pat(), passwd() { clear(); } 33 34 void print(FILE* f); set_passwd(string password)35 void set_passwd(string password) { passwd.set_passwd(password);} 36 size_t acquire_mail_list( ); 37 void get_delim(); 38 string full_mailbox_name(const string& box); 39 bool fetch_message_ids(MsgIdPositions& mids, MsgIdSet& remove_set); 40 bool list_contents(); 41 bool flag_message_for_removal( unsigned long msgno, const MsgId& msgid, 42 char * place); 43 MAILSTREAM* mailbox_open( const string& boxname, 44 long c_client_options); 45 MAILSTREAM* store_open( long c_client_options); 46 bool mailbox_create( const string& boxname ); 47 char* driver_name(); 48 void display_driver(); 49 void print_error(const char * cause, const string& mailbox); 50 int mailbox_expunge(string mailbox_name); 51 }; 52 53 #define __MAILSYNC_STORE__ 54 #endif 55