Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

KRFBConnection Class Reference

#include </home/clem/local/src/opie/noncore/comm/keypebble/krfbconnection.h>

Collaboration diagram for KRFBConnection:

Collaboration graph
[legend]
List of all members.

Public Types

enum  State {
  Connecting, LoggingIn, Connected, Disconnecting,
  Disconnected, Error
}

Signals

void statusChanged (const QString &)
void passwordRequired (KRFBConnection *)
void connected ()
void loggedIn ()
void disconnected ()
void error (const QString &msg)
void gotEnoughData ()

Public Member Functions

 KRFBConnection (QObject *parent=0)
 ~KRFBConnection ()
State state () const
KRFBServeroptions () const
KRFBBufferbuffer () const
KRFBDecoderdecoder () const
void setPortBase (int base)
int portBase () const
void connectTo (KRFBServer)
void disconnect ()
const QCString host () const
int display () const
const QUrl & url ()
void refresh ()
void sendCutText (const QString &)

Protected Slots

void gotSocketError (int)
void gotSocketConnection ()
void gotRFBConnection ()
void gotMoreData ()
void updateTimer ()
void disconnectDone ()

Private Member Functions

void waitForData (unsigned int)
int read (void *buf, int sz)
int write (void *buf, int sz)

Private Attributes

int portBase_
QSocket * sock
State currentState_
unsigned int minData_
QTimer * updater
KRFBLoginlogin
KRFBDecoderdecoder_
KRFBServeroptions_
KRFBBufferbuffer_
QUrl url_

Friends

class KRFBLogin
class KRFBDecoder

Detailed Description

Encapsulates the RFB socket.

Definition at line 24 of file krfbconnection.h.


Member Enumeration Documentation

enum KRFBConnection::State
 

Enumeration values:
Connecting 
LoggingIn 
Connected 
Disconnecting 
Disconnected 
Error 

Definition at line 33 of file krfbconnection.h.


Constructor & Destructor Documentation

KRFBConnection::KRFBConnection QObject *  parent = 0  ) 
 

Definition at line 18 of file krfbconnection.cpp.

References buffer_, currentState_, decoder_, Disconnected, minData_, options_, portBase_, sock, and updater.

KRFBConnection::~KRFBConnection  ) 
 

Definition at line 31 of file krfbconnection.cpp.

References currentState_, disconnectDone(), Disconnected, Disconnecting, options_, and sock.


Member Function Documentation

KRFBBuffer* KRFBConnection::buffer  )  const [inline]
 

Definition at line 51 of file krfbconnection.h.

References buffer_.

Referenced by KRFBCanvas::contentsMouseMoveEvent(), KRFBCanvas::contentsMousePressEvent(), KRFBCanvas::contentsMouseReleaseEvent(), KRFBCanvas::keyPressEvent(), KRFBCanvas::keyReleaseEvent(), KRFBCanvas::loggedIn(), KRFBCanvas::sendCtlAltDel(), and KRFBCanvas::viewportPaintEvent().

void KRFBConnection::connected  )  [signal]
 

Referenced by connectTo(), and gotRFBConnection().

void KRFBConnection::connectTo KRFBServer   ) 
 

Definition at line 39 of file krfbconnection.cpp.

References connected(), Connecting, currentState_, disconnect(), Disconnected, KRFBServer::display, error(), gotSocketConnection(), gotSocketError(), KRFBServer::hostname, QString::latin1(), oendl, options_, owarn, portBase_, and sock.

Referenced by KRFBCanvas::openConnection().

KRFBDecoder* KRFBConnection::decoder  )  const [inline]
 

Definition at line 53 of file krfbconnection.h.

References decoder_.

void KRFBConnection::disconnect  ) 
 

Definition at line 59 of file krfbconnection.cpp.

References currentState_, disconnectDone(), Disconnected, Disconnecting, oendl, owarn, and sock.

Referenced by KRFBCanvas::closeConnection(), and connectTo().

void KRFBConnection::disconnectDone  )  [protected, slot]
 

Definition at line 76 of file krfbconnection.cpp.

References buffer_, currentState_, decoder_, disconnected(), Disconnected, minData_, sock, and updater.

Referenced by disconnect(), and ~KRFBConnection().

void KRFBConnection::disconnected  )  [signal]
 

Referenced by disconnectDone().

int KRFBConnection::display  )  const [inline]
 

Definition at line 71 of file krfbconnection.h.

References KRFBServer::display, and options_.

Referenced by url().

void KRFBConnection::error const QString msg  )  [signal]
 

Referenced by connectTo(), and gotSocketError().

void KRFBConnection::gotEnoughData  )  [signal]
 

Referenced by gotMoreData(), and waitForData().

void KRFBConnection::gotMoreData  )  [protected, slot]
 

Definition at line 164 of file krfbconnection.cpp.

References assert, gotEnoughData(), minData_, and sock.

Referenced by gotSocketError(), and waitForData().

void KRFBConnection::gotRFBConnection  )  [protected, slot]
 

Definition at line 101 of file krfbconnection.cpp.

References buffer_, connected(), Connected, currentState_, decoder_, KRFBDecoder, loggedIn(), oendl, options_, owarn, KRFBDecoder::setBuffer(), statusChanged(), updater, KRFBServer::updateRate, and updateTimer().

Referenced by KRFBLogin::gotAuthResult().

void KRFBConnection::gotSocketConnection  )  [protected, slot]
 

Definition at line 88 of file krfbconnection.cpp.

References currentState_, KRFBLogin, LoggingIn, login, oendl, owarn, statusChanged(), and tr.

Referenced by connectTo().

void KRFBConnection::gotSocketError int   )  [protected, slot]
 

Definition at line 127 of file krfbconnection.cpp.

References currentState_, Disconnected, error(), Error, gotMoreData(), host(), oendl, owarn, read(), sock, and tr.

Referenced by connectTo().

const QCString KRFBConnection::host  )  const [inline]
 

Definition at line 68 of file krfbconnection.h.

References KRFBServer::hostname, QString::latin1(), and options_.

Referenced by gotSocketError(), and url().

void KRFBConnection::loggedIn  )  [signal]
 

Referenced by gotRFBConnection().

KRFBServer* KRFBConnection::options  )  const [inline]
 

Definition at line 49 of file krfbconnection.h.

References options_.

Referenced by KRFBCanvas::bell(), KRFBDecoder::decidePixelFormat(), KRFBBuffer::drawRawRectChunk(), KRFBDecoder::gotServerInit(), KRFBDecoder::sendAllowedEncodings(), KRFBDecoder::sendClientInit(), and KRFBDecoder::sendMouseEvent().

void KRFBConnection::passwordRequired KRFBConnection  )  [signal]
 

Emitted when we *really* need a password. If the password was specified before you tried to connect then you won't see this.

int KRFBConnection::portBase  )  const
 

Definition at line 212 of file krfbconnection.cpp.

References portBase_.

int KRFBConnection::read void *  buf,
int  sz
[private]
 

Definition at line 192 of file krfbconnection.cpp.

References sock.

Referenced by KRFBLogin::getPassword(), KRFBLogin::gotAuthResult(), KRFBLogin::gotAuthScheme(), KRFBDecoder::gotCopyRectPos(), KRFBDecoder::gotDesktopName(), KRFBDecoder::gotRawRectChunk(), KRFBDecoder::gotRectHeader(), KRFBDecoder::gotServerCutLength(), KRFBDecoder::gotServerCutText(), KRFBDecoder::gotServerInit(), KRFBLogin::gotServerVersion(), gotSocketError(), and KRFBDecoder::gotUpdateHeader().

void KRFBConnection::refresh  ) 
 

Definition at line 222 of file krfbconnection.cpp.

References decoder_, and KRFBDecoder::sendUpdateRequest().

Referenced by KRFBCanvas::refresh().

void KRFBConnection::sendCutText const QString  ) 
 

Definition at line 227 of file krfbconnection.cpp.

References decoder_, and KRFBDecoder::sendCutEvent().

Referenced by KRFBCanvas::clipboardChanged().

void KRFBConnection::setPortBase int  base  ) 
 

Definition at line 207 of file krfbconnection.cpp.

References portBase_.

KRFBConnection::State KRFBConnection::state  )  const
 

Definition at line 202 of file krfbconnection.cpp.

References currentState_.

Referenced by KRFBDecoder::KRFBDecoder().

void KRFBConnection::statusChanged const QString  )  [signal]
 

Referenced by gotRFBConnection(), and gotSocketConnection().

void KRFBConnection::updateTimer  )  [protected, slot]
 

Definition at line 217 of file krfbconnection.cpp.

References decoder_, and KRFBDecoder::sendUpdateRequest().

Referenced by gotRFBConnection().

const QUrl & KRFBConnection::url  ) 
 

Definition at line 232 of file krfbconnection.cpp.

References display(), host(), and url_.

void KRFBConnection::waitForData unsigned  int  )  [private]
 

Definition at line 175 of file krfbconnection.cpp.

References assert, currentState_, Error, gotEnoughData(), gotMoreData(), minData_, and sock.

Referenced by KRFBDecoder::getRawRectChunk(), KRFBDecoder::gotServerCut(), KRFBDecoder::gotServerCutLength(), KRFBDecoder::gotServerInit(), KRFBLogin::gotServerVersion(), KRFBDecoder::gotUpdateHeader(), KRFBDecoder::handleCopyRect(), KRFBLogin::KRFBLogin(), KRFBDecoder::sendClientInit(), and KRFBDecoder::sendUpdateRequest().

int KRFBConnection::write void *  buf,
int  sz
[private]
 

Definition at line 197 of file krfbconnection.cpp.

References sock.

Referenced by KRFBLogin::getPassword(), KRFBDecoder::sendAllowedEncodings(), KRFBDecoder::sendClientInit(), KRFBLogin::sendClientVersion(), KRFBDecoder::sendCutEvent(), KRFBDecoder::sendKeyPressEvent(), KRFBDecoder::sendKeyReleaseEvent(), KRFBDecoder::sendMouseEvent(), KRFBDecoder::sendPixelFormat(), and KRFBDecoder::sendUpdateRequest().


Friends And Related Function Documentation

friend class KRFBDecoder [friend]
 

Definition at line 30 of file krfbconnection.h.

Referenced by gotRFBConnection().

friend class KRFBLogin [friend]
 

Definition at line 26 of file krfbconnection.h.

Referenced by gotSocketConnection().


Member Data Documentation

KRFBBuffer* KRFBConnection::buffer_ [private]
 

Definition at line 142 of file krfbconnection.h.

Referenced by buffer(), disconnectDone(), gotRFBConnection(), and KRFBConnection().

State KRFBConnection::currentState_ [private]
 

Definition at line 136 of file krfbconnection.h.

Referenced by connectTo(), disconnect(), disconnectDone(), gotRFBConnection(), gotSocketConnection(), gotSocketError(), KRFBConnection(), state(), waitForData(), and ~KRFBConnection().

KRFBDecoder* KRFBConnection::decoder_ [private]
 

Definition at line 140 of file krfbconnection.h.

Referenced by decoder(), disconnectDone(), gotRFBConnection(), KRFBConnection(), refresh(), sendCutText(), and updateTimer().

KRFBLogin* KRFBConnection::login [private]
 

Definition at line 139 of file krfbconnection.h.

Referenced by gotSocketConnection().

unsigned int KRFBConnection::minData_ [private]
 

Definition at line 137 of file krfbconnection.h.

Referenced by disconnectDone(), gotMoreData(), KRFBConnection(), and waitForData().

KRFBServer* KRFBConnection::options_ [private]
 

Definition at line 141 of file krfbconnection.h.

Referenced by connectTo(), display(), KRFBLogin::getPassword(), gotRFBConnection(), host(), KRFBConnection(), options(), and ~KRFBConnection().

int KRFBConnection::portBase_ [private]
 

Definition at line 134 of file krfbconnection.h.

Referenced by connectTo(), KRFBConnection(), portBase(), and setPortBase().

QSocket* KRFBConnection::sock [private]
 

Definition at line 135 of file krfbconnection.h.

Referenced by connectTo(), disconnect(), disconnectDone(), gotMoreData(), gotSocketError(), KRFBConnection(), read(), waitForData(), write(), and ~KRFBConnection().

QTimer* KRFBConnection::updater [private]
 

Definition at line 138 of file krfbconnection.h.

Referenced by disconnectDone(), gotRFBConnection(), and KRFBConnection().

QUrl KRFBConnection::url_ [private]
 

Definition at line 143 of file krfbconnection.h.

Referenced by url().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:38:02 2005 for OPIE by  doxygen 1.4.2