serverstatusevent.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 serverstatusevent.h
00013 ** \version $Id: serverstatusevent.h 2780 2008-06-21 21:48:32Z edmanm $
00014 ** \brief Base class for all Tor server status events
00015 */
00016 
00017 #ifndef _SERVERSTATUSEVENT_H
00018 #define _SERVERSTATUSEVENT_H
00019 
00020 #include "statusevent.h"
00021 
00022 
00023 class ServerStatusEvent : public StatusEvent
00024 {
00025 public:
00026   /**< Tor server status event types. */
00027   enum Status {
00028     UnrecognizedStatus,
00029     ExternalAddressChanged,
00030     NameserverStatusChanged,
00031     NameserversAllDown,
00032     DnsHijacked,
00033     DnsUseless,
00034     AcceptedServerDescriptor,
00035     RejectedServerDescriptor,
00036     GoodServerDescriptor,
00037     CheckingReachability,
00038     ReachabilityFailed,
00039     ReachabilitySucceeded
00040   };
00041 
00042   /** Constructor */
00043   ServerStatusEvent(tc::Severity severity, Status status)
00044     : StatusEvent((QEvent::Type)CustomEventType::ServerStatusEvent, severity),
00045       _status(status) {}
00046 
00047   /** Returns the server status indicated by this event. */
00048   Status status() const { return _status; }
00049   /** Returns a ServerStatusEvent::Status enum value for the server status
00050    * represented by <b>str</b>. */
00051   static Status statusFromString(const QString &str);
00052 
00053 private:
00054   Status _status; /**< Tor Server status indicated by this event. */
00055 };
00056 
00057 #endif
00058 

Generated on Sat Aug 16 17:31:48 2008 for Vidalia by  doxygen 1.5.6