00001 // -*- c++ -*- 00002 00003 #ifndef KRFBLOGIN_H 00004 #define KRFBLOGIN_H 00005 00006 #include <qobject.h> 00007 00008 class KRFBConnection; 00009 00016 class KRFBLogin : QObject 00017 { 00018 Q_OBJECT 00019 00020 public: 00021 enum State { 00022 AwaitingServerVersion, 00023 AwaitingAuthScheme, 00024 AwaitingChallenge, 00025 WaitingForResponse, 00026 Authenticated, 00027 Ready, 00028 Failed, 00029 Error 00030 }; 00031 00032 KRFBLogin( KRFBConnection *con ); 00033 ~KRFBLogin(); 00034 00035 KRFBLogin::State state() const; 00036 00037 protected: 00038 void sendClientVersion(); 00039 00040 protected slots: 00041 void getPassword(); 00042 void gotServerVersion(); 00043 void gotAuthScheme(); 00044 void gotChallenge(); 00045 void gotAuthResult(); 00046 void gotFailureReasonSize(); 00047 00048 signals: 00049 void passwordRequired( KRFBConnection * ); 00050 void error( const QString & ); 00051 void status( const QString & ); 00052 00053 private: 00054 KRFBConnection *con; 00055 State currentState; 00056 QCString versionString; 00057 int serverMajor; 00058 int serverMinor; 00059 }; 00060 00061 #endif // KRFBLOGIN_H 00062
1.4.2