Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

MailFolder.h

Go to the documentation of this file.
00001 #ifndef MAILFOLDER_H
00002 #define MAILFOLDER_H
00003 
00004 /*
00005  * Abstract interface to mail folders
00006  *
00007  * Copyright (C) 2003  Enrico Zini <enrico@debian.org>
00008  *
00009  * This library is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public
00011  * License as published by the Free Software Foundation; either
00012  * version 2.1 of the License, or (at your option) any later version.
00013  *
00014  * This library is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017  * Lesser General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU Lesser General Public
00020  * License along with this library; if not, write to the Free Software
00021  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00022  */
00023 
00024 #pragma interface
00025 
00026 #include <buffy/Consumer.h>
00027 #include <buffy/SmartPointer.h>
00028 #include <string>
00029 #include <vector>
00030 
00031 class MailFolderImpl : public SmartPointerItem
00032 {
00033 public:
00034     virtual const std::string& name() const throw () = 0;
00035     virtual const std::string& path() const throw () = 0;
00036 
00037     virtual int getMsgTotal() const throw () = 0;
00038     virtual int getMsgUnread() const throw () = 0;
00039     virtual int getMsgNew() const throw () = 0;
00040     virtual int getMsgFlagged() const throw () = 0;
00041 
00042     virtual bool changed() = 0;
00043 
00044     virtual void updateStatistics() = 0;
00045 };
00046 
00047 class MailFolder : public SmartPointer<MailFolderImpl>
00048 {
00049 public:
00050     MailFolder() throw () : SmartPointer<MailFolderImpl>() {}
00051     MailFolder(const MailFolder& mf) throw () : SmartPointer<MailFolderImpl>(mf) {}
00052     MailFolder(MailFolderImpl* otherimpl) throw () : SmartPointer<MailFolderImpl>(otherimpl) {}
00053 
00054     const std::string& name() const throw () { return impl->name(); }
00055     const std::string& path() const throw () { return impl->path(); }
00056 
00057     int getMsgTotal() const throw () { return impl->getMsgTotal(); }
00058     int getMsgUnread() const throw () { return impl->getMsgUnread(); }
00059     int getMsgNew() const throw () { return impl->getMsgNew(); }
00060     int getMsgFlagged() const throw () { return impl->getMsgFlagged(); }
00061 
00063     bool changed() { return impl->changed(); }
00064 
00066     void updateStatistics()
00067     {
00068         impl->updateStatistics();
00069     }
00070 
00071 //  static void enumerateFoldersSwig(const char* path, Consumer<MailFolder>& cons);
00072     static void enumerateFolders(const std::string& path, Consumer<MailFolder>& cons);
00073     static std::vector<MailFolder> enumerateFolders(const std::string& path);
00074 };
00075 
00076 typedef Consumer<MailFolder> MailFolderConsumer;
00077 typedef Filter<MailFolder> MailFolderFilter;
00078 
00079 // vim:set ts=4 sw=4:
00080 #endif

Generated on Wed Mar 23 12:37:00 2005 for libbuffy by  doxygen 1.4.0