00001 /* 00002 ** This file is part of Vidalia, and is subject to the license terms in the 00003 ** LICENSE file, found in the top level directory of this distribution. If 00004 ** you did not receive the LICENSE file with this file, you may obtain it 00005 ** from the Vidalia source package distributed by the Vidalia Project at 00006 ** http://www.vidalia-project.net/. No part of Vidalia, including this file, 00007 ** may be copied, modified, propagated, or distributed except according to 00008 ** the terms described in the LICENSE file. 00009 */ 00010 00011 /* 00012 ** \file orconnevent.h 00013 ** \version $Id: orconnevent.h 2362 2008-02-29 04:30:11Z edmanm $ 00014 ** \brief Event dispatched upon receiving an ORCONN update from Tor 00015 */ 00016 00017 #ifndef _ORCONNEVENT_H 00018 #define _ORCONNEVENT_H 00019 00020 #include <QEvent> 00021 #include <QString> 00022 00023 class OrConnEvent : public QEvent 00024 { 00025 public: 00026 /** OR connection status */ 00027 enum Status { 00028 Unknown, /**< Unknown OR status. */ 00029 New, /**< Incoming connection. */ 00030 Launched, /**< Outgoing connection. */ 00031 Connected, /**< TLS handshake finished. */ 00032 Failed, /**< Connection closed before handshake completed. */ 00033 Closed /**< Connection closed that had previously handshaked. */ 00034 }; 00035 00036 /** Contructor */ 00037 OrConnEvent(Status status, QString server); 00038 00039 /** Converts a string description of a connection's status to an enum value */ 00040 static Status toStatus(QString status); 00041 00042 /** Returns the status for this OR connection. */ 00043 Status status(); 00044 /** Returns the OR server with which this connection is associated. */ 00045 QString server(); 00046 00047 private: 00048 /** OR connection status associated with this event. */ 00049 Status _status; 00050 /** OR server */ 00051 QString _server; 00052 }; 00053 00054 #endif 00055