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

knode

  • KPIM
  • FolderTreeWidgetItem
Public Types | Public Member Functions | Protected Member Functions | List of all members
KPIM::FolderTreeWidgetItem Class Reference

#include <foldertreewidget.h>

Inheritance diagram for KPIM::FolderTreeWidgetItem:
Inheritance graph
[legend]

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 ()
 

Protected Member Functions

virtual QString elidedLabelText (const QFontMetrics &metrics, unsigned int width) const
 
void setLabelTextElided (bool labelTextElided)
 

Detailed Description

A folder tree node to be used with FolderTreeWidget.

Author
Szymon Tomasz Stefanek pragm.nosp@m.a@kv.nosp@m.irc.n.nosp@m.et

Definition at line 225 of file foldertreewidget.h.

Member Enumeration Documentation

enum KPIM::FolderTreeWidgetItem::FolderType

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.

enum KPIM::FolderTreeWidgetItem::Protocol

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

KPIM::FolderTreeWidgetItem::FolderTreeWidgetItem ( FolderTreeWidget *  parent,
const QString &  label,
Protocol  protocol,
FolderType  folderType 
)
explicit

Constructs a root-item.

Definition at line 334 of file foldertreewidget.cpp.

KPIM::FolderTreeWidgetItem::FolderTreeWidgetItem ( FolderTreeWidgetItem *  parent,
const QString &  label,
Protocol  protocol,
FolderType  folderType 
)
explicit

Constructs a child-item.

Definition at line 348 of file foldertreewidget.cpp.

Member Function Documentation

bool KPIM::FolderTreeWidgetItem::alwaysDisplayCounts ( ) const
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.

qint64 KPIM::FolderTreeWidgetItem::childrenDataSize ( ) const
inline

Returns the size in bytes of the children folders displayed in the special "DataSize" column.

Definition at line 364 of file foldertreewidget.h.

int KPIM::FolderTreeWidgetItem::childrenTotalCount ( ) const
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.

int KPIM::FolderTreeWidgetItem::childrenUnreadCount ( ) const
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.

qint64 KPIM::FolderTreeWidgetItem::dataSize ( ) const
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.

QString KPIM::FolderTreeWidgetItem::elidedLabelText ( const QFontMetrics &  metrics,
unsigned int  width 
) const
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.

FolderType KPIM::FolderTreeWidgetItem::folderType ( ) const
inline

Returns the type of the folder.

Definition at line 396 of file foldertreewidget.h.

bool KPIM::FolderTreeWidgetItem::isCloseToQuota ( ) const
inline

Returns the sate of the "Close to quota" warning for this folder.

Definition at line 289 of file foldertreewidget.h.

const QString& KPIM::FolderTreeWidgetItem::labelText ( ) const
inline

Returns the textual data for the "Label" column of the parent FolderTreeWidget.

Definition at line 300 of file foldertreewidget.h.

bool KPIM::FolderTreeWidgetItem::labelTextElided ( ) const
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.

bool KPIM::FolderTreeWidgetItem::operator< ( const QTreeWidgetItem &  other) const
virtual

Operator used for item sorting.

Reimplemented in KNCollectionViewItem.

Definition at line 569 of file foldertreewidget.cpp.

Protocol KPIM::FolderTreeWidgetItem::protocol ( ) const
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.

void KPIM::FolderTreeWidgetItem::setAlwaysDisplayCounts ( bool  alwaysDisplayCounts)
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.

void KPIM::FolderTreeWidgetItem::setFolderType ( FolderType  folderType)
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.

void KPIM::FolderTreeWidgetItem::setLabelTextElided ( bool  labelTextElided)
inlineprotected

This is called by FolderTreeWidgetItemLabelColumnDelegate to update the mLabelTextElided flag.

Definition at line 456 of file foldertreewidget.h.

void KPIM::FolderTreeWidgetItem::setProtocol ( Protocol  protocol)
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.

int KPIM::FolderTreeWidgetItem::totalCount ( ) const
inline

Returns the total message count.

Displayed in the special "Total" column by FolderTreeWidget.

Definition at line 324 of file foldertreewidget.h.

int KPIM::FolderTreeWidgetItem::unreadCount ( ) const
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:
  • foldertreewidget.h
  • foldertreewidget.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:37 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

knode

Skip menu "knode"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal