KMBox Library
mbox.h
00001 /* 00002 Copyright (c) 2009 Bertjan Broeksema <broeksema@kde.org> 00003 00004 This library is free software; you can redistribute it and/or modify it 00005 under the terms of the GNU Library General Public License as published by 00006 the Free Software Foundation; either version 2 of the License, or (at your 00007 option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, but WITHOUT 00010 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00011 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00012 License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to the 00016 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00017 02110-1301, USA. 00018 */ 00019 00020 #ifndef KMBOX_MBOX_H 00021 #define KMBOX_MBOX_H 00022 00023 #include "kmbox_export.h" 00024 #include "mboxentry.h" 00025 00026 #include <kmime/kmime_message.h> 00027 00028 namespace KMBox { 00029 00030 class MBoxPrivate; 00031 00038 class KMBOX_EXPORT MBox 00039 { 00040 public: 00044 enum LockType { 00045 ProcmailLockfile, 00046 MuttDotlock, 00047 MuttDotlockPrivileged, 00048 None 00049 }; 00050 00054 MBox(); 00055 00061 ~MBox(); 00062 00073 MBoxEntry appendMessage( const KMime::Message::Ptr &message ); 00074 00082 MBoxEntry::List entries( const MBoxEntry::List &deletedEntries = MBoxEntry::List() ) const; 00083 00087 QString fileName() const; 00088 00101 bool load( const QString &fileName ); 00102 00115 bool lock(); 00116 00120 bool locked() const; 00121 00141 bool purge( const MBoxEntry::List &deletedEntries, QList<MBoxEntry::Pair> *movedEntries = 0 ); 00142 00155 KMime::Message *readMessage( const MBoxEntry &entry ); 00156 00168 QByteArray readMessageHeaders( const MBoxEntry &entry ); 00169 00181 QByteArray readRawMessage( const MBoxEntry &entry ); 00182 00194 bool save( const QString &fileName = QString() ); 00195 00205 bool setLockType( LockType ltype ); 00206 00213 void setLockFile( const QString &lockFile ); 00214 00221 void setUnlockTimeout( int msec ); 00222 00230 bool unlock(); 00231 00232 private: 00233 //@cond PRIVATE 00234 friend class MBoxPrivate; 00235 MBoxPrivate * const d; 00236 //@endcond 00237 }; 00238 00239 } 00240 00241 #endif // KMBOX_MBOX_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu Aug 2 2012 15:24:32 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu Aug 2 2012 15:24:32 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.