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

kleopatra

  • sources
  • kde-4.12
  • 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 #ifndef QT_NO_WIZARD
45 #include <QWizardPage>
46 #else
47 #include <utils/qwizard.h>
48 #endif
49 
50 class QListView;
51 class QLabel;
52 class QCheckBox;
53 
54 namespace Kleo {
55  namespace Dialogs {
56  namespace CertifyCertificateDialogPrivate {
57  class UserIDModel : public QStandardItemModel {
58  Q_OBJECT
59  public:
60  enum Role {
61  UserIDIndex=Qt::UserRole
62  };
63  explicit UserIDModel( QObject * parent=0 ) : QStandardItemModel( parent ) {}
64  GpgME::Key certificateToCertify() const { return m_key; }
65  void setCertificateToCertify( const GpgME::Key & key );
66  void setCheckedUserIDs( const std::vector<unsigned int> & uids );
67  std::vector<unsigned int> checkedUserIDs() const;
68 
69  private:
70  GpgME::Key m_key;
71  };
72 
73  class SecretKeysModel : public QStandardItemModel {
74  Q_OBJECT
75  public:
76  enum Role {
77  IndexRole=Qt::UserRole
78  };
79  explicit SecretKeysModel( QObject * parent=0 ) : QStandardItemModel( parent ) {}
80  void setSecretKeys( const std::vector<GpgME::Key> & keys );
81  std::vector<GpgME::Key> secretKeys() const;
82  GpgME::Key keyFromItem( const QStandardItem * item ) const;
83  GpgME::Key keyFromIndex( const QModelIndex & index ) const;
84 
85  private:
86  std::vector<GpgME::Key> m_secretKeys;
87  };
88 
89  class SelectUserIDsPage : public QWizardPage {
90  Q_OBJECT
91  public:
92  explicit SelectUserIDsPage( QWidget * parent=0 );
93  /* reimp */ bool isComplete() const;
94 
95  void setSelectedUserIDs( const std::vector<unsigned int> & indexes );
96  std::vector<unsigned int> selectedUserIDs() const;
97  void setCertificateToCertify( const GpgME::Key & ids );
98  GpgME::Key certificateToCertify() const { return m_userIDModel.certificateToCertify(); }
99 
100  private:
101  QListView * m_listView;
102  QLabel * m_label;
103  QCheckBox * m_checkbox;
104  UserIDModel m_userIDModel;
105  };
106 
107  class SelectCheckLevelPage : public QWizardPage {
108  Q_OBJECT
109  public:
110  explicit SelectCheckLevelPage( QWidget * parent=0 );
111  unsigned int checkLevel() const;
112  private:
113  Ui::SelectCheckLevelWidget m_ui;
114  };
115 
116  class OptionsPage : public QWizardPage {
117  Q_OBJECT
118  public:
119  explicit OptionsPage( QWidget * parent=0 );
120 
121  bool exportableCertificationSelected() const;
122  void setCertificatesWithSecretKeys( const std::vector<GpgME::Key> & keys );
123  GpgME::Key selectedSecretKey() const;
124  bool sendToServer() const;
125 
126  /* reimp */ bool validatePage();
127  /* reimp */ bool isComplete() const;
128 
129  Q_SIGNALS:
130  void nextClicked();
131 
132  private:
133  Ui::CertificationOptionsWidget m_ui;
134  SecretKeysModel m_model;
135  };
136 
137  class SummaryPage : public QWizardPage {
138  Q_OBJECT
139  public:
140  explicit SummaryPage( QWidget * parent=0 );
141  /* reimp */ bool isComplete() const;
142  void setComplete( bool complete );
143 
144  void setResult( const GpgME::Error & err );
145 
146  struct Summary {
147  std::vector<unsigned int> selectedUserIDs;
148  unsigned int checkLevel;
149  GpgME::Key certificateToCertify;
150  GpgME::Key secretKey;
151  bool exportable;
152  bool sendToServer;
153  };
154 
155  void setSummary( const Summary & summary );
156 
157  private:
158  bool m_complete;
159  QLabel * m_userIDsLabel;
160  QLabel * m_secretKeyLabel;
161  QLabel * m_checkLevelLabel;
162  QLabel * m_resultLabel;
163  };
164  }
165  }
166 }
167 
168 #endif
169 
Kleo::Dialogs::CertifyCertificateDialogPrivate::SummaryPage::setResult
void setResult(const GpgME::Error &err)
Definition: certifycertificatedialog.cpp:285
Kleo::Dialogs::CertifyCertificateDialogPrivate::UserIDModel::UserIDModel
UserIDModel(QObject *parent=0)
Definition: certifycertificatedialog_p.h:63
Kleo::Dialogs::CertifyCertificateDialogPrivate::SelectCheckLevelPage::SelectCheckLevelPage
SelectCheckLevelPage(QWidget *parent=0)
Definition: certifycertificatedialog.cpp:166
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:79
Kleo::Dialogs::CertifyCertificateDialogPrivate::UserIDModel::setCertificateToCertify
void setCertificateToCertify(const GpgME::Key &key)
Definition: certifycertificatedialog.cpp:72
Kleo::Dialogs::CertifyCertificateDialogPrivate::UserIDModel
Definition: certifycertificatedialog_p.h:57
Kleo::Dialogs::CertifyCertificateDialogPrivate::SecretKeysModel::Role
Role
Definition: certifycertificatedialog_p.h:76
QWizardPage
The QWizardPage class is the base class for wizard pages.
Definition: qwizard.h:206
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
QWidget
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:148
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:116
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:149
QStandardItemModel
Kleo::Dialogs::CertifyCertificateDialogPrivate::SelectUserIDsPage
Definition: certifycertificatedialog_p.h:89
Kleo::Dialogs::CertifyCertificateDialogPrivate::OptionsPage::sendToServer
bool sendToServer() const
Definition: certifycertificatedialog.cpp:214
Kleo::Dialogs::CertifyCertificateDialogPrivate::SummaryPage::Summary::sendToServer
bool sendToServer
Definition: certifycertificatedialog_p.h:152
Kleo::Dialogs::CertifyCertificateDialogPrivate::SecretKeysModel::secretKeys
std::vector< GpgME::Key > secretKeys() const
Definition: certifycertificatedialog.cpp:113
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
Kleo::Dialogs::CertifyCertificateDialogPrivate::UserIDModel::UserIDIndex
Definition: certifycertificatedialog_p.h:61
Kleo::Dialogs::CertifyCertificateDialogPrivate::SummaryPage::Summary::selectedUserIDs
std::vector< unsigned int > selectedUserIDs
Definition: certifycertificatedialog_p.h:147
Kleo::Dialogs::CertifyCertificateDialogPrivate::UserIDModel::Role
Role
Definition: certifycertificatedialog_p.h:60
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:137
Kleo::Dialogs::CertifyCertificateDialogPrivate::SecretKeysModel::IndexRole
Definition: certifycertificatedialog_p.h:77
Kleo::Dialogs::CertifyCertificateDialogPrivate::SelectCheckLevelPage
Definition: certifycertificatedialog_p.h:107
Kleo::Dialogs::CertifyCertificateDialogPrivate::SummaryPage::Summary::exportable
bool exportable
Definition: certifycertificatedialog_p.h:151
Kleo::Dialogs::CertifyCertificateDialogPrivate::SummaryPage::Summary::secretKey
GpgME::Key secretKey
Definition: certifycertificatedialog_p.h:150
qwizard.h
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:146
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:98
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:64
Kleo::Dialogs::CertifyCertificateDialogPrivate::SecretKeysModel
Definition: certifycertificatedialog_p.h:73
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:56:40 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

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