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

kleopatra

  • sources
  • kde-4.14
  • kdepim
  • kleopatra
  • dialogs
certifycertificatedialog_p.h
Go to the documentation of this file.
1 /* -*- mode: c++; c-basic-offset:4 -*-
2  dialogs/signcertificatedialog_p.h
3 
4  This file is part of Kleopatra, the KDE keymanager
5  Copyright (c) 2008 Klarälvdalens Datakonsult AB
6 
7  Kleopatra is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  Kleopatra is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
21  In addition, as a special exception, the copyright holders give
22  permission to link the code of this program with any edition of
23  the Qt library by Trolltech AS, Norway (or with modified versions
24  of Qt that use the same license as Qt), and distribute linked
25  combinations including the two. You must obey the GNU General
26  Public License in all respects for all of the code used other than
27  Qt. If you modify this file, you may extend this exception to
28  your version of the file, but you are not obligated to do so. If
29  you do not wish to do so, delete this exception statement from
30  your version.
31 */
32 
33 #ifndef __KLEOPATRA_DIALOGS_CERTIFYCERTIFICATEDIALOG_P_H
34 #define __KLEOPATRA_DIALOGS_CERTIFYCERTIFICATEDIALOG_P_H
35 
36 #include "ui_selectchecklevelwidget.h"
37 #include "ui_certificationoptionswidget.h"
38 
39 #include <kleo/signkeyjob.h>
40 
41 #include <gpgme++/key.h>
42 
43 #include <QStandardItemModel>
44 #include <QWizardPage>
45 
46 class QListView;
47 class QLabel;
48 class QCheckBox;
49 
50 namespace Kleo {
51  namespace Dialogs {
52  namespace CertifyCertificateDialogPrivate {
53  class UserIDModel : public QStandardItemModel {
54  Q_OBJECT
55  public:
56  enum Role {
57  UserIDIndex=Qt::UserRole
58  };
59  explicit UserIDModel( QObject * parent=0 ) : QStandardItemModel( parent ) {}
60  GpgME::Key certificateToCertify() const { return m_key; }
61  void setCertificateToCertify( const GpgME::Key & key );
62  void setCheckedUserIDs( const std::vector<unsigned int> & uids );
63  std::vector<unsigned int> checkedUserIDs() const;
64 
65  private:
66  GpgME::Key m_key;
67  };
68 
69  class SecretKeysModel : public QStandardItemModel {
70  Q_OBJECT
71  public:
72  enum Role {
73  IndexRole=Qt::UserRole
74  };
75  explicit SecretKeysModel( QObject * parent=0 ) : QStandardItemModel( parent ) {}
76  void setSecretKeys( const std::vector<GpgME::Key> & keys );
77  std::vector<GpgME::Key> secretKeys() const;
78  GpgME::Key keyFromItem( const QStandardItem * item ) const;
79  GpgME::Key keyFromIndex( const QModelIndex & index ) const;
80 
81  private:
82  std::vector<GpgME::Key> m_secretKeys;
83  };
84 
85  class SelectUserIDsPage : public QWizardPage {
86  Q_OBJECT
87  public:
88  explicit SelectUserIDsPage( QWidget * parent=0 );
89  /* reimp */ bool isComplete() const;
90 
91  void setSelectedUserIDs( const std::vector<unsigned int> & indexes );
92  std::vector<unsigned int> selectedUserIDs() const;
93  void setCertificateToCertify( const GpgME::Key & ids );
94  GpgME::Key certificateToCertify() const { return m_userIDModel.certificateToCertify(); }
95 
96  private:
97  QListView * m_listView;
98  QLabel * m_label;
99  QCheckBox * m_checkbox;
100  UserIDModel m_userIDModel;
101  };
102 
103  class SelectCheckLevelPage : public QWizardPage {
104  Q_OBJECT
105  public:
106  explicit SelectCheckLevelPage( QWidget * parent=0 );
107  unsigned int checkLevel() const;
108  private:
109  Ui::SelectCheckLevelWidget m_ui;
110  };
111 
112  class OptionsPage : public QWizardPage {
113  Q_OBJECT
114  public:
115  explicit OptionsPage( QWidget * parent=0 );
116 
117  bool exportableCertificationSelected() const;
118  void setCertificatesWithSecretKeys( const std::vector<GpgME::Key> & keys );
119  GpgME::Key selectedSecretKey() const;
120  bool sendToServer() const;
121 
122  /* reimp */ bool validatePage();
123  /* reimp */ bool isComplete() const;
124 
125  Q_SIGNALS:
126  void nextClicked();
127 
128  private:
129  Ui::CertificationOptionsWidget m_ui;
130  SecretKeysModel m_model;
131  };
132 
133  class SummaryPage : public QWizardPage {
134  Q_OBJECT
135  public:
136  explicit SummaryPage( QWidget * parent=0 );
137  /* reimp */ bool isComplete() const;
138  void setComplete( bool complete );
139 
140  void setResult( const GpgME::Error & err );
141 
142  struct Summary {
143  std::vector<unsigned int> selectedUserIDs;
144  unsigned int checkLevel;
145  GpgME::Key certificateToCertify;
146  GpgME::Key secretKey;
147  bool exportable;
148  bool sendToServer;
149  };
150 
151  void setSummary( const Summary & summary );
152 
153  private:
154  bool m_complete;
155  QLabel * m_userIDsLabel;
156  QLabel * m_secretKeyLabel;
157  QLabel * m_checkLevelLabel;
158  QLabel * m_resultLabel;
159  };
160  }
161  }
162 }
163 
164 #endif
165 
Kleo::Dialogs::CertifyCertificateDialogPrivate::SummaryPage::setResult
void setResult(const GpgME::Error &err)
Definition: certifycertificatedialog.cpp:285
QStandardItemModel::index
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const
QModelIndex
Kleo::Dialogs::CertifyCertificateDialogPrivate::UserIDModel::UserIDModel
UserIDModel(QObject *parent=0)
Definition: certifycertificatedialog_p.h:59
Kleo::Dialogs::CertifyCertificateDialogPrivate::SelectCheckLevelPage::SelectCheckLevelPage
SelectCheckLevelPage(QWidget *parent=0)
Definition: certifycertificatedialog.cpp:166
QStandardItemModel
QWidget
Kleo::Dialogs::CertifyCertificateDialogPrivate::UserIDModel::checkedUserIDs
std::vector< unsigned int > checkedUserIDs() const
Definition: certifycertificatedialog.cpp:92
Kleo::Dialogs::CertifyCertificateDialogPrivate::SummaryPage::setSummary
void setSummary(const Summary &summary)
Definition: certifycertificatedialog.cpp:254
Kleo::Dialogs::CertifyCertificateDialogPrivate::SecretKeysModel::SecretKeysModel
SecretKeysModel(QObject *parent=0)
Definition: certifycertificatedialog_p.h:75
Kleo::Dialogs::CertifyCertificateDialogPrivate::UserIDModel::setCertificateToCertify
void setCertificateToCertify(const GpgME::Key &key)
Definition: certifycertificatedialog.cpp:72
Kleo::Dialogs::CertifyCertificateDialogPrivate::UserIDModel
Definition: certifycertificatedialog_p.h:53
Kleo::Dialogs::CertifyCertificateDialogPrivate::SecretKeysModel::Role
Role
Definition: certifycertificatedialog_p.h:72
Kleo::Dialogs::CertifyCertificateDialogPrivate::SummaryPage::setComplete
void setComplete(bool complete)
Definition: certifycertificatedialog.cpp:279
Kleo::Dialogs::CertifyCertificateDialogPrivate::SelectUserIDsPage::setSelectedUserIDs
void setSelectedUserIDs(const std::vector< unsigned int > &indexes)
Definition: certifycertificatedialog.cpp:150
Kleo::Dialogs::CertifyCertificateDialogPrivate::OptionsPage::exportableCertificationSelected
bool exportableCertificationSelected() const
Definition: certifycertificatedialog.cpp:190
Kleo::Dialogs::CertifyCertificateDialogPrivate::SummaryPage::Summary::checkLevel
unsigned int checkLevel
Definition: certifycertificatedialog_p.h:144
Kleo::Dialogs::CertifyCertificateDialogPrivate::UserIDModel::setCheckedUserIDs
void setCheckedUserIDs(const std::vector< unsigned int > &uids)
Definition: certifycertificatedialog.cpp:86
Kleo::Dialogs::CertifyCertificateDialogPrivate::OptionsPage
Definition: certifycertificatedialog_p.h:112
Kleo::Dialogs::CertifyCertificateDialogPrivate::OptionsPage::selectedSecretKey
GpgME::Key selectedSecretKey() const
Definition: certifycertificatedialog.cpp:206
Kleo::Dialogs::CertifyCertificateDialogPrivate::SummaryPage::Summary::certificateToCertify
GpgME::Key certificateToCertify
Definition: certifycertificatedialog_p.h:145
Kleo::Dialogs::CertifyCertificateDialogPrivate::SelectUserIDsPage
Definition: certifycertificatedialog_p.h:85
Kleo::Dialogs::CertifyCertificateDialogPrivate::OptionsPage::sendToServer
bool sendToServer() const
Definition: certifycertificatedialog.cpp:214
Kleo::Dialogs::CertifyCertificateDialogPrivate::SummaryPage::Summary::sendToServer
bool sendToServer
Definition: certifycertificatedialog_p.h:148
Kleo::Dialogs::CertifyCertificateDialogPrivate::SecretKeysModel::secretKeys
std::vector< GpgME::Key > secretKeys() const
Definition: certifycertificatedialog.cpp:113
QListView
Kleo::Dialogs::CertifyCertificateDialogPrivate::SelectCheckLevelPage::checkLevel
unsigned int checkLevel() const
Definition: certifycertificatedialog.cpp:170
Kleo::Dialogs::CertifyCertificateDialogPrivate::OptionsPage::nextClicked
void nextClicked()
Kleo::Dialogs::CertifyCertificateDialogPrivate::SelectUserIDsPage::setCertificateToCertify
void setCertificateToCertify(const GpgME::Key &ids)
Definition: certifycertificatedialog.cpp:158
QObject
Kleo::Dialogs::CertifyCertificateDialogPrivate::UserIDModel::UserIDIndex
Definition: certifycertificatedialog_p.h:57
QCheckBox
Kleo::Dialogs::CertifyCertificateDialogPrivate::SummaryPage::Summary::selectedUserIDs
std::vector< unsigned int > selectedUserIDs
Definition: certifycertificatedialog_p.h:143
Kleo::Dialogs::CertifyCertificateDialogPrivate::UserIDModel::Role
Role
Definition: certifycertificatedialog_p.h:56
Kleo::Dialogs::CertifyCertificateDialogPrivate::SecretKeysModel::keyFromItem
GpgME::Key keyFromItem(const QStandardItem *item) const
Definition: certifycertificatedialog.cpp:117
Kleo::Dialogs::CertifyCertificateDialogPrivate::SummaryPage::isComplete
bool isComplete() const
Definition: certifycertificatedialog.cpp:250
Kleo::Dialogs::CertifyCertificateDialogPrivate::SummaryPage
Definition: certifycertificatedialog_p.h:133
Kleo::Dialogs::CertifyCertificateDialogPrivate::SecretKeysModel::IndexRole
Definition: certifycertificatedialog_p.h:73
Kleo::Dialogs::CertifyCertificateDialogPrivate::SelectCheckLevelPage
Definition: certifycertificatedialog_p.h:103
Kleo::Dialogs::CertifyCertificateDialogPrivate::SummaryPage::Summary::exportable
bool exportable
Definition: certifycertificatedialog_p.h:147
Kleo::Dialogs::CertifyCertificateDialogPrivate::SummaryPage::Summary::secretKey
GpgME::Key secretKey
Definition: certifycertificatedialog_p.h:146
QStandardItemModel::item
QStandardItem * item(int row, int column) const
Kleo::Dialogs::CertifyCertificateDialogPrivate::OptionsPage::setCertificatesWithSecretKeys
void setCertificatesWithSecretKeys(const std::vector< GpgME::Key > &keys)
Definition: certifycertificatedialog.cpp:194
Kleo::Dialogs::CertifyCertificateDialogPrivate::SecretKeysModel::setSecretKeys
void setSecretKeys(const std::vector< GpgME::Key > &keys)
Definition: certifycertificatedialog.cpp:100
Kleo::Dialogs::CertifyCertificateDialogPrivate::OptionsPage::validatePage
bool validatePage()
Definition: certifycertificatedialog.cpp:218
Kleo::Dialogs::CertifyCertificateDialogPrivate::OptionsPage::OptionsPage
OptionsPage(QWidget *parent=0)
Definition: certifycertificatedialog.cpp:181
Kleo::Dialogs::CertifyCertificateDialogPrivate::SecretKeysModel::keyFromIndex
GpgME::Key keyFromIndex(const QModelIndex &index) const
Definition: certifycertificatedialog.cpp:124
Kleo::Dialogs::CertifyCertificateDialogPrivate::SelectUserIDsPage::isComplete
bool isComplete() const
Definition: certifycertificatedialog.cpp:146
Kleo::Dialogs::CertifyCertificateDialogPrivate::SummaryPage::Summary
Definition: certifycertificatedialog_p.h:142
Kleo::Dialogs::CertifyCertificateDialogPrivate::SummaryPage::SummaryPage
SummaryPage(QWidget *parent=0)
Definition: certifycertificatedialog.cpp:227
Kleo::Dialogs::CertifyCertificateDialogPrivate::SelectUserIDsPage::SelectUserIDsPage
SelectUserIDsPage(QWidget *parent=0)
Definition: certifycertificatedialog.cpp:128
Kleo::Dialogs::CertifyCertificateDialogPrivate::OptionsPage::isComplete
bool isComplete() const
Definition: certifycertificatedialog.cpp:223
Kleo::Dialogs::CertifyCertificateDialogPrivate::SelectUserIDsPage::certificateToCertify
GpgME::Key certificateToCertify() const
Definition: certifycertificatedialog_p.h:94
QStandardItem
QLabel
QObject::parent
QObject * parent() const
Kleo::Dialogs::CertifyCertificateDialogPrivate::SelectUserIDsPage::selectedUserIDs
std::vector< unsigned int > selectedUserIDs() const
Definition: certifycertificatedialog.cpp:154
Kleo::Dialogs::CertifyCertificateDialogPrivate::UserIDModel::certificateToCertify
GpgME::Key certificateToCertify() const
Definition: certifycertificatedialog_p.h:60
QWizardPage
Kleo::Dialogs::CertifyCertificateDialogPrivate::SecretKeysModel
Definition: certifycertificatedialog_p.h:69
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:33:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kleopatra

Skip menu "kleopatra"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

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
  • pimprint

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