• 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
storagemodel.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2009 Kevin Ottens <ervin@kde.org>
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18 
19 #ifndef __MESSAGELIST_STORAGEMODEL_H__
20 #define __MESSAGELIST_STORAGEMODEL_H__
21 
22 #include <messagelist/core/storagemodelbase.h>
23 
24 #include <akonadi/collection.h>
25 #include <akonadi/item.h>
26 
27 #include <QColor>
28 #include <QFont>
29 
30 #include <kmime/kmime_message.h>
31 
32 #include <messagelist/messagelist_export.h>
33 
34 class QAbstractItemModel;
35 class QItemSelectionModel;
36 
37 namespace MessageList
38 {
39 
40 namespace Core
41 {
42  class MessageItem;
43 }
44 
48 class MESSAGELIST_EXPORT StorageModel : public MessageList::Core::StorageModel
49 {
50  Q_OBJECT
51 
52 public:
56  explicit StorageModel( QAbstractItemModel *model, QItemSelectionModel *selectionModel, QObject *parent = 0 );
57  ~StorageModel();
58 
59  Akonadi::Collection::List displayedCollections() const;
60 
61  virtual QString id() const;
62  virtual bool containsOutboundMessages() const;
63 
64  virtual bool isOutBoundFolder( const Akonadi::Collection& c ) const;
65 
66  virtual int initialUnreadRowCountGuess() const;
67  virtual bool initializeMessageItem( MessageList::Core::MessageItem *mi, int row, bool bUseReceiver ) const;
68  virtual void fillMessageItemThreadingData( MessageList::Core::MessageItem *mi, int row, ThreadingDataSubset subset ) const;
69  virtual void updateMessageItemData( MessageList::Core::MessageItem *mi, int row ) const;
70  virtual void setMessageItemStatus( MessageList::Core::MessageItem *mi, int row, const Akonadi::MessageStatus &status );
71 
72  virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
73  virtual QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const;
74  virtual QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const;
75  virtual QModelIndex parent( const QModelIndex &index ) const;
76  virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
77 
78  virtual QMimeData* mimeData( const QList< MessageList::Core::MessageItem* >& ) const;
79  using MessageList::Core::StorageModel::mimeData;
80 
81  virtual void prepareForScan();
82 
83  Akonadi::Item itemForRow( int row ) const;
84  KMime::Message::Ptr messageForRow( int row ) const;
85 
86  void resetModelStorage();
87 
88 private:
89  Q_PRIVATE_SLOT(d, void onSourceDataChanged( const QModelIndex&, const QModelIndex& ))
90  Q_PRIVATE_SLOT(d, void onSelectionChanged())
91  Q_PRIVATE_SLOT(d, void loadSettings())
92  Q_PRIVATE_SLOT(d, void statementChanged( const Nepomuk2::Resource & ))
93 
94  class Private;
95  Private * const d;
96 };
97 
98 } // namespace MessageList
99 
100 #endif
messagelist_export.h
MessageList::Core::MessageItem
Definition: messageitem.h:50
QObject
MessageList::Core::StorageModel::ThreadingDataSubset
ThreadingDataSubset
Definition: storagemodelbase.h:95
MessageList::Core::StorageModel::mimeData
virtual QMimeData * mimeData(const QList< MessageItem * > &) const =0
The implementation-specific mime data for this list of items.
QAbstractItemModel
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::StorageModel
The Akonadi specific implementation of the Core::StorageModel.
Definition: storagemodel.h:48
storagemodelbase.h
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