Vidalia  0.2.15
ProtocolInfo.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.torproject.org/projects/vidalia.html. No part of Vidalia, 
00007 **  including this file, may be copied, modified, propagated, or distributed 
00008 **  except according to the terms described in the LICENSE file.
00009 */
00010 
00011 /*
00012 ** \file ProtocolInfo.h
00013 ** \brief Container for information in a PROTOCOLINFO reply from Tor
00014 */
00015 
00016 #ifndef _PROTOCOLINFO_H
00017 #define _PROTOCOLINFO_H
00018 
00019 #include <QStringList>
00020 
00021 
00022 class ProtocolInfo
00023 {
00024 public:
00025   /** Default constructor. */
00026   ProtocolInfo() {}
00027   
00028   /** Returns true if this ProtocolInfo object contains no data. */
00029   bool isEmpty() const;
00030   
00031   /** Sets the authentication methods Tor currently accepts. <b>methods</b>
00032    * should be a comma-delimited list of authentication methods. */
00033   void setAuthMethods(const QString methods);
00034   /** Returns the authentication methods Tor currently accepts. */
00035   QStringList authMethods() const { return _authMethods; }
00036 
00037   /** Sets the file to which Tor has written its authentication cookie. */
00038   void setCookieAuthFile(const QString cookieAuthFile)
00039     { _cookieAuthFile = cookieAuthFile; }
00040   /** Returns the file to which Tor has written its authentication cookie. */
00041   QString cookieAuthFile() const { return _cookieAuthFile; }
00042 
00043   /** Sets the version of Tor to which the controller is connected. */
00044   void setTorVersion(const QString torVersion) { _torVersion = torVersion; }
00045   /** Returns the version of Tor to which the controller is connected. */
00046   QString torVersionString() const { return _torVersion; }
00047 
00048 private:
00049   QString _torVersion;      /**< The Tor version in the PROTOCOLINFO reply. */
00050   QString _cookieAuthFile;  /**< Tor's authentication cookie file. */
00051   QStringList _authMethods; /**< Tor's ccepted authentication methods. */
00052 };
00053 
00054 #endif
00055