faithcore/faith/socketnotifier.h

Go to the documentation of this file.
00001 #ifndef KDE__SOCKETNOTIFIER_H
00002 #define KDE__SOCKETNOTIFIER_H
00003 
00004 #include "faith/application.h"
00005 
00006 namespace Faith
00007 {
00008 class Socket;
00009 
00019 class FAITH_CORE_EXPORT SocketNotifier : public Object
00020 {
00021 K_OBJECT
00022         int mSocket;
00023         int mError; // used to indicate a connection error
00024         friend class Faith::Application;
00025         friend class Faith::Socket;
00026 
00027 public:
00032         enum Type
00033         {
00034                 Read, Write, Exception
00035         };
00036 private:
00037         Type mType;
00038 public:
00039         
00044         SocketNotifier(int socket, Type type, Faith::Object *parent=0, const char *name=0);
00045         ~SocketNotifier();
00046         
00050         inline int socket() const { return mSocket; }
00051         
00055         inline Type type() const { return mType; }
00056 
00061         bool isEnabled() const;
00062 
00067         virtual void setEnabled(bool enable);
00068         
00069 signals:
00076         void activated(int);
00077         
00081         void activated(Faith::SocketNotifier *socket);
00082         
00086         void activated();
00087 
00088 private:
00089         // called by Application, friendship
00090         void activate(int internal);
00091 };
00092 
00093 }
00094 
00095 #endif
00096 

Generated on Fri Sep 1 00:23:07 2006 for Faith by  doxygen 1.4.7