messagelist
#include <item.h>
Classes | |
class | ChildItemStats |
Public Types | |
enum | InitialExpandStatus { ExpandNeeded, NoExpandNeeded, ExpandExecuted } |
enum | Type { GroupHeader, Message, InvisibleRoot } |
Public Member Functions | |
virtual | ~Item () |
int | appendChildItem (Model *model, Item *child) |
Item * | childItem (int idx) const |
int | childItemCount () const |
QList< Item * > * | childItems () const |
void | childItemStats (ChildItemStats &stats) const |
time_t | date () const |
Item * | deepestItem () |
void | dump (const QString &prefix) |
Item * | firstChildItem () const |
QString | formattedDate () const |
QString | formattedMaxDate () const |
QString | formattedSize () const |
bool | hasAncestor (const Item *it) const |
bool | hasChildren () const |
int | indexOfChildItem (Item *item) const |
InitialExpandStatus | initialExpandStatus () const |
void | initialSetup (time_t date, size_t size, const QString &sender, const QString &receiver, bool useReceiver) |
bool | isViewable () const |
Item * | itemAbove () |
Item * | itemAboveChild (Item *child) |
Item * | itemBelow () |
Item * | itemBelowChild (Item *child) |
qint64 | itemId () const |
void | killAllChildItems () |
time_t | maxDate () const |
Item * | parent () const |
qint64 | parentCollectionId () const |
void | rawAppendChildItem (Item *child) |
const QString & | receiver () const |
bool | recomputeMaxDate () |
const QString & | sender () const |
const QString & | senderOrReceiver () const |
void | setDate (time_t date) |
void | setIndexGuess (int index) |
void | setInitialExpandStatus (InitialExpandStatus initialExpandStatus) |
void | setItemId (qint64 id) |
void | setMaxDate (time_t date) |
void | setParent (Item *pParent) |
void | setParentCollectionId (qint64 id) |
void | setReceiver (const QString &receiver) |
void | setSender (const QString &sender) |
void | setSize (size_t size) |
void | setStatus (const Akonadi::MessageStatus &status) |
void | setSubject (const QString &subject) |
void | setSubjectAndStatus (const QString &subject, const Akonadi::MessageStatus &status) |
void | setViewable (Model *model, bool bViewable) |
size_t | size () const |
const Akonadi::MessageStatus & | status () const |
QString | statusDescription () const |
const QString & | subject () const |
void | takeChildItem (Model *model, Item *child) |
Item * | topmostNonRoot () |
Type | type () const |
bool | useReceiver () const |
Protected Member Functions | |
Item (Type type) | |
Item (Type type, ItemPrivate *dd) | |
Protected Attributes | |
ItemPrivate *const | d_ptr |
Detailed Description
A single item of the MessageList tree managed by MessageList::Model.
This class stores basic information needed in all the subclasses which at the moment of writing are MessageItem and GroupHeaderItem.
Member Enumeration Documentation
Specifies the initial expand status for the item that should be applied when it's attached to the viewable tree.
Needed as a workaround for QTreeView limitations in handling item expansion.
Enumerator | |
---|---|
ExpandNeeded |
Must expand when this item becomes viewable. |
NoExpandNeeded |
No expand needed at all. |
ExpandExecuted |
Item already expanded. |
The type of the Item.
Enumerator | |
---|---|
GroupHeader |
This item is a GroupHeaderItem. |
Message |
This item is a MessageItem. |
InvisibleRoot |
This item is just Item and it's the only InvisibleRoot per Model. |
Constructor & Destructor Documentation
|
protected |
|
protected |
|
virtual |
Member Function Documentation
Item * Item::childItem | ( | int | idx | ) | const |
int Item::childItemCount | ( | ) | const |
void Item::childItemStats | ( | ChildItemStats & | stats | ) | const |
Item * Item::deepestItem | ( | ) |
void Item::dump | ( | const QString & | prefix | ) |
Item * Item::firstChildItem | ( | ) | const |
QString Item::formattedDate | ( | ) | const |
QString Item::formattedMaxDate | ( | ) | const |
QString Item::formattedSize | ( | ) | const |
bool Item::hasAncestor | ( | const Item * | it | ) | const |
bool Item::hasChildren | ( | ) | const |
int Item::indexOfChildItem | ( | Item * | item | ) | const |
Item::InitialExpandStatus Item::initialExpandStatus | ( | ) | const |
bool Item::isViewable | ( | ) | const |
Item * Item::itemAbove | ( | ) |
Item * Item::itemBelow | ( | ) |
void Item::killAllChildItems | ( | ) |
time_t Item::maxDate | ( | ) | const |
Item * Item::parent | ( | ) | const |
void Item::rawAppendChildItem | ( | Item * | child | ) |
const QString & Item::receiver | ( | ) | const |
bool Item::recomputeMaxDate | ( | ) |
const QString & Item::sender | ( | ) | const |
const QString & Item::senderOrReceiver | ( | ) | const |
Returns the sender or the receiver, depending on the underlying StorageModel settings.
void Item::setDate | ( | time_t | date | ) |
void Item::setIndexGuess | ( | int | index | ) |
Sets the cached guess for the index of this item in the parent's child list.
This is used to speed up the index lookup with the following algorithm: Ask the parent if this item is at the position specified by index guess (this costs ~O(1)). If the position matches we have finished, if it doesn't then perform a linear search via indexOfChildItem() (which costs ~O(n)).
void Item::setInitialExpandStatus | ( | InitialExpandStatus | initialExpandStatus | ) |
void Item::setMaxDate | ( | time_t | date | ) |
void Item::setParent | ( | Item * | pParent | ) |
void Item::setReceiver | ( | const QString & | receiver | ) |
void Item::setSender | ( | const QString & | sender | ) |
void Item::setSize | ( | size_t | size | ) |
void Item::setStatus | ( | const Akonadi::MessageStatus & | status | ) |
void Item::setSubject | ( | const QString & | subject | ) |
void MessageList::Core::Item::setSubjectAndStatus | ( | const QString & | subject, |
const Akonadi::MessageStatus & | status | ||
) |
This is meant to be called right after the constructor for MessageItem objects.
It sets up several items at once (so even if not inlined it's still a single call).
void Item::setViewable | ( | Model * | model, |
bool | bViewable | ||
) |
size_t Item::size | ( | ) | const |
const Akonadi::MessageStatus & Item::status | ( | ) | const |
QString Item::statusDescription | ( | ) | const |
const QString & Item::subject | ( | ) | const |
Item * Item::topmostNonRoot | ( | ) |
Item::Type Item::type | ( | ) | const |
bool Item::useReceiver | ( | ) | const |
Member Data Documentation
|
protected |
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:01 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.