kmail

KMFolderCachedImap Class Reference

Inheritance diagram for KMFolderCachedImap:

KMFolderMaildir KMFolderIndex FolderStorage List of all members.

Detailed Description

Definition at line 77 of file kmfoldercachedimap.h.


Public Types

enum  imapState { imapNoInformation = 0, imapInProgress = 1, imapFinished = 2 }
enum  IncidencesFor { IncForNobody, IncForAdmins, IncForReaders }
typedef QValueVector< KMail::ACLListEntryACLList

Public Slots

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

Signals

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

Public Member Functions

 KMFolderCachedImap (KMFolder *folder, const char *name=0)
virtual ~KMFolderCachedImap ()
void initializeFrom (KMFolderCachedImap *parent)
virtual void readConfig ()
virtual void writeConfig ()
void writeConfigKeysWhichShouldNotGetOverwrittenByReadConfig ()
virtual KMFolderType folderType () const
virtual int create ()
virtual void remove ()
virtual void serverSync (bool recurse)
void resetSyncState ()
void checkUidValidity ()
virtual imapState getContentState ()
virtual void setContentState (imapState state)
virtual imapState getSubfolderState ()
virtual void setSubfolderState (imapState state)
void setImapPath (const QString &path)
QString imapPath () const
void setLastUid (ulong uid)
ulong lastUid ()
KMMsgBasefindByUID (ulong uid)
void setUidValidity (const QString &validity)
QString uidValidity () const
void clearUidMap ()
void setAccount (KMAcctCachedImap *acct)
KMAcctCachedImapaccount () const
QString uidCacheLocation () const
int readUidCache ()
int writeUidCache ()
int progress () const
virtual int rename (const QString &aName, KMFolderDir *aParent=0)
virtual KMMessagetake (int idx)
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)
virtual void removeMsg (int i, bool imapQuiet=FALSE)
virtual void removeMsg (QPtrList< KMMessage > msgList, bool imapQuiet=FALSE)
bool isReadOnly () const
void sendFolderComplete (bool success)
void setSilentUpload (bool silent)
bool silentUpload ()
virtual int createIndexFromContents ()
virtual bool listDirectory ()
virtual void listNamespaces ()
KMFoldertrashFolder () const
int userRights () const
void setUserRights (unsigned int userRights)
const QuotaInfo quotaInfo () const
const ACLListaclList () const
void setACLList (const ACLList &arr)
virtual void setStatus (int id, KMMsgStatus status, bool toggle)
virtual void setStatus (QValueList< int > &ids, KMMsgStatus status, bool toggle)
QString annotationFolderType () const
void updateAnnotationFolderType ()
IncidencesFor incidencesFor () const
void setIncidencesFor (IncidencesFor incfor)
virtual bool isMoveable () const
QStringList namespacesToList ()
void setNamespacesToList (QStringList list)
const QString & imapPathForCreation ()
void setImapPathForCreation (const QString &path)

Static Public Member Functions

static QString cacheLocation ()

Protected Slots

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

Protected Member Functions

bool deleteMessages ()
void listMessages ()
void uploadNewMessages ()
void uploadFlags ()
void createNewFolders ()
void listDirectory2 ()
virtual QValueList< unsigned
long > 
findNewMessages ()
virtual QValueList< KMFolderCachedImap * > findNewFolders ()
virtual bool canRemoveFolder () const
virtual FolderJobdoCreateJob (KMMessage *msg, FolderJob::JobType jt, KMFolder *folder, QString partSpecifier, const AttachmentStrategy *as) const
virtual FolderJobdoCreateJob (QPtrList< KMMessage > &msgList, const QString &sets, FolderJob::JobType jt, KMFolder *folder) const
virtual void timerEvent (QTimerEvent *)
void newState (int progress, const QString &syncStatus)
KMFolderCachedImapfindParent (const QString &path, const QString &name)

Member Typedef Documentation

Return the list of ACL for this folder.

Definition at line 231 of file kmfoldercachedimap.h.


Member Enumeration Documentation

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.

IncForNobody: not relevant for free-busy and alarms to anybody IncForAdmins: apply to persons with admin permissions on this calendar IncForReaders: apply to all readers of this calendar

Definition at line 254 of file kmfoldercachedimap.h.


Constructor & Destructor Documentation

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

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 143 of file kmfoldercachedimap.cpp.


Member Function Documentation

void KMFolderCachedImap::initializeFrom ( KMFolderCachedImap parent  ) 

Initialize this storage from another one.

Used when creating a child folder

Definition at line 186 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::readConfig (  )  [virtual]

Read the config file.

Reimplemented from FolderStorage.

Definition at line 195 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::writeConfig (  )  [virtual]

Write the config file.

Reimplemented from FolderStorage.

Definition at line 248 of file kmfoldercachedimap.cpp.

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

Returns the type of this folder.

Reimplemented from KMFolderMaildir.

Definition at line 101 of file kmfoldercachedimap.h.

int KMFolderCachedImap::create (  )  [virtual]

Reimplemented from KMFolderMaildir.

Definition at line 293 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::remove (  )  [virtual]

Remove this folder.

Reimplemented from FolderStorage.

Definition at line 302 of file kmfoldercachedimap.cpp.

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

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

Definition at line 597 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::resetSyncState (  ) 

Force the sync state to be done.

Definition at line 2132 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::setImapPath ( const QString &  path  ) 

The path to the imap folder on the server.

Definition at line 2190 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::setLastUid ( ulong  uid  ) 

The highest UID in the folder.

Definition at line 490 of file kmfoldercachedimap.cpp.

KMMsgBase * KMFolderCachedImap::findByUID ( ulong  uid  ) 

Find message by UID.

Returns NULL if it doesn't exist

Definition at line 511 of file kmfoldercachedimap.cpp.

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

The uidvalidity of the last update.

Definition at line 137 of file kmfoldercachedimap.h.

void KMFolderCachedImap::clearUidMap (  )  [inline]

Forget which mails are considered locally present.

Needed when uidvalidity changes.

Definition at line 142 of file kmfoldercachedimap.h.

void KMFolderCachedImap::setAccount ( KMAcctCachedImap acct  ) 

The imap account associated with this folder.

Definition at line 1624 of file kmfoldercachedimap.cpp.

QString KMFolderCachedImap::uidCacheLocation (  )  const

Returns the filename of the uidcache file.

Definition at line 316 of file kmfoldercachedimap.cpp.

int KMFolderCachedImap::readUidCache (  ) 

Read the uidValitidy and lastUid values from disk.

Definition at line 323 of file kmfoldercachedimap.cpp.

int KMFolderCachedImap::writeUidCache (  ) 

Write the uidValitidy and lastUid values to disk.

Definition at line 349 of file kmfoldercachedimap.cpp.

int KMFolderCachedImap::progress (  )  const [inline]

Current progress status (between 0 and 100).

Definition at line 158 of file kmfoldercachedimap.h.

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

Physically rename the folder.

Returns zero on success and an errno on failure.

Reimplemented from FolderStorage.

Definition at line 453 of file kmfoldercachedimap.cpp.

KMMessage * KMFolderCachedImap::take ( int  idx  )  [virtual]

Detach message from this folder.

Usable to call addMsg() afterwards. Loads the message if it is not loaded up to now.

Reimplemented from KMFolderMaildir.

Definition at line 396 of file kmfoldercachedimap.cpp.

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

Add the given message to the folder.

Usually the message is added at the end of the folder. Returns zero on success and an errno error code on failure. The index of the new message is stored in index_return if given. Please note that the message is added as is to the folder and the folder takes ownership of the message (deleting it in the destructor).

Reimplemented from KMFolderMaildir.

Definition at line 423 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 169 of file kmfoldercachedimap.h.

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

Remove (first occurrence of) given message from the folder.

Reimplemented from KMFolderMaildir.

Definition at line 433 of file kmfoldercachedimap.cpp.

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

Is the folder readonly?

Reimplemented from KMFolderMaildir.

Definition at line 179 of file kmfoldercachedimap.h.

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

Emit the folderComplete signal.

Definition at line 184 of file kmfoldercachedimap.h.

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

The silentUpload can be set to remove the folder upload error dialog.

Definition at line 190 of file kmfoldercachedimap.h.

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 193 of file kmfoldercachedimap.h.

bool KMFolderCachedImap::listDirectory (  )  [virtual]

List 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 1758 of file kmfoldercachedimap.cpp.

KMFolder * KMFolderCachedImap::trashFolder (  )  const [virtual]

Return the trash folder.

Reimplemented from FolderStorage.

Definition at line 484 of file kmfoldercachedimap.cpp.

int KMFolderCachedImap::userRights (  )  const [inline]

The user's rights on this folder - see bitfield in ACLJobs namespace.

Returns:
0 when not known yet, -1 if there was an error fetching them

Definition at line 214 of file kmfoldercachedimap.h.

void KMFolderCachedImap::setUserRights ( unsigned int  userRights  ) 

Set the user's rights on this folder - called by getUserRights.

Definition at line 2043 of file kmfoldercachedimap.cpp.

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

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 228 of file kmfoldercachedimap.h.

void KMFolderCachedImap::setACLList ( const ACLList arr  ) 

Set the list of ACL for this folder (for FolderDiaACLTab).

Definition at line 2092 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::setStatus ( int  id,
KMMsgStatus  status,
bool  toggle 
) [virtual]

Set the status of the message at index idx to status.

Reimplemented from FolderStorage.

Definition at line 1316 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::setStatus ( QValueList< int > &  ids,
KMMsgStatus  status,
bool  toggle 
) [virtual]

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

Reimplemented from FolderStorage.

Definition at line 1322 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::setIncidencesFor ( IncidencesFor  incfor  ) 

For the folder properties dialog.

Definition at line 2230 of file kmfoldercachedimap.cpp.

bool KMFolderCachedImap::isMoveable (  )  const [virtual]

Returns true if this folder can be moved.

Reimplemented from FolderStorage.

Definition at line 2423 of file kmfoldercachedimap.cpp.

QStringList KMFolderCachedImap::namespacesToList (  )  [inline]

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

Definition at line 267 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 274 of file kmfoldercachedimap.h.

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

Utility methods for syncing.

Finds new messages in the local cache that must be uploaded

Definition at line 1181 of file kmfoldercachedimap.cpp.

QValueList< 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 1344 of file kmfoldercachedimap.cpp.

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

This returns false if we have subfolders.

Otherwise it returns canRemoveFolder()

Definition at line 440 of file kmfoldercachedimap.cpp.

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

Reimplemented from KMFolder.

Reimplemented from KMFolderMaildir.

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

See if there is a better parent then this folder.

Definition at line 1957 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::slotSimpleData ( KIO::Job *  job,
const QByteArray &  data 
) [slot]

Add the data a KIO::Job retrieves to the buffer.

void KMFolderCachedImap::slotTroubleshoot (  )  [slot]

Troubleshoot the IMAP cache.

Definition at line 569 of file kmfoldercachedimap.cpp.

void KMFolderCachedImap::slotListResult ( const QStringList &  ,
const QStringList &  ,
const QStringList &  ,
const QStringList &  ,
const ImapAccountBase::jobData &   
) [slot]

Connected to ListJob::receivedFolders creates/removes folders.

void KMFolderCachedImap::slotCheckNamespace ( const QStringList &  ,
const QStringList &  ,
const QStringList &  ,
const QStringList &  ,
const ImapAccountBase::jobData &   
) [slot]

Connected to ListJob::receivedFolders creates namespace folders.

void KMFolderCachedImap::syncState ( int  state,
int  number 
) [signal]

emitted when we enter the state "state" and have to process "number" items (for example messages


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys