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

mailcommon

  • sources
  • kde-4.12
  • kdepim
  • mailcommon
  • snippets
snippetsmodel_p.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.net,
3  Author: Tobias Koenig <tokoe@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 MAILCOMMON_SNIPPETSMODEL_P_H
22 #define MAILCOMMON_SNIPPETSMODEL_P_H
23 
24 #include <QAbstractItemModel>
25 
26 namespace MailCommon {
27 
28 class SnippetItem;
29 
30 class SnippetsModel : public QAbstractItemModel
31 {
32  Q_OBJECT
33  public:
34  enum Role {
35  IsGroupRole = Qt::UserRole + 1,
36  NameRole,
37  TextRole,
38  KeySequenceRole
39  };
40 
41  explicit SnippetsModel( QObject *parent = 0 );
42  ~SnippetsModel();
43 
44  virtual bool setData( const QModelIndex &index, const QVariant &value,
45  int role = Qt::EditRole );
46 
47  virtual QVariant data( const QModelIndex &index, int role ) const;
48 
49  virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
50 
51  virtual QModelIndex index( int row, int column,
52  const QModelIndex &parent = QModelIndex() ) const;
53 
54  virtual QModelIndex parent( const QModelIndex &index ) const;
55 
56  virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
57 
58  virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
59 
60  virtual QStringList mimeTypes() const;
61 
62  virtual QMimeData *mimeData( const QModelIndexList &indexes ) const;
63 
64  virtual bool dropMimeData( const QMimeData *data, Qt::DropAction action,
65  int row, int column, const QModelIndex &parent );
66 
67  virtual Qt::DropActions supportedDropActions () const;
68 
69  protected:
70  virtual bool insertRows( int row, int count,
71  const QModelIndex &parent = QModelIndex() );
72 
73  virtual bool removeRows( int row, int count,
74  const QModelIndex &parent = QModelIndex() );
75 
76  signals:
77  void dndDone();
78  private:
79  SnippetItem *mRootItem;
80 };
81 
82 }
83 
84 #endif
MailCommon::SnippetsModel::columnCount
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
Definition: snippetsmodel.cpp:160
MailCommon::SnippetsModel::setData
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Definition: snippetsmodel.cpp:165
MailCommon::SnippetsModel::IsGroupRole
Returns whether the index represents a group.
Definition: snippetsmodel_p.h:35
MailCommon::SnippetsModel::KeySequenceRole
The key sequence to activate a snippet.
Definition: snippetsmodel_p.h:38
MailCommon::SnippetsModel::dropMimeData
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
Definition: snippetsmodel.cpp:366
MailCommon::SnippetsModel::dndDone
void dndDone()
MailCommon::SnippetsModel::flags
virtual Qt::ItemFlags flags(const QModelIndex &index) const
Definition: snippetsmodel.cpp:227
QObject
MailCommon::SnippetsModel::NameRole
The name of a snippet or group.
Definition: snippetsmodel_p.h:36
MailCommon::SnippetsModel::removeRows
virtual bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex())
Definition: snippetsmodel.cpp:315
MailCommon::SnippetsModel::parent
virtual QModelIndex parent(const QModelIndex &index) const
Definition: snippetsmodel.cpp:263
QAbstractItemModel
MailCommon::SnippetsModel::rowCount
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: snippetsmodel.cpp:279
MailCommon::SnippetsModel::insertRows
virtual bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex())
Definition: snippetsmodel.cpp:295
MailCommon::SnippetsModel::mimeTypes
virtual QStringList mimeTypes() const
Definition: snippetsmodel.cpp:334
MailCommon::SnippetsModel::SnippetsModel
SnippetsModel(QObject *parent=0)
Definition: snippetsmodel.cpp:143
MailCommon::SnippetsModel
Definition: snippetsmodel_p.h:30
MailCommon::SnippetsModel::Role
Role
Definition: snippetsmodel_p.h:34
MailCommon::SnippetsModel::TextRole
The text of a snippet.
Definition: snippetsmodel_p.h:37
MailCommon::SnippetsModel::index
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Definition: snippetsmodel.cpp:241
MailCommon::SnippetsModel::data
virtual QVariant data(const QModelIndex &index, int role) const
Definition: snippetsmodel.cpp:198
MailCommon::SnippetsModel::mimeData
virtual QMimeData * mimeData(const QModelIndexList &indexes) const
Definition: snippetsmodel.cpp:341
MailCommon::SnippetsModel::~SnippetsModel
~SnippetsModel()
Definition: snippetsmodel.cpp:155
MailCommon::SnippetsModel::supportedDropActions
virtual Qt::DropActions supportedDropActions() const
Definition: snippetsmodel.cpp:417
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:15 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

mailcommon

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

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

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