00001 #ifndef MAILBOXMAILFOLDER_H 00002 #define MAILBOXMAILFOLDER_H 00003 00004 /* 00005 * Mailbox mail folder access 00006 * 00007 * Copyright (C) 2004 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 #include <buffy/MailFolder.h> 00025 #include <string> 00026 00027 namespace buffy { 00028 00029 class MailboxMailFolder : public MailFolderImpl 00030 { 00031 protected: 00032 std::string _name; 00033 std::string _path; 00034 int _stat_total; 00035 int _stat_unread; 00036 int _stat_new; 00037 int _stat_flagged; 00038 int _mbox_mtime; 00039 int _mbox_size; 00040 int _deleted; 00041 00042 public: 00043 MailboxMailFolder(const std::string& path) throw (); 00044 MailboxMailFolder(const std::string& name, const std::string& path) throw (); 00045 virtual ~MailboxMailFolder() throw () {} 00046 00047 virtual const std::string& name() const throw () { return _name; } 00048 virtual const std::string& path() const throw () { return _path; } 00049 virtual std::string type() const throw () { return "Mailbox"; } 00050 00051 virtual int getMsgTotal() const throw () { return _stat_total; } 00052 virtual int getMsgUnread() const throw () { return _stat_unread; } 00053 virtual int getMsgNew() const throw () { return _stat_new; } 00054 virtual int getMsgFlagged() const throw () { return _stat_flagged; } 00055 00056 virtual bool changed(); 00057 virtual void updateStatistics(); 00058 00059 static MailFolder accessFolder(const std::string& path); 00060 static void enumerateFolders(const std::string& dir, MailFolderConsumer& cons); 00061 }; 00062 00063 } 00064 00065 // vim:set ts=4 sw=4: 00066 #endif