summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mailit/emailhandler.h
Unidiff
Diffstat (limited to 'noncore/unsupported/mailit/emailhandler.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/mailit/emailhandler.h166
1 files changed, 83 insertions, 83 deletions
diff --git a/noncore/unsupported/mailit/emailhandler.h b/noncore/unsupported/mailit/emailhandler.h
index 5b59f65..e4e7f46 100644
--- a/noncore/unsupported/mailit/emailhandler.h
+++ b/noncore/unsupported/mailit/emailhandler.h
@@ -37,114 +37,114 @@
37 37
38struct Enclosure 38struct Enclosure
39{ 39{
40 int id; 40 int id;
41 QString originalName; 41 QString originalName;
42 QString name; 42 QString name;
43 QString path; 43 QString path;
44 QString contentType; 44 QString contentType;
45 QString contentAttribute; 45 QString contentAttribute;
46 QString encoding; 46 QString encoding;
47 QString body; //might use to much mem. check!! 47 QString body; //might use to much mem. check!!
48 bool saved, installed; 48 bool saved, installed;
49}; 49};
50 50
51class EnclosureList : public QList<Enclosure> 51class EnclosureList : public QList<Enclosure>
52{ 52{
53public: 53public:
54 Item newItem(Item d); 54 Item newItem(Item d);
55private: 55private:
56 Enclosure* dupl(Enclosure *in); 56 Enclosure* dupl(Enclosure *in);
57 Enclosure *ac; 57 Enclosure *ac;
58}; 58};
59 59
60struct Email 60struct Email
61{ 61{
62 QString id; 62 QString id;
63 QString from; 63 QString from;
64 QString fromMail; 64 QString fromMail;
65 QStringList recipients; 65 QStringList recipients;
66 QStringList carbonCopies; 66 QStringList carbonCopies;
67 QString date; 67 QString date;
68 QString subject; 68 QString subject;
69 QString body; 69 QString body;
70 QString bodyPlain; 70 QString bodyPlain;
71 bool sent, received, read, downloaded; 71 bool sent, received, read, downloaded;
72 QString rawMail; 72 QString rawMail;
73 int mimeType; //1 = Mime 1.0 73 int mimeType; //1 = Mime 1.0
74 int serverId; 74 int serverId;
75 int internalId; 75 int internalId;
76 int fromAccountId; 76 int fromAccountId;
77 QString contentType; //0 = text 77 QString contentType; //0 = text
78 QString contentAttribute; //0 = plain, 1 = html 78 QString contentAttribute; //0 = plain, 1 = html
79 EnclosureList files; 79 EnclosureList files;
80 uint size; 80 uint size;
81 81
82 void addEnclosure(Enclosure *e) 82 void addEnclosure(Enclosure *e)
83 { 83 {
84 files.append(e); 84 files.append(e);
85 } 85 }
86}; 86};
87 87
88struct MailAccount 88struct MailAccount
89{ 89{
90 QString accountName; 90 QString accountName;
91 QString name; 91 QString name;
92 QString emailAddress; 92 QString emailAddress;
93 QString popUserName; 93 QString popUserName;
94 QString popPasswd; 94 QString popPasswd;
95 QString popServer; 95 QString popServer;
96 QString smtpServer; 96 QString smtpServer;
97 bool synchronize; 97 bool synchronize;
98 int syncLimit; 98 int syncLimit;
99 int lastServerMailCount; 99 int lastServerMailCount;
100 int id; 100 int id;
101}; 101};
102 102
103 const int ErrUnknownResponse = 1001; 103 const int ErrUnknownResponse = 1001;
104 const int ErrLoginFailed = 1002; 104 const int ErrLoginFailed = 1002;
105 const int ErrCancel = 1003; 105 const int ErrCancel = 1003;
106 106
107 107
108class EmailHandler : public QObject 108class EmailHandler : public QObject
109{ 109{
110 Q_OBJECT 110 Q_OBJECT
111 111
112public: 112public:
113 EmailHandler(); 113 EmailHandler();
114 void setAccount(MailAccount account); 114 void setAccount(MailAccount account);
115 MailAccount* getAccount(){return &mailAccount;} 115 MailAccount* getAccount(){return &mailAccount;}
116 void sendMail(QList<Email> *mailList); 116 void sendMail(QList<Email> *mailList);
117 void getMail(); 117 void getMail();
118 void getMailHeaders(); 118 void getMailHeaders();
119 void getMailByList(MailList *mailList); 119 void getMailByList(MailList *mailList);
120 bool parse(QString in, QString lineShift, Email *mail); 120 bool parse(const QString &in, const QString &lineShift, Email *mail);
121 bool getEnclosure(Enclosure *ePtr); 121 bool getEnclosure(Enclosure *ePtr);
122 int parse64base(char *src, char *dest); 122 int parse64base(char *src, char *dest);
123 int encodeMime(Email *mail); 123 int encodeMime(Email *mail);
124 int encodeFile(QString fileName, QString *toBody); 124 int encodeFile(const QString &fileName, QString *toBody);
125 void encode64base(char *src, QString *dest, int len); 125 void encode64base(char *src, QString *dest, int len);
126 void cancel(); 126 void cancel();
127 127
128signals: 128signals:
129 void mailSent(); 129 void mailSent();
130 void smtpError(int); 130 void smtpError(int);
131 void popError(int); 131 void popError(int);
132 void mailArrived(const Email &, bool); 132 void mailArrived(const Email &, bool);
133 void updatePopStatus(const QString &); 133 void updatePopStatus(const QString &);
134 void updateSmtpStatus(const QString &); 134 void updateSmtpStatus(const QString &);
135 void mailTransfered(int); 135 void mailTransfered(int);
136 void mailboxSize(int); 136 void mailboxSize(int);
137 void currentMailSize(int); 137 void currentMailSize(int);
138 void downloadedSize(int); 138 void downloadedSize(int);
139 139
140public slots: 140public slots:
141 void messageArrived(const QString &, int id, uint size, bool complete); 141 void messageArrived(const QString &, int id, uint size, bool complete);
142 142
143private: 143private:
144 MailAccount mailAccount; 144 MailAccount mailAccount;
145 SmtpClient *smtpClient; 145 SmtpClient *smtpClient;
146 PopClient *popClient; 146 PopClient *popClient;
147 bool headers; 147 bool headers;
148}; 148};
149 149
150#endif 150#endif