knode
#include <foldertreewidget.h>
Public Types | |
enum | FolderType { Inbox, Outbox, SentMail, Trash, Drafts, Templates, Root, Calendar, Tasks, Journals, Contacts, Notes, Other } |
enum | Protocol { Local, Imap, CachedImap, News, Search, NONE } |
Public Member Functions | |
FolderTreeWidgetItem (FolderTreeWidget *parent, const QString &label, Protocol protocol, FolderType folderType) | |
FolderTreeWidgetItem (FolderTreeWidgetItem *parent, const QString &label, Protocol protocol, FolderType folderType) | |
bool | alwaysDisplayCounts () const |
qint64 | childrenDataSize () const |
int | childrenTotalCount () const |
int | childrenUnreadCount () const |
qint64 | dataSize () const |
FolderType | folderType () const |
bool | isCloseToQuota () const |
const QString & | labelText () const |
bool | labelTextElided () const |
virtual bool | operator< (const QTreeWidgetItem &other) const |
Protocol | protocol () const |
QString | protocolDescription () const |
void | setAlwaysDisplayCounts (bool alwaysDisplayCounts) |
void | setDataSize (qint64 s) |
void | setFolderType (FolderType folderType) |
void | setIsCloseToQuota (bool closeToQuota) |
void | setLabelText (const QString &label) |
void | setProtocol (Protocol protocol) |
void | setTotalCount (int totalCount) |
void | setUnreadCount (int unreadCount) |
int | totalCount () const |
int | unreadCount () const |
bool | updateChildrenCounts () |
void | updateColumn (int columnIndex) |
void | updateExpandedState () |
Public Member Functions inherited from QTreeWidgetItem | |
QTreeWidgetItem (int type) | |
QTreeWidgetItem (const QStringList &strings, int type) | |
QTreeWidgetItem (QTreeWidget *parent, const QStringList &strings, int type) | |
QTreeWidgetItem (QTreeWidgetItem *parent, QTreeWidgetItem *preceding, int type) | |
QTreeWidgetItem (const QTreeWidgetItem &other) | |
QTreeWidgetItem (QTreeWidget *parent, QTreeWidgetItem *preceding, int type) | |
QTreeWidgetItem (QTreeWidget *parent, int type) | |
QTreeWidgetItem (QTreeWidgetItem *parent, int type) | |
QTreeWidgetItem (QTreeWidgetItem *parent, const QStringList &strings, int type) | |
virtual | ~QTreeWidgetItem () |
void | addChild (QTreeWidgetItem *child) |
void | addChildren (const QList< QTreeWidgetItem * > &children) |
QBrush | background (int column) const |
QColor | backgroundColor (int column) const |
Qt::CheckState | checkState (int column) const |
QTreeWidgetItem * | child (int index) const |
int | childCount () const |
QTreeWidgetItem::ChildIndicatorPolicy | childIndicatorPolicy () const |
virtual QTreeWidgetItem * | clone () const |
int | columnCount () const |
virtual QVariant | data (int column, int role) const |
Qt::ItemFlags | flags () const |
QFont | font (int column) const |
QBrush | foreground (int column) const |
QIcon | icon (int column) const |
int | indexOfChild (QTreeWidgetItem *child) const |
void | insertChild (int index, QTreeWidgetItem *child) |
void | insertChildren (int index, const QList< QTreeWidgetItem * > &children) |
bool | isDisabled () const |
bool | isExpanded () const |
bool | isFirstColumnSpanned () const |
bool | isHidden () const |
bool | isSelected () const |
QTreeWidgetItem & | operator= (const QTreeWidgetItem &other) |
QTreeWidgetItem * | parent () const |
virtual void | read (QDataStream &in) |
void | removeChild (QTreeWidgetItem *child) |
void | setBackground (int column, const QBrush &brush) |
void | setBackgroundColor (int column, const QColor &color) |
void | setCheckState (int column, Qt::CheckState state) |
void | setChildIndicatorPolicy (QTreeWidgetItem::ChildIndicatorPolicy policy) |
virtual void | setData (int column, int role, const QVariant &value) |
void | setDisabled (bool disabled) |
void | setExpanded (bool expand) |
void | setFirstColumnSpanned (bool span) |
void | setFlags (QFlags< Qt::ItemFlag > flags) |
void | setFont (int column, const QFont &font) |
void | setForeground (int column, const QBrush &brush) |
void | setHidden (bool hide) |
void | setIcon (int column, const QIcon &icon) |
void | setSelected (bool select) |
void | setSizeHint (int column, const QSize &size) |
void | setStatusTip (int column, const QString &statusTip) |
void | setText (int column, const QString &text) |
void | setTextAlignment (int column, int alignment) |
void | setTextColor (int column, const QColor &color) |
void | setToolTip (int column, const QString &toolTip) |
void | setWhatsThis (int column, const QString &whatsThis) |
QSize | sizeHint (int column) const |
void | sortChildren (int column, Qt::SortOrder order) |
QString | statusTip (int column) const |
QTreeWidgetItem * | takeChild (int index) |
QList< QTreeWidgetItem * > | takeChildren () |
QString | text (int column) const |
int | textAlignment (int column) const |
QColor | textColor (int column) const |
QString | toolTip (int column) const |
QTreeWidget * | treeWidget () const |
int | type () const |
QString | whatsThis (int column) const |
virtual void | write (QDataStream &out) const |
Protected Member Functions | |
virtual QString | elidedLabelText (const QFontMetrics &metrics, unsigned int width) const |
void | setLabelTextElided (bool labelTextElided) |
Protected Member Functions inherited from QTreeWidgetItem | |
void | emitDataChanged () |
Detailed Description
A folder tree node to be used with FolderTreeWidget.
Definition at line 225 of file foldertreewidget.h.
Member Enumeration Documentation
Folder type information Please note that this list should be kept in the order of items that one wants to be shown in the FolderTreeWidget, but better keep it in sync with the type in KFolderTree.
Enumerator | |
---|---|
Inbox | |
Outbox | |
SentMail | |
Trash | |
Drafts | |
Templates | |
Root | |
Calendar | |
Tasks | |
Journals | |
Contacts | |
Notes | |
Other |
Definition at line 245 of file foldertreewidget.h.
Protocol information associated to the item.
Please note that this list should be kept in the order of items that one wants to be shown in the foldertreewidget.
Enumerator | |
---|---|
Local | |
Imap | |
CachedImap | |
News | |
Search | |
NONE |
Definition at line 234 of file foldertreewidget.h.
Constructor & Destructor Documentation
|
explicit |
Constructs a root-item.
Definition at line 334 of file foldertreewidget.cpp.
|
explicit |
Constructs a child-item.
Definition at line 348 of file foldertreewidget.cpp.
Member Function Documentation
|
inline |
Returns true if this item should bypass the size, total and unread display logic.
Normally when this item is a toplevel one and has no children it doesn't display the counts. With this flag set it displays the counts regardless of this. FIXME: Why this logic is actually hardwired here ?
Definition at line 438 of file foldertreewidget.h.
|
inline |
Returns the size in bytes of the children folders displayed in the special "DataSize" column.
Definition at line 364 of file foldertreewidget.h.
|
inline |
Returns the total message count for the children.
Displayed in the special "Total" column by FolderTreeWidget.
Definition at line 357 of file foldertreewidget.h.
|
inline |
Returns the unread message count for the children.
Displayed in the special "Unread" column by FolderTreeWidget.
Definition at line 350 of file foldertreewidget.h.
|
inline |
Returns the size in bytes of the folder, displayed in the special "DataSize" column.
If the size is meaningless (for folders that don't have storage, for example) then this function returns -1.
Definition at line 337 of file foldertreewidget.h.
|
protectedvirtual |
Returns the label text that has been elided if necessary to fit into the width
for the given font metrics
.
The default implementation elides the right of the label.
Reimplemented in KNCollectionViewItem.
Definition at line 619 of file foldertreewidget.cpp.
|
inline |
Returns the type of the folder.
Definition at line 396 of file foldertreewidget.h.
|
inline |
Returns the sate of the "Close to quota" warning for this folder.
Definition at line 289 of file foldertreewidget.h.
|
inline |
Returns the textual data for the "Label" column of the parent FolderTreeWidget.
Definition at line 300 of file foldertreewidget.h.
|
inline |
Returns true if the last painting operation had to elide the label text thus making it partially invisible.
This flag is meaningful only for currently visible items.
Definition at line 428 of file foldertreewidget.h.
|
virtual |
Operator used for item sorting.
Reimplemented from QTreeWidgetItem.
Reimplemented in KNCollectionViewItem.
Definition at line 569 of file foldertreewidget.cpp.
|
inline |
Returns the protocol associated to the folder item.
Definition at line 379 of file foldertreewidget.h.
QString KPIM::FolderTreeWidgetItem::protocolDescription | ( | ) | const |
Returns a descriptive string of the folder's protocol.
Definition at line 364 of file foldertreewidget.cpp.
|
inline |
Sets whether this item should bypass the size, total and unread display logic.
Normally when this item is a toplevel one and has no children it doesn't display the counts. With this flag set it displays the counts regardless of this. FIXME: Why this logic is actually hardwired here ?
Definition at line 448 of file foldertreewidget.h.
void KPIM::FolderTreeWidgetItem::setDataSize | ( | qint64 | s | ) |
Sets the size in bytes of the folder to be displayed in the special "DataSize" column.
If s is -1 then the size becomes meaningless and is displayed as a dash in the view.
Definition at line 499 of file foldertreewidget.cpp.
|
inline |
Sets the type of the folder.
Definition at line 402 of file foldertreewidget.h.
void KPIM::FolderTreeWidgetItem::setIsCloseToQuota | ( | bool | closeToQuota | ) |
Sets the status of the close to quota warning.
Definition at line 557 of file foldertreewidget.cpp.
void KPIM::FolderTreeWidgetItem::setLabelText | ( | const QString & | label | ) |
Sets the textual data for the "Label" column of the parent FolderTreeWidget.
Definition at line 439 of file foldertreewidget.cpp.
|
inlineprotected |
This is called by FolderTreeWidgetItemLabelColumnDelegate to update the mLabelTextElided flag.
Definition at line 456 of file foldertreewidget.h.
|
inline |
Sets the protocol associated to the folder item.
Definition at line 385 of file foldertreewidget.h.
void KPIM::FolderTreeWidgetItem::setTotalCount | ( | int | totalCount | ) |
Sets the total message count to be displayed in the special "Total" column.
Definition at line 476 of file foldertreewidget.cpp.
void KPIM::FolderTreeWidgetItem::setUnreadCount | ( | int | unreadCount | ) |
Sets the unread message count to be displayed in the special "Unread" column.
Definition at line 453 of file foldertreewidget.cpp.
|
inline |
Returns the total message count.
Displayed in the special "Total" column by FolderTreeWidget.
Definition at line 324 of file foldertreewidget.h.
|
inline |
Returns the unread message count.
Displayed in the special "Unread" column by FolderTreeWidget.
Definition at line 312 of file foldertreewidget.h.
bool KPIM::FolderTreeWidgetItem::updateChildrenCounts | ( | ) |
Gathers the counts for the children.
Please note that this function is NOT recursive. It will simply scan the children and sum up their own+children counts. It will also NOT update any text. Returns true if any of the counts has actually changed.
Definition at line 393 of file foldertreewidget.cpp.
void KPIM::FolderTreeWidgetItem::updateColumn | ( | int | columnIndex | ) |
Triggers an update for the specified column of this item.
Definition at line 546 of file foldertreewidget.cpp.
void KPIM::FolderTreeWidgetItem::updateExpandedState | ( | ) |
This should be called whenever this item is expanded/collapsed.
It updates the text for the total, unread and size column. If the item is collapsed, that numbers will include the sum of the child numbers, otherwise it will just be the numbers of this item.
Definition at line 538 of file foldertreewidget.cpp.
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:34:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.