00001 /**************************************************************** 00002 * Vidalia is distributed under the following license: 00003 * 00004 * Copyright (C) 2007, Matt Edman, Justin Hipple 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 ****************************************************************/ 00021 00022 /** 00023 * \file protocolinfo.h 00024 * \version $Id: protocolinfo.h 1855 2007-08-23 01:22:55Z edmanm $ 00025 * \brief Container for information in a PROTOCOLINFO reply from Tor 00026 */ 00027 00028 #ifndef _PROTOCOLINFO_H 00029 #define _PROTOCOLINFO_H 00030 00031 #include <QStringList> 00032 00033 00034 class ProtocolInfo 00035 { 00036 public: 00037 /** Default constructor. */ 00038 ProtocolInfo() {} 00039 00040 /** Returns true if this ProtocolInfo object contains no data. */ 00041 bool isEmpty() const; 00042 00043 /** Sets the authentication methods Tor currently accepts. <b>methods</b> 00044 * should be a comma-delimited list of authentication methods. */ 00045 void setAuthMethods(const QString methods); 00046 /** Returns the authentication methods Tor currently accepts. */ 00047 QStringList authMethods() const { return _authMethods; } 00048 00049 /** Sets the file to which Tor has written its authentication cookie. */ 00050 void setCookieAuthFile(const QString cookieAuthFile) 00051 { _cookieAuthFile = cookieAuthFile; } 00052 /** Returns the file to which Tor has written its authentication cookie. */ 00053 QString cookieAuthFile() const { return _cookieAuthFile; } 00054 00055 /** Sets the version of Tor to which the controller is connected. */ 00056 void setTorVersion(const QString torVersion) { _torVersion = torVersion; } 00057 /** Returns the version of Tor to which the controller is connected. */ 00058 QString torVersionString() const { return _torVersion; } 00059 00060 private: 00061 QString _torVersion; /**< The Tor version in the PROTOCOLINFO reply. */ 00062 QString _cookieAuthFile; /**< Tor's authentication cookie file. */ 00063 QStringList _authMethods; /**< Tor's ccepted authentication methods. */ 00064 }; 00065 00066 #endif 00067