• 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
keylistproxymodel.h
Go to the documentation of this file.
1 /* Copyright 2008,2013 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 KEYLISTPROXYMODEL_H
20 #define KEYLISTPROXYMODEL_H
21 
22 #include <QSortFilterProxyModel>
23 #include "core/kgpgkey.h"
24 
25 class KGpgNode;
26 class KGpgExpandableNode;
27 class KGpgItemModel;
28 class KeyListProxyModelPrivate;
29 
30 class KeyListProxyModel: public QSortFilterProxyModel
31 {
32  Q_OBJECT
33 
34  Q_PROPERTY(int idLength READ idLength WRITE setIdLength)
35  Q_DECLARE_PRIVATE(KeyListProxyModel)
36 
37  KeyListProxyModelPrivate * const d_ptr;
38 
39 public:
40  enum DisplayMode {
41  MultiColumn = 0,
42  SingleColumnIdFirst = 1,
43  SingleColumnIdLast = 2
44  };
45 
46  explicit KeyListProxyModel(QObject * parent = 0, const DisplayMode mode = MultiColumn);
47  virtual ~KeyListProxyModel();
48 
49  virtual bool hasChildren(const QModelIndex &idx) const;
50  virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
51  virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
52  virtual Qt::ItemFlags flags(const QModelIndex &index) const;
53  void setKeyModel(KGpgItemModel *);
61  void setTrustFilter(const KgpgCore::KgpgKeyTrustFlag t);
62 
66  void setEncryptionKeyFilter(bool b);
67 
68  KGpgNode *nodeForIndex(const QModelIndex &index) const;
69  QModelIndex nodeIndex(KGpgNode *node);
70  void setPreviewSize(const int pixel);
71  KGpgItemModel *getModel() const;
72  int idLength() const;
73  void setIdLength(const int length);
74 
75 public slots:
80  void setOnlySecret(const bool b);
81 
85  void settingsChanged();
86 
87 protected:
88  virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
89  virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
90 };
91 
92 #endif
QSortFilterProxyModel::index
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const
KGpgItemModel
Definition: kgpgitemmodel.h:44
KgpgCore::KgpgKeyTrustFlag
KgpgKeyTrustFlag
trust levels of keys, uids and uats
Definition: kgpgkey.h:52
QModelIndex
KeyListProxyModel::DisplayMode
DisplayMode
Definition: keylistproxymodel.h:40
KeyListProxyModel::~KeyListProxyModel
virtual ~KeyListProxyModel()
Definition: keylistproxymodel.cpp:241
KeyListProxyModel::setEncryptionKeyFilter
void setEncryptionKeyFilter(bool b)
show only keys capable of encryption
Definition: keylistproxymodel.cpp:475
KeyListProxyModel::nodeForIndex
KGpgNode * nodeForIndex(const QModelIndex &index) const
Definition: keylistproxymodel.cpp:484
kgpgkey.h
KeyListProxyModel::setKeyModel
void setKeyModel(KGpgItemModel *)
Definition: keylistproxymodel.cpp:253
KeyListProxyModel::lessThan
virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const
Definition: keylistproxymodel.cpp:262
KeyListProxyModel::setTrustFilter
void setTrustFilter(const KgpgCore::KgpgKeyTrustFlag t)
set the minimum trust level to be shown
Definition: keylistproxymodel.cpp:466
QObject
KeyListProxyModel::hasChildren
virtual bool hasChildren(const QModelIndex &idx) const
Definition: keylistproxymodel.cpp:247
KeyListProxyModel::idLength
int idLength() const
KeyListProxyModel::flags
virtual Qt::ItemFlags flags(const QModelIndex &index) const
Definition: keylistproxymodel.cpp:584
KeyListProxyModel::d_ptr
KeyListProxyModelPrivate *const d_ptr
Definition: keylistproxymodel.h:37
KeyListProxyModel::setData
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Definition: keylistproxymodel.cpp:561
KeyListProxyModel::setIdLength
void setIdLength(const int length)
Definition: keylistproxymodel.cpp:549
KGpgNode
The abstract base class for all classes representing keyring data.
Definition: KGpgNode.h:42
QSortFilterProxyModel
KeyListProxyModel::filterAcceptsRow
virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
Definition: keylistproxymodel.cpp:384
KeyListProxyModel::MultiColumn
Definition: keylistproxymodel.h:41
KeyListProxyModel
Definition: keylistproxymodel.h:30
KGpgExpandableNode
The abstract base class for all classes that may have child objects.
Definition: KGpgExpandableNode.h:34
KeyListProxyModel::SingleColumnIdFirst
Definition: keylistproxymodel.h:42
KeyListProxyModel::SingleColumnIdLast
Definition: keylistproxymodel.h:43
KeyListProxyModel::getModel
KGpgItemModel * getModel() const
Definition: keylistproxymodel.cpp:533
KeyListProxyModel::setOnlySecret
void setOnlySecret(const bool b)
set if only secret keys should be shown
Definition: keylistproxymodel.cpp:444
KeyListProxyModel::KeyListProxyModel
KeyListProxyModel(QObject *parent=0, const DisplayMode mode=MultiColumn)
Definition: keylistproxymodel.cpp:232
KeyListProxyModel::data
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition: keylistproxymodel.cpp:510
KeyListProxyModel::nodeIndex
QModelIndex nodeIndex(KGpgNode *node)
Definition: keylistproxymodel.cpp:492
KeyListProxyModel::setPreviewSize
void setPreviewSize(const int pixel)
Definition: keylistproxymodel.cpp:500
QObject::parent
QObject * parent() const
KeyListProxyModel::settingsChanged
void settingsChanged()
call this when the settings have changed
Definition: keylistproxymodel.cpp:453
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: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