Vidalia 0.2.10

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