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 you 00004 ** did not receive the LICENSE file with this file, you may obtain it from the 00005 ** 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 the 00008 ** terms described in the LICENSE file. 00009 */ 00010 00011 /* 00012 ** \file circuitevent.h 00013 ** \version $Id: circuitevent.h 2511 2008-04-12 22:02:27Z edmanm $ 00014 ** \brief Event dispatched containing updated circuit status information 00015 */ 00016 00017 #ifndef _CIRCUITEVENT_H 00018 #define _CIRCUITEVENT_H 00019 00020 #include <QEvent> 00021 00022 #include "eventtype.h" 00023 #include "circuit.h" 00024 00025 00026 class CircuitEvent : public QEvent 00027 { 00028 public: 00029 /** Constructor */ 00030 CircuitEvent(Circuit circuit) 00031 : QEvent((QEvent::Type)CustomEventType::CircuitEvent) 00032 { _circuit = circuit; } 00033 00034 /** Returns the Circuit object for this event. */ 00035 Circuit circuit() const { return _circuit; } 00036 /** Returns the ID for this circuit event. */ 00037 quint64 id() const { return _circuit.id(); } 00038 /** Returns the status of this circuit event. */ 00039 Circuit::Status status() const { return _circuit.status(); } 00040 /** Returns the names of the routers in the path for this circuit event. */ 00041 QStringList routerNames() const { return _circuit.routerNames(); } 00042 /** Returns the IDs of the routers in the path for this circuit event. */ 00043 QStringList routerIDs() const { return _circuit.routerIDs(); } 00044 00045 private: 00046 /** Circuit object for this event. */ 00047 Circuit _circuit; 00048 }; 00049 00050 #endif 00051