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

kgpg

  • sources
  • kde-4.14
  • kdeutils
  • kgpg
  • transactions
kgpgencrypt.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2011,2012,2013 Rolf Eike Beer <kde@opensource.sf-tec.de>
3  */
4 
5 /***************************************************************************
6  * *
7  * This program 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  ***************************************************************************/
13 
14 #ifndef KGPGENCRYPT_H
15 #define KGPGENCRYPT_H
16 
17 #include <QObject>
18 #include <QString>
19 #include <QStringList>
20 
21 #include <KUrl>
22 
23 #include "kgpgtextorfiletransaction.h"
24 
25 class QProcess;
26 
30 class KGpgEncrypt: public KGpgTextOrFileTransaction {
31  Q_OBJECT
32 
33  Q_DISABLE_COPY(KGpgEncrypt)
34  KGpgEncrypt(); // = delete C++0x
35 public:
36  enum EncryptOption {
37  DefaultEncryption = 0,
38  AsciiArmored = 0x1,
39  AllowUntrustedEncryption = 0x2,
40  HideKeyId = 0x4
41  };
42  Q_DECLARE_FLAGS(EncryptOptions, EncryptOption);
43 
51  explicit KGpgEncrypt(QObject *parent, const QStringList &userIds = QStringList(), const QString &text = QString(), const EncryptOptions &options = DefaultEncryption, const QStringList &extraOptions = QStringList());
52 
60  KGpgEncrypt(QObject *parent, const QStringList &userIds, const KUrl::List &files, const EncryptOptions &options = DefaultEncryption, const QStringList &extraOptions = QStringList());
61 
65  virtual ~KGpgEncrypt();
66 
71  QStringList encryptedText() const;
72 
78  static QString encryptExtension(const bool ascii);
79 
80 protected:
81  virtual QStringList command() const;
82  virtual bool nextLine(const QString &line);
83  virtual ts_boolanswer confirmOverwrite (KUrl &currentFile);
84 
85 private:
86  int m_fileIndex;
87  const EncryptOptions m_options;
88  const QStringList m_userIds;
89  QStringList m_extraOptions;
90  QString m_currentFile;
91 };
92 
93 Q_DECLARE_OPERATORS_FOR_FLAGS(KGpgEncrypt::EncryptOptions);
94 
95 #endif // KGPGENCRYPT_H
KGpgTextOrFileTransaction
feed a text or file through gpg
Definition: kgpgtextorfiletransaction.h:29
KGpgEncrypt::AsciiArmored
output the data as printable ASCII as opposed to binary data
Definition: kgpgencrypt.h:38
KGpgEncrypt::nextLine
virtual bool nextLine(const QString &line)
Called for every line the gpg process writes.
Definition: kgpgencrypt.cpp:96
KGpgEncrypt::confirmOverwrite
virtual ts_boolanswer confirmOverwrite(KUrl &currentFile)
called when GnuPG asks for confirmation for overwriting a file
Definition: kgpgencrypt.cpp:119
KGpgEncrypt::command
virtual QStringList command() const
Definition: kgpgencrypt.cpp:59
kgpgtextorfiletransaction.h
KGpgEncrypt::Q_DECLARE_FLAGS
Q_DECLARE_FLAGS(EncryptOptions, EncryptOption)
KGpgEncrypt::EncryptOption
EncryptOption
Definition: kgpgencrypt.h:36
QProcess
QObject
QString
KGpgEncrypt::HideKeyId
remove anything that shows which key ids this data is encrypted to, ignored for symmetric encryption ...
Definition: kgpgencrypt.h:40
QStringList
KGpgTransaction::ts_boolanswer
ts_boolanswer
result codes for GnuPG boolean questions
Definition: kgpgtransaction.h:73
KGpgEncrypt::encryptedText
QStringList encryptedText() const
get decryption result
Definition: kgpgencrypt.cpp:81
KGpgEncrypt::~KGpgEncrypt
virtual ~KGpgEncrypt()
destructor
Definition: kgpgencrypt.cpp:54
Q_DECLARE_OPERATORS_FOR_FLAGS
Q_DECLARE_OPERATORS_FOR_FLAGS(KGpgEncrypt::EncryptOptions)
KGpgEncrypt::encryptExtension
static QString encryptExtension(const bool ascii)
return the preferred extension for encrypted files
Definition: kgpgencrypt.cpp:132
QObject::parent
QObject * parent() const
KGpgEncrypt
encrypt the given text or files
Definition: kgpgencrypt.h:30
KGpgEncrypt::DefaultEncryption
use whatever GnuPGs defaults are
Definition: kgpgencrypt.h:37
KGpgEncrypt::AllowUntrustedEncryption
allow encryption with untrusted keys, ignored for symmetric encryption
Definition: kgpgencrypt.h:39
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:42:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kgpg

Skip menu "kgpg"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeutils API Reference

Skip menu "kdeutils API Reference"
  • ark
  • filelight
  • kcalc
  • kcharselect
  • kdf
  • kfloppy
  • kgpg
  • ktimer
  • kwallet
  • sweeper

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