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

kgpg

  • sources
  • kde-4.14
  • kdeutils
  • kgpg
  • model
selectkeyproxymodel.h
Go to the documentation of this file.
1 /* Copyright 2008 Rolf Eike Beer <kde@opensource.sf-tec.de>
2  *
3  * This program is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU General Public License as
5  * published by the Free Software Foundation; either version 2 of
6  * the License or (at your option) version 3 or any later version
7  * accepted by the membership of KDE e.V. (or its successor approved
8  * by the membership of KDE e.V.), which shall act as a proxy
9  * defined in Section 14 of version 3 of the license.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef SELECTKEYPROXYMODEL_H
20 #define SELECTKEYPROXYMODEL_H
21 
22 #include <QSortFilterProxyModel>
23 
24 class KGpgNode;
25 class KGpgItemModel;
26 
30 class SelectKeyProxyModel: public QSortFilterProxyModel
31 {
32  Q_PROPERTY(bool showUntrusted read showUntrusted write setShowUntrusted)
33 
34 public:
35  explicit SelectKeyProxyModel(QObject * parent);
36 
37  void setKeyModel(KGpgItemModel *);
38 
39  KGpgNode *nodeForIndex(const QModelIndex &index) const;
40 
41  virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
42 
43  virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
44  virtual bool hasChildren(const QModelIndex &parent) const;
45  virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
46 
47  bool showUntrusted() const;
48  void setShowUntrusted(const bool b);
49 
50 protected:
51  virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
52  virtual int columnCount(const QModelIndex &) const;
53 
54  KGpgItemModel *m_model;
55 
56 private:
57  bool m_showUntrusted;
58 };
59 
60 class SelectSecretKeyProxyModel: public SelectKeyProxyModel
61 {
62 public:
63  explicit SelectSecretKeyProxyModel(QObject *parent);
64 
65  virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
66 
67  virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
68  virtual bool hasChildren(const QModelIndex &parent) const;
69  virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
70 
71 protected:
72  virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
73  virtual int columnCount(const QModelIndex &) const;
74 };
75 
76 #endif
QSortFilterProxyModel::index
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const
SelectKeyProxyModel::nodeForIndex
KGpgNode * nodeForIndex(const QModelIndex &index) const
Definition: selectkeyproxymodel.cpp:81
KGpgItemModel
Definition: kgpgitemmodel.h:44
QModelIndex
SelectKeyProxyModel
filter model to select a public key for encryption
Definition: selectkeyproxymodel.h:30
SelectSecretKeyProxyModel::filterAcceptsRow
virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
Definition: selectkeyproxymodel.cpp:182
SelectKeyProxyModel::rowCount
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: selectkeyproxymodel.cpp:93
SelectKeyProxyModel::SelectKeyProxyModel
SelectKeyProxyModel(QObject *parent)
Definition: selectkeyproxymodel.cpp:29
SelectSecretKeyProxyModel::rowCount
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: selectkeyproxymodel.cpp:197
SelectSecretKeyProxyModel::data
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition: selectkeyproxymodel.cpp:209
SelectKeyProxyModel::showUntrusted
bool showUntrusted() const
SelectSecretKeyProxyModel::SelectSecretKeyProxyModel
SelectSecretKeyProxyModel(QObject *parent)
Definition: selectkeyproxymodel.cpp:176
QObject
SelectSecretKeyProxyModel::hasChildren
virtual bool hasChildren(const QModelIndex &parent) const
Definition: selectkeyproxymodel.cpp:241
SelectKeyProxyModel::setKeyModel
void setKeyModel(KGpgItemModel *)
Definition: selectkeyproxymodel.cpp:37
SelectKeyProxyModel::setShowUntrusted
void setShowUntrusted(const bool b)
Definition: selectkeyproxymodel.cpp:170
SelectKeyProxyModel::filterAcceptsRow
virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
Definition: selectkeyproxymodel.cpp:44
KGpgNode
The abstract base class for all classes representing keyring data.
Definition: KGpgNode.h:42
QSortFilterProxyModel
SelectKeyProxyModel::m_model
KGpgItemModel * m_model
Definition: selectkeyproxymodel.h:54
SelectKeyProxyModel::data
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition: selectkeyproxymodel.cpp:105
SelectSecretKeyProxyModel::headerData
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition: selectkeyproxymodel.cpp:249
SelectSecretKeyProxyModel
Definition: selectkeyproxymodel.h:60
SelectKeyProxyModel::columnCount
virtual int columnCount(const QModelIndex &) const
Definition: selectkeyproxymodel.cpp:87
QObject::parent
QObject * parent() const
SelectKeyProxyModel::hasChildren
virtual bool hasChildren(const QModelIndex &parent) const
Definition: selectkeyproxymodel.cpp:132
SelectKeyProxyModel::headerData
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition: selectkeyproxymodel.cpp:140
SelectSecretKeyProxyModel::columnCount
virtual int columnCount(const QModelIndex &) const
Definition: selectkeyproxymodel.cpp:191
QVariant
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:42:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kgpg

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

kdeutils API Reference

Skip menu "kdeutils API Reference"
  • ark
  • filelight
  • kcalc
  • kcharselect
  • kdf
  • kfloppy
  • kgpg
  • ktimer
  • kwallet
  • sweeper

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