author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kmicromail/libmailwrapper/mailwrapper.h | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
Diffstat (limited to 'kmicromail/libmailwrapper/mailwrapper.h') (more/less context) (show whitespace changes)
-rw-r--r-- | kmicromail/libmailwrapper/mailwrapper.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kmicromail/libmailwrapper/mailwrapper.h b/kmicromail/libmailwrapper/mailwrapper.h index 3e8b51f..bebabf4 100644 --- a/kmicromail/libmailwrapper/mailwrapper.h +++ b/kmicromail/libmailwrapper/mailwrapper.h | |||
@@ -1,131 +1,133 @@ | |||
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 <qbitarray.h> | 6 | #include <qbitarray.h> |
7 | #include <qdatetime.h> | 7 | #include <qdatetime.h> |
8 | #include <qfileinfo.h> | 8 | #include <qfileinfo.h> |
9 | //Added by qt3to4: | ||
10 | #include <QPixmap> | ||
9 | #include <kiconloader.h> | 11 | #include <kiconloader.h> |
10 | 12 | ||
11 | #include "settings.h" | 13 | #include "settings.h" |
12 | 14 | ||
13 | #include <opie2/osmartpointer.h> | 15 | #include <opie2/osmartpointer.h> |
14 | /* | 16 | /* |
15 | class Attachment | 17 | class Attachment |
16 | { | 18 | { |
17 | public: | 19 | public: |
18 | Attachment( DocLnk lnk ); | 20 | Attachment( DocLnk lnk ); |
19 | virtual ~Attachment(){} | 21 | virtual ~Attachment(){} |
20 | const QString getFileName()const{ return doc.file(); } | 22 | const QString getFileName()const{ return doc.file(); } |
21 | const QString getName()const{ return doc.name(); } | 23 | const QString getName()const{ return doc.name(); } |
22 | const QString getMimeType()const{ return doc.type(); } | 24 | const QString getMimeType()const{ return doc.type(); } |
23 | const QPixmap getPixmap()const{ return doc.pixmap(); } | 25 | const QPixmap getPixmap()const{ return doc.pixmap(); } |
24 | const int getSize()const { return size; } | 26 | const int getSize()const { return size; } |
25 | DocLnk getDocLnk() { return doc; } | 27 | DocLnk getDocLnk() { return doc; } |
26 | 28 | ||
27 | protected: | 29 | protected: |
28 | DocLnk doc; | 30 | DocLnk doc; |
29 | int size; | 31 | int size; |
30 | 32 | ||
31 | }; | 33 | }; |
32 | */ | 34 | */ |
33 | 35 | ||
34 | class Attachment | 36 | class Attachment |
35 | { | 37 | { |
36 | public: | 38 | public: |
37 | Attachment( QString lnk ); | 39 | Attachment( QString lnk ); |
38 | virtual ~Attachment(){} | 40 | virtual ~Attachment(){} |
39 | const QString getFileName()const{ return doc; } | 41 | const QString getFileName()const{ return doc; } |
40 | const QString getName()const{ return QFileInfo( doc ).baseName (); } | 42 | const QString getName()const{ return QFileInfo( doc ).baseName (); } |
41 | const QString getMimeType()const{ return QFileInfo( doc ).extension(false); } | 43 | const QString getMimeType()const{ return QFileInfo( doc ).extension(false); } |
42 | const QPixmap getPixmap()const{ return mPix; } | 44 | const QPixmap getPixmap()const{ return mPix; } |
43 | const int getSize()const { return size; } | 45 | const int getSize()const { return size; } |
44 | QString getDocLnk() { return doc; } | 46 | QString getDocLnk() { return doc; } |
45 | 47 | ||
46 | protected: | 48 | protected: |
47 | QPixmap mPix; | 49 | QPixmap mPix; |
48 | QString doc; | 50 | QString doc; |
49 | int size; | 51 | int size; |
50 | 52 | ||
51 | }; | 53 | }; |
52 | 54 | ||
53 | class Mail:public Opie::Core::ORefCount | 55 | class Mail:public Opie::Core::ORefCount |
54 | { | 56 | { |
55 | public: | 57 | public: |
56 | Mail(); | 58 | Mail(); |
57 | /* Possible that this destructor must not be declared virtual | 59 | /* Possible that this destructor must not be declared virtual |
58 | * 'cause it seems that it will never have some child classes. | 60 | * 'cause it seems that it will never have some child classes. |
59 | * in this case this object will not get a virtual table -> memory and | 61 | * in this case this object will not get a virtual table -> memory and |
60 | * speed will be a little bit better? | 62 | * speed will be a little bit better? |
61 | */ | 63 | */ |
62 | virtual ~Mail(){} | 64 | virtual ~Mail(){} |
63 | void addAttachment( Attachment *att ) { attList.append( att ); } | 65 | void addAttachment( Attachment *att ) { attList.append( att ); } |
64 | const QList<Attachment>& getAttachments()const { return attList; } | 66 | const QList<Attachment*>& getAttachments()const { return attList; } |
65 | void removeAttachment( Attachment *att ) { attList.remove( att ); } | 67 | void removeAttachment( Attachment *att ) { attList.remove( att ); } |
66 | const QString&getName()const { return name; } | 68 | const QString&getName()const { return name; } |
67 | void setName( QString s ) { name = s; } | 69 | void setName( QString s ) { name = s; } |
68 | const QString&getMail()const{ return mail; } | 70 | const QString&getMail()const{ return mail; } |
69 | void setMail( const QString&s ) { mail = s; } | 71 | void setMail( const QString&s ) { mail = s; } |
70 | const QString&getTo()const{ return to; } | 72 | const QString&getTo()const{ return to; } |
71 | void setTo( const QString&s ) { to = s; } | 73 | void setTo( const QString&s ) { to = s; } |
72 | const QString&getCC()const{ return cc; } | 74 | const QString&getCC()const{ return cc; } |
73 | void setCC( const QString&s ) { cc = s; } | 75 | void setCC( const QString&s ) { cc = s; } |
74 | const QString&getBCC()const { return bcc; } | 76 | const QString&getBCC()const { return bcc; } |
75 | void setBCC( const QString&s ) { bcc = s; } | 77 | void setBCC( const QString&s ) { bcc = s; } |
76 | const QString&getMessage()const { return message; } | 78 | const QString&getMessage()const { return message; } |
77 | void setMessage( const QString&s ) { message = s; } | 79 | void setMessage( const QString&s ) { message = s; } |
78 | const QString&getSubject()const { return subject; } | 80 | const QString&getSubject()const { return subject; } |
79 | void setSubject( const QString&s ) { subject = s; } | 81 | void setSubject( const QString&s ) { subject = s; } |
80 | const QString&getReply()const{ return reply; } | 82 | const QString&getReply()const{ return reply; } |
81 | void setReply( const QString&a ) { reply = a; } | 83 | void setReply( const QString&a ) { reply = a; } |
82 | void setInreply(const QStringList&list){m_in_reply_to = list;} | 84 | void setInreply(const QStringList&list){m_in_reply_to = list;} |
83 | const QStringList&Inreply()const{return m_in_reply_to;} | 85 | const QStringList&Inreply()const{return m_in_reply_to;} |
84 | 86 | ||
85 | void setCharset( const QString&a ) { charset= a; } | 87 | void setCharset( const QString&a ) { charset= a; } |
86 | const QString& getCharset() const { return charset; } | 88 | const QString& getCharset() const { return charset; } |
87 | 89 | ||
88 | private: | 90 | private: |
89 | QList<Attachment> attList; | 91 | QList<Attachment*> attList; |
90 | QString name, mail, to, cc, bcc, reply, subject, message, charset; | 92 | QString name, mail, to, cc, bcc, reply, subject, message, charset; |
91 | QStringList m_in_reply_to; | 93 | QStringList m_in_reply_to; |
92 | }; | 94 | }; |
93 | 95 | ||
94 | class Folder:public Opie::Core::ORefCount | 96 | class Folder:public Opie::Core::ORefCount |
95 | { | 97 | { |
96 | public: | 98 | public: |
97 | Folder( const QString&init_name,const QString&sep ); | 99 | Folder( const QString&init_name,const QString&sep ); |
98 | virtual ~Folder(); | 100 | virtual ~Folder(); |
99 | const QString&getDisplayName()const { return nameDisplay; } | 101 | const QString&getDisplayName()const { return nameDisplay; } |
100 | const QString&getName()const { return name; } | 102 | const QString&getName()const { return name; } |
101 | const QString&getPrefix()const{return prefix; } | 103 | const QString&getPrefix()const{return prefix; } |
102 | virtual bool may_select()const{return true;} | 104 | virtual bool may_select()const{return true;} |
103 | virtual bool no_inferior()const{return true;} | 105 | virtual bool no_inferior()const{return true;} |
104 | const QString&Separator()const; | 106 | const QString&Separator()const; |
105 | 107 | ||
106 | protected: | 108 | protected: |
107 | QString nameDisplay, name, separator,prefix; | 109 | QString nameDisplay, name, separator,prefix; |
108 | }; | 110 | }; |
109 | 111 | ||
110 | typedef Opie::Core::OSmartPointer<Folder> FolderP; | 112 | typedef Opie::Core::OSmartPointer<Folder> FolderP; |
111 | 113 | ||
112 | class MHFolder : public Folder | 114 | class MHFolder : public Folder |
113 | { | 115 | { |
114 | public: | 116 | public: |
115 | MHFolder(const QString&disp_name,const QString&mbox); | 117 | MHFolder(const QString&disp_name,const QString&mbox); |
116 | virtual ~MHFolder(); | 118 | virtual ~MHFolder(); |
117 | }; | 119 | }; |
118 | 120 | ||
119 | class IMAPFolder : public Folder | 121 | class IMAPFolder : public Folder |
120 | { | 122 | { |
121 | public: | 123 | public: |
122 | IMAPFolder(const QString&name, const QString&sep, bool select=true,bool noinf=false,const QString&prefix="" ); | 124 | IMAPFolder(const QString&name, const QString&sep, bool select=true,bool noinf=false,const QString&prefix="" ); |
123 | virtual ~IMAPFolder(); | 125 | virtual ~IMAPFolder(); |
124 | virtual bool may_select()const{return m_MaySelect;} | 126 | virtual bool may_select()const{return m_MaySelect;} |
125 | virtual bool no_inferior()const{return m_NoInferior;} | 127 | virtual bool no_inferior()const{return m_NoInferior;} |
126 | static QString decodeFolderName( const QString &name ); | 128 | static QString decodeFolderName( const QString &name ); |
127 | private: | 129 | private: |
128 | bool m_MaySelect,m_NoInferior; | 130 | bool m_MaySelect,m_NoInferior; |
129 | }; | 131 | }; |
130 | 132 | ||
131 | #endif | 133 | #endif |