qgpgme
eventloopinteractor.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __QGPGME_EVENTLOOPINTERACTOR_H__
00023 #define __QGPGME_EVENTLOOPINTERACTOR_H__
00024
00025 #include "qgpgme_export.h"
00026 #include <gpgme++/eventloopinteractor.h>
00027
00028 #include <QtCore/QObject>
00029
00030 namespace GpgME {
00031 class Context;
00032 class Error;
00033 class TrustItem;
00034 class Key;
00035 }
00036
00037 namespace QGpgME {
00038
00039 class QGPGME_EXPORT EventLoopInteractor : public QObject, public GpgME::EventLoopInteractor {
00040 Q_OBJECT
00041 protected:
00042 explicit EventLoopInteractor( QObject * parent=0 );
00043 public:
00044 virtual ~EventLoopInteractor();
00045
00046 static EventLoopInteractor * instance();
00047
00048 Q_SIGNALS:
00049 void nextTrustItemEventSignal( GpgME::Context * context, const GpgME::TrustItem & item );
00050 void nextKeyEventSignal( GpgME::Context * context, const GpgME::Key & key );
00051 void operationDoneEventSignal( GpgME::Context * context, const GpgME::Error & e );
00052 void operationStartEventSignal( GpgME::Context * context );
00053
00054 void aboutToDestroy();
00055
00056 protected Q_SLOTS:
00057 void slotWriteActivity( int socket );
00058 void slotReadActivity( int socket );
00059
00060 protected:
00061
00062
00063
00064
00066 void * registerWatcher( int fd, Direction dir, bool & ok );
00068 void unregisterWatcher( void * tag );
00069
00070
00071
00072
00073
00075 void nextTrustItemEvent( GpgME::Context * context, const GpgME::TrustItem & item );
00077 void nextKeyEvent( GpgME::Context * context, const GpgME::Key & key );
00079 void operationStartEvent( GpgME::Context * context );
00081 void operationDoneEvent( GpgME::Context * context, const GpgME::Error & e );
00082
00083 private:
00084 class Private;
00085 Private * d;
00086 static EventLoopInteractor * mSelf;
00087 };
00088
00089 }
00090
00091 #endif // __QGPGME_EVENTLOOPINTERACTOR_H__
00092
00093