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

calendarsupport

  • sources
  • kde-4.14
  • kdepim
  • calendarsupport
incidenceattachmentmodel.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
3  Author: Stephen Kelly <stephen@kdab.com>
4 
5  This library is free software; you can redistribute it and/or modify it
6  under the terms of the GNU Library General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or (at your
8  option) any later version.
9 
10  This library is distributed in the hope that it will be useful, but WITHOUT
11  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13  License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to the
17  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18  02110-1301, USA.
19 */
20 
21 #ifndef CALENDARSUPPORT_INCIDENCEATTACHMENTMODEL_H
22 #define CALENDARSUPPORT_INCIDENCEATTACHMENTMODEL_H
23 
24 #include "calendarsupport_export.h"
25 
26 #include <Akonadi/Attribute>
27 #include <Akonadi/Item>
28 
29 #include <KCalCore/Incidence>
30 
31 #include <QtCore/QAbstractListModel>
32 
33 
34 namespace Akonadi {
35  class Item;
36 }
37 
38 namespace CalendarSupport {
39 class IncidenceAttachmentModelPrivate;
40 
41 class CALENDARSUPPORT_EXPORT IncidenceAttachmentModel : public QAbstractListModel
42 {
43  Q_OBJECT
44  Q_PROPERTY( int attachmentCount READ rowCount NOTIFY rowCountChanged )
45 
46  public:
47  enum Roles {
48  AttachmentDataRole = Qt::UserRole,
49  MimeTypeRole,
50  AttachmentUrl,
51  AttachmentCountRole,
52 
53  UserRole = Qt::UserRole + 100
54  };
55 
56  explicit IncidenceAttachmentModel( const QPersistentModelIndex &modelIndex,
57  QObject *parent = 0 );
58 
59  explicit IncidenceAttachmentModel( const Akonadi::Item &item, QObject *parent = 0 );
60 
61  explicit IncidenceAttachmentModel( QObject *parent = 0 );
62 
63  ~IncidenceAttachmentModel();
64 
65  KCalCore::Incidence::Ptr incidence() const;
66 
67  void setItem( const Akonadi::Item &item );
68  void setIndex( const QPersistentModelIndex &modelIndex );
69 
71  int rowCount( const QModelIndex &parent = QModelIndex() ) const;
72 
74  QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const;
75 
77  QVariant headerData( int section, Qt::Orientation orientation,
78  int role = Qt::DisplayRole ) const;
79 
80  signals:
81  void rowCountChanged();
82 
83  private:
84  Q_DECLARE_PRIVATE( IncidenceAttachmentModel )
85  IncidenceAttachmentModelPrivate *const d_ptr;
86 
87  Q_PRIVATE_SLOT( d_func(), void resetModel() )
88  Q_PRIVATE_SLOT( d_func(), void itemFetched(Akonadi::Item::List) )
89 };
90 
91 }
92 
93 #endif
QModelIndex
CalendarSupport::IncidenceAttachmentModel::MimeTypeRole
Definition: incidenceattachmentmodel.h:49
CalendarSupport::incidence
CALENDARSUPPORT_EXPORT KCalCore::Incidence::Ptr incidence(const Akonadi::Item &item)
returns the incidence from an akonadi item, or a null pointer if the item has no such payload ...
Definition: utils.cpp:78
calendarsupport_export.h
QObject
QAbstractListModel
CalendarSupport::IncidenceAttachmentModel
Definition: incidenceattachmentmodel.h:41
CalendarSupport::IncidenceAttachmentModel::AttachmentCountRole
Definition: incidenceattachmentmodel.h:51
QPersistentModelIndex
CalendarSupport::IncidenceAttachmentModel::Roles
Roles
Definition: incidenceattachmentmodel.h:47
CALENDARSUPPORT_EXPORT
#define CALENDARSUPPORT_EXPORT
Definition: calendarsupport_export.h:36
CalendarSupport::IncidenceAttachmentModel::AttachmentUrl
Definition: incidenceattachmentmodel.h:50
QVariant
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:31:15 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

calendarsupport

Skip menu "calendarsupport"
  • 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
  • pimprint

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