00001 /**************************************************************** 00002 * Vidalia is distributed under the following license: 00003 * 00004 * Copyright (C) 2006, Matt Edman, Justin Hipple 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 ****************************************************************/ 00021 00022 /** 00023 * \file orconnevent.h 00024 * \version $Id: orconnevent.h 1238 2006-09-25 17:50:57Z edmanm $ 00025 * \brief Event dispatched upon receiving an ORCONN update from Tor 00026 */ 00027 00028 #ifndef _ORCONNEVENT_H 00029 #define _ORCONNEVENT_H 00030 00031 #include <QEvent> 00032 #include <QString> 00033 00034 class OrConnEvent : public QEvent 00035 { 00036 public: 00037 /** OR connection status */ 00038 enum Status { 00039 Unknown, /**< Unknown OR status. */ 00040 New, /**< Incoming connection. */ 00041 Launched, /**< Outgoing connection. */ 00042 Connected, /**< TLS handshake finished. */ 00043 Failed, /**< Connection closed before handshake completed. */ 00044 Closed /**< Connection closed that had previously handshaked. */ 00045 }; 00046 00047 /** Contructor */ 00048 OrConnEvent(Status status, QString server); 00049 00050 /** Converts a string description of a connection's status to an enum value */ 00051 static Status toStatus(QString status); 00052 00053 /** Returns the status for this OR connection. */ 00054 Status status(); 00055 /** Returns the OR server with which this connection is associated. */ 00056 QString server(); 00057 00058 private: 00059 /** OR connection status associated with this event. */ 00060 Status _status; 00061 /** OR server */ 00062 QString _server; 00063 }; 00064 00065 #endif 00066