kleopatra
libkleopatraclient/core/command.cpp
Go to the documentation of this file.
207 const std::map<std::string,Private::Option>::const_iterator it = d->inputs.options.find( name );
250 const std::map<std::string,Private::Option>::const_iterator it = d->inputs.options.find( name );
357 explicit AssuanClientContext( assuan_context_t ctx ) : AssuanContextBase( ctx, &assuan_disconnect ) {}
360 explicit AssuanClientContext( assuan_context_t ctx ) : AssuanContextBase( ctx, &my_assuan_release ) {}
381 return assuan_transact( ctx.get(), command, data_cb, data_cb_arg, inquire_cb, inquire_cb_arg, status_cb, status_cb_arg );
421 if ( !QProcess::startDetached( uiserver_executable(), QStringList() << QLatin1String( "--daemon" ) ) )
462 static assuan_error_t send_option( const AssuanClientContext & ctx, const char * name, const QVariant & value ) {
476 static assuan_error_t send_recipient( const AssuanClientContext & ctx, const QString & recipient, bool info ) {
485 static assuan_error_t send_sender( const AssuanClientContext & ctx, const QString & sender, bool info ) {
531 out.errorString = tr( "Could not allocate resources to connect to Kleopatra UI server at %1: %2" )
593 err = send_option( ctx, "window-id", QString().sprintf( "%lx", reinterpret_cast<quintptr>( in.parentWId ) ) );
595 err = send_option( ctx, "window-id", QString().sprintf( "%lx", static_cast<unsigned long>( in.parentWId ) ) );
601 for ( std::map<std::string,Option>::const_iterator it = in.options.begin(), end = in.options.end() ; it != end ; ++it )
602 if ( ( err = send_option( ctx, it->first.c_str(), it->second.hasValue ? it->second.value.toString() : QVariant() ) ) ) {
608 qDebug() << "Failed to send non-critical option" << it->first.c_str() << ":" << to_error_string( err );
637 err = my_assuan_transact( ctx, in.command.constData(), &command_data_cb, &out.data, &command_inquire_cb, &id );
QString serverLocation() const
Definition: libkleopatraclient/core/command.cpp:144
void cancel()
Definition: libkleopatraclient/core/command.cpp:185
QStringList filePaths() const
Definition: libkleopatraclient/core/command.cpp:259
QByteArray receivedData() const
Definition: libkleopatraclient/core/command.cpp:325
bool error() const
Definition: libkleopatraclient/core/command.cpp:159
void setSenders(const QStringList &senders, bool informative)
Definition: libkleopatraclient/core/command.cpp:282
static QString default_socket_name()
Definition: libkleopatraclient/core/command.cpp:411
static assuan_error_t send_sender(const AssuanClientContext &ctx, const QString &sender, bool info)
Definition: libkleopatraclient/core/command.cpp:485
static assuan_error_t send_option(const AssuanClientContext &ctx, const char *name, const QVariant &value)
Definition: libkleopatraclient/core/command.cpp:462
QStringList senders() const
Definition: libkleopatraclient/core/command.cpp:288
char * default_homedir(void)
bool wasCanceled() const
Definition: libkleopatraclient/core/command.cpp:164
shared_ptr< remove_pointer< assuan_context_t >::type > AssuanContextBase
Definition: libkleopatraclient/core/command.cpp:352
WId parentWId() const
Definition: libkleopatraclient/core/command.cpp:133
QString errorString() const
Definition: libkleopatraclient/core/command.cpp:169
void start()
Definition: libkleopatraclient/core/command.cpp:181
static assuan_error_t my_assuan_transact(const AssuanClientContext &ctx, const char *command, assuan_error_t(*data_cb)(void *, const void *, size_t)=0, void *data_cb_arg=0, assuan_error_t(*inquire_cb)(void *, const char *)=0, void *inquire_cb_arg=0, assuan_error_t(*status_cb)(void *, const char *)=0, void *status_cb_arg=0)
Definition: libkleopatraclient/core/command.cpp:372
static assuan_error_t getinfo_pid_cb(void *opaque, const void *buffer, size_t length)
Definition: libkleopatraclient/core/command.cpp:427
~Command()
Definition: libkleopatraclient/core/command.cpp:119
void finished()
static std::string hexencode(const std::string &in)
Definition: libkleopatraclient/core/command.cpp:58
Command(QObject *parent=0)
Definition: libkleopatraclient/core/command.cpp:107
bool areSendersInformative() const
Definition: libkleopatraclient/core/command.cpp:293
static std::ostream & operator<<(std::ostream &s, const QByteArray &ba)
Definition: libkleopatraclient/core/command.cpp:458
qint64 serverPid() const
Definition: libkleopatraclient/core/command.cpp:175
QByteArray inquireData(const char *what) const
Definition: libkleopatraclient/core/command.cpp:309
void setCommand(const char *command)
Definition: libkleopatraclient/core/command.cpp:331
static QString uiserver_executable()
Definition: libkleopatraclient/core/command.cpp:416
bool isInquireDataSet(const char *what) const
Definition: libkleopatraclient/core/command.cpp:318
void setInquireData(const char *what, const QByteArray &data)
Definition: libkleopatraclient/core/command.cpp:299
void unsetInquireData(const char *what)
Definition: libkleopatraclient/core/command.cpp:304
bool waitForFinished()
Definition: libkleopatraclient/core/command.cpp:150
void setServerLocation(const QString &location)
Definition: libkleopatraclient/core/command.cpp:139
static QString gnupg_home_directory()
Definition: libkleopatraclient/core/command.cpp:392
bool areRecipientsInformative() const
Definition: libkleopatraclient/core/command.cpp:276
void setOptionValue(const char *name, const QVariant &value, bool critical=true)
Definition: libkleopatraclient/core/command.cpp:190
bool isOptionSet(const char *name) const
Definition: libkleopatraclient/core/command.cpp:239
static QString get_default_socket_name()
Definition: libkleopatraclient/core/command.cpp:404
bool isOptionCritical(const char *name) const
Definition: libkleopatraclient/core/command.cpp:246
void setParentWId(WId wid)
Definition: libkleopatraclient/core/command.cpp:128
void started()
static assuan_error_t send_recipient(const AssuanClientContext &ctx, const QString &recipient, bool info)
Definition: libkleopatraclient/core/command.cpp:476
void setFilePaths(const QStringList &filePaths)
Definition: libkleopatraclient/core/command.cpp:254
QByteArray command() const
Definition: libkleopatraclient/core/command.cpp:336
void setOption(const char *name, bool critical=true)
Definition: libkleopatraclient/core/command.cpp:215
QVariant optionValue(const char *name) const
Definition: libkleopatraclient/core/command.cpp:202
QStringList recipients() const
Definition: libkleopatraclient/core/command.cpp:271
void unsetOption(const char *name)
Definition: libkleopatraclient/core/command.cpp:232
static QString to_error_string(int err)
Definition: libkleopatraclient/core/command.cpp:384
static assuan_error_t command_inquire_cb(void *opaque, const char *what)
Definition: libkleopatraclient/core/command.cpp:446
static assuan_error_t command_data_cb(void *opaque, const void *buffer, size_t length)
Definition: libkleopatraclient/core/command.cpp:433
void setRecipients(const QStringList &recipients, bool informative)
Definition: libkleopatraclient/core/command.cpp:265
static assuan_error_t send_file(const AssuanClientContext &ctx, const QString &file)
Definition: libkleopatraclient/core/command.cpp:470
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
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.