Diffstat (limited to 'kmicromail/libmailwrapper/imapwrapper.h') (more/less context) (show whitespace changes)
-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/kmicromail/libmailwrapper/imapwrapper.h b/kmicromail/libmailwrapper/imapwrapper.h new file mode 100644 index 0000000..e56605a --- a/dev/null +++ b/kmicromail/libmailwrapper/imapwrapper.h | |||
@@ -0,0 +1,80 @@ | |||
1 | #ifndef __IMAPWRAPPER | ||
2 | #define __IMAPWRAPPER | ||
3 | |||
4 | #include <qlist.h> | ||
5 | #include "mailwrapper.h" | ||
6 | #include "abstractmail.h" | ||
7 | #include <libetpan/clist.h> | ||
8 | |||
9 | struct mailimap; | ||
10 | struct mailimap_body; | ||
11 | struct mailimap_body_type_1part; | ||
12 | struct mailimap_body_type_text; | ||
13 | struct mailimap_body_type_basic; | ||
14 | struct mailimap_body_type_msg; | ||
15 | struct mailimap_body_type_mpart; | ||
16 | struct mailimap_body_fields; | ||
17 | struct mailimap_msg_att; | ||
18 | class encodedString; | ||
19 | |||
20 | class IMAPwrapper : public AbstractMail | ||
21 | { | ||
22 | Q_OBJECT | ||
23 | public: | ||
24 | IMAPwrapper( IMAPaccount *a ); | ||
25 | virtual ~IMAPwrapper(); | ||
26 | virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); | ||
27 | virtual void listMessages(const QString & mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> >&target ); | ||
28 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | ||
29 | |||
30 | virtual void deleteMail(const RecMailP&mail); | ||
31 | virtual void answeredMail(const RecMailP&mail); | ||
32 | virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&folder); | ||
33 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); | ||
34 | virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder, | ||
35 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | ||
36 | virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | ||
37 | |||
38 | virtual RecBodyP fetchBody(const RecMailP&mail); | ||
39 | virtual QString fetchTextPart(const RecMailP&mail,const RecPartP&part); | ||
40 | virtual encodedString* fetchDecodedPart(const RecMailP&mail,const RecPartP&part); | ||
41 | virtual encodedString* fetchRawPart(const RecMailP&mail,const RecPartP&part); | ||
42 | virtual encodedString* fetchRawBody(const RecMailP&mail); | ||
43 | |||
44 | virtual int createMbox(const QString&,const Opie::Core::OSmartPointer<Folder>&parentfolder=0, | ||
45 | const QString& delemiter="/",bool getsubfolder=false); | ||
46 | virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&folder); | ||
47 | |||
48 | static void imap_progress( size_t current, size_t maximum ); | ||
49 | |||
50 | virtual void logout(); | ||
51 | virtual MAILLIB::ATYPE getType()const; | ||
52 | virtual const QString&getName()const; | ||
53 | |||
54 | protected: | ||
55 | RecMail*parse_list_result(mailimap_msg_att*); | ||
56 | void login(); | ||
57 | bool start_tls(bool force=true); | ||
58 | |||
59 | virtual QString fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call=false,const QString&enc=""); | ||
60 | virtual encodedString*fetchRawPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call); | ||
61 | int selectMbox(const QString&mbox); | ||
62 | |||
63 | void fillSinglePart(RecPartP&target_part,mailimap_body_type_1part*Description); | ||
64 | void fillSingleTextPart(RecPartP&target_part,mailimap_body_type_text*which); | ||
65 | void fillSingleBasicPart(RecPartP&target_part,mailimap_body_type_basic*which); | ||
66 | void fillSingleMsgPart(RecPartP&target_part,mailimap_body_type_msg*which); | ||
67 | void fillMultiPart(RecPartP&target_part,mailimap_body_type_mpart*which); | ||
68 | void traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body,int current_recursion,QValueList<int>recList,int current_count=1); | ||
69 | |||
70 | /* just helpers */ | ||
71 | static void fillBodyFields(RecPartP&target_part,mailimap_body_fields*which); | ||
72 | static QStringList address_list_to_stringlist(clist*list); | ||
73 | |||
74 | |||
75 | IMAPaccount *account; | ||
76 | mailimap *m_imap; | ||
77 | QString m_Lastmbox; | ||
78 | }; | ||
79 | |||
80 | #endif | ||