bandwidthevent.h

Go to the documentation of this file.
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 bandwidthevent.h
00013 ** \version $Id: bandwidthevent.h 2362 2008-02-29 04:30:11Z edmanm $
00014 ** \brief Event dispatched upon receiving a bandwidth update from Tor
00015 */
00016 
00017 #ifndef _BANDWIDTHEVENT_H
00018 #define _BANDWIDTHEVENT_H
00019 
00020 #include <QEvent>
00021 
00022 
00023 class BandwidthEvent : public QEvent
00024 {
00025 public:
00026   /** Constructor */
00027   BandwidthEvent(quint64 bytesRead, quint64 bytesWritten)
00028   : QEvent((QEvent::Type)CustomEventType::BandwidthEvent)
00029   { _bytesRead = bytesRead; _bytesWritten = bytesWritten; }
00030 
00031   /** Returns the number of bytes read in the last second */
00032   quint64 bytesRead() const { return _bytesRead; }
00033   /** Returns the number of bytes written in the last second */
00034   quint64 bytesWritten() const { return _bytesWritten; }
00035   
00036 private:
00037   quint64 _bytesWritten;
00038   quint64 _bytesRead;
00039 };
00040 
00041 #endif
00042 

Generated on Tue Jul 7 16:58:26 2009 for Vidalia by  doxygen 1.4.7