• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

qgpgme

  • qgpgme
dataprovider.h
1 /* dataprovider.h
2  Copyright (C) 2004 Klarälvdalens Datakonsult AB
3 
4  This file is part of QGPGME.
5 
6  QGPGME is free software; you can redistribute it and/or modify it
7  under the terms of the GNU Library General Public License as published
8  by the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  QGPGME is distributed in the hope that it will be useful, but
12  WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with QGPGME; see the file COPYING.LIB. If not, write to the
18  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA. */
20 
21 // -*- c++ -*-
22 #ifndef __QGPGME_DATAPROVIDER_H__
23 #define __QGPGME_DATAPROVIDER_H__
24 
25 #include "qgpgme_export.h"
26 #include <gpgme++/interfaces/dataprovider.h>
27 
28 #include <QtCore/QByteArray>
29 
30 #include <boost/shared_ptr.hpp>
31 
32 class QIODevice;
33 
34 namespace QGpgME {
35 
36  class QGPGME_EXPORT QByteArrayDataProvider : public GpgME::DataProvider {
37  public:
38  QByteArrayDataProvider();
39  explicit QByteArrayDataProvider( const QByteArray & initialData );
40  ~QByteArrayDataProvider();
41 
42  const QByteArray & data() const { return mArray; }
43 
44  private:
45  // these shall only be accessed through the dataprovider
46  // interface, where they're public:
48  bool isSupported( Operation ) const { return true; }
50  ssize_t read( void * buffer, size_t bufSize );
52  ssize_t write( const void * buffer, size_t bufSize );
54  off_t seek( off_t offset, int whence );
56  void release();
57 
58  private:
59  QByteArray mArray;
60  off_t mOff;
61  };
62 
63  class QGPGME_EXPORT QIODeviceDataProvider : public GpgME::DataProvider {
64  public:
65  explicit QIODeviceDataProvider( const boost::shared_ptr<QIODevice> & initialData );
66  ~QIODeviceDataProvider();
67 
68  const boost::shared_ptr<QIODevice> & ioDevice() const { return mIO; }
69 
70  private:
71  // these shall only be accessed through the dataprovider
72  // interface, where they're public:
74  bool isSupported( Operation ) const;
76  ssize_t read( void * buffer, size_t bufSize );
78  ssize_t write( const void * buffer, size_t bufSize );
80  off_t seek( off_t offset, int whence );
82  void release();
83 
84  private:
85  const boost::shared_ptr<QIODevice> mIO;
86  bool mErrorOccurred : 1;
87  bool mHaveQProcess : 1;
88  };
89 
90 } // namespace QGpgME
91 
92 #endif // __QGPGME_EVENTLOOPINTERACTOR_H__
93 
94 
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:26:41 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

qgpgme

Skip menu "qgpgme"
  • Main Page
  • File List

kdepimlibs-4.10.5 API Reference

Skip menu "kdepimlibs-4.10.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
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