streamevent.h

Go to the documentation of this file.
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 streamevent.h
00024  * \version $Id: streamevent.h 1563 2006-12-26 06:06:04Z edmanm $
00025  * \brief Event dispatched when a stream status update is received from Tor
00026  */
00027 
00028 #ifndef _STREAMEVENT_H
00029 #define _STREAMEVENT_H
00030 
00031 #include <QEvent>
00032 
00033 #include "eventtype.h"
00034 #include "stream.h"
00035 
00036 
00037 class StreamEvent : public QEvent
00038 {
00039 public:
00040   /** Default constructor */
00041   StreamEvent(Stream stream)
00042   : QEvent((QEvent::Type)CustomEventType::StreamEvent)
00043   { _stream = stream; }
00044   
00045   /** Returns the Stream object for this stream event. */
00046   Stream stream() { return _stream; }
00047   /** Returns the ID for this stream event. */
00048   quint64 id() { return _stream.id(); }
00049   /** Returns the status for this stream event. */
00050   Stream::Status status() { return _stream.status(); }
00051   /** Returns the ID of the circuit to which this stream is assigned */
00052   quint64 circuitId() { return _stream.circuitId(); }
00053   /** Returns the target for this stream event. */
00054   QString target() { return _stream.target(); }
00055   
00056 private:
00057   Stream _stream; /**< Stream object for this stream event. */
00058 };
00059 
00060 #endif
00061 

Generated on Wed Sep 5 15:49:28 2007 for Vidalia by  doxygen 1.5.3