• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

KMBox Library

  • sources
  • kde-4.12
  • kdepimlibs
  • kmbox
mbox.h
1 /*
2  Copyright (c) 2009 Bertjan Broeksema <broeksema@kde.org>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 #ifndef KMBOX_MBOX_H
21 #define KMBOX_MBOX_H
22 
23 #include "kmbox_export.h"
24 #include "mboxentry.h"
25 
26 #include <kmime/kmime_message.h>
27 
28 namespace KMBox {
29 
30 class MBoxPrivate;
31 
38 class KMBOX_EXPORT MBox
39 {
40  public:
44  enum LockType {
45  ProcmailLockfile,
46  MuttDotlock,
47  MuttDotlockPrivileged,
48  None
49  };
50 
54  MBox();
55 
61  ~MBox();
62 
73  MBoxEntry appendMessage( const KMime::Message::Ptr &message );
74 
82  MBoxEntry::List entries( const MBoxEntry::List &deletedEntries = MBoxEntry::List() ) const;
83 
87  QString fileName() const;
88 
101  bool load( const QString &fileName );
102 
115  bool lock();
116 
120  bool locked() const;
121 
141  bool purge( const MBoxEntry::List &deletedEntries, QList<MBoxEntry::Pair> *movedEntries = 0 );
142 
155  KMime::Message *readMessage( const MBoxEntry &entry );
156 
168  QByteArray readMessageHeaders( const MBoxEntry &entry );
169 
181  QByteArray readRawMessage( const MBoxEntry &entry );
182 
194  bool save( const QString &fileName = QString() );
195 
205  bool setLockType( LockType ltype );
206 
214  void setLockFile( const QString &lockFile );
215 
223  void setUnlockTimeout( int msec );
224 
232  bool unlock();
233 
234  private:
235  //@cond PRIVATE
236  friend class MBoxPrivate;
237  MBoxPrivate * const d;
238  //@endcond
239 };
240 
241 }
242 
243 #endif // KMBOX_MBOX_H
KMBox::MBox
A class to access mail storages in MBox format.
Definition: mbox.h:38
KMBox::MBoxEntry::List
QList< MBoxEntry > List
Describes a list of mbox entry objects.
Definition: mboxentry.h:44
KMBox::MBox::LockType
LockType
Describes the type of locking that will be used.
Definition: mbox.h:44
KMBox::MBoxEntry
A class that encapsulates an entry of a MBox.
Definition: mboxentry.h:38
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KMBox Library

Skip menu "KMBox Library"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Members
  • File List
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal