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

akonadi

  • sources
  • kde-4.14
  • kdepimlibs
  • akonadi
tagmodel.h
1 /*
2  Copyright (c) 2014 Daniel Vrátil <dvratil@redhat.com>
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_TAGMODEL_H
21 #define AKONADI_TAGMODEL_H
22 
23 #include <QtCore/QModelIndex>
24 
25 #include "akonadi_export.h"
26 #include <akonadi/tag.h>
27 
28 namespace Akonadi
29 {
30 
31 class Monitor;
32 class TagModelPrivate;
33 
34 class AKONADI_EXPORT TagModel : public QAbstractItemModel
35 {
36  Q_OBJECT
37 
38 public:
39  enum Roles {
40  IdRole = Qt::UserRole + 1,
41  NameRole,
42  TypeRole,
43  GIDRole,
44  ParentRole,
45  TagRole,
46 
47  UserRole = Qt::UserRole + 500,
48  TerminalUserRole = 2000,
49  EndRole = 65535
50  };
51 
52  explicit TagModel(Monitor *recorder, QObject *parent);
53  virtual ~TagModel();
54 
55  virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
56  virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
57 
58  virtual QVariant data(const QModelIndex &index, int role) const;
59  virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
60 
61  virtual Qt::ItemFlags flags(const QModelIndex &index) const;
62  /*
63  virtual Qt::DropActions supportedDropActions() const;
64  virtual QMimeData* mimeData( const QModelIndexList &indexes ) const;
65  virtual bool dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent );
66  */
67 
68  virtual QModelIndex parent(const QModelIndex &child) const;
69  virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
70 
71 protected:
72  Q_DECLARE_PRIVATE(TagModel)
73  TagModelPrivate *d_ptr;
74 
75  TagModel(Monitor *recorder, TagModelPrivate *dd, QObject *parent = 0);
76 
77 private:
78  virtual bool insertRows(int, int, const QModelIndex& = QModelIndex());
79  virtual bool insertColumns(int, int, const QModelIndex& = QModelIndex());
80  virtual bool removeColumns(int, int, const QModelIndex& = QModelIndex());
81  virtual bool removeRows(int, int, const QModelIndex& = QModelIndex());
82 
83  Q_PRIVATE_SLOT(d_func(), void tagsFetched(const Akonadi::Tag::List &tags))
84  Q_PRIVATE_SLOT(d_func(), void tagsFetchDone(KJob *job))
85  Q_PRIVATE_SLOT(d_func(), void monitoredTagAdded(const Akonadi::Tag &tag))
86  Q_PRIVATE_SLOT(d_func(), void monitoredTagRemoved(const Akonadi::Tag &tag))
87  Q_PRIVATE_SLOT(d_func(), void monitoredTagChanged(const Akonadi::Tag &tag))
88 };
89 }
90 
91 #endif // AKONADI_TAGMODEL_H
QModelIndex
QObject
QAbstractItemModel
QVariant
Qt::ItemFlags
typedef ItemFlags
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:03 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
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2

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