• 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
favoritecollectionsmodel.h
1 /*
2  Copyright (c) 2009 Kevin Ottens <ervin@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_FAVORITECOLLECTIONSMODEL_H
21 #define AKONADI_FAVORITECOLLECTIONSMODEL_H
22 
23 #include "akonadi_export.h"
24 
25 #include <akonadi/selectionproxymodel.h>
26 
27 #include <akonadi/collection.h>
28 
29 class KConfigGroup;
30 class KJob;
31 
32 namespace Akonadi {
33 
34 class EntityTreeModel;
35 
65 class AKONADI_EXPORT FavoriteCollectionsModel : public Akonadi::SelectionProxyModel
66 {
67  Q_OBJECT
68 
69  public:
79  FavoriteCollectionsModel( QAbstractItemModel *model, const KConfigGroup &group, QObject *parent = 0 );
80 
84  virtual ~FavoriteCollectionsModel();
85 
90  Collection::List collections() const;
91 
114  QList<Collection::Id> collectionIds() const;
115 
119  QString favoriteLabel( const Akonadi::Collection & col );
120 
121  virtual QVariant data( const QModelIndex & index, int role = Qt::DisplayRole ) const;
122  virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole);
123  virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
124  virtual bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent);
125  virtual QStringList mimeTypes() const;
126  virtual Qt::ItemFlags flags(const QModelIndex& index) const;
127 
128  public Q_SLOTS:
132  void setCollections( const Collection::List &collections );
133 
137  void addCollection( const Collection &collection );
138 
142  void removeCollection( const Collection &collection );
143 
148  void setFavoriteLabel( const Collection &collection, const QString &label );
149 
150  private Q_SLOTS:
151  void pasteJobDone( KJob *job );
152 
153  private:
154  //@cond PRIVATE
155  using KSelectionProxyModel::setSourceModel;
156 
157  class Private;
158  Private* const d;
159 
160  Q_PRIVATE_SLOT( d, void clearAndUpdateSelection() )
161  Q_PRIVATE_SLOT( d, void updateSelection() )
162  //@endcond
163 };
164 
165 }
166 
167 #endif
Akonadi::SelectionProxyModel
A proxy model used to reference count selected Akonadi::Collection in a view.
Definition: selectionproxymodel.h:99
Akonadi::Collection
Represents a collection of PIM items.
Definition: collection.h:75
Akonadi::Collection::List
QList< Collection > List
Describes a list of collections.
Definition: collection.h:81
Akonadi::FavoriteCollectionsModel
A model that lists a set of favorite collections.
Definition: favoritecollectionsmodel.h:65
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:27 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