• 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
  • commands
changeroottrustcommand.h
Go to the documentation of this file.
1 /* -*- mode: c++; c-basic-offset:4 -*-
2  commands/changeroottrustcommand.h
3 
4  This file is part of Kleopatra, the KDE keymanager
5  Copyright (c) 2010 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_COMMANDS_CHANGEROOTTRUSTCOMMAND_H__
34 #define __KLEOPATRA_COMMANDS_CHANGEROOTTRUSTCOMMAND_H__
35 
36 #include <commands/command.h>
37 
38 #include <gpgme++/key.h>
39 
40 namespace Kleo {
41 namespace Commands {
42 
43  class ChangeRootTrustCommand : public Command {
44  Q_OBJECT
45  public:
46  explicit ChangeRootTrustCommand( KeyListController * parent );
47  explicit ChangeRootTrustCommand( QAbstractItemView * view, KeyListController * parent );
48  explicit ChangeRootTrustCommand( const GpgME::Key & key, KeyListController * parent );
49  explicit ChangeRootTrustCommand( const GpgME::Key & key, QAbstractItemView * view, KeyListController * parent );
50  ~ChangeRootTrustCommand();
51 
52  void setTrust( GpgME::Key::OwnerTrust trust );
53  GpgME::Key::OwnerTrust trust() const;
54 
55  void setTrustListFile( const QString & file );
56  QString trustListFile() const;
57 
58  /* reimp */ static Restrictions restrictions() { return OnlyOneKey|MustBeCMS|MustBeRoot; }
59 
60  private:
61  /* reimp */ void doStart();
62  /* reimp */ void doCancel();
63 
64  private:
65  class Private;
66  inline Private * d_func();
67  inline const Private * d_func() const;
68  Q_PRIVATE_SLOT( d_func(), void slotOperationFinished() )
69  };
70 
71  class TrustRootCommand : public ChangeRootTrustCommand {
72  public:
73  explicit TrustRootCommand( KeyListController * parent )
74  : ChangeRootTrustCommand( parent )
75  {
76  setTrust( GpgME::Key::Ultimate );
77  }
78  explicit TrustRootCommand( QAbstractItemView * view, KeyListController * parent )
79  : ChangeRootTrustCommand( view, parent )
80  {
81  setTrust( GpgME::Key::Ultimate );
82  }
83  explicit TrustRootCommand( const GpgME::Key & key, KeyListController * parent )
84  : ChangeRootTrustCommand( key, parent )
85  {
86  setTrust( GpgME::Key::Ultimate );
87  }
88  explicit TrustRootCommand( const GpgME::Key & key, QAbstractItemView * view, KeyListController * parent )
89  : ChangeRootTrustCommand( key, view, parent )
90  {
91  setTrust( GpgME::Key::Ultimate );
92  }
93 
94  /* reimp */ static Restrictions restrictions() { return ChangeRootTrustCommand::restrictions()|MustBeUntrustedRoot; }
95 
96  };
97 
98  class DistrustRootCommand : public ChangeRootTrustCommand {
99  public:
100  explicit DistrustRootCommand( KeyListController * parent )
101  : ChangeRootTrustCommand( parent )
102  {
103  setTrust( GpgME::Key::Never );
104  }
105  explicit DistrustRootCommand( QAbstractItemView * view, KeyListController * parent )
106  : ChangeRootTrustCommand( view, parent )
107  {
108  setTrust( GpgME::Key::Never );
109  }
110  explicit DistrustRootCommand( const GpgME::Key & key, KeyListController * parent )
111  : ChangeRootTrustCommand( key, parent )
112  {
113  setTrust( GpgME::Key::Never );
114  }
115  explicit DistrustRootCommand( const GpgME::Key & key, QAbstractItemView * view, KeyListController * parent )
116  : ChangeRootTrustCommand( key, view, parent )
117  {
118  setTrust( GpgME::Key::Never );
119  }
120 
121  /* reimp */ static Restrictions restrictions() { return ChangeRootTrustCommand::restrictions()|MustBeTrustedRoot; }
122 
123  };
124 
125 }
126 }
127 
128 #endif /* __KLEOPATRA_COMMANDS_CHANGEROOTTRUSTCOMMAND_H__ */
Kleo::Commands::DistrustRootCommand
Definition: changeroottrustcommand.h:98
Kleo::Command::MustBeUntrustedRoot
Definition: commands/command.h:84
Kleo::Command::MustBeRoot
Definition: commands/command.h:82
Kleo::Commands::ChangeRootTrustCommand::ChangeRootTrustCommand
ChangeRootTrustCommand(KeyListController *parent)
Definition: changeroottrustcommand.cpp:116
Kleo::KeyListController
Definition: keylistcontroller.h:55
Kleo::Commands::TrustRootCommand
Definition: changeroottrustcommand.h:71
Kleo::Commands::ChangeRootTrustCommand::trustListFile
QString trustListFile() const
Definition: changeroottrustcommand.cpp:163
Kleo::Commands::DistrustRootCommand::restrictions
static Restrictions restrictions()
Definition: changeroottrustcommand.h:121
Kleo::Commands::DistrustRootCommand::DistrustRootCommand
DistrustRootCommand(const GpgME::Key &key, QAbstractItemView *view, KeyListController *parent)
Definition: changeroottrustcommand.h:115
Kleo::Commands::TrustRootCommand::TrustRootCommand
TrustRootCommand(const GpgME::Key &key, QAbstractItemView *view, KeyListController *parent)
Definition: changeroottrustcommand.h:88
Kleo::Command::OnlyOneKey
Definition: commands/command.h:70
Kleo::Commands::ChangeRootTrustCommand::setTrust
void setTrust(GpgME::Key::OwnerTrust trust)
Definition: changeroottrustcommand.cpp:146
Kleo::Commands::TrustRootCommand::TrustRootCommand
TrustRootCommand(KeyListController *parent)
Definition: changeroottrustcommand.h:73
Kleo::Command::MustBeCMS
Definition: commands/command.h:74
Kleo::Commands::ChangeRootTrustCommand
Definition: changeroottrustcommand.h:43
Kleo::Commands::TrustRootCommand::restrictions
static Restrictions restrictions()
Definition: changeroottrustcommand.h:94
Kleo::Commands::TrustRootCommand::TrustRootCommand
TrustRootCommand(QAbstractItemView *view, KeyListController *parent)
Definition: changeroottrustcommand.h:78
Kleo::Commands::ChangeRootTrustCommand::~ChangeRootTrustCommand
~ChangeRootTrustCommand()
Definition: changeroottrustcommand.cpp:144
Kleo::Command::MustBeTrustedRoot
Definition: commands/command.h:83
Kleo::Commands::ChangeRootTrustCommand::trust
GpgME::Key::OwnerTrust trust() const
Definition: changeroottrustcommand.cpp:152
Kleo::Commands::ChangeRootTrustCommand::setTrustListFile
void setTrustListFile(const QString &file)
Definition: changeroottrustcommand.cpp:157
command.h
Kleo::Commands::TrustRootCommand::TrustRootCommand
TrustRootCommand(const GpgME::Key &key, KeyListController *parent)
Definition: changeroottrustcommand.h:83
Kleo::Commands::DistrustRootCommand::DistrustRootCommand
DistrustRootCommand(QAbstractItemView *view, KeyListController *parent)
Definition: changeroottrustcommand.h:105
Kleo::Formatting::OwnerTrust
Definition: formatting.h:79
Kleo::Commands::ChangeRootTrustCommand::restrictions
static Restrictions restrictions()
Definition: changeroottrustcommand.h:58
Kleo::Commands::DistrustRootCommand::DistrustRootCommand
DistrustRootCommand(KeyListController *parent)
Definition: changeroottrustcommand.h:100
Kleo::Command
Definition: commands/command.h:58
Kleo::Commands::DistrustRootCommand::DistrustRootCommand
DistrustRootCommand(const GpgME::Key &key, KeyListController *parent)
Definition: changeroottrustcommand.h:110
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