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

kleopatra

  • sources
  • kde-4.14
  • kdepim
  • kleopatra
  • uiserver
uiserver_p.h
Go to the documentation of this file.
1 /* -*- mode: c++; c-basic-offset:4 -*-
2  uiserver/uiserver_p.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 #ifndef __KLEOPATRA_UISERVER_UISERVER_P_H__
33 #define __KLEOPATRA_UISERVER_UISERVER_P_H__
34 
35 #include "uiserver.h"
36 
37 #include "assuanserverconnection.h"
38 #include "assuancommand.h"
39 
40 #include <utils/wsastarter.h>
41 
42 #include <QTcpServer>
43 #include <QFile>
44 
45 #include <kleo-assuan.h>
46 
47 #ifndef Q_MOC_RUN
48 #include <boost/bind.hpp>
49 #endif
50 
51 #include <algorithm>
52 #include <vector>
53 
54 namespace {
55  template <typename Ex>
56  void throw_( const QString & message ) {
57  throw Ex( message.toUtf8().constData() );
58  }
59 }
60 
61 namespace Kleo {
62 
63  class UiServer::Private : public QTcpServer {
64  Q_OBJECT
65  friend class ::Kleo::UiServer;
66  UiServer * const q;
67  public:
68  explicit Private( UiServer * qq );
69  static bool isStaleAssuanSocket( const QString& socketName );
70 
71  private:
72  void makeListeningSocket();
73  // platform-specific creation impl for makeListeningSocket():
74  void doMakeListeningSocket( const QByteArray & encodedFileName );
75  QString makeFileName( const QString & hint=QString() ) const;
76  void ensureDirectoryExists( const QString& path ) const;
77  static QString systemErrorString();
78 
79  protected:
80  /* reimp */ void incomingConnection( int fd );
81 
82  private Q_SLOTS:
83  void slotConnectionClosed( Kleo::AssuanServerConnection * conn );
84 
85  private:
86  QFile file;
87  std::vector< boost::shared_ptr<AssuanCommandFactory> > factories;
88  std::vector< boost::shared_ptr<AssuanServerConnection> > connections;
89  QString suggestedSocketName;
90  QString actualSocketName;
91  assuan_sock_nonce_t nonce;
92  const WSAStarter _wsastarter;
93  bool cryptoCommandsEnabled;
94  };
95 
96 }
97 
98 #endif /* __KLEOPATRA_UISERVER_UISERVER_P_H__ */
kleo-assuan.h
wsastarter.h
QByteArray
QFile
Kleo::UiServer
Definition: uiserver.h:52
Kleo::WSAStarter
Definition: wsastarter.h:38
Kleo::UiServer::Private
Definition: uiserver_p.h:63
QByteArray::constData
const char * constData() const
QString
assuancommand.h
QTcpServer
Kleo::UiServer::Private::Private
Private(UiServer *qq)
Definition: uiserver.cpp:72
Kleo::UiServer::Private::incomingConnection
void incomingConnection(int fd)
Definition: uiserver.cpp:197
assuanserverconnection.h
Kleo::UiServer::Private::isStaleAssuanSocket
static bool isStaleAssuanSocket(const QString &socketName)
Definition: uiserver.cpp:90
Kleo::UiServer::socketName
QString socketName() const
Definition: uiserver.cpp:160
Kleo::AssuanServerConnection
Definition: assuanserverconnection.h:53
uiserver.h
QString::toUtf8
QByteArray toUtf8() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:33:11 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
  • pimprint

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