libkdenetwork Library API Documentation

qgpgme/eventloopinteractor.h

00001 /* qeventloopinteractor.h
00002    Copyright (C) 2003 Klarälvdalens Datakonsult AB
00003 
00004    This file is part of QGPGME.
00005  
00006    QGPGME is free software; you can redistribute it and/or modify it
00007    under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2 of the License, or
00009    (at your option) any later version.
00010  
00011    QGPGME is distributed in the hope that it will be useful, but
00012    WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    General Public License for more details.
00015 
00016    You should have received a copy of the GNU General Public License
00017    along with QGPGME; if not, write to the Free Software Foundation,
00018    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA.  */
00019 
00020 // -*- c++ -*-
00021 #ifndef __QGPGME_EVENTLOOPINTERACTOR_H__
00022 #define __QGPGME_EVENTLOOPINTERACTOR_H__
00023 
00024 #include <gpgmepp/eventloopinteractor.h>
00025 
00026 #include <qobject.h>
00027 
00028 namespace GpgME {
00029   class Context;
00030   class Error;
00031   class TrustItem;
00032   class Key;
00033 } // namespace GpgME
00034   
00035 namespace QGpgME {
00036 
00037   class EventLoopInteractor : public QObject, public GpgME::EventLoopInteractor {
00038     Q_OBJECT
00039   protected:
00040     EventLoopInteractor( QObject * parent, const char * name=0 );
00041   public:
00042     virtual ~EventLoopInteractor();
00043 
00044     static EventLoopInteractor * instance();
00045 
00046   signals:
00047     void nextTrustItemEventSignal( GpgME::Context * context, const GpgME::TrustItem & item  );
00048     void nextKeyEventSignal( GpgME::Context * context, const GpgME::Key & key );
00049     void operationDoneEventSignal( GpgME::Context * context, const GpgME::Error & e );
00050 
00051     void aboutToDestroy();
00052 
00053   protected slots:
00054     void slotWriteActivity( int socket );
00055     void slotReadActivity( int socket );
00056     
00057   protected:
00058     //
00059     // IO Notification Interface
00060     //
00061 
00063     void * registerWatcher( int fd, Direction dir, bool & ok );
00065     void unregisterWatcher( void * tag );
00066 
00067     //
00068     // Event Handler Interface
00069     //
00070 
00072     void nextTrustItemEvent( GpgME::Context * context, const GpgME::TrustItem & item );
00074     void nextKeyEvent( GpgME::Context * context, const GpgME::Key & key );
00076     void operationDoneEvent( GpgME::Context * context, const GpgME::Error & e );
00077 
00078   private:
00079     class Private;
00080     Private * d;
00081     static EventLoopInteractor * mSelf;
00082   };
00083 
00084 } // namespace QGpgME
00085 
00086 #endif // __QGPGME_EVENTLOOPINTERACTOR_H__
00087 
00088 
KDE Logo
This file is part of the documentation for libkdenetwork Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Dec 21 14:21:38 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003