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

kmail

KMFolderCachedImap Class Reference

#include <kmfoldercachedimap.h>

Inheritance diagram for KMFolderCachedImap:

Inheritance graph
[legend]

List of all members.


Detailed Description

Definition at line 89 of file kmfoldercachedimap.h.


Public Types

typedef QVector
< KMail::ACLListEntry > 
ACLList
enum  imapState { imapNoInformation = 0, imapInProgress = 1, imapFinished = 2 }
enum  IncidencesFor { IncForNobody, IncForAdmins, IncForReaders }

Public Slots

void slotCheckNamespace (const QStringList &folderNames, const QStringList &folderPaths, const QStringList &folderMimeTypes, const QStringList &folderAttributes, const ImapAccountBase::jobData &jobData)
void slotListResult (const QStringList &folderNames, const QStringList &folderPaths, const QStringList &folderMimeTypes, const QStringList &folderAttributes, const ImapAccountBase::jobData &jobData)
void slotSimpleData (KIO::Job *job, const QByteArray &data)
void slotTroubleshoot ()

Signals

void folderComplete (KMFolderCachedImap *folder, bool success)
void listComplete (KMFolderCachedImap *folder)
void syncState (int state, int number)

Public Member Functions

KMAcctCachedImap * account () const
const ACLList & aclList () const
virtual int addMsg (KMMessage *msg, int *index_return=0)
virtual int addMsgInternal (KMMessage *msg, bool, int *index_return=0)
virtual int addMsgKeepUID (KMMessage *msg, int *index_return=0)
bool alarmsBlocked () const
QString annotationFolderType () const
void checkUidValidity ()
void clearUidMap ()
virtual int create ()
virtual int createIndexFromContents ()
int createIndexFromContentsRecursive ()
KMMsgBase * findByUID (ulong uid)
QString folderAttributes () const
virtual KMFolderType folderType () const
virtual imapState getContentState ()
virtual imapState getSubfolderState ()
QString imapPath () const
const QString & imapPathForCreation ()
IncidencesFor incidencesFor () const
void initializeFrom (KMFolderCachedImap *parent)
bool isCloseToQuota () const
virtual bool isMoveable () const
bool isReadOnly () const
 KMFolderCachedImap (KMFolder *folder, const char *name=0)
ulong lastUid ()
virtual bool listDirectory ()
virtual void listNamespaces ()
QStringList namespacesToList ()
int permanentFlags () const
int progress () const
const QuotaInfo quotaInfo () const
virtual void readConfig ()
int readUidCache ()
virtual void remove ()
virtual void removeMsg (int i, bool imapQuiet=false)
virtual int rename (const QString &aName, KMFolderDir *aParent=0)
void resetSyncState ()
void sendFolderComplete (bool success)
virtual void serverSync (bool recurse)
void setAccount (KMAcctCachedImap *acct)
void setACLList (const ACLList &arr)
void setAlarmsBlocked (bool blocked)
virtual void setContentState (imapState state)
void setImapPath (const QString &path)
void setImapPathForCreation (const QString &path)
void setIncidencesFor (IncidencesFor incfor)
void setLastUid (ulong uid)
void setNamespacesToList (QStringList list)
void setQuotaInfo (const QuotaInfo &)
void setSilentUpload (bool silent)
virtual void setStatus (QList< int > &ids, const MessageStatus &status, bool toggle)
virtual void setStatus (int id, const MessageStatus &status, bool toggle)
virtual void setSubfolderState (imapState state)
void setUidValidity (const QString &validity)
void setUserRights (unsigned int userRights)
bool silentUpload ()
virtual KMMessage * take (int idx)
KMFolder * trashFolder () const
QString uidCacheLocation () const
QString uidValidity () const
void updateAnnotationFolderType ()
int userRights () const
virtual void writeConfig ()
void writeConfigKeysWhichShouldNotGetOverwrittenByReadConfig ()
int writeUidCache ()
virtual ~KMFolderCachedImap ()

Static Public Member Functions

static QString cacheLocation ()

Protected Slots

void getMessagesResult (KMail::FolderJob *job, bool lastSet)
void slotACLChanged (const QString &, int)
void slotAnnotationChanged (const QString &entry, const QString &attribute, const QString &value)
void slotAnnotationResult (const QString &entry, const QString &value, bool found)
void slotCheckUidValidityResult (KMail::FolderJob *job)
void slotConnectionResult (int errorCode, const QString &errorMsg)
void slotDeleteMessagesResult (KMail::FolderJob *job)
void slotGetAnnotationResult (KJob *job)
void slotGetLastMessagesResult (KMail::FolderJob *job)
void slotGetMessagesData (KIO::Job *job, const QByteArray &data)
void slotImapStatusChanged (KMFolder *folder, const QString &, bool)
void slotMultiSetACLResult (KJob *job)
void slotMultiUrlGetAnnotationResult (KJob *job)
void slotPermanentFlags (int flags)
void slotProgress (unsigned long done, unsigned long total)
void slotPutProgress (unsigned long, unsigned long)
void slotQuotaResult (KJob *job)
void slotReceivedACL (KMFolder *folder, KIO::Job *job, const KMail::ACLList &arr)
void slotReceivedUserRights (KMFolder *folder)
void slotSetAnnotationResult (KJob *job)
void slotStorageQuotaResult (const QuotaInfo &info)
void slotSubFolderComplete (KMFolderCachedImap *, bool)
void slotTestAnnotationResult (KJob *job)

Protected Member Functions

virtual bool canRemoveFolder () const
void createFoldersNewOnServerAndFinishListing (const QVector< int > foldersNewOnServer)
void createNewFolders ()
bool deleteMessages ()
virtual FolderJob * doCreateJob (QList< KMMessage * > &msgList, const QString &sets, FolderJob::JobType jt, KMFolder *folder) const
virtual FolderJob * doCreateJob (KMMessage *msg, FolderJob::JobType jt, KMFolder *folder, const QString &partSpecifier, const AttachmentStrategy *as) const
virtual QList
< KMFolderCachedImap * > 
findNewFolders ()
virtual QList< unsigned long > findNewMessages ()
KMFolderCachedImap * findParent (const QString &path, const QString &name)
void listDirectory2 ()
void listMessages ()
void newState (int progress, const QString &syncStatus)
virtual void timerEvent (QTimerEvent *e)
void uploadFlags ()
void uploadNewMessages ()
void uploadSeenFlags ()

Member Typedef Documentation

typedef QVector<KMail::ACLListEntry> KMFolderCachedImap::ACLList

Returns the list of ACL for this folder.

Definition at line 311 of file kmfoldercachedimap.h.


Member Enumeration Documentation

enum KMFolderCachedImap::imapState

Enumerator:
imapNoInformation 
imapInProgress 
imapFinished 

Definition at line 149 of file kmfoldercachedimap.h.

enum KMFolderCachedImap::IncidencesFor

Free-busy and alarms relevance of this folder, i.e.

for whom should events in this calendar lead to "busy" periods in their freebusy lists, and who should get alarms for the incidences in this folder. Applies to Calendar and Task folders only.

Enumerator:
IncForNobody  Not relevant for free-busy and alarms to anybody.
IncForAdmins  Persons with admin permissions on this calendar.
IncForReaders  All readers of this calendar.

Definition at line 334 of file kmfoldercachedimap.h.


Constructor & Destructor Documentation

KMFolderCachedImap::KMFolderCachedImap ( KMFolder *  folder,
const char *  name = 0 
) [explicit]

Usually a parent is given.

But in some cases there is no fitting parent object available. Then the name of the folder is used as the absolute path to the folder file.

Definition at line 190 of file kmfoldercachedimap.cpp.

KMFolderCachedImap::~KMFolderCachedImap (  )  [virtual]

Definition at line 214 of file kmfoldercachedimap.cpp.


Member Function Documentation

KMAcctCachedImap * KMFolderCachedImap::account (  )  const [virtual]

Returns the account associated with this folder.

If no account exists yet, one is created.

Reimplemented from FolderStorage.

Definition at line 611 of file kmfoldercachedimap.cpp.

const ACLList& KMFolderCachedImap::aclList (  )  const [inline]

Definition at line 312 of file kmfoldercachedimap.h.

int KMFolderCachedImap::addMsg ( KMMessage *  msg,
int *  index_return = 0 
) [virtual]

Reimplemented from KMFolderMaildir.

Reimplemented from KMFolderMaildir.

Definition at line 479 of file kmfoldercachedimap.cpp.

int KMFolderCachedImap::addMsgInternal ( KMMessage *  msg,
bool  newMail,
int *  index_return = 0 
) [virtual]

Adds a message without clearing it's X-UID field.

Definition at line 451 of file kmfoldercachedimap.cpp.

virtual int KMFolderCachedImap::addMsgKeepUID ( KMMessage *  msg,
int *  index_return = 0 
) [inline, virtual]

(Note(bo): This needs to be fixed better at a later point.

) This is overridden by dIMAP because addMsg strips the X-UID header from the mail.

Reimplemented from FolderStorage.

Definition at line 236 of file kmfoldercachedimap.h.

bool KMFolderCachedImap::alarmsBlocked (  )  const

Should alarms for this folder be blocked? (Only useful for resource folders).

Definition at line 2872 of file kmfoldercachedimap.cpp.

QString KMFolderCachedImap::annotationFolderType (  )  const [inline]

Definition at line 323 of file kmfoldercachedimap.h.

static QString KMFolderCachedImap::cacheLocation (  )  [inline, static]

Definition at line 94 of file kmfoldercachedimap.h.

bool KMFolderCachedImap::canRemoveFolder (  )  const [protected, virtual]

Returns false if we have subfolders; else returns canRemoveFolder().

Definition at line 497 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::checkUidValidity (  ) 

Definition at line 1539 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::clearUidMap (  )  [inline]

Clears the map of which messages are considered present locally.

Needed when uidvalidity changes.

Definition at line 189 of file kmfoldercachedimap.h.

int KMFolderCachedImap::create (  )  [virtual]

Reimplemented from KMFolderMaildir.

Definition at line 344 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::createFoldersNewOnServerAndFinishListing ( const QVector< int >  foldersNewOnServer  )  [protected]

Definition at line 2172 of file kmfoldercachedimap.cpp.

virtual int KMFolderCachedImap::createIndexFromContents (  )  [inline, virtual]

Create index file from messages file and fill the message-info list mMsgList.

Returns 0 on success and an errno value (see fopen) on failure.

Reimplemented from KMFolderMaildir.

Definition at line 265 of file kmfoldercachedimap.h.

int KMFolderCachedImap::createIndexFromContentsRecursive (  ) 

Definition at line 2845 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::createNewFolders (  )  [protected]

Definition at line 1447 of file kmfoldercachedimap.cpp.

bool KMFolderCachedImap::deleteMessages (  )  [protected]

Returns true if there were messages to delete on the server.

Definition at line 1485 of file kmfoldercachedimap.cpp.

virtual FolderJob* KMFolderCachedImap::doCreateJob ( QList< KMMessage * > &  msgList,
const QString &  sets,
FolderJob::JobType  jt,
KMFolder *  folder 
) const [protected, virtual]

Reimplemented from KMFolderMaildir.

virtual FolderJob* KMFolderCachedImap::doCreateJob ( KMMessage *  msg,
FolderJob::JobType  jt,
KMFolder *  folder,
const QString &  partSpecifier,
const AttachmentStrategy *  as 
) const [protected, virtual]

Reimplemented from KMFolder.

Reimplemented from KMFolderMaildir.

KMMsgBase * KMFolderCachedImap::findByUID ( ulong  uid  ) 

Finds the message by UID.

Returns:
NULL if the message does not exist.

Definition at line 575 of file kmfoldercachedimap.cpp.

QList< KMFolderCachedImap * > KMFolderCachedImap::findNewFolders (  )  [protected, virtual]

Utility methods for syncing.

Finds new subfolders in the local cache that must be created in the server.

Definition at line 1461 of file kmfoldercachedimap.cpp.

QList< unsigned long > KMFolderCachedImap::findNewMessages (  )  [protected, virtual]

Utility methods for syncing.

Finds new messages in the local cache that must be uploaded.

Definition at line 1262 of file kmfoldercachedimap.cpp.

KMFolderCachedImap * KMFolderCachedImap::findParent ( const QString &  path,
const QString &  name 
) [protected]

Determines if there is a better parent then this folder.

Definition at line 2206 of file kmfoldercachedimap.cpp.

QString KMFolderCachedImap::folderAttributes (  )  const [inline]

Definition at line 368 of file kmfoldercachedimap.h.

void KMFolderCachedImap::folderComplete ( KMFolderCachedImap *  folder,
bool  success 
) [signal]

virtual KMFolderType KMFolderCachedImap::folderType (  )  const [inline, virtual]

Returns the type of this folder.

Reimplemented from KMFolderMaildir.

Definition at line 119 of file kmfoldercachedimap.h.

virtual imapState KMFolderCachedImap::getContentState (  )  [inline, virtual]

Definition at line 155 of file kmfoldercachedimap.h.

void KMFolderCachedImap::getMessagesResult ( KMail::FolderJob *  job,
bool  lastSet 
) [protected, slot]

Definition at line 1749 of file kmfoldercachedimap.cpp.

virtual imapState KMFolderCachedImap::getSubfolderState (  )  [inline, virtual]

Definition at line 158 of file kmfoldercachedimap.h.

QString KMFolderCachedImap::imapPath (  )  const [inline]

Definition at line 165 of file kmfoldercachedimap.h.

const QString& KMFolderCachedImap::imapPathForCreation (  )  [inline]

Specify an imap path that is used to create the folder on the server Otherwise the parent folder is used to construct the path.

Definition at line 365 of file kmfoldercachedimap.h.

IncidencesFor KMFolderCachedImap::incidencesFor (  )  const [inline]

Definition at line 340 of file kmfoldercachedimap.h.

void KMFolderCachedImap::initializeFrom ( KMFolderCachedImap *  parent  ) 

Initializes this storage from another.

Used when creating a child folder.

Definition at line 226 of file kmfoldercachedimap.cpp.

bool KMFolderCachedImap::isCloseToQuota (  )  const [virtual]

Reimplemented from superclass.

Reimplemented from FolderStorage.

Definition at line 2877 of file kmfoldercachedimap.cpp.

bool KMFolderCachedImap::isMoveable (  )  const [virtual]

Returns true if this folder can be moved.

Reimplemented from FolderStorage.

Definition at line 2828 of file kmfoldercachedimap.cpp.

bool KMFolderCachedImap::isReadOnly (  )  const [inline, virtual]

Returns true if the folder is read-only; false otherwise.

Reimplemented from KMFolderMaildir.

Definition at line 246 of file kmfoldercachedimap.h.

ulong KMFolderCachedImap::lastUid (  ) 

Definition at line 570 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::listComplete ( KMFolderCachedImap *  folder  )  [signal]

bool KMFolderCachedImap::listDirectory (  )  [virtual]

Lists a directory and add the contents to kmfoldermgr.

It uses a ListJob to get the folders

Returns:
false if the connection failed.

Definition at line 1925 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::listDirectory2 (  )  [protected]

Synchronizes the local folders as needed (creation/deletion).

No network communication here.

Definition at line 2026 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::listMessages (  )  [protected]

List the messages in a folder.

No directory listing done.

Definition at line 1577 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::listNamespaces (  )  [virtual]

Definition at line 1804 of file kmfoldercachedimap.cpp.

QStringList KMFolderCachedImap::namespacesToList (  )  [inline]

Returns a list of namespaces that need to be queried Is set by the account for the root folder when the listing starts.

Definition at line 352 of file kmfoldercachedimap.h.

void KMFolderCachedImap::newState ( int  progress,
const QString &  syncStatus 
) [protected]

Updates the progress status.

Definition at line 2428 of file kmfoldercachedimap.cpp.

int KMFolderCachedImap::permanentFlags (  )  const [inline]

Flags that can be permanently stored on the server.

Definition at line 359 of file kmfoldercachedimap.h.

int KMFolderCachedImap::progress (  )  const [inline]

Returns the cCurrent progress status (between 0 and 100).

Definition at line 220 of file kmfoldercachedimap.h.

const QuotaInfo KMFolderCachedImap::quotaInfo (  )  const [inline]

Returns the quota information for this folder.

Returns:
an invalid info if we haven't synced yet, or the server doesn't support quota. The difference can be figured out by asking the account whether it supports quota. If we have synced, the account supports quota, but there is no quota on the folder, the return info will be valid, but empty.
See also:
QuotaInfo::isEmpty(), QuotaInfo::isValid()

Definition at line 306 of file kmfoldercachedimap.h.

void KMFolderCachedImap::readConfig ( void   )  [virtual]

Read the config file.

Reimplemented from FolderStorage.

Definition at line 239 of file kmfoldercachedimap.cpp.

int KMFolderCachedImap::readUidCache (  ) 

Reads the uidValitidy and lastUid values from disk.

Definition at line 377 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::remove (  )  [virtual]

Removes this folder.

Reimplemented from FolderStorage.

Definition at line 353 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::removeMsg ( int  i,
bool  imapQuiet = false 
) [virtual]

Reimplemented from KMFolderMaildir.

Reimplemented from KMFolderMaildir.

Definition at line 490 of file kmfoldercachedimap.cpp.

int KMFolderCachedImap::rename ( const QString &  aName,
KMFolderDir *  aParent = 0 
) [virtual]

Reimplemented from KMFolder.

Moving is not supported, so aParent must be 0.

Reimplemented from FolderStorage.

Definition at line 506 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::resetSyncState (  ) 

Forces the sync state to be reset.

Definition at line 2403 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::sendFolderComplete ( bool  success  )  [inline]

Emits the folderComplete signal.

Definition at line 253 of file kmfoldercachedimap.h.

void KMFolderCachedImap::serverSync ( bool  recurse  )  [virtual]

Synchronizes this folder and it's subfolders with the server.

Definition at line 672 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::setAccount ( KMAcctCachedImap *  acct  ) 

Sets the imap account associated with this folder.

Definition at line 1776 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::setACLList ( const ACLList &  arr  ) 

Sets the list of ACL for this folder (for FolderDialogACLTab).

Definition at line 2353 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::setAlarmsBlocked ( bool  blocked  ) 

Block this folder from generating alarms, even if the annotations on it say otherwise.

Used to override alarms for read-only folders. (Only useful for resource folders)

Definition at line 2867 of file kmfoldercachedimap.cpp.

virtual void KMFolderCachedImap::setContentState ( imapState  state  )  [inline, virtual]

Definition at line 156 of file kmfoldercachedimap.h.

void KMFolderCachedImap::setImapPath ( const QString &  path  ) 

Sets the path to the imap folder on the server.

Definition at line 2470 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::setImapPathForCreation ( const QString &  path  )  [inline]

Definition at line 366 of file kmfoldercachedimap.h.

void KMFolderCachedImap::setIncidencesFor ( IncidencesFor  incfor  ) 

Definition at line 2513 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::setLastUid ( ulong  uid  ) 

Sets the highest UID in the folder.

Definition at line 552 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::setNamespacesToList ( QStringList  list  )  [inline]

Definition at line 353 of file kmfoldercachedimap.h.

void KMFolderCachedImap::setQuotaInfo ( const QuotaInfo &  info  ) 

Definition at line 2343 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::setSilentUpload ( bool  silent  )  [inline]

Sets the silentUpload flag, which removes the folder upload error dialog.

Definition at line 260 of file kmfoldercachedimap.h.

virtual void KMFolderCachedImap::setStatus ( QList< int > &  ids,
const MessageStatus &  status,
bool  toggle 
) [virtual]

Set the status of the message(s) in the QValueList ids to status.

Reimplemented from FolderStorage.

virtual void KMFolderCachedImap::setStatus ( int  id,
const MessageStatus &  status,
bool  toggle 
) [virtual]

Reimplemented so the mStatusChangedLocally bool can be set.

Reimplemented from FolderStorage.

void KMFolderCachedImap::setSubfolderState ( imapState  state  )  [virtual]

Definition at line 2453 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::setUidValidity ( const QString &  validity  )  [inline]

Sets the uidvalidity of the last update.

Definition at line 182 of file kmfoldercachedimap.h.

void KMFolderCachedImap::setUserRights ( unsigned int  userRights  ) 

Sets the user's rights on this folder.

Definition at line 2298 of file kmfoldercachedimap.cpp.

bool KMFolderCachedImap::silentUpload (  )  [inline]

Definition at line 263 of file kmfoldercachedimap.h.

void KMFolderCachedImap::slotACLChanged ( const QString &  userId,
int  permissions 
) [protected, slot]

Definition at line 2386 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::slotAnnotationChanged ( const QString &  entry,
const QString &  attribute,
const QString &  value 
) [protected, slot]

Definition at line 2738 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::slotAnnotationResult ( const QString &  entry,
const QString &  value,
bool  found 
) [protected, slot]

Definition at line 2521 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::slotCheckNamespace ( const QStringList &