#pragma interface #ifndef TLMPMAIL_H #define TLMPMAIL_H #include #ifndef MISC_H #include #endif #ifndef DICTIONARY_H #include #endif #ifndef PRIVATE_MSG_H #include #endif class MAIL_MESSAGE_FULL; class PRIVATE_MESSAGE; class PRIVATE_MESSAGES; enum CONTENT_TYPE { CONTENT_TYPE_TEXT, CONTENT_TYPE_HTML, CONTENT_TYPE_MULTIPART_MIXED, CONTENT_TYPE_MULTIPART_RELATED, CONTENT_TYPE_MULTIPART_ALTERNATIVE, CONTENT_TYPE_DATA, }; class ATTACHEMENT: public ARRAY_OBJ{ friend class ATTACHEMENTS; SSTRING part; // File or wildcard or "| command ..." SSTRING description; SSTRING mimetype; SSTRING name; /*~PROTOBEG~ ATTACHEMENT */ public: const char *getdescription (void)const; const char *getfname (void)const; const char *getmimetype (void)const; const char *getname (void)const; void setdescription (const char *desc); void setfname (const char *fname); void setmimetype (const char *type); void setname (const char *_name); /*~PROTOEND~ ATTACHEMENT */ }; typedef ARRAY_OBJS _ATTACHEMENTS; class ATTACHEMENTS: public _ATTACHEMENTS{ /*~PROTOBEG~ ATTACHEMENTS */ public: int edit (void); private: void setfields (DIALOG&dia, ATTACHEMENT *a, PRIVATE_MESSAGE *msg); public: /*~PROTOEND~ ATTACHEMENTS */ }; class EMAILADDRS{ public: SSTRINGS names; SSTRINGS addrs; /*~PROTOBEG~ EMAILADDRS */ public: void append (const EMAILADDRS&tb); void append_nodup (const EMAILADDRS&tb); void copy (int i, EMAILADDRS&to); void format (SSTRING&s)const; void format (int n, SSTRING&s)const; private: void format_append (int i, SSTRING&s)const; public: void get (int i, SSTRING&name, SSTRING&addr); const char *getfirstaddr (void)const; const char *getfirstname (void)const; int getnb (void)const; bool is_empty (void)const; bool is_filled (void)const; void parse (const char *s); void remove_all (void); void set (const char *name, const char *addr); int size (void)const; /*~PROTOEND~ EMAILADDRS */ }; // State used to parse email header class HEAD_STATE{ friend class MAIL_MESSAGE; SSTRING *lastline; SSTRING lastlinebuf; EMAILADDRS *addrs; /*~PROTOBEG~ HEAD_STATE */ public: HEAD_STATE (void); /*~PROTOEND~ HEAD_STATE */ }; class MAIL_MESSAGE: public ARRAY_OBJ{ class FOLDER_VIEW *folder; int usage; public: int fid; // Used by some folder to identify quickly a message SSTRING uuid; // Same thing bool deleted; bool replied; bool viewed; bool tagged; SSTRINGS attrib; EMAILADDRS from; EMAILADDRS to; EMAILADDRS cc; EMAILADDRS reply; //SSTRING name; SSTRING subject; time_t date; SSTRING id; SSTRING replyid; SSTRING references; // Used to discover thread relations off_t filepos; int size; DICTIONARY flags; SSTRING comment; /*~PROTOBEG~ MAIL_MESSAGE */ public: MAIL_MESSAGE (void); void assign (FOLDER_VIEW *_folder); void copy (MAIL_MESSAGE&full)const; void decrusage (void); void folder_wakeup (void); void formatdate (char datestr[20], bool nohour); const char *get_from (void)const; const char *get_reply (void)const; const char *get_to (void)const; const char *getauthor (void)const; const char *getdest (void)const; const char *getemail_from (void)const; const char *getemail_reply (void)const; const char *getemail_to (void)const; const char *getflag (const char *key); FOLDER_VIEW *getfolder (void)const; int getnb_to (void)const; const char *getsubject (void)const; int getusage (void); void incrusage (void); int loadmsg (MAIL_MESSAGE_FULL&full)const; void parse_head (HEAD_STATE&st, const char *line); void set_deleted (bool val); void set_friends (void); private: void set_in_list (const char *key, const char *title, const char *intro); public: void set_rejected (void); void set_replied (bool val); void set_tagged (bool val); void set_viewed (bool val); void setmodified (void); void update_folder (void); ~MAIL_MESSAGE (void); /*~PROTOEND~ MAIL_MESSAGE */ }; class MAIL_MESSAGE_FULL: public MAIL_MESSAGE{ public: SSTRING header; SSTRING text; SSTRINGS attach; SSTRINGS spc_headers; // Special headers EMAILADDRS bcc; SSTRING fcc; SSTRING newid; // Stuff extracted from the header SSTRING received; SSTRING content_type; SSTRING content_encoding; SSTRING content_description; SSTRING charset; /*~PROTOBEG~ MAIL_MESSAGE_FULL */ public: CONTENT_TYPE gettype (void)const; void parse_header (void); CONTENT_TYPE parsetype (SSTRING&boundary)const; void updateheader (void); ~MAIL_MESSAGE_FULL (void); /*~PROTOEND~ MAIL_MESSAGE_FULL */ }; class MAIL_MESSAGES: public ARRAY{ /*~PROTOBEG~ MAIL_MESSAGES */ public: void decrusage (void); MAIL_MESSAGE *getitem (int no)const; void incrusage (void); /*~PROTOEND~ MAIL_MESSAGES */ }; class FOLDER_VIEW: public ARRAY_OBJ{ protected: class FOLDER_VIEW_PRIVATE *priv; public: virtual void getupdmsgs (PRIVATE_MESSAGES &upds)=0; virtual void checkupdate ()=0; virtual int loadindex (MAIL_MESSAGES &tb, int &revision)=0; virtual int update (bool clean)=0; virtual const char *gettitle ()=0; virtual int loadmsg (const MAIL_MESSAGE &msg, MAIL_MESSAGE_FULL &full)=0; virtual bool is_postponed()=0; virtual bool is_shared()=0; virtual int getid(SSTRING &id)=0; // Return a string identifying the // folder or virtual folder virtual int getrevision()=0; // Revision history of the folder // an int going up every time the folder // is reloaded PRIVATE_MESSAGE jump2prec; // Allow the message viewer to request PRIVATE_MESSAGE jump2next; // the next or previous message in the // proper view /*~PROTOBEG~ FOLDER_VIEW */ public: FOLDER_VIEW (void); virtual int appendmsg (MAIL_MESSAGE_FULL&msg); void classify (void); virtual void decrusage (void); virtual void getmsgs (PRIVATE_MESSAGES&msgs); virtual int getusage (void); virtual void incrusage (void); virtual bool msgexist (MAIL_MESSAGE&); void set_deleted (bool val); void set_tagged (bool val); virtual void updatemsg (MAIL_MESSAGE&); virtual void wakeup (void); virtual ~FOLDER_VIEW (void); /*~PROTOEND~ FOLDER_VIEW */ }; class FOLDER_FILE: public FOLDER_VIEW{ SSTRING path; MAIL_MESSAGES tb; time_t last; // Time stamp of the folder long size; // Size of the folder int revision; // How many time it was reloaded time_t lastupdate; // When we performed the last update // The update function is called too often... PRIVATE_MESSAGE updmsg; // Send when the folder was modified /*~PROTOBEG~ FOLDER_FILE */ public: FOLDER_FILE (const char *_path); virtual int appendmsg (MAIL_MESSAGE_FULL&full); void checkupdate (void); void forget (int no); int getid (SSTRING&id); int getrevision (void); const char *gettitle (void); void getupdmsgs (PRIVATE_MESSAGES&upds); int getusage (void); void incrrevision (void); bool is_postponed (void); bool is_shared (void); int loadindex (MAIL_MESSAGES&idx, int &callerrev); int loadmsg (const MAIL_MESSAGE&msg, MAIL_MESSAGE_FULL&full); void setstate (void); int update (bool clean); /*~PROTOEND~ FOLDER_FILE */ }; class FOLDER_SQL: public FOLDER_VIEW{ int id; SSTRING name; MAIL_MESSAGES tb; int revision; // Current revision of the folder in tb[] PRIVATE_MESSAGE updmsg; /*~PROTOBEG~ FOLDER_SQL */ public: FOLDER_SQL (const char *folder); int appendmsg (MAIL_MESSAGE_FULL&full); void checkupdate (void); private: void forget (bool deleted); public: int getid (SSTRING&id); int getrevision (void); const char *gettitle (void); void getupdmsgs (PRIVATE_MESSAGES&upds); private: void incrrevision (void); public: bool is_postponed (void); bool is_shared (void); int loadindex (MAIL_MESSAGES&idx, int &callerrev); int loadmsg (const MAIL_MESSAGE&msg, MAIL_MESSAGE_FULL&full); bool msgexist (MAIL_MESSAGE&msg); int update (bool clean); virtual void updatemsg (MAIL_MESSAGE&msg); /*~PROTOEND~ FOLDER_SQL */ }; class FOLDER_BXO: public FOLDER_VIEW{ SSTRING uuid; SSTRING name; MAIL_MESSAGES tb; int revision; // Current revision of the folder in tb[] PRIVATE_MESSAGE updmsg; /*~PROTOBEG~ FOLDER_BXO */ public: FOLDER_BXO (const char *folder); int appendmsg (MAIL_MESSAGE_FULL&full); void checkupdate (void); private: void forget (bool deleted); public: int getid (SSTRING&id); int getrevision (void); const char *gettitle (void); void getupdmsgs (PRIVATE_MESSAGES&upds); private: void incrrevision (void); public: bool is_postponed (void); bool is_shared (void); int loadindex (MAIL_MESSAGES&idx, int &callerrev); int loadmsg (const MAIL_MESSAGE&msg, MAIL_MESSAGE_FULL&full); bool msgexist (MAIL_MESSAGE&msg); int update (bool clean); virtual void updatemsg (MAIL_MESSAGE&msg); /*~PROTOEND~ FOLDER_BXO */ }; class FOLDER_VIEWS: public ARRAY{ /*~PROTOBEG~ FOLDER_VIEWS */ public: FOLDER_VIEW *getitem (int no)const; /*~PROTOEND~ FOLDER_VIEWS */ }; enum FILTER_ON { FILTER_ON_FROM, // Match the from FILTER_ON_TO, // Match the to FILTER_ON_CC, // Match the to FILTER_ON_SUBJECT, // Match the subject FILTER_ON_BODY, // Search in the body FILTER_ON_HEADER, // Search in the header FILTER_ON_VIEWED, // The message has been viewed or not FILTER_ON_REPLIED, // The message has been replied or not FILTER_ON_DELETED, // The message has been deleted or not FILTER_ON_TAGGED, // The message has been tagged or not FILTER_ON_TODAY, // The message has been received today FILTER_ON_THISWEEK, // The message has been received this week FILTER_ON_THISMONTH, // The message has been received this month FILTER_ON_MSGTYPE, FILTER_ON_PROJECT, FILTER_ON_COMMENT, }; enum FILTER_SCOPE { FILTER_SCOPE_NONE, // Do not check this field FILTER_SCOPE_FULL, // Requires a complete match FILTER_SCOPE_PARTIAL, // Requires a partial match FILTER_SCOPE_REGEX // The user has supplied a regex }; struct FILTER_STATUS{ bool flag; bool check; /*~PROTOBEG~ FILTER_STATUS */ public: FILTER_STATUS (void); /*~PROTOEND~ FILTER_STATUS */ }; #include #include struct FILTER_STRING{ SSTRING s; FILTER_SCOPE scope; regex_t reg; bool reg_is_init; /*~PROTOBEG~ FILTER_STRING */ public: FILTER_STRING (void); private: void freeregex (void); public: void init (void); void set (const SSTRING&_s, FILTER_SCOPE _scope); void set (const char *_s, FILTER_SCOPE _scope); void setscope (FILTER_SCOPE _scope); ~FILTER_STRING (void); /*~PROTOEND~ FILTER_STRING */ }; #define NB_CLASSES 5 class MAIL_FILTER: public ARRAY_OBJ{ char negative; // Inverse the logic of the filter SSTRING name; // filter name/id. // Search criterion FILTER_STRING from; FILTER_STRING to; FILTER_STRING cc; FILTER_STRING subject; FILTER_STRING body; FILTER_STRING header; FILTER_STRING comment; FILTER_STRING type; FILTER_STRING project; FILTER_STATUS viewed; FILTER_STATUS deleted; FILTER_STATUS replied; FILTER_STATUS tagged; FILTER_STRING classes[NB_CLASSES]; int since; // Message received since or -1 int remind; // Message with a reminder date in less than N days // or -1 if we do not care SSTRING present; // How to present mail in folders matching this filter // just a bunch of colors separated by commas. SSTRING dcs; // present translated to drawing context. SSTRING viewcmd; // Filter to use to view the mail // Information to speedup the match int today; char remindstr[12]; /*~PROTOBEG~ MAIL_FILTER */ public: MAIL_FILTER (void); int edit (void); const char *getdcs (void); const char *getname (void)const; const char *getpresent (void); bool has_present (void); bool has_viewcmd (void); void init (void); void loaddef (const char *_name); bool match (MAIL_MESSAGE *m); int quickedit (void); void savedef (const char *_name); void set (FILTER_ON cmd, FILTER_SCOPE scope, const char *_key); void setfrom (const char *_from, FILTER_SCOPE scope); void setsubject (const char *_subject, FILTER_SCOPE scope); void setto (const char *_to, FILTER_SCOPE scope); void setup (void); bool status_sensitive (void); /*~PROTOEND~ MAIL_FILTER */ }; class MAIL_FILTERS: public ARRAY{ /*~PROTOBEG~ MAIL_FILTERS */ public: MAIL_FILTER *getitem (int no)const; void present (MAIL_MESSAGE&msg, SSTRING&dcs); void setup (void); /*~PROTOEND~ MAIL_FILTERS */ }; class FOLDER_FILTER: public FOLDER_VIEW{ SSTRING title; // Title of the folder MAIL_FILTER filter; FOLDER_VIEW *folder; // Folder on which we perform the search bool negative; SSTRING id; /*~PROTOBEG~ FOLDER_FILTER */ public: FOLDER_FILTER (FOLDER_VIEW *_folder); FOLDER_FILTER (FOLDER_VIEW *_folder, FILTER_ON cmd, FILTER_SCOPE scope, const char *_key); FOLDER_FILTER (FOLDER_VIEW *_folder, FILTER_ON cmd, const char *_key); void checkupdate (void); void decrusage (void); int editfilter (void); int editqfilter (void); private: void format_title (void); public: int getid (SSTRING&_id); void getmsgs (PRIVATE_MESSAGES&msgs); int getrevision (void); const char *gettitle (void); void getupdmsgs (PRIVATE_MESSAGES&upds); void incrusage (void); private: void init (FOLDER_VIEW *_folder); public: bool is_postponed (void); bool is_shared (void); void loaddef (const char *filtername); int loadindex (MAIL_MESSAGES&idx, int &callerrev); int loadmsg (const MAIL_MESSAGE&msg, MAIL_MESSAGE_FULL&full); private: void setfilter (FILTER_ON cmd, FILTER_SCOPE scope, const char *_key); public: void setfrom (const char *_from, FILTER_SCOPE scope); void setmode (bool _negative); void setsubject (const char *_subject, FILTER_SCOPE scope); void settitle (const char *s); void setto (const char *_to, FILTER_SCOPE scope); int update (bool clean); ~FOLDER_FILTER (void); /*~PROTOEND~ FOLDER_FILTER */ }; // Virtual view of several folders class FOLDER_MULTI: public FOLDER_VIEW{ FOLDER_VIEWS folders; /*~PROTOBEG~ FOLDER_MULTI */ public: FOLDER_MULTI (void); void add (FOLDER_VIEW *v); void checkupdate (void); int getid (SSTRING&id); void getmsgs (PRIVATE_MESSAGES&msgs); int getrevision (void); const char *gettitle (void); void getupdmsgs (PRIVATE_MESSAGES&upds); bool is_postponed (void); bool is_shared (void); int loadindex (MAIL_MESSAGES&idx, int &callerrev); int loadmsg (const MAIL_MESSAGE&msg, MAIL_MESSAGE_FULL&full); int update (bool clean); ~FOLDER_MULTI (void); /*~PROTOEND~ FOLDER_MULTI */ }; // Virtual view of one message thread class FOLDER_THREAD: public FOLDER_VIEW{ SSTRING ref; // First message of the thread FOLDER_VIEW *folder; SSTRING title; /*~PROTOBEG~ FOLDER_THREAD */ public: FOLDER_THREAD (MAIL_MESSAGE&msg); void checkupdate (void); private: int getid (SSTRING&); public: int getrevision (void); const char *gettitle (void); void getupdmsgs (PRIVATE_MESSAGES&upds); bool is_postponed (void); bool is_shared (void); int loadindex (MAIL_MESSAGES&idx, int &revision); int loadmsg (const MAIL_MESSAGE&msg, MAIL_MESSAGE_FULL&full); int update (bool clean); ~FOLDER_THREAD (void); /*~PROTOEND~ FOLDER_THREAD */ }; #define _TLMP_folder_edit class UISTATE; struct _F_folder_edit{ class FOLDER_EDIT_PRIVATE *priv; void msg_delete (int no); void msg_reply (int no); void msg_forward (int no); void msg_tag (int no, bool set, const char *tag); #define _F_folder_edit_loadindex(nom) void nom loadindex(FOLDER_VIEW *folder, MAIL_MESSAGES &tb, int &revision) virtual _F_folder_edit_loadindex ( )=0; #define _F_folder_edit_showmsg(nom) void nom showmsg(int no, MAIL_MESSAGE &msg, FOLDER_VIEW *folder) virtual _F_folder_edit_showmsg( )=0; #define _F_folder_edit_command(nom) void nom command(int cmd) virtual _F_folder_edit_command( )=0; #define _F_folder_edit_popup(nom) void nom popup(int no, MAIL_MESSAGE &msg, FOLDER_VIEW *folder, const UISTATE &uistate) virtual _F_folder_edit_popup( ); #define _F_folder_edit_stats(nom) void nom stats(int curmsg, int nbmsg, int nbnew, int nbdeleted, int nbtagged) virtual _F_folder_edit_stats( ); #define _F_folder_edit_event(nom) void nom event(int no, MAIL_MESSAGE &msg) virtual _F_folder_edit_event( ); #define _F_folder_edit_message(nom) void nom message(bool &end, FOLDER_VIEW *folder, MAIL_MESSAGE &msg) virtual _F_folder_edit_message( ); #define _F_folder_edit_present(nom) void nom present(int no, MAIL_MESSAGE &msg, SSTRING &dcs) virtual _F_folder_edit_present( ); #define _F_folder_edit_clickhead(nom) void nom clickhead (int column, FOLDER_VIEW *folder) virtual _F_folder_edit_clickhead( ); #define _F_folder_edit_notice(nom) void nom notice (const char *text) virtual _F_folder_edit_notice( ); #define _F_folder_edit_docpopup(nom) void nom docpopup(FOLDER_VIEW *folder, const UISTATE &uistate, bool &end) virtual _F_folder_edit_docpopup( ); }; #define _TLMP_MAIL_COMPOSE struct _F_MAIL_COMPOSE{ #define _F_MAIL_COMPOSE_postpone(nom) void nom postpone (void *data, MAIL_MESSAGE_FULL &msg, const ATTACHEMENTS &attachs) virtual _F_MAIL_COMPOSE_postpone( )=0; #define _F_MAIL_COMPOSE_archive(nom) void nom archive (void *data, MAIL_MESSAGE_FULL &msg, const ATTACHEMENTS &attachs) virtual _F_MAIL_COMPOSE_archive( ); #define _F_MAIL_COMPOSE_cancel(nom) void nom cancel (void *data, MAIL_MESSAGE_FULL &msg) virtual _F_MAIL_COMPOSE_cancel( ); #define _F_MAIL_COMPOSE_send(nom) int nom send (void *data, MAIL_MESSAGE_FULL &msg, const ATTACHEMENTS &attachs) virtual _F_MAIL_COMPOSE_send( )=0; #define _F_MAIL_COMPOSE_outbox(nom) int nom outbox (void *data, MAIL_MESSAGE_FULL &msg, const ATTACHEMENTS &attachs) virtual _F_MAIL_COMPOSE_outbox( ); #define _F_MAIL_COMPOSE_quotereply(nom) void nom quotereply (MAIL_MESSAGE_FULL &msg, SSTRING &txt) virtual _F_MAIL_COMPOSE_quotereply( ); #define _F_MAIL_COMPOSE_quoteforward(nom) void nom quoteforward (MAIL_MESSAGE_FULL &msg, SSTRING &txt) virtual _F_MAIL_COMPOSE_quoteforward( ); #define _F_MAIL_COMPOSE_initnewmsg(nom) void nom initnewmsg (SSTRING &txt) virtual _F_MAIL_COMPOSE_initnewmsg( ); #define _F_MAIL_COMPOSE_addrbook(nom) void nom addrbook (EMAILADDRS &emails) virtual _F_MAIL_COMPOSE_addrbook( ); #define _F_MAIL_COMPOSE_folderlist(nom) void nom folderlist (SSTRING &folder) virtual _F_MAIL_COMPOSE_folderlist( ); #define _F_MAIL_COMPOSE_codialog_setup(nom) void * nom codialog_setup (DIALOG &dia, int &butmask) virtual _F_MAIL_COMPOSE_codialog_setup( ); #define _F_MAIL_COMPOSE_codialog_end(nom) void nom codialog_end (void *data) virtual _F_MAIL_COMPOSE_codialog_end( ); #define _F_MAIL_COMPOSE_codialog_buttons(nom) void nom codialog_buttons (void *data, DIALOG &dia, MENU_STATUS code) virtual _F_MAIL_COMPOSE_codialog_buttons( ); #define _F_MAIL_COMPOSE_codialog_validate(nom) int nom codialog_validate (void *data, DIALOG &dia, int &nof) virtual _F_MAIL_COMPOSE_codialog_validate( ); #define _F_MAIL_COMPOSE_complete(nom) int nom complete (const char *nick, EMAILADDRS &emails) virtual _F_MAIL_COMPOSE_complete( ); #define _F_MAIL_COMPOSE_editattach(nom) int nom editattach (ATTACHEMENTS &attachs) virtual _F_MAIL_COMPOSE_editattach( ); }; class MAIL_COMPOSE{ class MAIL_COMPOSE_PRIVATE *priv; _F_MAIL_COMPOSE &c; public: /*~PROTOBEG~ MAIL_COMPOSE */ public: MAIL_COMPOSE (_F_MAIL_COMPOSE&_c); void compose (EMAILADDRS&recipients); void compose (void); void forward (MAIL_MESSAGE&msg); private: void manage (void); public: void reply (MAIL_MESSAGE&msg); void reply (MAIL_MESSAGE&msg, EMAILADDRS&to, EMAILADDRS&cc, EMAILADDRS&bcc); void resume (MAIL_MESSAGE&msg); void start_framework (void); /*~PROTOEND~ MAIL_COMPOSE */ }; #define _TLMP_MAIL_VIEW struct _F_MAIL_VIEW{ #define _F_MAIL_VIEW_reply(nom) void nom reply (EMAILADDRS &to, MAIL_MESSAGE &msg) virtual _F_MAIL_VIEW_reply( ); #define _F_MAIL_VIEW_reply_pick(nom) void nom reply_pick (MAIL_MESSAGE &msg) virtual _F_MAIL_VIEW_reply_pick( ); #define _F_MAIL_VIEW_newmsg(nom) void nom newmsg (EMAILADDRS &to) virtual _F_MAIL_VIEW_newmsg( ); #define _F_MAIL_VIEW_forward(nom) void nom forward (MAIL_MESSAGE &msg) virtual _F_MAIL_VIEW_forward( ); #define _F_MAIL_VIEW_codialog_setup(nom) void *nom codialog_setup (DIALOG &dia, int &butmask, MAIL_MESSAGE_FULL &msg) virtual _F_MAIL_VIEW_codialog_setup( ); #define _F_MAIL_VIEW_codialog_end(nom) void nom codialog_end (void *data) virtual _F_MAIL_VIEW_codialog_end( ); #define _F_MAIL_VIEW_codialog_buttons(nom) void nom codialog_buttons (void *data, DIALOG &dia, MENU_STATUS code, MAIL_MESSAGE &msg, MAIL_MESSAGE_FULL &full) virtual _F_MAIL_VIEW_codialog_buttons( ); #define _F_MAIL_VIEW_codialog_validate(nom) int nom codialog_validate (void *data, DIALOG &dia, int &nof, MAIL_MESSAGE &msg, MAIL_MESSAGE_FULL &full) virtual _F_MAIL_VIEW_codialog_validate( ); }; class MAIL_VIEW{ class MAIL_VIEW_PRIVATE *priv; _F_MAIL_VIEW &c; public: /*~PROTOBEG~ MAIL_VIEW */ public: MAIL_VIEW (_F_MAIL_VIEW&_c); void manage (void); void view (FOLDER_VIEW *folder, MAIL_MESSAGE&msg, bool replace); /*~PROTOEND~ MAIL_VIEW */ }; class FOLDERS: public ARRAY{ /*~PROTOBEG~ FOLDERS */ public: FOLDER_VIEW *getitem (int no)const; /*~PROTOEND~ FOLDERS */ }; #define _TLMP_maillock struct _F_maillock{ #define _F_maillock_ok(nom) void nom ok(const char *path) virtual _F_maillock_ok( )=0; #define _F_maillock_fail(nom) void nom fail(const char *path) virtual _F_maillock_fail( ); #define _F_maillock_create(nom) int nom create(const char *path) virtual _F_maillock_create( ); }; struct ATTACH_INFO { const char *body; int len; bool is_binary; // Is the body binary (use body and len to manipulate) SSTRING encoding; SSTRING name; SSTRING description; /*~PROTOBEG~ ATTACH_INFO */ public: ATTACH_INFO (void); /*~PROTOEND~ ATTACH_INFO */ }; #define _TLMP_mime_split struct _F_mime_split{ #define _F_mime_split_part(nom) void nom part(int no, ATTACH_INFO &info) virtual _F_mime_split_part( ); #define _F_mime_split_mainmsg(nom) void nom mainmsg(int no, ATTACH_INFO &info) virtual _F_mime_split_mainmsg( ); }; #define _TLMP_mailsend class SSTREAM; struct _F_mailsend { #define _F_mailsend_send(nom) int nom send(SSTRINGS &addrs, MAIL_MESSAGE_FULL &msg, const ATTACHEMENTS &attachs, SSTREAM &ss) virtual _F_mailsend_send( )=0; #define _F_mailsend_fail(nom) void nom fail(SSTRINGS &addrs, MAIL_MESSAGE_FULL &msg, const ATTACHEMENTS &attachs) virtual _F_mailsend_fail( ); #define _F_mailsend_ok(nom) void nom ok (SSTRINGS &addrs, MAIL_MESSAGE_FULL &msg, const ATTACHEMENTS &attachs) virtual _F_mailsend_ok( ); }; // Various folder types records how they are build here class FOLDER_FACTORY: public ARRAY_OBJ{ public: virtual FOLDER_VIEW *build (const char *path)=0; virtual bool exist (const char *path)=0; virtual int list (SSTRINGS &tb)=0; /*~PROTOBEG~ FOLDER_FACTORY */ public: FOLDER_FACTORY (void); /*~PROTOEND~ FOLDER_FACTORY */ }; class NICKS; class NICK: public ARRAY_OBJ{ public: bool selected; SSTRING nick; SSTRING name; SSTRINGS addrs; SSTRING fcc; SSTRING comment; /*~PROTOBEG~ NICK */ public: NICK (void); void copyaddr (EMAILADDRS&emails); int edit (NICKS&nicks); void write (FILE *fout); /*~PROTOEND~ NICK */ }; class NICKS: public ARRAY{ /*~PROTOBEG~ NICKS */ public: NICKS (void); NICK *getitem (const char *nick)const; NICK *getitem (int no)const; NICK *locateaddr (const char *addr)const; int write (void); /*~PROTOEND~ NICKS */ }; class BINBUF{ private: void *buf; int len; /*~PROTOBEG~ BINBUF */ public: BINBUF (const void *_buf, int _len); BINBUF (void); void free (void); const void *get (void); void setfrom (const void *_buf, int _len); int size (void); ~BINBUF (void); /*~PROTOEND~ BINBUF */ }; class _F_framework; class PRIVATE_MESSAGE; class FRAMEWORK_MSGS; class FRAMEWORK_INFO; class _F_FRAMEWORK; extern bool debug; extern const char *tlmpmail_version; #include "tlmpmail.pp" #endif