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

kgpg

Public Member Functions | Protected Member Functions | List of all members
KGpgEditKeyTransaction Class Reference

#include <kgpgeditkeytransaction.h>

Inheritance diagram for KGpgEditKeyTransaction:
Inheritance graph
[legend]

Public Member Functions

virtual ~KGpgEditKeyTransaction ()
 
QString getKeyid () const
 
- Public Member Functions inherited from KGpgTransaction
 KGpgTransaction (QObject *parent=0, const bool allowChaining=false)
 
virtual ~KGpgTransaction ()
 
void clearInputTransaction ()
 
const QString & getDescription () const
 
bool hasInputTransaction () const
 
void kill ()
 
void setGnuPGHome (const QString &home)
 
void setInputTransaction (KGpgTransaction *ta)
 
void start ()
 
int waitForFinished (const int msecs=-1)
 

Protected Member Functions

 KGpgEditKeyTransaction (QObject *parent, const QString &keyid, const QString &command, const bool hasValue, const bool autoSave=true)
 
virtual ts_boolanswer boolQuestion (const QString &line)
 
virtual bool nextLine (const QString &line)
 
virtual bool preStart ()
 
void replaceCommand (const QString &cmd)
 
void replaceValue (const QString &arg)
 
- Protected Member Functions inherited from KGpgTransaction
int addArgument (const QString &arg)
 
void addArgumentRef (int *ref)
 
int addArguments (const QStringList &args)
 
void addIdHint (QString txt)
 
void askNewPassphrase (const QString &text)
 
bool askPassphrase (const QString &message=QString())
 
virtual ts_boolanswer confirmOverwrite (KUrl &currentFile)
 
virtual void finish ()
 
QString getIdHints () const
 
GPGProc * getProcess ()
 
int getSuccess () const
 
virtual bool hintLine (const ts_hintType hint, const QString &args)
 
void insertArgument (const int pos, const QString &arg)
 
void insertArguments (const int pos, const QStringList &args)
 
virtual void newPassphraseEntered ()
 
virtual bool passphraseReceived ()
 
virtual bool passphraseRequested ()
 
virtual void postStart ()
 
void replaceArgument (const int pos, const QString &arg)
 
void setDescription (const QString &description)
 
void setSuccess (const int v)
 
void unexpectedLine (const QString &line)
 
void waitForInputTransaction ()
 
void write (const QByteArray &a, const bool lf=true)
 
void write (const int i)
 

Additional Inherited Members

- Public Types inherited from KGpgTransaction
enum  ts_boolanswer { BA_UNKNOWN = 0, BA_YES = 1, BA_NO = 2 }
 
enum  ts_hintType { HT_KEYEXPIRED = 0, HT_SIGEXPIRED = 1, HT_NOSECKEY = 2, HT_ENCTO = 3 }
 
enum  ts_transaction {
  TS_OK = 0, TS_BAD_PASSPHRASE = 1, TS_MSG_SEQUENCE = 2, TS_USER_ABORTED = 3,
  TS_INVALID_EMAIL = 4, TS_INPUT_PROCESS_ERROR = 5, TS_COMMON_END = 100
}
 
- Signals inherited from KGpgTransaction
void done (int result)
 
void infoProgress (qulonglong processedAmount, qulonglong totalAmount)
 
void statusMessage (const QString &msg)
 

Detailed Description

edit a single property of a key

Definition at line 24 of file kgpgeditkeytransaction.h.

Constructor & Destructor Documentation

KGpgEditKeyTransaction::KGpgEditKeyTransaction ( QObject *  parent,
const QString &  keyid,
const QString &  command,
const bool  hasValue,
const bool  autoSave = true 
)
protected

constructor

Parameters
parentparent object
keyidkey to edit
commandGnuPG command to use
hasValueif the command takes an extra argument
autoSaveif a "save" command should be sent to GnuPG immediately

Definition at line 16 of file kgpgeditkeytransaction.cpp.

KGpgEditKeyTransaction::~KGpgEditKeyTransaction ( )
virtual

destructor

Definition at line 41 of file kgpgeditkeytransaction.cpp.

Member Function Documentation

KGpgTransaction::ts_boolanswer KGpgEditKeyTransaction::boolQuestion ( const QString &  line)
protectedvirtual

Called for every boolean question GnuPG answers.

Parameters
linethe question GnuPG asked
Returns
what to answer GnuPG

This is called instead of nextLine() if the line contains a boolean question. Returning BA_UNKNOWN will cancel the current transaction and will set the transaction result to TS_MSG_SEQUENCE.

The default implementation will answer BA_UNKNOWN to every question.

Reimplemented from KGpgTransaction.

Reimplemented in KGpgSignKey, and KGpgChangeTrust.

Definition at line 83 of file kgpgeditkeytransaction.cpp.

QString KGpgEditKeyTransaction::getKeyid ( ) const

return the id of the key we are editing

Definition at line 46 of file kgpgeditkeytransaction.cpp.

bool KGpgEditKeyTransaction::nextLine ( const QString &  line)
protectedvirtual

handle standard GnuPG prompts

Parameters
linethe line to handle

By default this handles passphrase questions and quits the operation when GnuPG returns to it's command prompt. The "GOOD_PASSPHRASE" line is not handled here. When you inherit this class and need to handle specific line do them first and then call this method at the end of your method to handle all standard things (if you don't want to handle them yourself). Every line sent here by GnuPG not recognised as command handled here will set a sequence error so be sure to handle your stuff first!

Implements KGpgTransaction.

Reimplemented in KGpgSignKey, KGpgAddUid, KGpgChangeTrust, KGpgChangeDisable, KGpgChangeExpire, and KGpgAddPhoto.

Definition at line 60 of file kgpgeditkeytransaction.cpp.

bool KGpgEditKeyTransaction::preStart ( )
protectedvirtual

reset class before next operation starts

If you inherit from this class make sure this method is called from your inherited method before you do anything else there.

Reimplemented from KGpgTransaction.

Reimplemented in KGpgAddUid, KGpgChangeTrust, and KGpgChangeDisable.

Definition at line 52 of file kgpgeditkeytransaction.cpp.

void KGpgEditKeyTransaction::replaceCommand ( const QString &  cmd)
protected

replace the command

Parameters
cmdnew command

This is seldomly needed, only when a command has different names for positive or negative action instead of taking that as argument.

Definition at line 101 of file kgpgeditkeytransaction.cpp.

void KGpgEditKeyTransaction::replaceValue ( const QString &  arg)
protected

replace the argument of the edit command

Parameters
argnew argument

Calling this function when the hasValue parameter of the constructor was false is an error.

Definition at line 93 of file kgpgeditkeytransaction.cpp.


The documentation for this class was generated from the following files:
  • kgpgeditkeytransaction.h
  • kgpgeditkeytransaction.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:07:52 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
  • kremotecontrol
  • ktimer
  • kwallet
  • superkaramba
  • 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