clientstatusevent.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 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 clientstatusevent.h
00013 ** \version $Id: clientstatusevent.h 2780 2008-06-21 21:48:32Z edmanm $
00014 ** \brief Base class for all Tor client status events
00015 */
00016 
00017 #ifndef _CLIENTSTATUSEVENT_H
00018 #define _CLIENTSTATUSEVENT_H
00019 
00020 #include "statusevent.h"
00021 
00022 
00023 class ClientStatusEvent : public StatusEvent
00024 {
00025 public:
00026   /** Tor client status event type. */
00027   enum Status {
00028     UnrecognizedStatus,
00029     Bootstrap,
00030     CircuitEstablished,
00031     CircuitNotEstablished,
00032     NotEnoughDirectoryInfo,
00033     EnoughDirectoryInfo,
00034     DangerousSocks,
00035     UnknownSocksProtocol,
00036     SocksBadHostname
00037   };
00038   
00039   /** Constructor. */
00040   ClientStatusEvent(tc::Severity severity, Status status)
00041     : StatusEvent((QEvent::Type)CustomEventType::ClientStatusEvent, severity),
00042        _status(status) {}
00043 
00044   /** Returns the client status indicated by this event. */
00045   Status status() const { return _status; }
00046   /** Returns a ClientStatusEvent::Status enum value for the status event type
00047    * represented by <b>str</b>. */
00048   static Status statusFromString(const QString &str);
00049 
00050 private:
00051   Status _status; /**< Tor Client status indicated by this event. */
00052 };
00053 
00054 #endif
00055 

Generated on Wed Dec 23 21:11:08 2009 for Vidalia by  doxygen 1.6.1