00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __blue_ext_httpmail_Folder_h_included__
00028 #define __blue_ext_httpmail_Folder_h_included__
00029
00030
00031
00032
00033 #include "Blue/Extension/HttpMail/Message.h"
00034
00035
00036
00037
00038
00039
00040 namespace blue {
00041 namespace ext {
00042 namespace httpmail {
00043
00044
00045
00046
00047 class Mailbox;
00048
00049
00062 class BLUE_EXPORT_HTTPMAIL Folder
00063 {
00064 public:
00065
00066
00067
00068
00070 Folder( Mailbox& mailbox, Folder* parent, String url );
00071
00073 ~Folder();
00074
00075
00076
00077
00078
00079
00081 String getUrl() const;
00082
00084 String getName() const;
00086 String getDisplayName() const;
00087
00089 int getMessageCount() const;
00091 int getMessageCountUnread() const;
00092
00094 int getFolderCount() const;
00095
00097 Folder* getFolder( int index );
00099 const Folder* getFolder( int index ) const;
00100
00102 Folder* getFolder( String folderName );
00104 const Folder* getFolder( String folderName ) const;
00105
00107 Array<Folder*> getFolders();
00109 const Array<Folder*> getFolders() const;
00110
00112 Message* getMessage( int index );
00114 const Message* getMessage( int index ) const;
00115
00117 Array<Message*> getMessages();
00119 const Array<Message*> getMessages() const;
00120
00125 Folder* getParent();
00127 const Folder* getParent() const;
00128
00129
00130
00131
00132
00133
00139 void setUrl( String url );
00144 void setName( String name );
00150 void setDisplay( String display );
00156 void setMessageCount( int messageCnt );
00162 void setMessageCountUnread( int messageCntUnread );
00163
00168 int createFolder( String folderName );
00170 void removeFolder( int index );
00172 void removeFolder( String folderName );
00173
00177 void moveMessage( int index, Folder* to );
00179 void moveMessage( Message* message, Folder* to );
00180
00184 void copyMessage( int index, Folder* to );
00186 void copyMessage( Message* message, Folder* to );
00187
00191 void removeMessage( int index );
00193 void removeMessage( Message* message );
00194
00198 void setMessageRead( int index, bool read );
00200 void setMessageRead( Message* message, bool read );
00201
00206 void refresh();
00207
00208
00209 protected:
00210
00211 private:
00216 Folder( const Folder& );
00218 const Folder& operator=( const Folder& );
00219
00220 Mailbox& m_mailbox;
00221 Folder* m_parent;
00222 String m_url;
00223 String m_name;
00224 String m_display;
00225 int m_msgCount;
00226 int32_t m_msgCountUnread;
00227
00228 Array<Folder*> m_folders;
00229 Array<Message*> m_messages;
00230 };
00231
00232
00233
00239 class BLUE_EXPORT_HTTPMAIL FolderException :public HttpMailException
00240 {
00241 public:
00242 FolderException( String desc )
00243 :HttpMailException(desc) {}
00244
00245 virtual String getException() const {
00246 return ("FolderException");
00247 }
00248 };
00249
00250
00251 }}}
00252
00253
00254
00255
00256
00257
00258
00259
00260 #endif // include guard