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

kgpg

kgpgitemmodel.h

Go to the documentation of this file.
00001 /* Copyright 2008  Rolf Eike Beer <kde@opensource.sf-tec.de>
00002  *
00003  * This program is free software; you can redistribute it and/or
00004  * modify it under the terms of the GNU General Public License as
00005  * published by the Free Software Foundation; either version 2 of
00006  * the License or (at your option) version 3 or any later version
00007  * accepted by the membership of KDE e.V. (or its successor approved
00008  * by the membership of KDE e.V.), which shall act as a proxy
00009  * defined in Section 14 of version 3 of the license.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00018  */
00019 #ifndef KGPGITEMMODEL_H
00020 #define KGPGITEMMODEL_H
00021 
00022 #include <QAbstractItemModel>
00023 
00024 #define KEYCOLUMN_NAME  0
00025 #define KEYCOLUMN_EMAIL 1
00026 #define KEYCOLUMN_TRUST 2
00027 #define KEYCOLUMN_EXPIR 3
00028 #define KEYCOLUMN_SIZE  4
00029 #define KEYCOLUMN_CREAT 5
00030 #define KEYCOLUMN_ID    6
00031 
00032 #include "kgpgitemnode.h"
00033 #include "kgpgkey.h"
00034 
00035 class QColor;
00036 
00037 class KGpgItemModel : public QAbstractItemModel
00038 {
00039     Q_OBJECT
00040 
00041 private:
00042     KGpgRootNode *m_root;
00043     QString m_default;
00044 
00045 public:
00046 
00047     explicit KGpgItemModel(QObject *parent = 0);
00048     virtual ~KGpgItemModel();
00049 
00050     virtual QModelIndex index(int row, int column,
00051                 const QModelIndex &parent = QModelIndex()) const;
00052     virtual QModelIndex parent(const QModelIndex &child) const;
00053 
00054     virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
00055     virtual int columnCount(const QModelIndex & /*parent = QModelIndex()*/ ) const
00056             { return 7; }
00057 
00058     virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
00059     virtual bool hasChildren(const QModelIndex &parent) const;
00060     virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
00061 
00062     KGpgNode *nodeForIndex(const QModelIndex &index) const;
00063 
00064     KGpgRootNode *getRootNode() const;
00065     QString statusCountMessage() const;
00066 
00067 public Q_SLOTS:
00068     KGpgGroupNode *addGroup(const QString &name, const KGpgKeyNodeList &keys);
00069     void delNode(const KGpgNode *node);
00070     void changeGroup(KGpgGroupNode *node, const QList<KGpgNode *> &keys);
00071     void setDefaultKey(const QString &def);
00072     QModelIndex nodeIndex(KGpgNode *node);
00073     void refreshKey(const QString &id);
00074     void refreshKey(KGpgKeyNode *nd);
00075     void refreshKeys(const QStringList &ids = QStringList());
00076     void refreshKeys(KGpgKeyNodeList keys);
00077     void refreshGroups();
00078     void invalidateIndexes(KGpgNode *nd);
00079     void refreshTrust(const KgpgCore::KgpgKeyTrust &trust, const QColor &color);
00080 
00081 protected:
00082     int rowForNode(KGpgNode *node) const;
00083     void refreshKeyIds(const QStringList &id);
00084     void refreshKeyIds(KGpgKeyNodeList &nodes);
00085     bool isDefaultKey(const KGpgNode *node) const;
00086     void fixPersistentIndexes();
00087     void updateNodeTrustColor(KGpgExpandableNode *node, const KgpgCore::KgpgKeyTrust &trust, const QColor &color);
00088 };
00089 
00090 #endif

kgpg

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

kdeutils

Skip menu "kdeutils"
  • ark
  • kcalc
  • kcharselect
  • kdessh
  • kdf
  • kfloppy
  • kgpg
  • ktimer
  • kwallet
  • okteta
  • printer-applet
  • superkaramba
  • sweeper
Generated for kdeutils by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal