Diffstat (limited to 'noncore/net/mail/mailwrapper.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/mailwrapper.h | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/noncore/net/mail/mailwrapper.h b/noncore/net/mail/mailwrapper.h index 332034f..34fd5c5 100644 --- a/noncore/net/mail/mailwrapper.h +++ b/noncore/net/mail/mailwrapper.h | |||
@@ -1,135 +1,81 @@ | |||
1 | #ifndef MAILWRAPPER_H | 1 | #ifndef MAILWRAPPER_H |
2 | #define MAILWRAPPER_H | 2 | #define MAILWRAPPER_H |
3 | 3 | ||
4 | #include <qpe/applnk.h> | 4 | #include <qpe/applnk.h> |
5 | 5 | ||
6 | #include <libetpan/mailmime.h> | 6 | #include <libetpan/mailmime.h> |
7 | #include <libetpan/mailimf.h> | 7 | #include <libetpan/mailimf.h> |
8 | #include <libetpan/mailsmtp.h> | 8 | #include <libetpan/mailsmtp.h> |
9 | #include <libetpan/mailstorage.h> | 9 | #include <libetpan/mailstorage.h> |
10 | #include <libetpan/maildriver.h> | 10 | #include <libetpan/maildriver.h> |
11 | #include <qbitarray.h> | 11 | #include <qbitarray.h> |
12 | #include <qdatetime.h> | 12 | #include <qdatetime.h> |
13 | 13 | ||
14 | #include "settings.h" | 14 | #include "settings.h" |
15 | 15 | ||
16 | class Attachment | 16 | class Attachment |
17 | { | 17 | { |
18 | public: | 18 | public: |
19 | Attachment( DocLnk lnk ); | 19 | Attachment( DocLnk lnk ); |
20 | virtual ~Attachment(){} | 20 | virtual ~Attachment(){} |
21 | const QString getFileName()const{ return doc.file(); } | 21 | const QString getFileName()const{ return doc.file(); } |
22 | const QString getName()const{ return doc.name(); } | 22 | const QString getName()const{ return doc.name(); } |
23 | const QString getMimeType()const{ return doc.type(); } | 23 | const QString getMimeType()const{ return doc.type(); } |
24 | const QPixmap getPixmap()const{ return doc.pixmap(); } | 24 | const QPixmap getPixmap()const{ return doc.pixmap(); } |
25 | const int getSize()const { return size; } | 25 | const int getSize()const { return size; } |
26 | DocLnk getDocLnk() { return doc; } | 26 | DocLnk getDocLnk() { return doc; } |
27 | 27 | ||
28 | protected: | 28 | protected: |
29 | DocLnk doc; | 29 | DocLnk doc; |
30 | int size; | 30 | int size; |
31 | 31 | ||
32 | }; | 32 | }; |
33 | 33 | ||
34 | #define FLAG_ANSWERED 0 | ||
35 | #define FLAG_FLAGGED 1 | ||
36 | #define FLAG_DELETED 2 | ||
37 | #define FLAG_SEEN 3 | ||
38 | #define FLAG_DRAFT 4 | ||
39 | #define FLAG_RECENT 5 | ||
40 | |||
41 | /* a class to describe mails in a mailbox */ | ||
42 | /* Attention! | ||
43 | From programmers point of view it would make sense to | ||
44 | store the mail body into this class, too. | ||
45 | But: not from the point of view of the device. | ||
46 | Mailbodies can be real large. So we request them when | ||
47 | needed from the mail-wrapper class direct from the server itself | ||
48 | (imap) or from a file-based cache (pop3?) | ||
49 | So there is no interface "const QString&body()" but you should | ||
50 | make a request to the mailwrapper with this class as parameter to | ||
51 | get the body. Same words for the attachments. | ||
52 | */ | ||
53 | class RecMail | ||
54 | { | ||
55 | public: | ||
56 | RecMail(); | ||
57 | virtual ~RecMail(){} | ||
58 | |||
59 | const int getNumber()const{return msg_number;} | ||
60 | void setNumber(int number){msg_number=number;} | ||
61 | const QString&getDate()const{ return date; } | ||
62 | void setDate( const QString&a ) { date = a; } | ||
63 | const QString&getFrom()const{ return from; } | ||
64 | void setFrom( const QString&a ) { from = a; } | ||
65 | const QString&getSubject()const { return subject; } | ||
66 | void setSubject( const QString&s ) { subject = s; } | ||
67 | const QString&getMbox()const{return mbox;} | ||
68 | void setMbox(const QString&box){mbox = box;} | ||
69 | const QBitArray&getFlags()const{return msg_flags;} | ||
70 | void setFlags(const QBitArray&flags){msg_flags = flags;} | ||
71 | |||
72 | #if 0 | ||
73 | void setDate(const QString&dstring); | ||
74 | void setDate(const QDateTime&date){mDate = date;} | ||
75 | QString getDate()const{return mDate.toString();} | ||
76 | #endif | ||
77 | protected: | ||
78 | QString subject,date,from,mbox; | ||
79 | int msg_number; | ||
80 | QBitArray msg_flags; | ||
81 | #if 0 | ||
82 | QDateTime mDate; | ||
83 | #endif | ||
84 | }; | ||
85 | |||
86 | typedef QList<RecMail> Maillist; | ||
87 | |||
88 | class Mail | 34 | class Mail |
89 | { | 35 | { |
90 | public: | 36 | public: |
91 | Mail(); | 37 | Mail(); |
92 | /* Possible that this destructor must not be declared virtual | 38 | /* Possible that this destructor must not be declared virtual |
93 | * 'cause it seems that it will never have some child classes. | 39 | * 'cause it seems that it will never have some child classes. |
94 | * 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 |
95 | * speed will be a little bit better? | 41 | * speed will be a little bit better? |
96 | */ | 42 | */ |
97 | virtual ~Mail(){} | 43 | virtual ~Mail(){} |
98 | void addAttachment( Attachment *att ) { attList.append( att ); } | 44 | void addAttachment( Attachment *att ) { attList.append( att ); } |
99 | const QList<Attachment>& getAttachments()const { return attList; } | 45 | const QList<Attachment>& getAttachments()const { return attList; } |
100 | void removeAttachment( Attachment *att ) { attList.remove( att ); } | 46 | void removeAttachment( Attachment *att ) { attList.remove( att ); } |
101 | const QString&getName()const { return name; } | 47 | const QString&getName()const { return name; } |
102 | void setName( QString s ) { name = s; } | 48 | void setName( QString s ) { name = s; } |
103 | const QString&getMail()const{ return mail; } | 49 | const QString&getMail()const{ return mail; } |
104 | void setMail( const QString&s ) { mail = s; } | 50 | void setMail( const QString&s ) { mail = s; } |
105 | const QString&getTo()const{ return to; } | 51 | const QString&getTo()const{ return to; } |
106 | void setTo( const QString&s ) { to = s; } | 52 | void setTo( const QString&s ) { to = s; } |
107 | const QString&getCC()const{ return cc; } | 53 | const QString&getCC()const{ return cc; } |
108 | void setCC( const QString&s ) { cc = s; } | 54 | void setCC( const QString&s ) { cc = s; } |
109 | const QString&getBCC()const { return bcc; } | 55 | const QString&getBCC()const { return bcc; } |
110 | void setBCC( const QString&s ) { bcc = s; } | 56 | void setBCC( const QString&s ) { bcc = s; } |
111 | const QString&getMessage()const { return message; } | 57 | const QString&getMessage()const { return message; } |
112 | void setMessage( const QString&s ) { message = s; } | 58 | void setMessage( const QString&s ) { message = s; } |
113 | const QString&getSubject()const { return subject; } | 59 | const QString&getSubject()const { return subject; } |
114 | void setSubject( const QString&s ) { subject = s; } | 60 | void setSubject( const QString&s ) { subject = s; } |
115 | const QString&getReply()const{ return reply; } | 61 | const QString&getReply()const{ return reply; } |
116 | void setReply( const QString&a ) { reply = a; } | 62 | void setReply( const QString&a ) { reply = a; } |
117 | 63 | ||
118 | private: | 64 | private: |
119 | QList<Attachment> attList; | 65 | QList<Attachment> attList; |
120 | QString name, mail, to, cc, bcc, reply, subject, message; | 66 | QString name, mail, to, cc, bcc, reply, subject, message; |
121 | }; | 67 | }; |
122 | 68 | ||
123 | class Folder : public QObject | 69 | class Folder : public QObject |
124 | { | 70 | { |
125 | Q_OBJECT | 71 | Q_OBJECT |
126 | 72 | ||
127 | public: | 73 | public: |
128 | Folder( const QString&init_name ); | 74 | Folder( const QString&init_name ); |
129 | const QString&getDisplayName()const { return nameDisplay; } | 75 | const QString&getDisplayName()const { return nameDisplay; } |
130 | const QString&getName()const { return name; } | 76 | const QString&getName()const { return name; } |
131 | virtual bool may_select()const{return true;}; | 77 | virtual bool may_select()const{return true;}; |
132 | 78 | ||
133 | private: | 79 | private: |
134 | QString nameDisplay, name; | 80 | QString nameDisplay, name; |
135 | 81 | ||