• 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
model.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_MODEL_H__
22 #define __MESSAGELIST_CORE_MODEL_H__
23 
24 #include <QAbstractItemModel>
25 #include <QList>
26 #include <QHash>
27 #include <QMultiHash>
28 #include <QDate>
29 #include <QTimer>
30 
31 #include <messagelist/core/aggregation.h>
32 #include <messagelist/core/enums.h>
33 #include <messagelist/core/sortorder.h>
34 
35 #include <time.h> // time_t
36 
37 #include <messagelist/messagelist_export.h>
38 
39 class QTime;
40 
41 namespace MessageList
42 {
43 
44 namespace Core
45 {
46 
47 typedef long int MessageItemSetReference;
48 
49 class ViewItemJob;
50 class Filter;
51 class GroupHeaderItem;
52 class Item;
53 class Manager;
54 class MessageItem;
55 class Theme;
56 class StorageModel;
57 class ModelInvariantRowMapper;
58 class MessageItemSetManager;
59 class View;
60 class ModelPrivate;
61 
77 class MESSAGELIST_EXPORT Model : public QAbstractItemModel
78 {
79  friend class Item;
80  friend class ItemPrivate;
81 
82  Q_OBJECT
83 public:
84 
88  explicit Model( View *pParent );
89 
93  ~Model();
94 
98  StorageModel *storageModel() const;
99 
115  void setStorageModel( StorageModel *storageModel, PreSelectionMode preSelectionMode = PreSelectLastSelected );
116 
124  void setPreSelectionMode( PreSelectionMode preSelect );
125 
130  Item *rootItem() const;
131 
136  bool isLoading() const;
137 
144  MessageItem * messageItemByStorageRow( int row ) const;
145 
153  void setAggregation( const Aggregation * aggregation );
154 
162  void setTheme( const Theme * theme );
163 
168  void setSortOrder( const SortOrder * sortOrder );
169 
173  const SortOrder * sortOrder() const;
174 
181  void setFilter( const Filter *filter );
182 
193  MessageItemSetReference createPersistentSet( const QList< MessageItem * > &items );
194 
202  QList< MessageItem * > persistentSetCurrentMessageItemList( MessageItemSetReference ref );
203 
208  void deletePersistentSet( MessageItemSetReference ref );
209 
210  // Mandatory QAbstractItemModel interface.
211 
212  virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
213  virtual QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const;
214  virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
215  virtual QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const;
216  QModelIndex index( Item *item, int column ) const;
217  virtual QModelIndex parent( const QModelIndex &index ) const;
218  virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
219  virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
220 
222  virtual QMimeData* mimeData( const QModelIndexList& indexes ) const;
223 
224 Q_SIGNALS:
229  void statusMessage( const QString &message );
230 
231 private:
232  Q_PRIVATE_SLOT(d, void checkIfDateChanged())
233  Q_PRIVATE_SLOT(d, void viewItemJobStep())
234  Q_PRIVATE_SLOT(d, void slotStorageModelRowsInserted( const QModelIndex &, int, int ))
235  Q_PRIVATE_SLOT(d, void slotStorageModelRowsRemoved( const QModelIndex &, int, int ))
236  Q_PRIVATE_SLOT(d, void slotStorageModelDataChanged( const QModelIndex &, const QModelIndex & ))
237  Q_PRIVATE_SLOT(d, void slotStorageModelHeaderDataChanged( Qt::Orientation, int, int ))
238  Q_PRIVATE_SLOT(d, void slotStorageModelLayoutChanged())
239  Q_PRIVATE_SLOT(d, void slotApplyFilter())
240 
241  friend class ModelPrivate;
242  ModelPrivate * const d;
243 };
244 
245 } // namespace Core
246 
247 } // namespace MessageList
248 
249 #endif
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::MessageItem
Definition: messageitem.h:50
MessageList::Core::ItemPrivate
Definition: item_p.h:41
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::PreSelectionMode
PreSelectionMode
Pre-selection is the action of automatically selecting a message just after the folder has finished l...
Definition: enums.h:44
aggregation.h
QAbstractItemModel
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
sortorder.h
enums.h
MessageList::Core::Filter
This class is responsable of matching messages that should be displayed in the View.
Definition: filter.h:51
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
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