• 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.cpp
Go to the documentation of this file.
1 /* -*- mode: C++; c-file-style: "gnu" -*-
2 
3  Copyright (c) 2009 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 #include "foldertreeview.h"
20 #include "kernel/mailkernel.h"
21 
22 #include <Akonadi/CollectionStatistics>
23 #include <Akonadi/CollectionStatisticsDelegate>
24 #include <Akonadi/EntityTreeModel>
25 
26 #include <KConfigGroup>
27 #include <KDebug>
28 #include <KGuiItem>
29 #include <KLocale>
30 #include <KMenu>
31 #include <KMessageBox>
32 
33 #include <QHeaderView>
34 #include <QMouseEvent>
35 
36 namespace MailCommon {
37 
38 FolderTreeView::FolderTreeView( QWidget *parent, bool showUnreadCount )
39  : Akonadi::EntityTreeView( parent ),
40  mbDisableContextMenuAndExtraColumn( false ),
41  mbDisableSaveConfig( false )
42 {
43  init(showUnreadCount);
44 }
45 
46 FolderTreeView::FolderTreeView( KXMLGUIClient *xmlGuiClient, QWidget *parent, bool showUnreadCount )
47  : Akonadi::EntityTreeView( xmlGuiClient, parent ),
48  mbDisableContextMenuAndExtraColumn( false ),
49  mbDisableSaveConfig( false )
50 {
51  init( showUnreadCount );
52 }
53 
54 FolderTreeView::~FolderTreeView()
55 {
56 }
57 
58 void FolderTreeView::disableSaveConfig()
59 {
60  mbDisableSaveConfig = true;
61 }
62 
63 void FolderTreeView::setTooltipsPolicy( FolderTreeWidget::ToolTipDisplayPolicy policy )
64 {
65  if ( mToolTipDisplayPolicy == policy ) {
66  return;
67  }
68 
69  mToolTipDisplayPolicy = policy;
70  emit changeTooltipsPolicy( mToolTipDisplayPolicy );
71  writeConfig();
72 }
73 
74 void FolderTreeView::disableContextMenuAndExtraColumn()
75 {
76  mbDisableContextMenuAndExtraColumn = true;
77  const int nbColumn = header()->count();
78  for ( int i = 1; i <nbColumn; ++i ) {
79  setColumnHidden( i, true );
80  }
81 }
82 
83 void FolderTreeView::init( bool showUnreadCount )
84 {
85  setIconSize( QSize( 22, 22 ) );
86  setUniformRowHeights( true );
87  mSortingPolicy = FolderTreeWidget::SortByCurrentColumn;
88  mToolTipDisplayPolicy = FolderTreeWidget::DisplayAlways;
89 
90  header()->setContextMenuPolicy( Qt::CustomContextMenu );
91  connect( header(), SIGNAL(customContextMenuRequested(QPoint)),
92  SLOT(slotHeaderContextMenuRequested(QPoint)) );
93 
94  mCollectionStatisticsDelegate = new Akonadi::CollectionStatisticsDelegate( this );
95  mCollectionStatisticsDelegate->setProgressAnimationEnabled( true );
96  setItemDelegate(mCollectionStatisticsDelegate);
97  mCollectionStatisticsDelegate->setUnreadCountShown(
98  showUnreadCount && !header()->isSectionHidden( 1 ) );
99 }
100 
101 void FolderTreeView::showStatisticAnimation( bool anim )
102 {
103  mCollectionStatisticsDelegate->setProgressAnimationEnabled( anim );
104 }
105 
106 void FolderTreeView::writeConfig()
107 {
108  if ( mbDisableSaveConfig ) {
109  return;
110  }
111 
112  KConfigGroup myGroup( KernelIf->config(), "MainFolderView" );
113  myGroup.writeEntry( "IconSize", iconSize().width() );
114  myGroup.writeEntry( "ToolTipDisplayPolicy", (int)mToolTipDisplayPolicy );
115  myGroup.writeEntry( "SortingPolicy", (int)mSortingPolicy );
116 }
117 
118 void FolderTreeView::readConfig()
119 {
120  KConfigGroup myGroup( KernelIf->config(), "MainFolderView" );
121  int iIconSize = myGroup.readEntry( "IconSize", iconSize().width() );
122  if ( iIconSize < 16 || iIconSize > 32 ) {
123  iIconSize = 22;
124  }
125  setIconSize( QSize( iIconSize, iIconSize ) );
126  mToolTipDisplayPolicy =
127  static_cast<FolderTreeWidget::ToolTipDisplayPolicy>(
128  myGroup.readEntry( "ToolTipDisplayPolicy",
129  static_cast<int>( FolderTreeWidget::DisplayAlways ) ) );
130 
131  emit changeTooltipsPolicy( mToolTipDisplayPolicy );
132 
133  setSortingPolicy(
134  ( FolderTreeWidget::SortingPolicy )myGroup.readEntry(
135  "SortingPolicy", (int)FolderTreeWidget::SortByCurrentColumn ), false );
136 }
137 
138 void FolderTreeView::slotHeaderContextMenuRequested( const QPoint &pnt )
139 {
140  if ( mbDisableContextMenuAndExtraColumn ) {
141  readConfig();
142  return;
143  }
144 
145  // the menu for the columns
146  KMenu menu;
147  QAction *act;
148  menu.addTitle( i18n( "View Columns" ) );
149  const int nbColumn = header()->count();
150  for ( int i = 1; i <nbColumn; ++i ) {
151  act = menu.addAction( model()->headerData( i, Qt::Horizontal ).toString() );
152  act->setCheckable( true );
153  act->setChecked( !header()->isSectionHidden( i ) );
154  act->setData( QVariant( i ) );
155  connect( act, SIGNAL(triggered(bool)),
156  SLOT(slotHeaderContextMenuChangeHeader(bool)) );
157  }
158 
159  menu.addTitle( i18n( "Icon Size" ) );
160 
161  static int icon_sizes[] = { 16, 22, 32 /*, 48, 64, 128 */ };
162 
163  QActionGroup *grp = new QActionGroup( &menu );
164  const int nbElement( (int)( sizeof( icon_sizes ) / sizeof( int ) ) );
165  for ( int i = 0; i < nbElement; ++i ) {
166  act = menu.addAction( QString::fromLatin1( "%1x%2" ).arg( icon_sizes[ i ] ).arg( icon_sizes[ i ] ) );
167  act->setCheckable( true );
168  grp->addAction( act );
169  if ( iconSize().width() == icon_sizes[ i ] ) {
170  act->setChecked( true );
171  }
172  act->setData( QVariant( icon_sizes[ i ] ) );
173 
174  connect( act, SIGNAL(triggered(bool)),
175  SLOT(slotHeaderContextMenuChangeIconSize(bool)) );
176  }
177  menu.addTitle( i18n( "Display Tooltips" ) );
178 
179  grp = new QActionGroup( &menu );
180 
181  act = menu.addAction( i18nc( "@action:inmenu Always display tooltips", "Always" ) );
182  act->setCheckable( true );
183  grp->addAction( act );
184  act->setChecked( mToolTipDisplayPolicy == FolderTreeWidget::DisplayAlways );
185  act->setData( QVariant( (int)FolderTreeWidget::DisplayAlways ) );
186  connect( act, SIGNAL(triggered(bool)),
187  SLOT(slotHeaderContextMenuChangeToolTipDisplayPolicy(bool)) );
188 
189  act = menu.addAction( i18nc( "@action:inmenu Never display tooltips.", "Never" ) );
190  act->setCheckable( true );
191  grp->addAction( act );
192  act->setChecked( mToolTipDisplayPolicy == FolderTreeWidget::DisplayNever );
193  act->setData( QVariant( (int)FolderTreeWidget::DisplayNever ) );
194  connect( act, SIGNAL(triggered(bool)),
195  SLOT(slotHeaderContextMenuChangeToolTipDisplayPolicy(bool)) );
196 
197  menu.addTitle( i18nc( "@action:inmenu", "Sort Items" ) );
198 
199  grp = new QActionGroup( &menu );
200 
201  act = menu.addAction( i18nc( "@action:inmenu", "Automatically, by Current Column" ) );
202  act->setCheckable( true );
203  grp->addAction( act );
204  act->setChecked( mSortingPolicy == FolderTreeWidget::SortByCurrentColumn );
205  act->setData( QVariant( (int)FolderTreeWidget::SortByCurrentColumn ) );
206  connect( act, SIGNAL(triggered(bool)),
207  SLOT(slotHeaderContextMenuChangeSortingPolicy(bool)) );
208 
209  act = menu.addAction( i18nc( "@action:inmenu", "Manually, by Drag And Drop" ) );
210  act->setCheckable( true );
211  grp->addAction( act );
212  act->setChecked( mSortingPolicy == FolderTreeWidget::SortByDragAndDropKey );
213  act->setData( QVariant( (int)FolderTreeWidget::SortByDragAndDropKey ) );
214  connect( act, SIGNAL(triggered(bool)),
215  SLOT(slotHeaderContextMenuChangeSortingPolicy(bool)) );
216 
217  menu.exec( header()->mapToGlobal( pnt ) );
218 }
219 
220 void FolderTreeView::slotHeaderContextMenuChangeSortingPolicy( bool )
221 {
222  QAction *act = dynamic_cast< QAction * >( sender() );
223  if ( !act ) {
224  return;
225  }
226 
227  QVariant data = act->data();
228 
229  bool ok;
230  int policy = data.toInt( &ok );
231  if ( !ok ) {
232  return;
233  }
234 
235  setSortingPolicy( ( FolderTreeWidget::SortingPolicy )policy, true );
236 }
237 
238 void FolderTreeView::setSortingPolicy( FolderTreeWidget::SortingPolicy policy, bool writeInConfig )
239 {
240  if ( mSortingPolicy == policy ) {
241  return;
242  }
243 
244  mSortingPolicy = policy;
245  switch ( mSortingPolicy ) {
246  case FolderTreeWidget::SortByCurrentColumn:
247  header()->setClickable( true );
248  header()->setSortIndicatorShown( true );
249  setSortingEnabled( true );
250  emit manualSortingChanged( false );
251  break;
252 
253  case FolderTreeWidget::SortByDragAndDropKey:
254  header()->setClickable( false );
255  header()->setSortIndicatorShown( false );
256 
257 #if 0
258  //
259  // Qt 4.5 introduced a nasty bug here:
260  // Sorting must be enabled in order to sortByColumn() to work.
261  // If sorting is disabled it disconnects some internal signal/slot pairs
262  // and calling sortByColumn() silently has no effect.
263  // This is a bug as we actually DON'T want automatic sorting to be
264  // performed by the view whenever it wants. We want to control sorting.
265  //
266  setSortingEnabled( true ); // hack for qutie bug: the param here should be false
267  header()->setSortIndicator( 0, Qt::AscendingOrder );
268 #endif
269  setSortingEnabled( false ); // hack for qutie bug: this call shouldn't be here at all
270  emit manualSortingChanged( true );
271 
272  break;
273  default:
274  // should never happen
275  break;
276  }
277  if ( writeInConfig ) {
278  writeConfig();
279  }
280 }
281 
282 void FolderTreeView::slotHeaderContextMenuChangeToolTipDisplayPolicy( bool )
283 {
284  QAction *act = dynamic_cast< QAction * >( sender() );
285  if ( !act ) {
286  return;
287  }
288 
289  QVariant data = act->data();
290 
291  bool ok;
292  const int id = data.toInt( &ok );
293  if ( !ok ) {
294  return;
295  }
296  emit changeTooltipsPolicy( ( FolderTreeWidget::ToolTipDisplayPolicy )id );
297 }
298 
299 void FolderTreeView::slotHeaderContextMenuChangeHeader( bool )
300 {
301  QAction *act = dynamic_cast< QAction * >( sender() );
302  if ( !act ) {
303  return;
304  }
305 
306  QVariant data = act->data();
307 
308  bool ok;
309  const int id = data.toInt( &ok );
310  if ( !ok ) {
311  return;
312  }
313 
314  if ( id > header()->count() ) {
315  return;
316  }
317 
318  if ( id == 1 ) {
319  mCollectionStatisticsDelegate->setUnreadCountShown( !act->isChecked() );
320  }
321 
322  setColumnHidden( id, !act->isChecked() );
323 }
324 
325 void FolderTreeView::slotHeaderContextMenuChangeIconSize( bool )
326 {
327  QAction *act = dynamic_cast< QAction * >( sender() );
328  if ( !act ) {
329  return;
330  }
331 
332  QVariant data = act->data();
333 
334  bool ok;
335  const int size = data.toInt( &ok );
336  if ( !ok ) {
337  return;
338  }
339 
340  const QSize newIconSize( QSize( size, size ) );
341  if ( newIconSize == iconSize() ) {
342  return;
343  }
344  setIconSize( newIconSize );
345 
346  writeConfig();
347 }
348 
349 void FolderTreeView::setCurrentModelIndex( const QModelIndex & index )
350 {
351  if ( index.isValid() ) {
352  clearSelection();
353  scrollTo( index );
354  selectionModel()->setCurrentIndex( index, QItemSelectionModel::Rows );
355  }
356 }
357 
358 void FolderTreeView::selectModelIndex( const QModelIndex & index )
359 {
360  if ( index.isValid() ) {
361  scrollTo( index );
362  selectionModel()->select(
363  index,
364  QItemSelectionModel::Rows | QItemSelectionModel::Select |
365  QItemSelectionModel::Current | QItemSelectionModel::Clear );
366  }
367 }
368 
369 void FolderTreeView::slotSelectFocusFolder()
370 {
371  const QModelIndex index = currentIndex();
372  if ( index.isValid() ) {
373  setCurrentIndex( index );
374  }
375 }
376 
377 void FolderTreeView::slotFocusNextFolder()
378 {
379  const QModelIndex nextFolder = selectNextFolder( currentIndex() );
380 
381  if ( nextFolder.isValid() ) {
382  expand( nextFolder );
383  setCurrentModelIndex( nextFolder );
384  }
385 }
386 
387 QModelIndex FolderTreeView::selectNextFolder( const QModelIndex & current )
388 {
389  QModelIndex below;
390  if ( current.isValid() ) {
391  model()->fetchMore( current );
392  if ( model()->hasChildren( current ) ) {
393  expand( current );
394  below = indexBelow( current );
395  } else if ( current.row() < model()->rowCount( model()->parent( current ) ) -1 ) {
396  below = model()->index( current.row()+1, current.column(), model()->parent( current ) );
397  } else {
398  below = indexBelow( current );
399  }
400  }
401  return below;
402 }
403 
404 void FolderTreeView::slotFocusPrevFolder()
405 {
406  const QModelIndex current = currentIndex();
407  if ( current.isValid() ) {
408  QModelIndex above = indexAbove( current );
409  setCurrentModelIndex( above );
410  }
411 }
412 
413 void FolderTreeView::slotFocusFirstFolder()
414 {
415  const QModelIndex first = moveCursor( QAbstractItemView::MoveHome, 0 );
416  if ( first.isValid() ) {
417  setCurrentModelIndex( first );
418  }
419 }
420 
421 void FolderTreeView::slotFocusLastFolder()
422 {
423  const QModelIndex last = moveCursor( QAbstractItemView::MoveEnd, 0 );
424  if ( last.isValid() ) {
425  setCurrentModelIndex( last );
426  }
427 }
428 
429 
430 void FolderTreeView::selectNextUnreadFolder( bool confirm )
431 {
432  // find next unread collection starting from current position
433  if ( !trySelectNextUnreadFolder( currentIndex(), MailCommon::Util::ForwardSearch, confirm ) ) {
434  // if there is none, jump to the last collection and try again
435  trySelectNextUnreadFolder( model()->index( 0, 0 ), MailCommon::Util::ForwardSearch, confirm );
436  }
437 }
438 
439 // helper method to find last item in the model tree
440 static QModelIndex lastChildOf( QAbstractItemModel *model, const QModelIndex &current )
441 {
442  if ( model->rowCount( current ) == 0 ) {
443  return current;
444  }
445 
446  return lastChildOf( model, model->index( model->rowCount( current ) - 1, 0, current ) );
447 }
448 
449 void FolderTreeView::selectPrevUnreadFolder( bool confirm )
450 {
451  // find next unread collection starting from current position
452  if ( !trySelectNextUnreadFolder( currentIndex(), MailCommon::Util::BackwardSearch, confirm ) ) {
453  // if there is none, jump to top and try again
454  const QModelIndex index = lastChildOf( model(), QModelIndex() );
455  trySelectNextUnreadFolder( index, MailCommon::Util::BackwardSearch, confirm );
456  }
457 }
458 
459 bool FolderTreeView::trySelectNextUnreadFolder( const QModelIndex &current,
460  MailCommon::Util::SearchDirection direction,
461  bool confirm )
462 {
463  QModelIndex index = current;
464  while ( true ) {
465  index = MailCommon::Util::nextUnreadCollection( model(), index, direction );
466 
467  if ( !index.isValid() ) {
468  return false;
469  }
470 
471  const Akonadi::Collection collection =
472  index.data( Akonadi::EntityTreeModel::CollectionRole ).value<Akonadi::Collection>();
473  if ( collection == Kernel::self()->trashCollectionFolder() ||
474  collection == Kernel::self()->outboxCollectionFolder() )
475  continue;
476 
477  if ( ignoreUnreadFolder( collection, confirm ) ) {
478  continue;
479  }
480 
481  if ( allowedToEnterFolder( collection, confirm ) ) {
482  expand( index );
483  setCurrentIndex( index );
484  selectModelIndex( index );
485  return true;
486  } else {
487  return false;
488  }
489  }
490 
491  return false;
492 }
493 
494 bool FolderTreeView::ignoreUnreadFolder( const Akonadi::Collection &collection, bool confirm ) const
495 {
496  if ( !confirm ) {
497  return false;
498  }
499 
500  // Skip drafts, sent mail and templates as well, when reading mail with the
501  // space bar - but not when changing into the next folder with unread mail
502  // via ctrl+ or ctrl- so we do this only if (confirm == true), which means
503  // we are doing readOn.
504 
505  return ( collection == Kernel::self()->draftsCollectionFolder() ||
506  collection == Kernel::self()->templatesCollectionFolder() ||
507  collection == Kernel::self()->sentCollectionFolder() );
508 }
509 
510 bool FolderTreeView::allowedToEnterFolder( const Akonadi::Collection &collection,
511  bool confirm ) const
512 {
513  if ( !confirm ) {
514  return true;
515  }
516 
517  // warn user that going to next folder - but keep track of
518  // whether he wishes to be notified again in "AskNextFolder"
519  // parameter (kept in the config file for kmail)
520  const int result =
521  KMessageBox::questionYesNo(
522  const_cast<FolderTreeView*>( this ),
523  i18n( "<qt>Go to the next unread message in folder <b>%1</b>?</qt>", collection.name() ),
524  i18n( "Go to Next Unread Message" ),
525  KGuiItem( i18n( "Go To" ) ),
526  KGuiItem( i18n( "Do Not Go To" ) ), // defaults
527  QLatin1String(":kmail_AskNextFolder"), 0 );
528 
529  return ( result == KMessageBox::Yes );
530 }
531 
532 bool FolderTreeView::isUnreadFolder( const QModelIndex &current,
533  QModelIndex &index, FolderTreeView::Move move,
534  bool confirm )
535 {
536  if ( current.isValid() ) {
537 
538  if ( move == FolderTreeView::Next ) {
539  index = selectNextFolder( current );
540  } else if ( move == FolderTreeView::Previous ) {
541  index = indexAbove( current );
542  }
543 
544  if ( index.isValid() ) {
545  const Akonadi::Collection collection =
546  index.model()->data(
547  current, Akonadi::EntityTreeModel::CollectionRole ).value<Akonadi::Collection>();
548 
549  if ( collection.isValid() ) {
550  if ( collection.statistics().unreadCount() > 0 ) {
551  if ( !confirm ) {
552  selectModelIndex( current );
553  return true;
554  } else {
555  // Skip drafts, sent mail and templates as well, when reading mail with the
556  // space bar - but not when changing into the next folder with unread mail
557  // via ctrl+ or ctrl- so we do this only if (confirm == true), which means
558  // we are doing readOn.
559 
560  if ( collection == Kernel::self()->draftsCollectionFolder() ||
561  collection == Kernel::self()->templatesCollectionFolder() ||
562  collection == Kernel::self()->sentCollectionFolder() ) {
563  return false;
564  }
565 
566  // warn user that going to next folder - but keep track of
567  // whether he wishes to be notified again in "AskNextFolder"
568  // parameter (kept in the config file for kmail)
569  if ( KMessageBox::questionYesNo(
570  this,
571  i18n( "<qt>Go to the next unread message in folder <b>%1</b>?</qt>",
572  collection.name() ),
573  i18n( "Go to Next Unread Message" ),
574  KGuiItem( i18n( "Go To" ) ),
575  KGuiItem( i18n( "Do Not Go To" ) ), // defaults
576  QLatin1String(":kmail_AskNextFolder"),
577  0 ) == KMessageBox::No ) {
578  return true; // assume selected (do not continue looping)
579  }
580 
581  selectModelIndex( current );
582  return true;
583  }
584  }
585  }
586  }
587  }
588  return false;
589 }
590 
591 Akonadi::Collection FolderTreeView::currentFolder() const
592 {
593  const QModelIndex current = currentIndex();
594  if ( current.isValid() ) {
595  const Akonadi::Collection collection =
596  current.model()->data(
597  current,
598  Akonadi::EntityTreeModel::CollectionRole ).value<Akonadi::Collection>();
599  return collection;
600  }
601  return Akonadi::Collection();
602 }
603 
604 void FolderTreeView::mousePressEvent( QMouseEvent *e )
605 {
606  const bool buttonPressedIsMiddle = ( e->button() == Qt::MidButton );
607  emit prefereCreateNewTab( buttonPressedIsMiddle );
608  EntityTreeView::mousePressEvent( e );
609 }
610 
611 void FolderTreeView::restoreHeaderState( const QByteArray &data )
612 {
613  if (data.isEmpty()) {
614  const int nbColumn = header()->count();
615  for ( int i = 1; i <nbColumn; ++i ) {
616  setColumnHidden( i, true );
617  }
618  }
619  else
620  header()->restoreState( data );
621  mCollectionStatisticsDelegate->setUnreadCountShown( header()->isSectionHidden( 1 ) );
622 }
623 
624 void FolderTreeView::updatePalette()
625 {
626  mCollectionStatisticsDelegate->updatePalette();
627 }
628 
629 void FolderTreeView::keyboardSearch( const QString & )
630 {
631  // Disable keyboardSearch: it interfers with filtering in the
632  // FolderSelectionDialog. We don't want it in KMail main window
633  // either because KMail has one-letter keyboard shortcuts.
634 }
635 
636 }
637 
638 #include "foldertreeview.moc"
MailCommon::FolderTreeView::slotFocusNextFolder
void slotFocusNextFolder()
Definition: foldertreeview.cpp:377
MailCommon::FolderTreeView::updatePalette
void updatePalette()
Definition: foldertreeview.cpp:624
KernelIf
#define KernelIf
Definition: mailkernel.h:186
MailCommon::FolderTreeView::slotHeaderContextMenuChangeToolTipDisplayPolicy
void slotHeaderContextMenuChangeToolTipDisplayPolicy(bool)
Definition: foldertreeview.cpp:282
MailCommon::FolderTreeView::slotFocusLastFolder
void slotFocusLastFolder()
Definition: foldertreeview.cpp:421
MailCommon::FolderTreeView::disableSaveConfig
void disableSaveConfig()
Definition: foldertreeview.cpp:58
MailCommon::FolderTreeView::slotHeaderContextMenuRequested
void slotHeaderContextMenuRequested(const QPoint &)
Definition: foldertreeview.cpp:138
MailCommon::FolderTreeView::setSortingPolicy
void setSortingPolicy(FolderTreeWidget::SortingPolicy policy, bool writeInConfig=false)
Definition: foldertreeview.cpp:238
MailCommon::FolderTreeView::mousePressEvent
virtual void mousePressEvent(QMouseEvent *e)
Definition: foldertreeview.cpp:604
MailCommon::FolderTreeView::readConfig
void readConfig()
Definition: foldertreeview.cpp:118
MailCommon::Kernel::trashCollectionFolder
Akonadi::Collection trashCollectionFolder()
Definition: mailkernel.cpp:85
indexAbove
static QModelIndex indexAbove(QAbstractItemModel *model, const QModelIndex &current)
Definition: mailutil.cpp:516
QWidget
MailCommon::FolderTreeWidget::ToolTipDisplayPolicy
ToolTipDisplayPolicy
The possible tooltip display policies.
Definition: foldertreewidget.h:76
MailCommon::FolderTreeWidget::DisplayNever
Nevery display tooltips.
Definition: foldertreewidget.h:79
MailCommon::FolderTreeView::currentFolder
Akonadi::Collection currentFolder() const
Definition: foldertreeview.cpp:591
MailCommon::FolderTreeView::selectPrevUnreadFolder
void selectPrevUnreadFolder(bool confirm=false)
Definition: foldertreeview.cpp:449
MailCommon::FolderTreeView::Move
Move
Definition: foldertreeview.h:73
MailCommon::FolderTreeView::slotFocusPrevFolder
void slotFocusPrevFolder()
Definition: foldertreeview.cpp:404
MailCommon::FolderTreeWidget::SortByDragAndDropKey
Columns are NOT clickable, sorting is done by drag and drop.
Definition: foldertreewidget.h:87
MailCommon::FolderTreeView::changeTooltipsPolicy
void changeTooltipsPolicy(FolderTreeWidget::ToolTipDisplayPolicy)
MailCommon::FolderTreeView::slotSelectFocusFolder
void slotSelectFocusFolder()
Definition: foldertreeview.cpp:369
MailCommon::FolderTreeView::slotHeaderContextMenuChangeHeader
void slotHeaderContextMenuChangeHeader(bool)
Definition: foldertreeview.cpp:299
MailCommon::FolderTreeView::slotHeaderContextMenuChangeSortingPolicy
void slotHeaderContextMenuChangeSortingPolicy(bool)
Definition: foldertreeview.cpp:220
MailCommon::FolderTreeView::disableContextMenuAndExtraColumn
void disableContextMenuAndExtraColumn()
Definition: foldertreeview.cpp:74
MailCommon::Util::SearchDirection
SearchDirection
Describes the direction for searching next unread collection.
Definition: mailutil.h:96
foldertreeview.h
MailCommon::FolderTreeView::Next
Definition: foldertreeview.h:74
MailCommon::FolderTreeView::isUnreadFolder
bool isUnreadFolder(const QModelIndex &current, QModelIndex &nextIndex, FolderTreeView::Move move, bool confirm)
Definition: foldertreeview.cpp:532
MailCommon::FolderTreeView::restoreHeaderState
void restoreHeaderState(const QByteArray &data)
Definition: foldertreeview.cpp:611
MailCommon::FolderTreeView::manualSortingChanged
void manualSortingChanged(bool actif)
MailCommon::Util::ForwardSearch
Definition: mailutil.h:97
MailCommon::FolderTreeView::setCurrentModelIndex
void setCurrentModelIndex(const QModelIndex &)
Definition: foldertreeview.cpp:349
MailCommon::FolderTreeView::slotHeaderContextMenuChangeIconSize
void slotHeaderContextMenuChangeIconSize(bool)
Definition: foldertreeview.cpp:325
MailCommon::FolderTreeView::~FolderTreeView
virtual ~FolderTreeView()
Definition: foldertreeview.cpp:54
MailCommon::FolderTreeView::selectNextFolder
QModelIndex selectNextFolder(const QModelIndex &current)
Definition: foldertreeview.cpp:387
indexBelow
static QModelIndex indexBelow(QAbstractItemModel *model, const QModelIndex &current)
Definition: mailutil.cpp:462
MailCommon::FolderTreeView::showStatisticAnimation
void showStatisticAnimation(bool anim)
Definition: foldertreeview.cpp:101
MailCommon::FolderTreeWidget::SortByCurrentColumn
Columns are clickable, sorting is by the current column.
Definition: foldertreewidget.h:86
QAbstractItemModel
MailCommon::Util::BackwardSearch
Definition: mailutil.h:98
MailCommon::FolderTreeView::prefereCreateNewTab
void prefereCreateNewTab(bool)
MailCommon::FolderTreeView::keyboardSearch
void keyboardSearch(const QString &)
Definition: foldertreeview.cpp:629
MailCommon::FolderTreeView::writeConfig
void writeConfig()
Definition: foldertreeview.cpp:106
MailCommon::FolderTreeView::setTooltipsPolicy
void setTooltipsPolicy(FolderTreeWidget::ToolTipDisplayPolicy)
Definition: foldertreeview.cpp:63
mailkernel.h
MailCommon::FolderTreeView::FolderTreeView
FolderTreeView(QWidget *parent=0, bool showUnreadCount=true)
Definition: foldertreeview.cpp:38
MailCommon::FolderTreeView::selectModelIndex
void selectModelIndex(const QModelIndex &)
Definition: foldertreeview.cpp:358
MailCommon::lastChildOf
static QModelIndex lastChildOf(QAbstractItemModel *model, const QModelIndex &current)
Definition: foldertreeview.cpp:440
MailCommon::FolderTreeView::slotFocusFirstFolder
void slotFocusFirstFolder()
Definition: foldertreeview.cpp:413
MailCommon::Kernel::outboxCollectionFolder
Akonadi::Collection outboxCollectionFolder()
Definition: mailkernel.cpp:99
MailCommon::Util::nextUnreadCollection
MAILCOMMON_EXPORT QModelIndex nextUnreadCollection(QAbstractItemModel *model, const QModelIndex &current, SearchDirection direction, bool(*ignoreCollectionCallback)(const Akonadi::Collection &collection)=0)
Returns the index of the next unread collection following a given index.
Definition: mailutil.cpp:533
MailCommon::FolderTreeWidget::SortingPolicy
SortingPolicy
The available sorting policies.
Definition: foldertreewidget.h:85
MailCommon::FolderTreeView::selectNextUnreadFolder
void selectNextUnreadFolder(bool confirm=false)
Definition: foldertreeview.cpp:430
MailCommon::FolderTreeView::Previous
Definition: foldertreeview.h:75
MailCommon::Kernel::self
static Kernel * self()
Definition: mailkernel.cpp:71
MailCommon::FolderTreeView::init
void init(bool showUnreadCount)
Definition: foldertreeview.cpp:83
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