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

mailcommon

  • sources
  • kde-4.12
  • kdepim
  • mailcommon
  • folder
foldertreewidget.h
Go to the documentation of this file.
1 /* -*- mode: C++; c-file-style: "gnu" -*-
2 
3  Copyright (c) 2009, 2010 Montel Laurent <montel@kde.org>
4 
5  The program is free software; you can redistribute it and/or modify it
6  under the terms of the GNU General Public License, version 2, as
7  published by the Free Software Foundation.
8 
9  This program is distributed in the hope that it will be useful, but
10  WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License along
15  with this program; if not, write to the Free Software Foundation, Inc.,
16  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 #ifndef MAILCOMMON_FOLDERTREEWIDGET_H
20 #define MAILCOMMON_FOLDERTREEWIDGET_H
21 
22 #include "mailcommon_export.h"
23 #include "foldertreewidgetproxymodel.h"
24 
25 #include <Akonadi/Collection>
26 
27 #include <QAbstractItemView>
28 #include <QWidget>
29 
30 namespace KPIM {
31  class StatisticsProxyModel;
32 }
33 
34 class KLineEdit;
35 class KXMLGUIClient;
36 
37 class QItemSelectionModel;
38 
39 namespace MailCommon {
40 
41 class EntityCollectionOrderProxyModel;
42 class FolderTreeView;
43 
50 class MAILCOMMON_EXPORT FolderTreeWidget : public QWidget
51 {
52  Q_OBJECT
53 
54  public:
55  enum TreeViewOption {
56  None = 0,
57  ShowUnreadCount = 1,
58  UseLineEditForFiltering = 2,
59  UseDistinctSelectionModel = 4,
60  ShowCollectionStatisticAnimation = 8,
61  DontKeyFilter = 16
62  };
63  Q_DECLARE_FLAGS( TreeViewOptions, TreeViewOption )
64 
65  explicit FolderTreeWidget(
66  QWidget *parent = 0,
67  KXMLGUIClient *xmlGuiClient = 0,
68  TreeViewOptions options = (TreeViewOptions)( ShowUnreadCount |
69  ShowCollectionStatisticAnimation ),
70  FolderTreeWidgetProxyModel::FolderTreeWidgetProxyModelOptions optReadableProxy = FolderTreeWidgetProxyModel::None );
71  ~FolderTreeWidget();
72 
76  enum ToolTipDisplayPolicy {
77  DisplayAlways,
78  DisplayWhenTextElided,
79  DisplayNever
80  };
81 
85  enum SortingPolicy {
86  SortByCurrentColumn,
87  SortByDragAndDropKey
88  };
89 
90  void selectCollectionFolder( const Akonadi::Collection & col );
91 
92  void setSelectionMode( QAbstractItemView::SelectionMode mode );
93 
94  QAbstractItemView::SelectionMode selectionMode() const;
95 
96  QItemSelectionModel * selectionModel () const;
97 
98  QModelIndex currentIndex() const;
99 
100  Akonadi::Collection selectedCollection() const;
101 
102  Akonadi::Collection::List selectedCollections() const;
103 
104  FolderTreeView *folderTreeView() const;
105 
106  KPIM::StatisticsProxyModel * statisticsProxyModel() const;
107 
108  FolderTreeWidgetProxyModel *folderTreeWidgetProxyModel() const;
109 
110  EntityCollectionOrderProxyModel *entityOrderProxy() const;
111 
112  void quotaWarningParameters( const QColor &color, qreal threshold );
113  void readQuotaConfig();
114 
115  KLineEdit *filterFolderLineEdit() const;
116  void applyFilter( const QString & );
117  void clearFilter();
118 
119  void disableContextMenuAndExtraColumn();
120 
121  void readConfig();
122 
123  void restoreHeaderState( const QByteArray &data );
124 
125  protected:
126  void changeToolTipsPolicyConfig( ToolTipDisplayPolicy );
127 
128  protected slots:
129  void slotChangeTooltipsPolicy( FolderTreeWidget::ToolTipDisplayPolicy );
130  void slotManualSortingChanged( bool );
131  void slotFilterFixedString( const QString & );
132  void slotGeneralFontChanged();
133  void slotGeneralPaletteChanged();
134 
135  private:
136  virtual bool eventFilter( QObject *o, QEvent *e );
137  class FolderTreeWidgetPrivate;
138  FolderTreeWidgetPrivate *const d;
139 
140 };
141 
142 }
143 
144 #endif
foldertreewidgetproxymodel.h
QWidget
MailCommon::FolderTreeWidget::ToolTipDisplayPolicy
ToolTipDisplayPolicy
The possible tooltip display policies.
Definition: foldertreewidget.h:76
QObject
MailCommon::FolderTreeView
This is an enhanced EntityTreeView specially suited for the folders in KMail's main folder widget...
Definition: foldertreeview.h:41
mailcommon_export.h
MailCommon::FolderTreeWidget::TreeViewOption
TreeViewOption
Definition: foldertreewidget.h:55
MailCommon::FolderTreeWidgetProxyModel
Definition: foldertreewidgetproxymodel.h:28
MailCommon::FolderTreeWidget::SortByCurrentColumn
Columns are clickable, sorting is by the current column.
Definition: foldertreewidget.h:86
MAILCOMMON_EXPORT
#define MAILCOMMON_EXPORT
Definition: mailcommon_export.h:35
MailCommon::FolderTreeWidget
This is the widget that shows the main folder tree.
Definition: foldertreewidget.h:50
MailCommon::EntityCollectionOrderProxyModel
Definition: entitycollectionorderproxymodel.h:26
MailCommon::FolderTreeWidget::DisplayWhenTextElided
Display the tooltip if the item text is actually elided.
Definition: foldertreewidget.h:78
MailCommon::FolderTreeWidget::SortingPolicy
SortingPolicy
The available sorting policies.
Definition: foldertreewidget.h:85
MailCommon::FolderTreeWidget::DisplayAlways
Always display a tooltip when hovering over an item.
Definition: foldertreewidget.h:77
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:14 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

mailcommon

Skip menu "mailcommon"
  • Main Page
  • Namespace List
  • Namespace Members
  • 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