• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kmail

kmfoldermbox.h

Go to the documentation of this file.
00001 /*
00002  * kmail: KDE mail client
00003  * Copyright (c) 1996-1998 Stefan Taferner <taferner@kde.org>
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018  *
00019  */
00020 #ifndef kmfoldermbox_h
00021 #define kmfoldermbox_h
00022 
00023 #include "kmfolderindex.h"
00024 #include "mboxjob.h"
00025 
00026 #include <QList>
00027 
00028 namespace KMail {
00029   class FolderJob;
00030   class MboxJob;
00031   class AttachmentStrategy;
00032 }
00033 using KMail::FolderJob;
00034 using KMail::MboxJob;
00035 using KMail::AttachmentStrategy;
00036 
00037 /* Mail folder.
00038  * (description will be here).
00039  *
00040  * Accounts:
00041  *   The accounts (of KMail) that are fed into the folder are
00042  *   represented as the children of the folder. They are only stored here
00043  *   during runtime to have a reference for which accounts point to a
00044  *   specific folder.
00045  */
00046 
00047 class KMFolderMbox : public KMFolderIndex
00048 {
00049   Q_OBJECT
00050   friend class ::KMail::MboxJob;
00051 public:
00052 
00053 
00057   explicit KMFolderMbox(KMFolder* folder, const char* name=0);
00058   virtual ~KMFolderMbox();
00059 
00061   virtual KMFolderType folderType() const { return KMFolderTypeMbox; }
00062 
00064   DwString getDwString(int idx);
00065 
00072   virtual int addMsg( KMMessage* msg, int* index_return = 0 );
00073 
00079   virtual int open( const char *owner );
00080 
00082   virtual void reallyDoClose();
00083 
00084   virtual bool canAccess() const;
00085 
00087   virtual void sync();
00088 
00090   virtual int create();
00091 
00094   virtual int compact( bool silent );
00095 
00098   int compact( unsigned int startIndex, int nbMessages, FILE* tmpFile,
00099                off_t& offs, bool& done );
00100 
00102   virtual bool isReadOnly() const { return mReadOnly; }
00103 
00105   bool isLocked() const { return mFilesLocked; }
00106 
00107   void setLockType( LockType ltype=FCNTL );
00108 
00109   void setProcmailLockFileName( const QString& );
00110 
00111   static QByteArray escapeFrom( const DwString & str );
00112 
00113   virtual IndexStatus indexStatus();
00114 
00116   virtual qint64 doFolderSize() const;
00117 
00118 protected:
00119   virtual FolderJob* doCreateJob( KMMessage *msg, FolderJob::JobType jt, KMFolder *folder,
00120                                   const QString &partSpecifier, const AttachmentStrategy *as ) const;
00121   virtual FolderJob* doCreateJob( QList<KMMessage*>& msgList, const QString& sets,
00122                                   FolderJob::JobType jt, KMFolder *folder ) const;
00125   virtual KMMessage* readMsg(int idx);
00126 
00130   virtual int createIndexFromContents();
00131 
00134   virtual int lock();
00135 
00138   virtual int unlock();
00139 
00143   virtual int removeContents();
00144 
00148   virtual int expungeContents();
00149 
00150 private:
00151   FILE *mStream;
00152   bool mFilesLocked; // true if the files of the folder are locked (writable)
00153   bool mReadOnly; // true if locking failed
00154   LockType mLockType;
00155   QString mProcmailLockFileName;
00156   QStringList mOwners;
00157 };
00158 
00159 #endif // kmfoldermbox_h

kmail

Skip menu "kmail"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal