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 #ifndef _SERVICESETTINGS_H 00012 #define _SERVICESETTINGS_H 00013 00014 #include <torcontrol.h> 00015 #include <servicelist.h> 00016 #include "vidaliasettings.h" 00017 #include "exitpolicy.h" 00018 00019 /* XXX: Domenik: Shouldn't this inherit AbstractTorSettings like the rest of 00020 * the settings classes? */ 00021 class ServiceSettings : private VidaliaSettings 00022 { 00023 public: 00024 /** Constructor */ 00025 ServiceSettings(TorControl *torControl); 00026 /** Returns the service port for a specific service*/ 00027 QString getVirtualPort(); 00028 /** Set the service port for a specific service*/ 00029 void setVirtualPort(QString servicePort); 00030 /** Returns the .onion - service address for a specific service */ 00031 QString getServiceAddress(); 00032 /** Set the .onion - service address for a specific service */ 00033 void setServiceAddress(QString serviceAddress); 00034 /** Returns the service address or hostname for a specific service */ 00035 QString getPhysicalAddressPort(); 00036 /** Set the service address or hostname for a specific service */ 00037 void setPhysicalAddressPort(QString physicalAddress); 00038 /** Returns if the Service is enabled */ 00039 bool isEnabled(); 00040 /** Set the service enabled */ 00041 void setEnabled(bool enabled); 00042 /** Returns a ServiceList containing all services */ 00043 ServiceList getServices(); 00044 /** Set ServiceList to serialise it */ 00045 void setServices(ServiceList services); 00046 /** Get Service Directories */ 00047 QString getHiddenServiceDirectories(); 00048 /** Set all services the user wants to start and send it to the 00049 * Tor Controller */ 00050 void applyServices(QString value, QString *errmsg); 00051 /** Unpublish all services */ 00052 void unpublishAllServices(QString *errmsg); 00053 00054 private: 00055 /** A TorControl object used to talk to Tor. */ 00056 TorControl* _torControl; 00057 }; 00058 00059 #endif 00060