gpgmepp/eventloopinteractor.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __GPGMEPP_EVENTLOOPINTERACTOR_H__
00022 #define __GPGMEPP_EVENTLOOPINTERACTOR_H__
00023
00024
00025 namespace GpgME {
00026
00027 class Context;
00028 class Error;
00029 class TrustItem;
00030 class Key;
00031
00106 class EventLoopInteractor {
00107 protected:
00108 EventLoopInteractor();
00109 public:
00110 virtual ~EventLoopInteractor();
00111
00112 static EventLoopInteractor * instance() { return mSelf; }
00113
00114 void manage( Context * context );
00115 void unmanage( Context * context );
00116
00117 enum Direction { Read, Write };
00118 protected:
00119
00120
00121
00122
00125 void actOn( int fd, Direction dir );
00126
00127 virtual void * registerWatcher( int fd, Direction dir, bool & ok ) = 0;
00128 virtual void unregisterWatcher( void * tag ) = 0;
00129
00130
00131
00132
00133
00134 virtual void nextTrustItemEvent( Context * context, const TrustItem & item ) = 0;
00135 virtual void nextKeyEvent( Context * context, const Key & key ) = 0;
00136 virtual void operationDoneEvent( Context * context, const Error & e ) = 0;
00137
00138 private:
00139 class Private;
00140 friend class Private;
00141 Private * d;
00142 static EventLoopInteractor * mSelf;
00143 };
00144
00145 }
00146
00147 #endif // __GPGMEPP_EVENTLOOPINTERACTOR_H__
This file is part of the documentation for libkdenetwork Library Version 3.3.2.