Vidalia 0.2.12
|
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 VidaliaSettings.h 00013 ** \brief General Vidalia settings, such as language and interface style 00014 */ 00015 00016 #ifndef _VIDALIASETTINGS_H 00017 #define _VIDALIASETTINGS_H 00018 00019 #include "VSettings.h" 00020 00021 #include <QDateTime> 00022 00023 00024 /** Handles saving and restoring Vidalia's settings, such as the 00025 * location of Tor, the control port, etc. 00026 * 00027 * NOTE: Qt 4.1 documentation states that constructing a QSettings object is 00028 * "very fast", so we shouldn't need to create a global instance of this 00029 * class. 00030 */ 00031 class VidaliaSettings : public VSettings 00032 { 00033 Q_OBJECT 00034 00035 public: 00036 /** Default constructor. */ 00037 VidaliaSettings(); 00038 00039 /** Gets the currently preferred language code for Vidalia. */ 00040 QString getLanguageCode(); 00041 /** Saves the preferred language code. */ 00042 void setLanguageCode(QString languageCode); 00043 00044 /** Gets the interface style key (e.g., "windows", "motif", etc.) */ 00045 QString getInterfaceStyle(); 00046 /** Sets the interface style key. */ 00047 void setInterfaceStyle(QString styleKey); 00048 00049 /** Returns true if Vidalia should start Tor when it starts. */ 00050 bool runTorAtStart(); 00051 /** Set whether to run Tor when Vidalia starts. */ 00052 void setRunTorAtStart(bool run); 00053 00054 /** Returns true if Vidalia's main window should be visible when the 00055 * application starts. */ 00056 bool showMainWindowAtStart(); 00057 /** Sets whether to show Vidalia's main window when the application starts. */ 00058 void setShowMainWindowAtStart(bool show); 00059 00060 /** Returns true if Vidalia should start on system boot. */ 00061 bool runVidaliaOnBoot(); 00062 /** Set whether to run Vidalia on system boot. */ 00063 void setRunVidaliaOnBoot(bool run); 00064 00065 /** If browserDirectory is empty, returns a fully-qualified path to 00066 * the web browser, including the executable name. If browserDirectory 00067 * is set, then returns the basename of the configured web browser */ 00068 QString getBrowserExecutable() const; 00069 /** Sets the location and name of the web browser executable to the given 00070 * string. If set to the empty string, the browser will not be started. */ 00071 void setBrowserExecutable(const QString &browserExecutable); 00072 00073 /** Returns a fully-qualified path to the web browser directory */ 00074 QString getBrowserDirectory() const; 00075 /** Sets the location and name of the web browser directory to the given string. 00076 * If set to the empty string, the browser will not be started. */ 00077 void setBrowserDirectory(const QString &browserDirectory); 00078 00079 /** Returns a fully-qualified path to the IM client, including the 00080 * executable name. */ 00081 QString getIMExecutable() const; 00082 /** Sets the location and name of the IM client executable to the given 00083 * string. If set to the empty string, the client will not be started. */ 00084 void setIMExecutable(const QString &IMExecutable); 00085 00086 /** Returns true if Vidalia should start a proxy application when it 00087 * starts. */ 00088 bool runProxyAtStart(); 00089 /** Set whether to run a proxy application when Vidalia starts. */ 00090 void setRunProxyAtStart(bool run); 00091 00092 /** Returns a fully-qualified path to the proxy server, including the 00093 * executable name. */ 00094 QString getProxyExecutable() const; 00095 /** Sets the location and name of the proxy server executable to the given 00096 * string. If set to the empty string, the proxy will not be started. */ 00097 void setProxyExecutable(const QString &proxyExecutable); 00098 00099 /** Returns a list containing additional command line arguments to be 00100 * passed to ProxyExecutable */ 00101 QString getProxyExecutableArguments() const; 00102 /** Sets the additional arguments to be passed to Proxy Executable */ 00103 void setProxyExecutableArguments(const QString &proxyExecutableArguments); 00104 00105 /** Returns true if Vidalia should automatically check for software updates. 00106 */ 00107 bool isAutoUpdateEnabled() const; 00108 /** Sets to <b>enabled</b> whether Vidalia should automatically check for 00109 * software updates or not. */ 00110 void setAutoUpdateEnabled(bool enabled); 00111 00112 /** Returns the time at which Vidalia last checked for software updates. */ 00113 QDateTime lastCheckedForUpdates() const; 00114 /** Sets to <b>checkedAt</b> the time at which Vidalia last checked for 00115 * available software updates. */ 00116 void setLastCheckedForUpdates(const QDateTime &checkedAt); 00117 00118 /** Returns true if Vidalia is currently configured to use a local GeoIP 00119 * database. */ 00120 bool useLocalGeoIpDatabase() const; 00121 /** Enables or disables use of a local GeoIP database. */ 00122 void setUseLocalGeoIpDatabase(bool enabled); 00123 00124 /** Returns the file, if set, to be used as the local GeoIP database. */ 00125 QString localGeoIpDatabase() const; 00126 /** Sets the file to use as a local GeoIP database. */ 00127 void setLocalGeoIpDatabase(const QString &databaseFile); 00128 }; 00129 00130 #endif 00131