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

messagelist

  • sources
  • kde-4.14
  • 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 #include <messagelist/core/widgets/quicksearchline.h>
31 
32 class KMenu;
33 
34 class QTimer;
35 
36 namespace Akonadi
37 {
38 class MessageStatus;
39 }
40 
41 namespace MessageList
42 {
43 
44 namespace Core
45 {
46 
47 typedef long int MessageItemSetReference;
48 
49 class Aggregation;
50 class Delegate;
51 class Item;
52 class MessageItem;
53 class GroupHeaderItem;
54 class Model;
55 class Theme;
56 class SortOrder;
57 class StorageModel;
58 class Widget;
59 
65 class MESSAGELIST_EXPORT View : public QTreeView
66 {
67  friend class Model;
68  friend class ModelPrivate;
69  Q_OBJECT
70 public:
71  explicit View( Widget *parent );
72  ~View();
73 
78  Model * model() const;
79 
84  Delegate * delegate() const;
85 
94  void setStorageModel( StorageModel * storageModel, PreSelectionMode preSelectionMode = PreSelectLastSelected );
95 
99  StorageModel * storageModel() const;
100 
105  void setAggregation( const Aggregation * aggregation );
106 
111  void setTheme( Theme * theme );
112 
117  void setSortOrder( const SortOrder * sortOrder );
118 
123  void reload();
124 
131  MessageItem * currentMessageItem( bool selectIfNeeded = true ) const;
132 
139  Item * currentItem() const;
140 
144  void setCurrentMessageItem( MessageItem * it, bool center = false );
145 
151  bool isDisplayedWithParentsExpanded( Item * it ) const;
152 
157  void ensureDisplayedWithParentsExpanded( Item * it );
158 
170  QList< MessageItem * > selectionAsMessageItemList( bool includeCollapsedChildren = true ) const;
171 
182  QList< MessageItem * > currentThreadAsMessageItemList() const;
183 
187  bool selectionEmpty() const;
188 
193  void selectMessageItems( const QList< MessageItem * > &list );
194 
205  MessageItemSetReference createPersistentSet( const QList< MessageItem * > &items );
206 
214  QList< MessageItem * > persistentSetCurrentMessageItemList( MessageItemSetReference ref );
215 
220  void deletePersistentSet( MessageItemSetReference ref );
221 
228  void markMessageItemsAsAboutToBeRemoved( QList< MessageItem * > &items, bool bMark );
229 
234  bool isThreaded() const;
235 
240  void setCurrentThreadExpanded( bool expand );
241 
246  void setAllThreadsExpanded( bool expand );
247 
254  void setAllGroupsExpanded( bool expand );
255 
273  bool selectNextMessageItem(
274  MessageTypeFilter messageTypeFilter,
275  ExistingSelectionBehaviour existingSelectionBehaviour,
276  bool centerItem,
277  bool loop
278  );
279 
297  bool selectPreviousMessageItem(
298  MessageTypeFilter messageTypeFilter,
299  ExistingSelectionBehaviour existingSelectionBehaviour,
300  bool centerItem,
301  bool loop
302  );
303 
315  bool focusNextMessageItem( MessageTypeFilter messageTypeFilter, bool centerItem, bool loop );
316 
325  bool focusPreviousMessageItem( MessageTypeFilter messageTypeFilter, bool centerItem, bool loop );
326 
333  void selectFocusedMessageItem( bool centerItem );
334 
340  bool selectFirstMessageItem( MessageTypeFilter messageTypeFilter, bool centerItem );
341 
347  bool selectLastMessageItem( MessageTypeFilter messageTypeFilter, bool centerItem );
348 
352  void focusQuickSearch(const QString &selectedText);
353 
357  QList<Akonadi::MessageStatus> currentFilterStatus() const;
358 
362  QString currentFilterSearchString() const;
363 
368  virtual void setRowHidden( int row, const QModelIndex & parent, bool hide );
369 
370  void sortOrderMenuAboutToShow(KMenu *menu);
371 
372  void aggregationMenuAboutToShow(KMenu *menu);
373 
374  void themeMenuAboutToShow(KMenu *menu);
375 
376  void setCollapseItem(const QModelIndex& index);
377  void setExpandItem(const QModelIndex& index);
378 
379  void setQuickSearchClickMessage(const QString &msg);
380 
381  MessageList::Core::QuickSearchLine::SearchOptions currentOptions() const;
382 protected:
386  virtual bool event( QEvent *e );
387 
391  virtual void changeEvent( QEvent *e );
392 
396  virtual void showEvent( QShowEvent *e );
397 
401  virtual void mousePressEvent( QMouseEvent * e );
402 
406  virtual void mouseDoubleClickEvent( QMouseEvent * e );
407 
411  virtual void mouseMoveEvent( QMouseEvent * e );
412 
416  virtual void contextMenuEvent( QContextMenuEvent* e );
417 
421  virtual void dragEnterEvent( QDragEnterEvent * e );
422 
426  virtual void dragMoveEvent( QDragMoveEvent * e );
427 
431  virtual void dropEvent( QDropEvent * e );
432 
436  virtual void resizeEvent( QResizeEvent * e );
437 
441  virtual int sizeHintForColumn( int logicalColumnIndex ) const;
442 
448  virtual void updateGeometries();
449 
454  bool isScrollingLocked() const;
455 
459  void ignoreUpdateGeometries( bool ignore );
460 
466  void modelHasBeenReset();
467 
468  void modelAboutToEmitLayoutChanged();
469  void modelEmittedLayoutChanged();
470 
474  void appendMessageItemChildren( MessageItem * par, QList< MessageItem * > &list );
475 
480  void ignoreCurrentChanges( bool ignore );
481 
485  void setChildrenExpanded( const Item * parent, bool expand );
486 
497  Item * nextMessageItem( MessageTypeFilter messageTypeFilter, bool loop );
498 
509  Item * messageItemAfter( Item * referenceItem, MessageTypeFilter messageTypeFilter, bool loop );
510 
519  Item * firstMessageItem( MessageTypeFilter messageTypeFilter )
520  { return messageItemAfter( 0, messageTypeFilter, false ); }
521 
532  Item * previousMessageItem( MessageTypeFilter messageTypeFilter, bool loop );
533 
538  Item * deepestExpandedChild( Item * referenceItem ) const;
539 
550  Item * messageItemBefore( Item * referenceItem, MessageTypeFilter messageTypeFilter, bool loop );
551 
560  Item * lastMessageItem( MessageTypeFilter messageTypeFilter )
561  { return messageItemBefore( 0, messageTypeFilter, false ); }
562 
567  void modelJobBatchStarted();
568 
573  void modelJobBatchTerminated();
574 
579  void modelFinishedLoading();
580 
586  void changeMessageStatus( MessageItem * it, const Akonadi::MessageStatus &set, const Akonadi::MessageStatus &unset );
587  void changeMessageStatusRead( MessageItem *it, bool read );
588 
594  void triggerDelayedSaveThemeColumnState();
595 
601  void triggerDelayedApplyThemeColumns();
602 
611  void growOrShrinkExistingSelection( const QModelIndex &newSelectedIndex, bool movingUp );
612 
613 public slots:
617  void slotCollapseAllGroups();
618 
622  void slotExpandAllGroups();
623 
628  void slotExpandCurrentItem();
629 
634  void slotCollapseCurrentItem();
635 
636 protected slots:
637 
641  void slotHeaderContextMenuRequested( const QPoint &pnt );
642 
646  void slotShowHideColumn( int columnIndex );
647 
651  void slotAdjustColumnSizes();
652 
656  void slotShowDefaultColumns();
657 
661  void slotDisplayTooltips( bool showTooltips );
662 
666  void slotHeaderSectionResized( int logicalIndex, int oldWidth, int newWidth );
667 
671  void slotSelectionChanged( const QItemSelection &current, const QItemSelection & );
672 
676  void saveThemeColumnState();
677 
683  void applyThemeColumns();
684 
685 private:
687  Q_PRIVATE_SLOT(d, void expandFullThread( const QModelIndex& ))
688 
689  class Private;
690  Private * d;
691 }; // class View
692 
693 } // namespace Core
694 
695 } // namespace MessageList
696 
697 
698 #endif
699 
quicksearchline.h
QModelIndex
QEvent
QResizeEvent
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:46
QDragMoveEvent
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:61
QPoint
QMouseEvent
MessageList::Core::View
The MessageList::View is the real display of the message list.
Definition: view.h:65
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
QTimer
MessageList::Core::View::firstMessageItem
Item * firstMessageItem(MessageTypeFilter messageTypeFilter)
Finds the first message item in the view.
Definition: view.h:519
QContextMenuEvent
QShowEvent
QDropEvent
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:560
QString
QList
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
QItemSelection
MessageList::Core::MessageTypeFilter
MessageTypeFilter
This enum is used in the view message selection functions (for instance View::nextMessageItem()).
Definition: enums.h:56
enums.h
QDragEnterEvent
QTreeView
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-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:01 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
  • pimprint

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