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

messagelist

  • sources
  • kde-4.12
  • kdepim
  • messagelist
  • core
view.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Copyright 2008 Szymon Tomasz Stefanek <pragma@kvirc.net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  *
19  *******************************************************************************/
20 
21 #ifndef __MESSAGELIST_CORE_VIEW_H__
22 #define __MESSAGELIST_CORE_VIEW_H__
23 
24 #include <QTreeView>
25 #include <QList>
26 #include <QPoint>
27 
28 #include <messagelist/core/enums.h>
29 #include <messagelist/messagelist_export.h>
30 
31 class KMenu;
32 
33 class QTimer;
34 
35 namespace Akonadi
36 {
37  class MessageStatus;
38 }
39 
40 namespace MessageList
41 {
42 
43 namespace Core
44 {
45 
46 typedef long int MessageItemSetReference;
47 
48 class Aggregation;
49 class Delegate;
50 class Item;
51 class MessageItem;
52 class GroupHeaderItem;
53 class Model;
54 class Theme;
55 class SortOrder;
56 class StorageModel;
57 class Widget;
58 
64 class MESSAGELIST_EXPORT View : public QTreeView
65 {
66  friend class Model;
67  friend class ModelPrivate;
68  Q_OBJECT
69 public:
70  explicit View( Widget *parent );
71  ~View();
72 
77  Model * model() const;
78 
83  Delegate * delegate() const;
84 
93  void setStorageModel( StorageModel * storageModel, PreSelectionMode preSelectionMode = PreSelectLastSelected );
94 
98  StorageModel * storageModel() const;
99 
104  void setAggregation( const Aggregation * aggregation );
105 
110  void setTheme( Theme * theme );
111 
116  void setSortOrder( const SortOrder * sortOrder );
117 
122  void reload();
123 
130  MessageItem * currentMessageItem( bool selectIfNeeded = true ) const;
131 
138  Item * currentItem() const;
139 
143  void setCurrentMessageItem( MessageItem * it, bool center = false );
144 
150  bool isDisplayedWithParentsExpanded( Item * it ) const;
151 
156  void ensureDisplayedWithParentsExpanded( Item * it );
157 
169  QList< MessageItem * > selectionAsMessageItemList( bool includeCollapsedChildren = true ) const;
170 
181  QList< MessageItem * > currentThreadAsMessageItemList() const;
182 
186  bool selectionEmpty() const;
187 
192  void selectMessageItems( const QList< MessageItem * > &list );
193 
204  MessageItemSetReference createPersistentSet( const QList< MessageItem * > &items );
205 
213  QList< MessageItem * > persistentSetCurrentMessageItemList( MessageItemSetReference ref );
214 
219  void deletePersistentSet( MessageItemSetReference ref );
220 
227  void markMessageItemsAsAboutToBeRemoved( QList< MessageItem * > &items, bool bMark );
228 
233  bool isThreaded() const;
234 
239  void setCurrentThreadExpanded( bool expand );
240 
245  void setAllThreadsExpanded( bool expand );
246 
253  void setAllGroupsExpanded( bool expand );
254 
272  bool selectNextMessageItem(
273  MessageTypeFilter messageTypeFilter,
274  ExistingSelectionBehaviour existingSelectionBehaviour,
275  bool centerItem,
276  bool loop
277  );
278 
296  bool selectPreviousMessageItem(
297  MessageTypeFilter messageTypeFilter,
298  ExistingSelectionBehaviour existingSelectionBehaviour,
299  bool centerItem,
300  bool loop
301  );
302 
314  bool focusNextMessageItem( MessageTypeFilter messageTypeFilter, bool centerItem, bool loop );
315 
324  bool focusPreviousMessageItem( MessageTypeFilter messageTypeFilter, bool centerItem, bool loop );
325 
332  void selectFocusedMessageItem( bool centerItem );
333 
339  bool selectFirstMessageItem( MessageTypeFilter messageTypeFilter, bool centerItem );
340 
346  bool selectLastMessageItem( MessageTypeFilter messageTypeFilter, bool centerItem );
347 
351  void focusQuickSearch();
352 
356  Akonadi::MessageStatus currentFilterStatus() const;
357 
361  QString currentFilterSearchString() const;
362 
367  virtual void setRowHidden( int row, const QModelIndex & parent, bool hide );
368 
369  void sortOrderMenuAboutToShow(KMenu *menu);
370 
371  void aggregationMenuAboutToShow(KMenu *menu);
372 
373  void themeMenuAboutToShow(KMenu *menu);
374 
375  void setCollapseItem(const QModelIndex& index);
376  void setExpandItem(const QModelIndex& index);
377 
378 
379 protected:
383  virtual bool event( QEvent *e );
384 
388  virtual void changeEvent( QEvent *e );
389 
393  virtual void showEvent( QShowEvent *e );
394 
398  virtual void mousePressEvent( QMouseEvent * e );
399 
403  virtual void mouseDoubleClickEvent( QMouseEvent * e );
404 
408  virtual void mouseMoveEvent( QMouseEvent * e );
409 
413  virtual void contextMenuEvent( QContextMenuEvent* e );
414 
418  virtual void dragEnterEvent( QDragEnterEvent * e );
419 
423  virtual void dragMoveEvent( QDragMoveEvent * e );
424 
428  virtual void dropEvent( QDropEvent * e );
429 
433  virtual void resizeEvent( QResizeEvent * e );
434 
438  virtual int sizeHintForColumn( int logicalColumnIndex ) const;
439 
445  virtual void updateGeometries();
446 
451  bool isScrollingLocked() const;
452 
456  void ignoreUpdateGeometries( bool ignore );
457 
463  void modelHasBeenReset();
464 
465  void modelAboutToEmitLayoutChanged();
466  void modelEmittedLayoutChanged();
467 
471  void appendMessageItemChildren( MessageItem * par, QList< MessageItem * > &list );
472 
477  void ignoreCurrentChanges( bool ignore );
478 
482  void setChildrenExpanded( const Item * parent, bool expand );
483 
494  Item * nextMessageItem( MessageTypeFilter messageTypeFilter, bool loop );
495 
506  Item * messageItemAfter( Item * referenceItem, MessageTypeFilter messageTypeFilter, bool loop );
507 
516  Item * firstMessageItem( MessageTypeFilter messageTypeFilter )
517  { return messageItemAfter( 0, messageTypeFilter, false ); }
518 
529  Item * previousMessageItem( MessageTypeFilter messageTypeFilter, bool loop );
530 
535  Item * deepestExpandedChild( Item * referenceItem ) const;
536 
547  Item * messageItemBefore( Item * referenceItem, MessageTypeFilter messageTypeFilter, bool loop );
548 
557  Item * lastMessageItem( MessageTypeFilter messageTypeFilter )
558  { return messageItemBefore( 0, messageTypeFilter, false ); }
559 
564  void modelJobBatchStarted();
565 
570  void modelJobBatchTerminated();
571 
576  void modelFinishedLoading();
577 
583  void changeMessageStatus( MessageItem * it, const Akonadi::MessageStatus &set, const Akonadi::MessageStatus &unset );
584  void changeMessageStatusRead( MessageItem *it, bool read );
585 
591  void triggerDelayedSaveThemeColumnState();
592 
598  void triggerDelayedApplyThemeColumns();
599 
608  void growOrShrinkExistingSelection( const QModelIndex &newSelectedIndex, bool movingUp );
609 
610 public slots:
614  void slotCollapseAllGroups();
615 
619  void slotExpandAllGroups();
620 
625  void slotExpandCurrentItem();
626 
631  void slotCollapseCurrentItem();
632 
633 protected slots:
634 
638  void slotHeaderContextMenuRequested( const QPoint &pnt );
639 
643  void slotShowHideColumn( int columnIndex );
644 
648  void slotAdjustColumnSizes();
649 
653  void slotShowDefaultColumns();
654 
658  void slotDisplayTooltips( bool showTooltips );
659 
663  void slotHeaderSectionResized( int logicalIndex, int oldWidth, int newWidth );
664 
668  void slotSelectionChanged( const QItemSelection &current, const QItemSelection & );
669 
673  void saveThemeColumnState();
674 
680  void applyThemeColumns();
681 
682 private:
684  Q_PRIVATE_SLOT(d, void expandFullThread( const QModelIndex& ))
685 
686  class Private;
687  Private * d;
688 }; // class View
689 
690 } // namespace Core
691 
692 } // namespace MessageList
693 
694 
695 #endif
696 
MessageList::Core::SortOrder
A class which holds information about sorting, e.g.
Definition: sortorder.h:37
messagelist_export.h
MessageList::Core::Aggregation
A set of aggregation options that can be applied to the MessageList::Model in a single shot...
Definition: aggregation.h:43
MessageList::Core::Delegate
Definition: delegate.h:34
MessageList::Core::MessageItem
Definition: messageitem.h:50
MessageList::Core::Widget
Provides a widget which has the messagelist and the most important helper widgets, like the search line and the comboboxes for changing status filtering, aggregation etc.
Definition: widgetbase.h:60
MessageList::Core::View
The MessageList::View is the real display of the message list.
Definition: view.h:64
MessageList::Core::Model
This class manages the huge tree of displayable objects: GroupHeaderItems and MessageItems.
Definition: model.h:77
MessageList::Core::ModelPrivate
Definition: model_p.h:33
MessageList::Core::View::firstMessageItem
Item * firstMessageItem(MessageTypeFilter messageTypeFilter)
Finds the first message item in the view.
Definition: view.h:516
QTreeView
MessageList::Core::PreSelectionMode
PreSelectionMode
Pre-selection is the action of automatically selecting a message just after the folder has finished l...
Definition: enums.h:44
MessageList::Core::View::lastMessageItem
Item * lastMessageItem(MessageTypeFilter messageTypeFilter)
Finds the last message item in the view.
Definition: view.h:557
MessageList::Core::Item
A single item of the MessageList tree managed by MessageList::Model.
Definition: item.h:52
MESSAGELIST_EXPORT
#define MESSAGELIST_EXPORT
Definition: messagelist_export.h:34
MessageList::Core::StorageModel
The QAbstractItemModel based interface that you need to provide for your storage to work with Message...
Definition: storagemodelbase.h:45
MessageList::Core::MessageTypeFilter
MessageTypeFilter
This enum is used in the view message selection functions (for instance View::nextMessageItem()).
Definition: enums.h:56
enums.h
MessageList::Core::Theme
The Theme class defines the visual appearance of the MessageList.
Definition: theme.h:65
MessageList::Core::PreSelectLastSelected
Definition: enums.h:47
MessageList::Core::MessageItemSetReference
long int MessageItemSetReference
Definition: messageitemsetmanager.h:33
MessageList::Core::ExistingSelectionBehaviour
ExistingSelectionBehaviour
This enum is used in the view message selection functions (for instance View::selectNextMessage()) ...
Definition: enums.h:65
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:32 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

messagelist

Skip menu "messagelist"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

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