[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[vidalia-svn] r2157: Add some QEvent subclasses for representing Tor client, serv (in trunk: . src/control)
Author: edmanm
Date: 2007-12-02 04:29:56 -0500 (Sun, 02 Dec 2007)
New Revision: 2157
Added:
trunk/src/control/circuitestablishedevent.h
trunk/src/control/clientstatusevent.cpp
trunk/src/control/clientstatusevent.h
trunk/src/control/generalstatusevent.cpp
trunk/src/control/generalstatusevent.h
trunk/src/control/serverstatusevent.cpp
trunk/src/control/serverstatusevent.h
trunk/src/control/statusevent.cpp
trunk/src/control/statusevent.h
trunk/src/control/unrecognizedclientstatusevent.h
trunk/src/control/unrecognizedgeneralstatusevent.h
trunk/src/control/unrecognizedserverstatusevent.h
Modified:
trunk/
Log:
r2195@lysithea: edmanm | 2007-12-02 04:28:30 -0500
Add some QEvent subclasses for representing Tor client, server, and general
status events.
Property changes on: trunk
___________________________________________________________________
svk:merge ticket from /local/vidalia/trunk [r2195] on 0108964c-5b0b-4c9e-969f-e2288315d100
Added: trunk/src/control/circuitestablishedevent.h
===================================================================
--- trunk/src/control/circuitestablishedevent.h (rev 0)
+++ trunk/src/control/circuitestablishedevent.h 2007-12-02 09:29:56 UTC (rev 2157)
@@ -0,0 +1,43 @@
+/****************************************************************
+ * Vidalia is distributed under the following license:
+ *
+ * Copyright (C) 2007, Matt Edman, Justin Hipple
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ ****************************************************************/
+
+/**
+ * \file circuitestablishedevent.h
+ * \version $Id$
+ * \brief Event sent when Tor has first successfully established a circuit
+ */
+
+#ifndef _CIRCUITESTABLISHEDEVENT_H
+#define _CIRCUITESTABLISHEDEVENT_H
+
+#include "clientstatusevent.h"
+
+
+class CircuitEstablishedEvent : public ClientStatusEvent
+{
+public:
+ /** Constructor. */
+ CircuitEstablishedEvent(StatusEvent::Severity severity)
+ : ClientStatusEvent(severity, ClientStatusEvent::CircuitEstablished) {}
+};
+
+#endif
+
Property changes on: trunk/src/control/circuitestablishedevent.h
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: trunk/src/control/clientstatusevent.cpp
===================================================================
--- trunk/src/control/clientstatusevent.cpp (rev 0)
+++ trunk/src/control/clientstatusevent.cpp 2007-12-02 09:29:56 UTC (rev 2157)
@@ -0,0 +1,52 @@
+/****************************************************************
+ * Vidalia is distributed under the following license:
+ *
+ * Copyright (C) 2007, Matt Edman, Justin Hipple
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ ****************************************************************/
+
+/**
+ * \file clientstatusevent.cpp
+ * \version $Id$
+ * \brief Base class for all Tor client status events
+ */
+
+#include "clientstatusevent.h"
+
+
+/** Returns a ClientStatusEvent::Status enum value for the status event type
+ * represented by <b>str</b>. */
+ClientStatusEvent::Status
+ClientStatusEvent::statusFromString(const QString &str)
+{
+ if (!str.compare("ENOUGH_DIR_INFO", Qt::CaseInsensitive))
+ return EnoughDirectoryInfo;
+ if (!str.compare("NOT_ENOUGH_DIR_INFO", Qt::CaseInsensitive))
+ return NotEnoughDirectoryInfo;
+ if (!str.compare("CIRCUIT_ESTABLISHED", Qt::CaseInsensitive))
+ return CircuitEstablished;
+ if (!str.compare("CIRCUIT_NOT_ESTABLISHED", Qt::CaseInsensitive))
+ return CircuitNotEstablished;
+ if (!str.compare("DANGEROUS_SOCKS", Qt::CaseInsensitive))
+ return DangerousSocks;
+ if (!str.compare("SOCKS_UNKNOWN_PROTOCOL", Qt::CaseInsensitive))
+ return UnknownSocksProtocol;
+ if (!str.compare("SOCKS_BAD_HOSTNAME", Qt::CaseInsensitive))
+ return SocksBadHostname;
+ return UnrecognizedStatus;
+}
+
Property changes on: trunk/src/control/clientstatusevent.cpp
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: trunk/src/control/clientstatusevent.h
===================================================================
--- trunk/src/control/clientstatusevent.h (rev 0)
+++ trunk/src/control/clientstatusevent.h 2007-12-02 09:29:56 UTC (rev 2157)
@@ -0,0 +1,65 @@
+/****************************************************************
+ * Vidalia is distributed under the following license:
+ *
+ * Copyright (C) 2007, Matt Edman, Justin Hipple
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ ****************************************************************/
+
+/**
+ * \file clientstatusevent.h
+ * \version $Id$
+ * \brief Base class for all Tor client status events
+ */
+
+#ifndef _CLIENTSTATUSEVENT_H
+#define _CLIENTSTATUSEVENT_H
+
+#include "statusevent.h"
+
+
+class ClientStatusEvent : public StatusEvent
+{
+public:
+ /** Tor client status event type. */
+ enum Status {
+ UnrecognizedStatus,
+ CircuitEstablished,
+ CircuitNotEstablished,
+ NotEnoughDirectoryInfo,
+ EnoughDirectoryInfo,
+ DangerousSocks,
+ UnknownSocksProtocol,
+ SocksBadHostname
+ };
+
+ /** Constructor. */
+ ClientStatusEvent(StatusEvent::Severity severity, Status status)
+ : StatusEvent((QEvent::Type)CustomEventType::ClientStatusEvent, severity),
+ _status(status) {}
+
+ /** Returns the client status indicated by this event. */
+ Status status() const { return _status; }
+ /** Returns a ClientStatusEvent::Status enum value for the status event type
+ * represented by <b>str</b>. */
+ static Status statusFromString(const QString &str);
+
+private:
+ Status _status; /**< Tor Client status indicated by this event. */
+};
+
+#endif
+
Property changes on: trunk/src/control/clientstatusevent.h
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: trunk/src/control/generalstatusevent.cpp
===================================================================
--- trunk/src/control/generalstatusevent.cpp (rev 0)
+++ trunk/src/control/generalstatusevent.cpp 2007-12-02 09:29:56 UTC (rev 2157)
@@ -0,0 +1,52 @@
+/****************************************************************
+ * Vidalia is distributed under the following license:
+ *
+ * Copyright (C) 2007, Matt Edman, Justin Hipple
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ ****************************************************************/
+
+/**
+ * \file generalstatusevent.cpp
+ * \version $Id$
+ * \brief Base class for all general Tor status events
+ */
+
+#include "generalstatusevent.h"
+
+
+/** Returns a GeneralStatusEvent::Status enum value for the status value
+ * represented by <b>str</b>. */
+GeneralStatusEvent::Status
+GeneralStatusEvent::statusFromString(const QString &str)
+{
+ if (!str.compare("CLOCK_JUMPED", Qt::CaseInsensitive))
+ return ClockJumped;
+ if (!str.compare("DANGEROUS_VERSION", Qt::CaseInsensitive))
+ return DangerousTorVersion;
+ if (!str.compare("TOO_MANY_CONNECTIONS", Qt::CaseInsensitive))
+ return TooManyConnections;
+ if (!str.compare("BUG", Qt::CaseInsensitive))
+ return TorBug;
+ if (!str.compare("CLOCK_SKEW", Qt::CaseInsensitive))
+ return ClockSkew;
+ if (!str.compare("BAD_LIBEVENT", Qt::CaseInsensitive))
+ return BadLibevent;
+ if (!str.compare("DIR_ALL_UNREACHABLE", Qt::CaseInsensitive))
+ return DirAllUnreachable;
+ return UnrecognizedStatus;
+}
+
Property changes on: trunk/src/control/generalstatusevent.cpp
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: trunk/src/control/generalstatusevent.h
===================================================================
--- trunk/src/control/generalstatusevent.h (rev 0)
+++ trunk/src/control/generalstatusevent.h 2007-12-02 09:29:56 UTC (rev 2157)
@@ -0,0 +1,65 @@
+/****************************************************************
+ * Vidalia is distributed under the following license:
+ *
+ * Copyright (C) 2007, Matt Edman, Justin Hipple
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ ****************************************************************/
+
+/**
+ * \file generalstatusevent.h
+ * \version $Id$
+ * \brief Base class for all general Tor status events
+ */
+
+#ifndef _GENERALSTATUSEVENT_H
+#define _GENERALSTATUSEVENT_H
+
+#include "statusevent.h"
+
+
+class GeneralStatusEvent : public StatusEvent
+{
+public:
+ /**< General Tor status event types. */
+ enum Status {
+ UnrecognizedStatus,
+ ClockJumped,
+ DangerousTorVersion,
+ TooManyConnections,
+ TorBug,
+ ClockSkew,
+ BadLibevent,
+ DirAllUnreachable
+ };
+
+ /** Constructor */
+ GeneralStatusEvent(StatusEvent::Severity severity, Status status)
+ : StatusEvent((QEvent::Type)CustomEventType::ServerStatusEvent, severity),
+ _status(status) {}
+
+ /** Returns the general Tor status indicated by this event. */
+ Status status() const { return _status; }
+ /** Returns a GeneralStatusEvent::Status enum value for the status value
+ * represented by <b>str</b>. */
+ static Status statusFromString(const QString &str);
+
+private:
+ Status _status; /**< General Tor status value indicated by this event. */
+};
+
+#endif
+
Property changes on: trunk/src/control/generalstatusevent.h
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: trunk/src/control/serverstatusevent.cpp
===================================================================
--- trunk/src/control/serverstatusevent.cpp (rev 0)
+++ trunk/src/control/serverstatusevent.cpp 2007-12-02 09:29:56 UTC (rev 2157)
@@ -0,0 +1,60 @@
+/****************************************************************
+ * Vidalia is distributed under the following license:
+ *
+ * Copyright (C) 2007, Matt Edman, Justin Hipple
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ ****************************************************************/
+
+/**
+ * \file serverstatusevent.cpp
+ * \version $Id$
+ * \brief Base class for all Tor server status events
+ */
+
+#include "serverstatusevent.h"
+
+
+/** Returns a ServerStatusEvent::Status enum value for the server status
+ * represented by <b>str</b>. */
+ServerStatusEvent::Status
+ServerStatusEvent::statusFromString(const QString &str)
+{
+ if (!str.compare("EXTERNAL_ADDRESS", Qt::CaseInsensitive))
+ return ExternalAddressChanged;
+ if (!str.compare("CHECKING_REACHABILITY", Qt::CaseInsensitive))
+ return CheckingReachability;
+ if (!str.compare("REACHABILITY_SUCCEEDED", Qt::CaseInsensitive))
+ return ReachabilitySucceeded;
+ if (!str.compare("GOOD_SERVER_DESCRIPTOR", Qt::CaseInsensitive))
+ return GoodServerDescriptor;
+ if (!str.compare("NAMESERVER_STATUS", Qt::CaseInsensitive))
+ return NameserverStatusChanged;
+ if (!str.compare("NAMESERVER_ALL_DOWN", Qt::CaseInsensitive))
+ return NameserversAllDown;
+ if (!str.compare("DNS_HIJACKED", Qt::CaseInsensitive))
+ return DnsHijacked;
+ if (!str.compare("DNS_USELESS", Qt::CaseInsensitive))
+ return DnsUseless;
+ if (!str.compare("BAD_SERVER_DESCRIPTOR", Qt::CaseInsensitive))
+ return RejectedServerDescriptor;
+ if (!str.compare("ACCEPTED_SERVER_DESCRIPTOR", Qt::CaseInsensitive))
+ return AcceptedServerDescriptor;
+ if (!str.compare("REACHABILITY_FAILED", Qt::CaseInsensitive))
+ return ReachabilityFailed;
+ return UnrecognizedStatus;
+}
+
Property changes on: trunk/src/control/serverstatusevent.cpp
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: trunk/src/control/serverstatusevent.h
===================================================================
--- trunk/src/control/serverstatusevent.h (rev 0)
+++ trunk/src/control/serverstatusevent.h 2007-12-02 09:29:56 UTC (rev 2157)
@@ -0,0 +1,69 @@
+/****************************************************************
+ * Vidalia is distributed under the following license:
+ *
+ * Copyright (C) 2007, Matt Edman, Justin Hipple
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ ****************************************************************/
+
+/**
+ * \file serverstatusevent.h
+ * \version $Id$
+ * \brief Base class for all Tor server status events
+ */
+
+#ifndef _SERVERSTATUSEVENT_H
+#define _SERVERSTATUSEVENT_H
+
+#include "statusevent.h"
+
+
+class ServerStatusEvent : public StatusEvent
+{
+public:
+ /**< Tor server status event types. */
+ enum Status {
+ UnrecognizedStatus,
+ ExternalAddressChanged,
+ NameserverStatusChanged,
+ NameserversAllDown,
+ DnsHijacked,
+ DnsUseless,
+ AcceptedServerDescriptor,
+ RejectedServerDescriptor,
+ GoodServerDescriptor,
+ CheckingReachability,
+ ReachabilityFailed,
+ ReachabilitySucceeded
+ };
+
+ /** Constructor */
+ ServerStatusEvent(StatusEvent::Severity severity, Status status)
+ : StatusEvent((QEvent::Type)CustomEventType::ServerStatusEvent, severity),
+ _status(status) {}
+
+ /** Returns the server status indicated by this event. */
+ Status status() const { return _status; }
+ /** Returns a ServerStatusEvent::Status enum value for the server status
+ * represented by <b>str</b>. */
+ static Status statusFromString(const QString &str);
+
+private:
+ Status _status; /**< Tor Server status indicated by this event. */
+};
+
+#endif
+
Property changes on: trunk/src/control/serverstatusevent.h
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: trunk/src/control/statusevent.cpp
===================================================================
--- trunk/src/control/statusevent.cpp (rev 0)
+++ trunk/src/control/statusevent.cpp 2007-12-02 09:29:56 UTC (rev 2157)
@@ -0,0 +1,44 @@
+/****************************************************************
+ * Vidalia is distributed under the following license:
+ *
+ * Copyright (C) 2007, Matt Edman, Justin Hipple
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ ****************************************************************/
+
+/**
+ * \file statusevent.cpp
+ * \version $Id$
+ * \brief Base class for all Tor status events
+ */
+
+#include "statusevent.h"
+
+
+/** Returns a StatusEvent::Severity enum value for the severity represented
+ * by <b>str</b>. */
+StatusEvent::Severity
+StatusEvent::severityFromString(const QString &str)
+{
+ if (!str.compare("NOTICE", Qt::CaseInsensitive))
+ return SeverityNotice;
+ else if (!str.compare("WARN", Qt::CaseInsensitive))
+ return SeverityWarn;
+ else if (!str.compare("ERR", Qt::CaseInsensitive))
+ return SeverityError;
+ return SeverityUnknown;
+}
+
Property changes on: trunk/src/control/statusevent.cpp
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: trunk/src/control/statusevent.h
===================================================================
--- trunk/src/control/statusevent.h (rev 0)
+++ trunk/src/control/statusevent.h 2007-12-02 09:29:56 UTC (rev 2157)
@@ -0,0 +1,62 @@
+/****************************************************************
+ * Vidalia is distributed under the following license:
+ *
+ * Copyright (C) 2007, Matt Edman, Justin Hipple
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ ****************************************************************/
+
+/**
+ * \file statusevent.h
+ * \version $Id$
+ * \brief Base class for all Tor status events
+ */
+
+#ifndef _STATUSEVENT_H
+#define _STATUSEVENT_H
+
+#include <QEvent>
+#include <QString>
+#include "eventtype.h"
+
+
+class StatusEvent : public QEvent
+{
+public:
+ /** Satus event severity values. */
+ enum Severity {
+ SeverityUnknown, /**< An unrecognized status event severity. */
+ SeverityNotice, /**< A not-so-bad status event. */
+ SeverityWarn, /**< An important, but non-fatal status event. */
+ SeverityError /**< A critical status event. */
+ };
+
+ /** Constructor */
+ StatusEvent(QEvent::Type type, Severity severity)
+ : QEvent(type), _severity(severity) {}
+
+ /** Returns the severity of this status event. */
+ Severity severity() const { return _severity; }
+ /** Returns a StatusEvent::Severity enum value for the severity represented
+ * by <b>str</b>. */
+ static Severity severityFromString(const QString &str);
+
+private:
+ Severity _severity; /**< Severity of this status event. */
+};
+
+#endif
+
Property changes on: trunk/src/control/statusevent.h
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: trunk/src/control/unrecognizedclientstatusevent.h
===================================================================
--- trunk/src/control/unrecognizedclientstatusevent.h (rev 0)
+++ trunk/src/control/unrecognizedclientstatusevent.h 2007-12-02 09:29:56 UTC (rev 2157)
@@ -0,0 +1,59 @@
+/****************************************************************
+ * Vidalia is distributed under the following license:
+ *
+ * Copyright (C) 2007, Matt Edman, Justin Hipple
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ ****************************************************************/
+
+/**
+ * \file unrecognizedclientstatusevent.h
+ * \version $Id$
+ * \brief Client status event with an unrecognized status value
+ */
+
+#ifndef _UNRECOGNIZEDCLIENTSTATUSEVENT_H
+#define _UNRECOGNIZEDCLIENTSTATUSEVENT_H
+
+#include <QHash>
+#include "clientstatusevent.h"
+
+
+class UnrecognizedClientStatusEvent : public ClientStatusEvent
+{
+public:
+ /** Constructor. <b>statusString</b> is the unrecognized client status value
+ * string and <b>args</b> is the (possibly empty) list of status event
+ * arguments. */
+ UnrecognizedClientStatusEvent(StatusEvent::Severity severity,
+ const QString &statusString,
+ const QHash<QString,QString> &args)
+ : ClientStatusEvent(severity, ClientStatusEvent::UnrecognizedStatus),
+ _statusString(statusString), _args(args) {}
+
+ /** Returns the status string for this client status event. */
+ QString statusString() const { return _statusString; }
+ /** Returns a (possibly empty) list of status event arguments given for this
+ * event. */
+ QHash<QString,QString> arguments() const { return _args; }
+
+private:
+ QString _statusString; /**< Name of the unrecognized status event. */
+ QHash<QString,QString> _args; /**< Status event arguments. */
+};
+
+#endif
+
Property changes on: trunk/src/control/unrecognizedclientstatusevent.h
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: trunk/src/control/unrecognizedgeneralstatusevent.h
===================================================================
--- trunk/src/control/unrecognizedgeneralstatusevent.h (rev 0)
+++ trunk/src/control/unrecognizedgeneralstatusevent.h 2007-12-02 09:29:56 UTC (rev 2157)
@@ -0,0 +1,59 @@
+/****************************************************************
+ * Vidalia is distributed under the following license:
+ *
+ * Copyright (C) 2007, Matt Edman, Justin Hipple
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ ****************************************************************/
+
+/**
+ * \file unrecognizedgeneralstatusevent.h
+ * \version $Id$
+ * \brief General status event with an unrecognized status value
+ */
+
+#ifndef _UNRECOGNIZEDGENERALSTATUSEVENT_H
+#define _UNRECOGNIZEDGENERALSTATUSEVENT_H
+
+#include <QHash>
+#include "generalstatusevent.h"
+
+
+class UnrecognizedGeneralStatusEvent : public GeneralStatusEvent
+{
+public:
+ /** Constructor. <b>statusString</b> is the unrecognized general status
+ * string and <b>args</b> is the (possibly empty) list of status event
+ * arguments. */
+ UnrecognizedGeneralStatusEvent(StatusEvent::Severity severity,
+ const QString &statusString,
+ const QHash<QString,QString> &args)
+ : GeneralStatusEvent(severity, GeneralStatusEvent::UnrecognizedStatus),
+ _statusString(statusString), _args(args) {}
+
+ /** Returns the status string for this general status event. */
+ QString statusString() const { return _statusString; }
+ /** Returns a (possibly empty) list of status event arguments given for this
+ * event. */
+ QHash<QString,QString> arguments() const { return _args; }
+
+private:
+ QString _statusString; /**< Name of the unrecognized status event. */
+ QHash<QString,QString> _args; /**< Status event arguments. */
+};
+
+#endif
+
Property changes on: trunk/src/control/unrecognizedgeneralstatusevent.h
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: trunk/src/control/unrecognizedserverstatusevent.h
===================================================================
--- trunk/src/control/unrecognizedserverstatusevent.h (rev 0)
+++ trunk/src/control/unrecognizedserverstatusevent.h 2007-12-02 09:29:56 UTC (rev 2157)
@@ -0,0 +1,59 @@
+/****************************************************************
+ * Vidalia is distributed under the following license:
+ *
+ * Copyright (C) 2007, Matt Edman, Justin Hipple
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ ****************************************************************/
+
+/**
+ * \file unrecognizedserverstatusevent.h
+ * \version $Id$
+ * \brief Server status event with an unrecognized status value
+ */
+
+#ifndef _UNRECOGNIZEDSERVERSTATUSEVENT_H
+#define _UNRECOGNIZEDSERVERSTATUSEVENT_H
+
+#include <QHash>
+#include "serverstatusevent.h"
+
+
+class UnrecognizedServerStatusEvent : public ServerStatusEvent
+{
+public:
+ /** Constructor. <b>statusString</b> is the unrecognized server status value
+ * string we and <b>args</b> is the (possibly empty) list of status event
+ * arguments. */
+ UnrecognizedServerStatusEvent(StatusEvent::Severity severity,
+ const QString &statusString,
+ const QHash<QString,QString> &args)
+ : ServerStatusEvent(severity, ServerStatusEvent::UnrecognizedStatus),
+ _statusString(statusString), _args(args) {}
+
+ /** Returns the status string for this server status event. */
+ QString statusString() const { return _statusString; }
+ /** Returns a (possibly empty) list of status event arguments given for this
+ * event. */
+ QHash<QString,QString> arguments() const { return _args; }
+
+private:
+ QString _statusString; /**< Name of the unrecognized status event. */
+ QHash<QString,QString> _args; /**< Status event arguments. */
+};
+
+#endif
+
Property changes on: trunk/src/control/unrecognizedserverstatusevent.h
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native