summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/mailwrapper.h
Unidiff
Diffstat (limited to 'kmicromail/libmailwrapper/mailwrapper.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/mailwrapper.h128
1 files changed, 128 insertions, 0 deletions
diff --git a/kmicromail/libmailwrapper/mailwrapper.h b/kmicromail/libmailwrapper/mailwrapper.h
new file mode 100644
index 0000000..adfac6a
--- a/dev/null
+++ b/kmicromail/libmailwrapper/mailwrapper.h
@@ -0,0 +1,128 @@
1#ifndef MAILWRAPPER_H
2#define MAILWRAPPER_H
3
4#include <qpe/applnk.h>
5
6#include <qbitarray.h>
7#include <qdatetime.h>
8#include <qfileinfo.h>
9#include <kiconloader.h>
10
11#include "settings.h"
12
13#include <opie2/osmartpointer.h>
14/*
15class Attachment
16{
17public:
18 Attachment( DocLnk lnk );
19 virtual ~Attachment(){}
20 const QString getFileName()const{ return doc.file(); }
21 const QString getName()const{ return doc.name(); }
22 const QString getMimeType()const{ return doc.type(); }
23 const QPixmap getPixmap()const{ return doc.pixmap(); }
24 const int getSize()const { return size; }
25 DocLnk getDocLnk() { return doc; }
26
27protected:
28 DocLnk doc;
29 int size;
30
31};
32*/
33
34class Attachment
35{
36public:
37 Attachment( QString lnk );
38 virtual ~Attachment(){}
39 const QString getFileName()const{ return QFileInfo( doc ).fileName (); }
40 const QString getName()const{ return QFileInfo( doc ).baseName (); }
41 const QString getMimeType()const{ return QFileInfo( doc ).extension(false); }
42 const QPixmap getPixmap()const{ return mPix; }
43 const int getSize()const { return size; }
44 QString getDocLnk() { return doc; }
45
46protected:
47 QPixmap mPix;
48 QString doc;
49 int size;
50
51};
52
53class Mail:public Opie::Core::ORefCount
54{
55public:
56 Mail();
57 /* Possible that this destructor must not be declared virtual
58 * '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
60 * speed will be a little bit better?
61 */
62 virtual ~Mail(){}
63 void addAttachment( Attachment *att ) { attList.append( att ); }
64 const QList<Attachment>& getAttachments()const { return attList; }
65 void removeAttachment( Attachment *att ) { attList.remove( att ); }
66 const QString&getName()const { return name; }
67 void setName( QString s ) { name = s; }
68 const QString&getMail()const{ return mail; }
69 void setMail( const QString&s ) { mail = s; }
70 const QString&getTo()const{ return to; }
71 void setTo( const QString&s ) { to = s; }
72 const QString&getCC()const{ return cc; }
73 void setCC( const QString&s ) { cc = s; }
74 const QString&getBCC()const { return bcc; }
75 void setBCC( const QString&s ) { bcc = s; }
76 const QString&getMessage()const { return message; }
77 void setMessage( const QString&s ) { message = s; }
78 const QString&getSubject()const { return subject; }
79 void setSubject( const QString&s ) { subject = s; }
80 const QString&getReply()const{ return reply; }
81 void setReply( const QString&a ) { reply = a; }
82 void setInreply(const QStringList&list){m_in_reply_to = list;}
83 const QStringList&Inreply()const{return m_in_reply_to;}
84
85private:
86 QList<Attachment> attList;
87 QString name, mail, to, cc, bcc, reply, subject, message;
88 QStringList m_in_reply_to;
89};
90
91class Folder:public Opie::Core::ORefCount
92{
93public:
94 Folder( const QString&init_name,const QString&sep );
95 virtual ~Folder();
96 const QString&getDisplayName()const { return nameDisplay; }
97 const QString&getName()const { return name; }
98 const QString&getPrefix()const{return prefix; }
99 virtual bool may_select()const{return true;}
100 virtual bool no_inferior()const{return true;}
101 const QString&Separator()const;
102
103protected:
104 QString nameDisplay, name, separator,prefix;
105};
106
107typedef Opie::Core::OSmartPointer<Folder> FolderP;
108
109class MHFolder : public Folder
110{
111public:
112 MHFolder(const QString&disp_name,const QString&mbox);
113 virtual ~MHFolder();
114};
115
116class IMAPFolder : public Folder
117{
118 public:
119 IMAPFolder(const QString&name, const QString&sep, bool select=true,bool noinf=false,const QString&prefix="" );
120 virtual ~IMAPFolder();
121 virtual bool may_select()const{return m_MaySelect;}
122 virtual bool no_inferior()const{return m_NoInferior;}
123 private:
124 static QString decodeFolderName( const QString &name );
125 bool m_MaySelect,m_NoInferior;
126};
127
128#endif