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

akonadi

  • sources
  • kde-4.12
  • kdepimlibs
  • akonadi
collectionmodel.h
1 /*
2  Copyright (c) 2006 - 2008 Volker Krause <vkrause@kde.org>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 #ifndef AKONADI_COLLECTIONMODEL_H
21 #define AKONADI_COLLECTIONMODEL_H
22 
23 #include "akonadi_export.h"
24 
25 #include <akonadi/collection.h>
26 
27 #include <QtCore/QAbstractItemModel>
28 
29 namespace Akonadi {
30 
31 class CollectionModelPrivate;
32 
54 class AKONADI_DEPRECATED_EXPORT CollectionModel : public QAbstractItemModel
55 {
56  Q_OBJECT
57 
58  public:
62  enum Roles {
63  OldCollectionIdRole = Qt::UserRole + 1,
64  OldCollectionRole = Qt::UserRole + 2,
65  CollectionIdRole = Qt::UserRole + 10,
66  CollectionRole = Qt::UserRole + 11,
67  UserRole = Qt::UserRole + 42
68  };
69 
75  explicit CollectionModel( QObject *parent = 0 );
76 
80  virtual ~CollectionModel();
81 
89  void fetchCollectionStatistics( bool enable );
90 
94  void includeUnsubscribed( bool include = true );
95 
96  virtual int columnCount( const QModelIndex & parent = QModelIndex() ) const;
97  virtual QVariant data( const QModelIndex & index, int role = Qt::DisplayRole ) const;
98  virtual QModelIndex index( int row, int column, const QModelIndex & parent = QModelIndex() ) const;
99  virtual QModelIndex parent( const QModelIndex & index ) const;
100  virtual int rowCount( const QModelIndex & parent = QModelIndex() ) const;
101  virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
102  virtual bool setHeaderData( int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole );
103  virtual bool setData( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole );
104  virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
105  virtual Qt::DropActions supportedDropActions() const;
106  virtual QMimeData *mimeData( const QModelIndexList &indexes ) const;
107  virtual bool dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent );
108  virtual QStringList mimeTypes() const;
109 
110  protected:
114  Collection collectionForId( Collection::Id id ) const;
115 
116  //@cond PRIVATE
117  Akonadi::CollectionModelPrivate *d_ptr;
118  explicit CollectionModel( CollectionModelPrivate *d, QObject *parent = 0 );
119  //@endcond
120 
121  private:
122  Q_DECLARE_PRIVATE( CollectionModel )
123 
124  //@cond PRIVATE
125  Q_PRIVATE_SLOT( d_func(), void startFirstListJob() )
126  Q_PRIVATE_SLOT( d_func(), void collectionRemoved( const Akonadi::Collection& ) )
127  Q_PRIVATE_SLOT( d_func(), void collectionChanged( const Akonadi::Collection& ) )
128  Q_PRIVATE_SLOT( d_func(), void updateDone( KJob* ) )
129  Q_PRIVATE_SLOT( d_func(), void collectionStatisticsChanged(
130  Akonadi::Collection::Id,
131  const Akonadi::CollectionStatistics& ) )
132  Q_PRIVATE_SLOT( d_func(), void listDone( KJob* ) )
133  Q_PRIVATE_SLOT( d_func(), void editDone( KJob* ) )
134  Q_PRIVATE_SLOT( d_func(), void dropResult( KJob* ) )
135  Q_PRIVATE_SLOT( d_func(), void collectionsChanged( const Akonadi::Collection::List& ) )
136  //@endcond
137 };
138 
139 }
140 
141 #endif
Akonadi::CollectionModelPrivate
Definition: collectionmodel_p.h:44
Akonadi::CollectionStatistics
Provides statistics information of a Collection.
Definition: collectionstatistics.h:69
Akonadi::Collection
Represents a collection of PIM items.
Definition: collection.h:75
Akonadi::Entity::Id
qint64 Id
Describes the unique id type.
Definition: entity.h:65
Akonadi::CollectionModel::Roles
Roles
Describes the roles for collections.
Definition: collectionmodel.h:62
Akonadi::CollectionModel
A model for collections.
Definition: collectionmodel.h:54
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

Skip menu "akonadi"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Modules
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

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