Diffstat (limited to 'noncore/net/mailit/emailhandler.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mailit/emailhandler.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/net/mailit/emailhandler.h b/noncore/net/mailit/emailhandler.h index e47fd9a..b645868 100644 --- a/noncore/net/mailit/emailhandler.h +++ b/noncore/net/mailit/emailhandler.h | |||
@@ -66,83 +66,84 @@ struct Email | |||
66 | QString date; | 66 | QString date; |
67 | QString subject; | 67 | QString subject; |
68 | QString body; | 68 | QString body; |
69 | QString bodyPlain; | 69 | QString bodyPlain; |
70 | bool sent, received, read, downloaded; | 70 | bool sent, received, read, downloaded; |
71 | QString rawMail; | 71 | QString rawMail; |
72 | int mimeType; //1 = Mime 1.0 | 72 | int mimeType; //1 = Mime 1.0 |
73 | int serverId; | 73 | int serverId; |
74 | int internalId; | 74 | int internalId; |
75 | int fromAccountId; | 75 | int fromAccountId; |
76 | QString contentType; //0 = text | 76 | QString contentType; //0 = text |
77 | QString contentAttribute; //0 = plain, 1 = html | 77 | QString contentAttribute; //0 = plain, 1 = html |
78 | EnclosureList files; | 78 | EnclosureList files; |
79 | uint size; | 79 | uint size; |
80 | 80 | ||
81 | void addEnclosure(Enclosure *e) | 81 | void addEnclosure(Enclosure *e) |
82 | { | 82 | { |
83 | files.append(e); | 83 | files.append(e); |
84 | } | 84 | } |
85 | }; | 85 | }; |
86 | 86 | ||
87 | struct MailAccount | 87 | struct MailAccount |
88 | { | 88 | { |
89 | QString accountName; | 89 | QString accountName; |
90 | QString name; | 90 | QString name; |
91 | QString emailAddress; | 91 | QString emailAddress; |
92 | QString popUserName; | 92 | QString popUserName; |
93 | QString popPasswd; | 93 | QString popPasswd; |
94 | QString popServer; | 94 | QString popServer; |
95 | QString smtpServer; | 95 | QString smtpServer; |
96 | bool synchronize; | 96 | bool synchronize; |
97 | int syncLimit; | 97 | int syncLimit; |
98 | int lastServerMailCount; | 98 | int lastServerMailCount; |
99 | int id; | 99 | int id; |
100 | }; | 100 | }; |
101 | 101 | ||
102 | const int ErrUnknownResponse = 1001; | 102 | const int ErrUnknownResponse = 1001; |
103 | const int ErrLoginFailed = 1002; | 103 | const int ErrLoginFailed = 1002; |
104 | const int ErrCancel = 1003; | 104 | const int ErrCancel = 1003; |
105 | 105 | ||
106 | 106 | ||
107 | class EmailHandler : public QObject | 107 | class EmailHandler : public QObject |
108 | { | 108 | { |
109 | Q_OBJECT | 109 | Q_OBJECT |
110 | 110 | ||
111 | public: | 111 | public: |
112 | EmailHandler(); | 112 | EmailHandler(); |
113 | void setAccount(MailAccount account); | 113 | void setAccount(MailAccount account); |
114 | MailAccount* getAccount(){return &mailAccount;} | ||
114 | void sendMail(QList<Email> *mailList); | 115 | void sendMail(QList<Email> *mailList); |
115 | void getMail(); | 116 | void getMail(); |
116 | void getMailHeaders(); | 117 | void getMailHeaders(); |
117 | void getMailByList(MailList *mailList); | 118 | void getMailByList(MailList *mailList); |
118 | bool parse(QString in, QString lineShift, Email *mail); | 119 | bool parse(QString in, QString lineShift, Email *mail); |
119 | bool getEnclosure(Enclosure *ePtr); | 120 | bool getEnclosure(Enclosure *ePtr); |
120 | int parse64base(char *src, char *dest); | 121 | int parse64base(char *src, char *dest); |
121 | int encodeMime(Email *mail); | 122 | int encodeMime(Email *mail); |
122 | int encodeFile(QString fileName, QString *toBody); | 123 | int encodeFile(QString fileName, QString *toBody); |
123 | void encode64base(char *src, QString *dest, int len); | 124 | void encode64base(char *src, QString *dest, int len); |
124 | void cancel(); | 125 | void cancel(); |
125 | 126 | ||
126 | signals: | 127 | signals: |
127 | void mailSent(); | 128 | void mailSent(); |
128 | void smtpError(int); | 129 | void smtpError(int); |
129 | void popError(int); | 130 | void popError(int); |
130 | void mailArrived(const Email &, bool); | 131 | void mailArrived(const Email &, bool); |
131 | void updatePopStatus(const QString &); | 132 | void updatePopStatus(const QString &); |
132 | void updateSmtpStatus(const QString &); | 133 | void updateSmtpStatus(const QString &); |
133 | void mailTransfered(int); | 134 | void mailTransfered(int); |
134 | void mailboxSize(int); | 135 | void mailboxSize(int); |
135 | void currentMailSize(int); | 136 | void currentMailSize(int); |
136 | void downloadedSize(int); | 137 | void downloadedSize(int); |
137 | 138 | ||
138 | public slots: | 139 | public slots: |
139 | void messageArrived(const QString &, int id, uint size, bool complete); | 140 | void messageArrived(const QString &, int id, uint size, bool complete); |
140 | 141 | ||
141 | private: | 142 | private: |
142 | MailAccount mailAccount; | 143 | MailAccount mailAccount; |
143 | SmtpClient *smtpClient; | 144 | SmtpClient *smtpClient; |
144 | PopClient *popClient; | 145 | PopClient *popClient; |
145 | bool headers; | 146 | bool headers; |
146 | }; | 147 | }; |
147 | 148 | ||
148 | #endif | 149 | #endif |