• 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
  • crypto
  • gui
resolverecipientspage_p.h
Go to the documentation of this file.
1 /* -*- mode: c++; c-basic-offset:4 -*-
2  crypto/gui/resolverecipientspage_p.h
3 
4  This file is part of Kleopatra, the KDE keymanager
5  Copyright (c) 2007 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_CRYPTO_GUI_RESOLVERECIPIENTSPAGE_P_H__
34 #define __KLEOPATRA_CRYPTO_GUI_RESOLVERECIPIENTSPAGE_P_H__
35 
36 #include <crypto/gui/resolverecipientspage.h>
37 
38 #include <kmime/kmime_header_parsing.h>
39 
40 #include <QHash>
41 
42 class QComboBox;
43 class QLabel;
44 class QListWidget;
45 class QListWidgetItem;
46 class QPushButton;
47 class QStringList;
48 class QToolButton;
49 
50 class Kleo::Crypto::Gui::ResolveRecipientsPage::ListWidget : public QWidget {
51  Q_OBJECT
52 public:
53  explicit ListWidget( QWidget* parent = 0, Qt::WindowFlags flags = 0 );
54  ~ListWidget();
55 
56  void addEntry( const QString& id, const QString& name );
57  void addEntry( const KMime::Types::Mailbox& mbox );
58  void addEntry( const QString& id, const QString& name, const KMime::Types::Mailbox& mbox );
59 
60  void removeEntry( const QString& id );
61  QStringList selectedEntries() const;
62  void setCertificates( const QString& id, const std::vector<GpgME::Key>& pgpCerts, const std::vector<GpgME::Key>& cmsCerts );
63  GpgME::Key selectedCertificate( const QString& id ) const;
64  GpgME::Key selectedCertificate( const QString& id, GpgME::Protocol prot ) const;
65  KMime::Types::Mailbox mailbox( const QString& id ) const;
66  QStringList identifiers() const;
67  void setProtocol( GpgME::Protocol prot );
68  void showSelectionDialog( const QString& id );
69 
70  enum Role {
71  IdRole = Qt::UserRole
72  };
73 
74 Q_SIGNALS:
75  void selectionChanged();
76  void completeChanged();
77 
78 private Q_SLOTS:
79  void onSelectionChange();
80 
81 private:
82  QListWidget* m_listWidget;
83 
84  QHash<QString,ItemWidget*> widgets;
85  QHash<QString,QListWidgetItem*> items;
86  GpgME::Protocol m_protocol;
87 };
88 
89 class Kleo::Crypto::Gui::ResolveRecipientsPage::ItemWidget : public QWidget {
90  Q_OBJECT
91 public:
92  explicit ItemWidget( const QString& id, const QString& name, const KMime::Types::Mailbox& mbox, QWidget* parent = 0, Qt::WindowFlags flags = 0 );
93  ~ItemWidget();
94 
95  QString id() const;
96  KMime::Types::Mailbox mailbox() const;
97  void setCertificates( const std::vector<GpgME::Key>& pgp,
98  const std::vector<GpgME::Key>& cms );
99  GpgME::Key selectedCertificate() const;
100  GpgME::Key selectedCertificate( GpgME::Protocol prot ) const;
101  std::vector<GpgME::Key> certificates() const;
102  void setProtocol( GpgME::Protocol protocol );
103  void setSelected( bool selected );
104  bool isSelected() const;
105 
106 public Q_SLOTS:
107  void showSelectionDialog();
108 
109 Q_SIGNALS:
110  void changed();
111 
112 private:
113  void addCertificateToComboBox( const GpgME::Key& key );
114  void resetCertificates();
115  void selectCertificateInComboBox( const GpgME::Key& key );
116  void updateVisibility();
117 
118 private:
119  QString m_id;
120  KMime::Types::Mailbox m_mailbox;
121  QLabel* m_nameLabel;
122  QLabel* m_certLabel;
123  QComboBox* m_certCombo;
124  QToolButton* m_selectButton;
125  GpgME::Protocol m_protocol;
126  QHash<GpgME::Protocol, GpgME::Key> m_selectedCertificates;
127  std::vector<GpgME::Key> m_pgp, m_cms;
128  bool m_selected;
129 };
130 
131 #endif // __KLEOPATRA_CRYPTO_GUI_RESOLVERECIPIENTSPAGE_P_H__
Kleo::Crypto::Gui::ResolveRecipientsPage::ItemWidget::changed
void changed()
flags
static const char * flags[]
Definition: readerstatus.cpp:115
Kleo::Crypto::Gui::ResolveRecipientsPage::ListWidget::IdRole
Definition: resolverecipientspage_p.h:71
Kleo::Crypto::Gui::ResolveRecipientsPage::ListWidget::removeEntry
void removeEntry(const QString &id)
Definition: resolverecipientspage.cpp:161
Kleo::Crypto::Gui::ResolveRecipientsPage::ListWidget::ListWidget
ListWidget(QWidget *parent=0, Qt::WindowFlags flags=0)
Definition: resolverecipientspage.cpp:78
Kleo::Crypto::Gui::ResolveRecipientsPage::ItemWidget::showSelectionDialog
void showSelectionDialog()
Definition: resolverecipientspage.cpp:268
Kleo::Crypto::Gui::ResolveRecipientsPage::ItemWidget::setCertificates
void setCertificates(const std::vector< GpgME::Key > &pgp, const std::vector< GpgME::Key > &cms)
Definition: resolverecipientspage.cpp:339
Kleo::Crypto::Gui::ResolveRecipientsPage::ListWidget::addEntry
void addEntry(const QString &id, const QString &name)
Definition: resolverecipientspage.cpp:105
Kleo::Crypto::Gui::ResolveRecipientsPage::ListWidget::setProtocol
void setProtocol(GpgME::Protocol prot)
Definition: resolverecipientspage.cpp:152
QWidget
Kleo::Crypto::Gui::ResolveRecipientsPage::ItemWidget
Definition: resolverecipientspage_p.h:89
Kleo::Crypto::Gui::ResolveRecipientsPage::ItemWidget::isSelected
bool isSelected() const
Definition: resolverecipientspage.cpp:244
Kleo::Crypto::Gui::ResolveRecipientsPage::ItemWidget::id
QString id() const
Definition: resolverecipientspage.cpp:227
Kleo::Crypto::Gui::ResolveRecipientsPage::ItemWidget::selectedCertificate
GpgME::Key selectedCertificate() const
Definition: resolverecipientspage.cpp:346
Kleo::Crypto::Gui::ResolveRecipientsPage::ItemWidget::certificates
std::vector< GpgME::Key > certificates() const
Definition: resolverecipientspage.cpp:364
Kleo::Crypto::Gui::ResolveRecipientsPage::ListWidget::identifiers
QStringList identifiers() const
Definition: resolverecipientspage.cpp:147
Kleo::Crypto::Gui::ResolveRecipientsPage::ListWidget
Definition: resolverecipientspage_p.h:50
Kleo::Crypto::Gui::ResolveRecipientsPage::ListWidget::setCertificates
void setCertificates(const QString &id, const std::vector< GpgME::Key > &pgpCerts, const std::vector< GpgME::Key > &cmsCerts)
Definition: resolverecipientspage.cpp:130
Kleo::Crypto::Gui::ResolveRecipientsPage::ListWidget::completeChanged
void completeChanged()
Kleo::Crypto::Gui::ResolveRecipientsPage::ListWidget::selectedEntries
QStringList selectedEntries() const
Definition: resolverecipientspage.cpp:178
Kleo::Crypto::Gui::ResolveRecipientsPage::ItemWidget::setProtocol
void setProtocol(GpgME::Protocol protocol)
Definition: resolverecipientspage.cpp:328
Kleo::Crypto::Gui::ResolveRecipientsPage::ListWidget::showSelectionDialog
void showSelectionDialog(const QString &id)
Definition: resolverecipientspage.cpp:171
Kleo::Crypto::Gui::ResolveRecipientsPage::ItemWidget::mailbox
KMime::Types::Mailbox mailbox() const
Definition: resolverecipientspage.cpp:282
Kleo::Crypto::Gui::ResolveRecipientsPage::ListWidget::mailbox
KMime::Types::Mailbox mailbox(const QString &id) const
Definition: resolverecipientspage.cpp:125
name
const char * name
Definition: uiserver/selectcertificatecommand.cpp:114
Kleo::Crypto::Gui::ResolveRecipientsPage::ItemWidget::setSelected
void setSelected(bool selected)
Definition: resolverecipientspage.cpp:232
Kleo::Crypto::Gui::ResolveRecipientsPage::ItemWidget::~ItemWidget
~ItemWidget()
Definition: resolverecipientspage.cpp:223
Kleo::Crypto::Gui::ResolveRecipientsPage::ListWidget::selectionChanged
void selectionChanged()
Kleo::Crypto::Gui::ResolveRecipientsPage::ListWidget::~ListWidget
~ListWidget()
Definition: resolverecipientspage.cpp:87
Kleo::Crypto::Gui::ResolveRecipientsPage::ListWidget::Role
Role
Definition: resolverecipientspage_p.h:70
Kleo::Crypto::Gui::ResolveRecipientsPage::ItemWidget::ItemWidget
ItemWidget(const QString &id, const QString &name, const KMime::Types::Mailbox &mbox, QWidget *parent=0, Qt::WindowFlags flags=0)
Definition: resolverecipientspage.cpp:189
resolverecipientspage.h
Kleo::Crypto::Gui::ResolveRecipientsPage::ListWidget::selectedCertificate
GpgME::Key selectedCertificate(const QString &id) const
Definition: resolverecipientspage.cpp:136
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:56:42 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