Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

mailwrapper.h

Go to the documentation of this file.
00001 #ifndef MAILWRAPPER_H
00002 #define MAILWRAPPER_H
00003 
00004 #include <qpe/applnk.h>
00005 
00006 #include <qbitarray.h>
00007 #include <qdatetime.h>
00008 
00009 #include "settings.h"
00010 
00011 #include <opie2/osmartpointer.h>
00012 
00013 class Attachment
00014 {
00015 public:
00016     Attachment( DocLnk lnk );
00017     virtual ~Attachment(){}
00018     const QString getFileName()const{ return doc.file(); }
00019     const QString getName()const{ return doc.name(); }
00020     const QString getMimeType()const{ return doc.type(); }
00021     const QPixmap getPixmap()const{ return doc.pixmap(); }
00022     const int getSize()const { return size; }
00023     DocLnk  getDocLnk() { return doc; }
00024 
00025 protected:
00026     DocLnk doc;
00027     int size;
00028 
00029 };
00030 
00031 class Mail:public Opie::Core::ORefCount
00032 {
00033 public:
00034     Mail();
00035     /* Possible that this destructor must not be declared virtual
00036      * 'cause it seems that it will never have some child classes.
00037      * in this case this object will not get a virtual table -> memory and
00038      * speed will be a little bit better?
00039      */
00040     virtual ~Mail(){}
00041     void addAttachment( Attachment *att ) { attList.append( att ); }
00042     const QList<Attachment>& getAttachments()const { return attList; }
00043     void removeAttachment( Attachment *att ) { attList.remove( att ); }
00044     const QString&getName()const { return name; }
00045     void setName( QString s ) { name = s; }
00046     const QString&getMail()const{ return mail; }
00047     void setMail( const QString&s ) { mail = s; }
00048     const QString&getTo()const{ return to; }
00049     void setTo( const QString&s ) { to = s; }
00050     const QString&getCC()const{ return cc; }
00051     void setCC( const QString&s ) { cc = s; }
00052     const QString&getBCC()const { return bcc; }
00053     void setBCC( const QString&s ) { bcc = s; }
00054     const QString&getMessage()const { return message; }
00055     void setMessage( const QString&s ) { message = s; }
00056     const QString&getSubject()const { return subject; }
00057     void setSubject( const QString&s ) { subject = s; }
00058     const QString&getReply()const{ return reply; }
00059     void setReply( const QString&a ) { reply = a; }
00060     void setInreply(const QStringList&list){m_in_reply_to = list;}
00061     const QStringList&Inreply()const{return m_in_reply_to;}
00062 
00063 private:
00064     QList<Attachment> attList;
00065     QString name, mail, to, cc, bcc, reply, subject, message;
00066     QStringList m_in_reply_to;
00067 };
00068 
00069 class Folder:public Opie::Core::ORefCount
00070 {
00071 public:
00072     Folder( const QString&init_name,const QString&sep );
00073     virtual ~Folder();
00074     const QString&getDisplayName()const { return nameDisplay; }
00075     const QString&getName()const { return name; }
00076     const QString&getPrefix()const{return prefix; }
00077     virtual bool may_select()const{return true;}
00078     virtual bool no_inferior()const{return true;}
00079     const QString&Separator()const;
00080 
00081 protected:
00082     QString nameDisplay, name, separator,prefix;
00083 };
00084 
00085 typedef Opie::Core::OSmartPointer<Folder> FolderP;
00086 
00087 class MHFolder : public Folder
00088 {
00089 public:
00090     MHFolder(const QString&disp_name,const QString&mbox);
00091     virtual ~MHFolder();
00092 };
00093 
00094 class IMAPFolder : public Folder
00095 {
00096     public:
00097         IMAPFolder(const QString&name, const QString&sep, bool select=true,bool noinf=false,const QString&prefix="" );
00098         virtual ~IMAPFolder();
00099         virtual bool may_select()const{return m_MaySelect;}
00100         virtual bool no_inferior()const{return m_NoInferior;}
00101     private:
00102         static QString decodeFolderName( const QString &name );
00103         bool m_MaySelect,m_NoInferior;
00104 };
00105 
00106 #endif

Generated on Sat Nov 5 16:17:38 2005 for OPIE by  doxygen 1.4.2