kmail
KMMsgList Class Reference
An abstraction of an array of pointers to messages. More...
#include <kmmsglist.h>
Inherits QMemArray<KMMsgBase*>.
Public Member Functions | |
KMMsgList (int initialSize=32) | |
~KMMsgList () | |
void | remove (unsigned int idx) |
KMMsgBase * | take (unsigned int idx) |
void | insert (unsigned int idx, KMMsgBase *msg, bool syncDict=true) |
unsigned int | append (KMMsgBase *msg, bool syncDict=true) |
void | clear (bool autoDelete=TRUE, bool syncDict=false) |
bool | resize (unsigned int size) |
bool | reset (unsigned int size) |
void | set (unsigned int idx, KMMsgBase *msg) |
unsigned int | high () const |
unsigned int | count () const |
Protected Member Functions | |
void | rethinkHigh () |
Protected Attributes | |
unsigned int | mHigh |
unsigned int | mCount |
Detailed Description
An abstraction of an array of pointers to messages.This class represents an array of pointers to message objects. It autoresizes and can load a KMMsgDict object from its contents. It's a pure implementation detail of KMFolderIndex and should not be used by the layers above that.
Definition at line 37 of file kmmsglist.h.
Constructor & Destructor Documentation
KMMsgList::KMMsgList | ( | int | initialSize = 32 |
) |
KMMsgList::~KMMsgList | ( | ) |
Member Function Documentation
unsigned int KMMsgList::append | ( | KMMsgBase * | msg, | |
bool | syncDict = true | |||
) |
Append given message after the last used message.
Resizes the array if necessary. Returns index of new position. If syncDict
, also updates message dictionary.
Definition at line 131 of file kmmsglist.cpp.
void KMMsgList::clear | ( | bool | autoDelete = TRUE , |
|
bool | syncDict = false | |||
) |
Clear messages.
If autoDelete is set (default) the messages are deleted. The array is not resized. If syncDict
, also updates the message dictionary.
Definition at line 32 of file kmmsglist.cpp.
unsigned int KMMsgList::count | ( | ) | const [inline] |
unsigned int KMMsgList::high | ( | ) | const [inline] |
Returns first unused index (index of last message plus one).
Definition at line 83 of file kmmsglist.h.
void KMMsgList::insert | ( | unsigned int | idx, | |
KMMsgBase * | msg, | |||
bool | syncDict = true | |||
) |
Insert message at given index.
Resizes the array if necessary. If syncDict
, also updates message dictionary.
Definition at line 107 of file kmmsglist.cpp.
void KMMsgList::remove | ( | unsigned int | idx | ) |
Remove message at given index without deleting it.
Also removes from message dictionary.
Definition at line 140 of file kmmsglist.cpp.
bool KMMsgList::reset | ( | unsigned int | size | ) |
Clear the array and resize it to given size.
Returns FALSE if memory cannot be allocated.
Definition at line 83 of file kmmsglist.cpp.
bool KMMsgList::resize | ( | unsigned int | size | ) |
Resize array and initialize new elements if any.
Returns FALSE if memory cannot be allocated.
Definition at line 51 of file kmmsglist.cpp.
void KMMsgList::rethinkHigh | ( | ) | [protected] |
void KMMsgList::set | ( | unsigned int | idx, | |
KMMsgBase * | msg | |||
) |
Set message at given index.
The array is resized if necessary. If there is already a message at the given index this message is *not* deleted. Does not sync the message dictionary.
Definition at line 92 of file kmmsglist.cpp.
KMMsgBase * KMMsgList::take | ( | unsigned int | idx | ) |
Returns message at given index and removes it from the list.
Also removes from message dictionary.
Definition at line 161 of file kmmsglist.cpp.
The documentation for this class was generated from the following files: