Vidalia 0.2.10
|
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 CircuitItem.h 00013 ** \version $Id: CircuitItem.h 3735 2009-04-28 20:28:01Z edmanm $ 00014 ** \brief List item representing a Tor circuit and its status 00015 */ 00016 00017 #ifndef _CIRCUITITEM_H 00018 #define _CIRCUITITEM_H 00019 00020 #include "StreamItem.h" 00021 00022 #include "Circuit.h" 00023 #include "Stream.h" 00024 00025 #include <QApplication> 00026 #include <QTreeWidgetItem> 00027 00028 00029 class CircuitItem : public QTreeWidgetItem 00030 { 00031 Q_DECLARE_TR_FUNCTIONS(CircuitItem) 00032 00033 public: 00034 /** Default constructor */ 00035 CircuitItem(const Circuit &circuit); 00036 00037 /** Adds a stream to this circuit item */ 00038 void addStream(StreamItem *stream); 00039 /** Removes the stream item from the list and frees its memory. */ 00040 void removeStream(StreamItem *stream); 00041 /** Updates the status of this circuit item using the given circuit. */ 00042 void update(const Circuit &circuit); 00043 /** Returns the ID for this circuit. */ 00044 CircuitId id() const { return _circuit.id(); } 00045 /** Returns the Circuit object for this item. */ 00046 Circuit circuit() const { return _circuit; } 00047 /** Returns a list of all stream items on this circuit. */ 00048 QList<StreamItem *> streams() const; 00049 00050 private: 00051 Circuit _circuit; /**< Circuit associated with this item. */ 00052 }; 00053 00054 #endif 00055