summaryrefslogtreecommitdiff
path: root/noncore/net/mail/mailwrapper.h
Unidiff
Diffstat (limited to 'noncore/net/mail/mailwrapper.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/mailwrapper.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/noncore/net/mail/mailwrapper.h b/noncore/net/mail/mailwrapper.h
index 6994dd8..d78f8e9 100644
--- a/noncore/net/mail/mailwrapper.h
+++ b/noncore/net/mail/mailwrapper.h
@@ -26,98 +26,99 @@ public:
26 DocLnk getDocLnk() { return doc; } 26 DocLnk getDocLnk() { return doc; }
27 27
28protected: 28protected:
29 DocLnk doc; 29 DocLnk doc;
30 int size; 30 int size;
31 31
32}; 32};
33 33
34class Mail 34class Mail
35{ 35{
36public: 36public:
37 Mail(); 37 Mail();
38 /* Possible that this destructor must not be declared virtual 38 /* Possible that this destructor must not be declared virtual
39 * 'cause it seems that it will never have some child classes. 39 * 'cause it seems that it will never have some child classes.
40 * in this case this object will not get a virtual table -> memory and 40 * in this case this object will not get a virtual table -> memory and
41 * speed will be a little bit better? 41 * speed will be a little bit better?
42 */ 42 */
43 virtual ~Mail(){} 43 virtual ~Mail(){}
44 void addAttachment( Attachment *att ) { attList.append( att ); } 44 void addAttachment( Attachment *att ) { attList.append( att ); }
45 const QList<Attachment>& getAttachments()const { return attList; } 45 const QList<Attachment>& getAttachments()const { return attList; }
46 void removeAttachment( Attachment *att ) { attList.remove( att ); } 46 void removeAttachment( Attachment *att ) { attList.remove( att ); }
47 const QString&getName()const { return name; } 47 const QString&getName()const { return name; }
48 void setName( QString s ) { name = s; } 48 void setName( QString s ) { name = s; }
49 const QString&getMail()const{ return mail; } 49 const QString&getMail()const{ return mail; }
50 void setMail( const QString&s ) { mail = s; } 50 void setMail( const QString&s ) { mail = s; }
51 const QString&getTo()const{ return to; } 51 const QString&getTo()const{ return to; }
52 void setTo( const QString&s ) { to = s; } 52 void setTo( const QString&s ) { to = s; }
53 const QString&getCC()const{ return cc; } 53 const QString&getCC()const{ return cc; }
54 void setCC( const QString&s ) { cc = s; } 54 void setCC( const QString&s ) { cc = s; }
55 const QString&getBCC()const { return bcc; } 55 const QString&getBCC()const { return bcc; }
56 void setBCC( const QString&s ) { bcc = s; } 56 void setBCC( const QString&s ) { bcc = s; }
57 const QString&getMessage()const { return message; } 57 const QString&getMessage()const { return message; }
58 void setMessage( const QString&s ) { message = s; } 58 void setMessage( const QString&s ) { message = s; }
59 const QString&getSubject()const { return subject; } 59 const QString&getSubject()const { return subject; }
60 void setSubject( const QString&s ) { subject = s; } 60 void setSubject( const QString&s ) { subject = s; }
61 const QString&getReply()const{ return reply; } 61 const QString&getReply()const{ return reply; }
62 void setReply( const QString&a ) { reply = a; } 62 void setReply( const QString&a ) { reply = a; }
63 63
64private: 64private:
65 QList<Attachment> attList; 65 QList<Attachment> attList;
66 QString name, mail, to, cc, bcc, reply, subject, message; 66 QString name, mail, to, cc, bcc, reply, subject, message;
67}; 67};
68 68
69class Folder : public QObject 69class Folder : public QObject
70{ 70{
71 Q_OBJECT 71 Q_OBJECT
72 72
73public: 73public:
74 Folder( const QString&init_name ); 74 Folder( const QString&init_name,const QString&sep );
75 const QString&getDisplayName()const { return nameDisplay; } 75 const QString&getDisplayName()const { return nameDisplay; }
76 const QString&getName()const { return name; } 76 const QString&getName()const { return name; }
77 virtual bool may_select()const{return true;}; 77 virtual bool may_select()const{return true;};
78 const QString&Separator()const;
78 79
79protected: 80protected:
80 QString nameDisplay, name; 81 QString nameDisplay, name, separator;
81 82
82}; 83};
83 84
84class IMAPFolder : public Folder 85class IMAPFolder : public Folder
85{ 86{
86 public: 87 public:
87 IMAPFolder(const QString&name,bool select=true,const QString&prefix="" ); 88 IMAPFolder(const QString&name, const QString&sep, bool select=true,const QString&prefix="" );
88 virtual bool may_select()const{return m_MaySelect;} 89 virtual bool may_select()const{return m_MaySelect;}
89 private: 90 private:
90 bool m_MaySelect; 91 bool m_MaySelect;
91}; 92};
92 93
93class MailWrapper : public QObject 94class MailWrapper : public QObject
94{ 95{
95 Q_OBJECT 96 Q_OBJECT
96 97
97public: 98public:
98 MailWrapper( Settings *s ); 99 MailWrapper( Settings *s );
99 void sendMail( Mail mail ); 100 void sendMail( Mail mail );
100 101
101private: 102private:
102 mailimf_mailbox *newMailbox(const QString&name,const QString&mail ); 103 mailimf_mailbox *newMailbox(const QString&name,const QString&mail );
103 mailimf_address_list *parseAddresses(const QString&addr ); 104 mailimf_address_list *parseAddresses(const QString&addr );
104 mailimf_fields *createImfFields( Mail *mail ); 105 mailimf_fields *createImfFields( Mail *mail );
105 mailmime *buildTxtPart( QString str ); 106 mailmime *buildTxtPart( QString str );
106 mailmime *buildFilePart( QString filename, QString mimetype ); 107 mailmime *buildFilePart( QString filename, QString mimetype );
107 void addFileParts( mailmime *message, QList<Attachment> files ); 108 void addFileParts( mailmime *message, QList<Attachment> files );
108 mailmime *createMimeMail( Mail *mail ); 109 mailmime *createMimeMail( Mail *mail );
109 void smtpSend( mailmime *mail ); 110 void smtpSend( mailmime *mail );
110 mailimf_field *getField( mailimf_fields *fields, int type ); 111 mailimf_field *getField( mailimf_fields *fields, int type );
111 clist *createRcptList( mailimf_fields *fields ); 112 clist *createRcptList( mailimf_fields *fields );
112 char *getFrom( mailmime *mail ); 113 char *getFrom( mailmime *mail );
113 SMTPaccount *getAccount( QString from ); 114 SMTPaccount *getAccount( QString from );
114 void writeToFile( QString file, mailmime *mail ); 115 void writeToFile( QString file, mailmime *mail );
115 void readFromFile( QString file, char **data, size_t *size ); 116 void readFromFile( QString file, char **data, size_t *size );
116 static QString mailsmtpError( int err ); 117 static QString mailsmtpError( int err );
117 static QString getTmpFile(); 118 static QString getTmpFile();
118 119
119 Settings *settings; 120 Settings *settings;
120 121
121}; 122};
122 123
123#endif 124#endif