• 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
foldertreeview.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  This 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_FOLDERTREEVIEW_H
20 #define MAILCOMMON_FOLDERTREEVIEW_H
21 
22 #include "mailcommon_export.h"
23 #include "foldertreewidget.h"
24 #include "util/mailutil.h"
25 
26 #include <Akonadi/EntityTreeView>
27 #include <Akonadi/Collection>
28 
29 class QMouseEvent;
30 
31 namespace Akonadi {
32  class CollectionStatisticsDelegate;
33 }
34 
35 namespace MailCommon {
36 
41 class MAILCOMMON_EXPORT FolderTreeView : public Akonadi::EntityTreeView
42 {
43  Q_OBJECT
44 
45  public:
46  explicit FolderTreeView( QWidget *parent = 0, bool showUnreadCount = true );
47 
48  explicit FolderTreeView( KXMLGUIClient *xmlGuiClient, QWidget *parent = 0,
49  bool showUnreadCount = true );
50 
51  virtual ~FolderTreeView();
52 
53  void selectNextUnreadFolder( bool confirm = false );
54  void selectPrevUnreadFolder( bool confirm = false );
55 
56  void showStatisticAnimation( bool anim );
57 
58  void disableContextMenuAndExtraColumn();
59 
60  void setTooltipsPolicy( FolderTreeWidget::ToolTipDisplayPolicy );
61 
62  void restoreHeaderState( const QByteArray &data );
63 
64  Akonadi::Collection currentFolder() const;
65 
66  void disableSaveConfig();
67  void readConfig();
68 
69  void updatePalette();
70 
71  void keyboardSearch( const QString & ); // reimp
72  protected:
73  enum Move {
74  Next = 0,
75  Previous = 1
76  };
77 
78  void init( bool showUnreadCount );
79  void selectModelIndex( const QModelIndex & );
80  void setCurrentModelIndex( const QModelIndex & );
81  QModelIndex selectNextFolder( const QModelIndex &current );
82  bool isUnreadFolder( const QModelIndex &current, QModelIndex &nextIndex,
83  FolderTreeView::Move move, bool confirm );
84  void writeConfig();
85 
86  void setSortingPolicy( FolderTreeWidget::SortingPolicy policy,
87  bool writeInConfig = false );
88 
89  virtual void mousePressEvent( QMouseEvent *e );
90 
91  public slots:
92  void slotFocusNextFolder();
93  void slotFocusPrevFolder();
94  void slotSelectFocusFolder();
95  void slotFocusFirstFolder();
96  void slotFocusLastFolder();
97 
98  protected slots:
99  void slotHeaderContextMenuRequested( const QPoint & );
100  void slotHeaderContextMenuChangeIconSize( bool );
101  void slotHeaderContextMenuChangeHeader( bool );
102  void slotHeaderContextMenuChangeToolTipDisplayPolicy( bool );
103  void slotHeaderContextMenuChangeSortingPolicy( bool );
104 
105  signals:
106  void changeTooltipsPolicy( FolderTreeWidget::ToolTipDisplayPolicy );
107  void manualSortingChanged( bool actif );
108  void prefereCreateNewTab( bool );
109 
110  private:
111  bool ignoreUnreadFolder( const Akonadi::Collection &, bool ) const;
112  bool allowedToEnterFolder( const Akonadi::Collection &, bool ) const;
113  bool trySelectNextUnreadFolder( const QModelIndex &, MailCommon::Util::SearchDirection, bool );
114 
115  FolderTreeWidget::ToolTipDisplayPolicy mToolTipDisplayPolicy;
116  FolderTreeWidget::SortingPolicy mSortingPolicy;
117  Akonadi::CollectionStatisticsDelegate *mCollectionStatisticsDelegate;
118  bool mbDisableContextMenuAndExtraColumn;
119  bool mbDisableSaveConfig;
120 };
121 
122 }
123 
124 #endif
QWidget
MailCommon::FolderTreeWidget::ToolTipDisplayPolicy
ToolTipDisplayPolicy
The possible tooltip display policies.
Definition: foldertreewidget.h:76
MailCommon::FolderTreeView::Move
Move
Definition: foldertreeview.h:73
MailCommon::Util::SearchDirection
SearchDirection
Describes the direction for searching next unread collection.
Definition: mailutil.h:96
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
foldertreewidget.h
MAILCOMMON_EXPORT
#define MAILCOMMON_EXPORT
Definition: mailcommon_export.h:35
MailCommon::FolderTreeWidget::SortingPolicy
SortingPolicy
The available sorting policies.
Definition: foldertreewidget.h:85
mailutil.h
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