• 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
commands/command.h
Go to the documentation of this file.
1 /* -*- mode: c++; c-basic-offset:4 -*-
2  commands/command.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_COMMANDS_COMMAND_H__
34 #define __KLEOPATRA_COMMANDS_COMMAND_H__
35 
36 #include <QObject>
37 
38 #include <qwindowdefs.h> // for WId
39 
40 #include <utils/pimpl_ptr.h>
41 #include <utils/types.h> // for ExecutionContext
42 
43 #include <vector>
44 
45 class QModelIndex;
46 template <typename T> class QList;
47 class QAbstractItemView;
48 
49 namespace GpgME {
50  class Key;
51 }
52 
53 namespace Kleo {
54 
55  class KeyListController;
56  class AbstractKeyListSortFilterProxyModel;
57 
58  class Command : public QObject, public ExecutionContext {
59  Q_OBJECT
60  public:
61  explicit Command( KeyListController * parent );
62  explicit Command( QAbstractItemView * view, KeyListController * parent );
63  explicit Command( const GpgME::Key & key );
64  explicit Command( const std::vector<GpgME::Key> & keys );
65  ~Command();
66 
67  enum Restriction {
68  NoRestriction = 0,
69  NeedSelection = 1,
70  OnlyOneKey = 2,
71  NeedSecretKey = 4,
72  MustNotBeSecretKey = 8,
73  MustBeOpenPGP = 16,
74  MustBeCMS = 32,
75 
76  // esoteric:
77  MayOnlyBeSecretKeyIfOwnerTrustIsNotYetUltimate = 64, // for set-owner-trust
78 
79  AnyCardHasNullPin = 128,
80  AnyCardCanLearnKeys = 256,
81 
82  MustBeRoot = 512,
83  MustBeTrustedRoot = 1024|MustBeRoot,
84  MustBeUntrustedRoot = 2048|MustBeRoot,
85 
86  _AllRestrictions_Helper,
87  AllRestrictions = 2*(_AllRestrictions_Helper-1) - 1
88  };
89 
90  Q_DECLARE_FLAGS( Restrictions, Restriction )
91 
92  static Restrictions restrictions() { return NoRestriction; }
93 
94  void setParentWidget( QWidget* widget );
95  void setParentWId( WId wid );
96  void setView( QAbstractItemView * view );
97  void setIndex( const QModelIndex & idx );
98  void setIndexes( const QList<QModelIndex> & idx );
99  void setKey( const GpgME::Key & key );
100  void setKeys( const std::vector<GpgME::Key> & keys );
101 
102  void setAutoDelete( bool on );
103  bool autoDelete() const;
104 
105  void setWarnWhenRunningAtShutdown( bool warn );
106  bool warnWhenRunningAtShutdown() const;
107 
108  public Q_SLOTS:
109  void start();
110  void cancel();
111 
112  Q_SIGNALS:
113  void info( const QString & message, int timeout = 0 );
114  void progress( const QString & message, int current, int total );
115  void finished();
116  void canceled();
117 
118  private:
119  virtual void doStart() = 0;
120  virtual void doCancel() = 0;
121 
122  private:
123  /* reimp */ void applyWindowID( QWidget * wid ) const;
124 
125  protected:
126  void addTemporaryView( const QString & title, AbstractKeyListSortFilterProxyModel * proxy=0, const QString & tabToolTip=QString() );
127 
128  protected:
129  class Private;
130  kdtools::pimpl_ptr<Private> d;
131  protected:
132  explicit Command( Private * pp );
133  explicit Command( QAbstractItemView * view, Private * pp );
134  explicit Command( const std::vector<GpgME::Key> & keys, Private * pp );
135  explicit Command( const GpgME::Key & key, Private * pp );
136  };
137 
138 }
139 
140 Q_DECLARE_OPERATORS_FOR_FLAGS( Kleo::Command::Restrictions )
141 
142 #endif /* __KLEOPATRA_COMMANDS_COMMAND_H__ */
types.h
Kleo::Command::finished
void finished()
kdtools::pimpl_ptr< Private >
pimpl_ptr.h
Kleo::Command::MustBeUntrustedRoot
Definition: commands/command.h:84
Kleo::Command::MustBeRoot
Definition: commands/command.h:82
Kleo::Command::Private
Definition: commands/command_p.h:52
Kleo::KeyListController
Definition: keylistcontroller.h:55
QWidget
Kleo::Command::autoDelete
bool autoDelete() const
Definition: commands/command.cpp:124
Kleo::Command::addTemporaryView
void addTemporaryView(const QString &title, AbstractKeyListSortFilterProxyModel *proxy=0, const QString &tabToolTip=QString())
Definition: commands/command.cpp:192
Kleo::Command::start
void start()
Definition: commands/command.cpp:182
Kleo::Command::~Command
~Command()
Definition: commands/command.cpp:118
Kleo::Command::AnyCardHasNullPin
Definition: commands/command.h:79
Kleo::Command::NoRestriction
Definition: commands/command.h:68
Kleo::Command::AnyCardCanLearnKeys
Definition: commands/command.h:80
Kleo::Command::info
void info(const QString &message, int timeout=0)
Kleo::Command::setAutoDelete
void setAutoDelete(bool on)
Definition: commands/command.cpp:120
Kleo::Command::MayOnlyBeSecretKeyIfOwnerTrustIsNotYetUltimate
Definition: commands/command.h:77
Kleo::Command::setView
void setView(QAbstractItemView *view)
Definition: commands/command.cpp:144
Kleo::Command::d
kdtools::pimpl_ptr< Private > d
Definition: commands/command.h:129
Kleo::Command::warnWhenRunningAtShutdown
bool warnWhenRunningAtShutdown() const
Definition: commands/command.cpp:132
Kleo::Command::setKeys
void setKeys(const std::vector< GpgME::Key > &keys)
Definition: commands/command.cpp:178
Kleo::Command::setIndexes
void setIndexes(const QList< QModelIndex > &idx)
Definition: commands/command.cpp:167
Kleo::Command::NeedSelection
Definition: commands/command.h:69
Kleo::Command::OnlyOneKey
Definition: commands/command.h:70
Kleo::Command::MustBeCMS
Definition: commands/command.h:74
Kleo::Command::setParentWId
void setParentWId(WId wid)
Definition: commands/command.cpp:140
Kleo::AbstractKeyListSortFilterProxyModel
Definition: keylistsortfilterproxymodel.h:51
Kleo::Command::MustBeOpenPGP
Definition: commands/command.h:73
Kleo::Command::setIndex
void setIndex(const QModelIndex &idx)
Definition: commands/command.cpp:162
Kleo::Command::cancel
void cancel()
Definition: commands/command.cpp:186
Kleo::Command::setKey
void setKey(const GpgME::Key &key)
Definition: commands/command.cpp:172
Kleo::Command::_AllRestrictions_Helper
Definition: commands/command.h:86
Kleo::Command::restrictions
static Restrictions restrictions()
Definition: commands/command.h:92
Kleo::Command::setWarnWhenRunningAtShutdown
void setWarnWhenRunningAtShutdown(bool warn)
Definition: commands/command.cpp:128
Kleo::Command::MustNotBeSecretKey
Definition: commands/command.h:72
Kleo::Command::AllRestrictions
Definition: commands/command.h:87
Kleo::Command::MustBeTrustedRoot
Definition: commands/command.h:83
Kleo::Command::Command
Command(KeyListController *parent)
Definition: commands/command.cpp:62
Kleo::Command::canceled
void canceled()
Kleo::Command::Restriction
Restriction
Definition: commands/command.h:67
Kleo::Command::progress
void progress(const QString &message, int current, int total)
Kleo::ExecutionContext
Definition: types.h:65
Kleo::Command::NeedSecretKey
Definition: commands/command.h:71
Kleo::Command::setParentWidget
void setParentWidget(QWidget *widget)
Definition: commands/command.cpp:136
Kleo::Command
Definition: commands/command.h:58
QList
Definition: commands/command.h:46
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