MailCommon::FolderTreeView Class

class MailCommon::FolderTreeView
Header: #include <MailCommon/FolderTreeView>
CMake: find_package(KPim6MailCommon REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::MailCommon)

Public Functions

FolderTreeView(QWidget *parent = nullptr, bool showUnreadCount = true)
FolderTreeView(KXMLGUIClient *xmlGuiClient, QWidget *parent = nullptr, bool showUnreadCount = true)
virtual ~FolderTreeView() override
Akonadi::Collection currentFolder() const
void disableContextMenuAndExtraColumn()
void disableSaveConfig()
void readConfig()
void restoreHeaderState(const QByteArray &data)
void selectNextUnreadFolder(bool confirm = false)
void selectPrevUnreadFolder(bool confirm = false)
void setEnableDragDrop(bool enabled)
void setTooltipsPolicy(MailCommon::FolderTreeWidget::ToolTipDisplayPolicy)
void showStatisticAnimation(bool anim)
void updatePalette()

Reimplemented Public Functions

virtual void keyboardSearch(const QString &) override

Public Slots

Signals

void changeTooltipsPolicy(MailCommon::FolderTreeWidget::ToolTipDisplayPolicy)
void manualSortingChanged(bool actif)
void newTabRequested(bool)

Protected Functions

void init(bool showUnreadCount)
bool isUnreadFolder(const QModelIndex &current, QModelIndex &nextIndex, MailCommon::FolderTreeView::Move move, bool confirm)
void selectModelIndex(const QModelIndex &)
QModelIndex selectNextFolder(const QModelIndex &current)
void setCurrentModelIndex(const QModelIndex &)
void setSortingPolicy(MailCommon::FolderTreeWidget::SortingPolicy policy, bool writeInConfig = false)
void writeConfig()

Reimplemented Protected Functions

virtual void mousePressEvent(QMouseEvent *e) override

Protected Slots

Detailed Description

This is an enhanced EntityTreeView specially suited for the folders in KMail's main folder widget.

Member Function Documentation

[explicit] FolderTreeView::FolderTreeView(QWidget *parent = nullptr, bool showUnreadCount = true)

Constructs a folder tree view with the given parent. The unread count is shown if showUnreadCount is true.

[explicit] FolderTreeView::FolderTreeView(KXMLGUIClient *xmlGuiClient, QWidget *parent = nullptr, bool showUnreadCount = true)

Constructs a folder tree view using the xmlGuiClient for its actions, with the given parent. The unread count is shown if showUnreadCount is true.

[override virtual noexcept] FolderTreeView::~FolderTreeView()

Destroys the folder tree view.

[signal] void FolderTreeView::changeTooltipsPolicy(MailCommon::FolderTreeWidget::ToolTipDisplayPolicy)

Emitted when the tooltip display policy changes.

Akonadi::Collection FolderTreeView::currentFolder() const

Returns the current folder.

void FolderTreeView::disableContextMenuAndExtraColumn()

Disables the context menu and hides all the columns except the first one.

void FolderTreeView::disableSaveConfig()

Disables saving the configuration of the view.

[protected] void FolderTreeView::init(bool showUnreadCount)

Initializes the view. The unread count is shown if showUnreadCount is true.

[protected] bool FolderTreeView::isUnreadFolder(const QModelIndex &current, QModelIndex &nextIndex, MailCommon::FolderTreeView::Move move, bool confirm)

Looks for the folder next to current in the direction move and stores its index in nextIndex. Returns true if that folder has unread messages and was selected. If confirm is true, the user is asked before going to that folder.

[override virtual] void FolderTreeView::keyboardSearch(const QString &)

Reimplemented to disable the keyboard search.

[signal] void FolderTreeView::manualSortingChanged(bool actif)

Emitted when manual sorting is enabled or disabled, according to actif.

[override virtual protected] void FolderTreeView::mousePressEvent(QMouseEvent *e)

Reimplemented to handle the mouse press event e.

[signal] void FolderTreeView::newTabRequested(bool)

Emitted when a new tab is requested.

void FolderTreeView::readConfig()

Reads the configuration of the view.

void FolderTreeView::restoreHeaderState(const QByteArray &data)

Restores the header state from data.

[protected] void FolderTreeView::selectModelIndex(const QModelIndex &)

Selects the given index.

[protected] QModelIndex FolderTreeView::selectNextFolder(const QModelIndex &current)

Returns the index of the folder after current, expanding current if it has children.

void FolderTreeView::selectNextUnreadFolder(bool confirm = false)

Selects the next folder with unread messages. If confirm is true, the user is asked before going to the next folder, and the drafts, sent and templates folders are skipped.

void FolderTreeView::selectPrevUnreadFolder(bool confirm = false)

Selects the previous folder with unread messages. If confirm is true, the user is asked before going to the previous folder, and the drafts, sent and templates folders are skipped.

[protected] void FolderTreeView::setCurrentModelIndex(const QModelIndex &)

Sets the given index as current index.

void FolderTreeView::setEnableDragDrop(bool enabled)

Enables drag and drop if enabled is true.

[protected] void FolderTreeView::setSortingPolicy(MailCommon::FolderTreeWidget::SortingPolicy policy, bool writeInConfig = false)

Sets the sorting policy. If writeInConfig is true, the policy is saved in the configuration.

void FolderTreeView::setTooltipsPolicy(MailCommon::FolderTreeWidget::ToolTipDisplayPolicy)

Sets the tooltip display policy.

void FolderTreeView::showStatisticAnimation(bool anim)

Enables the progress animation of the collection statistics if anim is true.

[slot] void FolderTreeView::slotFocusFirstFolder()

Moves the focus to the first folder.

[slot] void FolderTreeView::slotFocusLastFolder()

Moves the focus to the last folder.

[slot] void FolderTreeView::slotFocusNextFolder()

Moves the focus to the next folder.

[slot] void FolderTreeView::slotFocusPrevFolder()

Moves the focus to the previous folder.

[protected slot] void FolderTreeView::slotHeaderContextMenuChangeHeader(bool)

Shows or hides a column from the header context menu.

[protected slot] void FolderTreeView::slotHeaderContextMenuChangeIconSize(bool)

Changes the icon size from the header context menu.

[protected slot] void FolderTreeView::slotHeaderContextMenuChangeSortingPolicy(bool)

Changes the sorting policy from the header context menu.

[protected slot] void FolderTreeView::slotHeaderContextMenuChangeToolTipDisplayPolicy(bool)

Changes the tooltip display policy from the header context menu.

[protected slot] void FolderTreeView::slotHeaderContextMenuRequested(const QPoint &)

Shows the header context menu.

[slot] void FolderTreeView::slotSelectFocusFolder()

Selects the focused folder.

void FolderTreeView::updatePalette()

Updates the palette used to paint the collection statistics.

[protected] void FolderTreeView::writeConfig()

Writes the configuration of the view.