• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

akonadi

itemmodel.h

00001 /*
00002     Copyright (c) 2006 - 2007 Volker Krause <vkrause@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or modify it
00005     under the terms of the GNU Library General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or (at your
00007     option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful, but WITHOUT
00010     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00012     License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to the
00016     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017     02110-1301, USA.
00018 */
00019 
00020 #ifndef AKONADI_ITEMMODEL_H
00021 #define AKONADI_ITEMMODEL_H
00022 
00023 #include "akonadi_export.h"
00024 #include <akonadi/item.h>
00025 #include <akonadi/job.h>
00026 
00027 #include <QtCore/QAbstractTableModel>
00028 
00029 namespace Akonadi {
00030 
00031 class Collection;
00032 class ItemFetchScope;
00033 class Job;
00034 class Session;
00035 
00055 class AKONADI_EXPORT ItemModel : public QAbstractTableModel
00056 {
00057   Q_OBJECT
00058 
00059   public:
00063     enum Column {
00064       Id = 0,     
00065       RemoteId,   
00066       MimeType    
00067     };
00068 
00072     enum Roles {
00073       IdRole = Qt::UserRole + 1,      
00074       ItemRole,                       
00075       MimeTypeRole,                   
00076       UserRole = Qt::UserRole + 42    
00077     };
00078 
00084     explicit ItemModel( QObject* parent = 0 );
00085 
00089     virtual ~ItemModel();
00090 
00091     virtual int columnCount( const QModelIndex & parent = QModelIndex() ) const;
00092 
00093     virtual QVariant data( const QModelIndex & index, int role = Qt::DisplayRole ) const;
00094 
00095     virtual int rowCount( const QModelIndex & parent = QModelIndex() ) const;
00096 
00097     virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
00098 
00099     virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
00100 
00101     virtual QMimeData *mimeData( const QModelIndexList &indexes ) const;
00102 
00103     virtual QStringList mimeTypes() const;
00104 
00115     void setFetchScope( const ItemFetchScope &fetchScope );
00116 
00129     ItemFetchScope &fetchScope();
00130 
00134     Item itemForIndex( const QModelIndex &index ) const;
00135 
00142     QModelIndex indexForItem( const Akonadi::Item& item, const int column ) const;
00143 
00144     bool dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent );
00145 
00149     Collection collection() const;
00150 
00151   public Q_SLOTS:
00159     void setCollection( const Akonadi::Collection &collection );
00160 
00161   Q_SIGNALS:
00167      void collectionChanged( const Akonadi::Collection &collection );
00168 
00169   protected:
00173     Session* session() const;
00174 
00175   private:
00176     //@cond PRIVATE
00177     class Private;
00178     Private* const d;
00179 
00180     Q_PRIVATE_SLOT( d, void listingDone( KJob* ) )
00181     Q_PRIVATE_SLOT( d, void collectionFetchResult( KJob* ) )
00182     Q_PRIVATE_SLOT( d, void itemChanged( const Akonadi::Item&, const QSet<QByteArray>& ) )
00183     Q_PRIVATE_SLOT( d, void itemMoved( const Akonadi::Item&, const Akonadi::Collection&, const Akonadi::Collection& ) )
00184     Q_PRIVATE_SLOT( d, void itemAdded( const Akonadi::Item& ) )
00185     Q_PRIVATE_SLOT( d, void itemsAdded( const Akonadi::Item::List& ) )
00186     Q_PRIVATE_SLOT( d, void itemRemoved( const Akonadi::Item& ) )
00187     //@endcond
00188 };
00189 
00190 }
00191 
00192 #endif

akonadi

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  • kabc
  • kblog
  • kcal
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal