Vidalia  0.3.1
Service.h
Go to the documentation of this file.
1 /*
2 ** This file is part of Vidalia, and is subject to the license terms in the
3 ** LICENSE file, found in the top level directory of this distribution. If you
4 ** did not receive the LICENSE file with this file, you may obtain it from the
5 ** Vidalia source package distributed by the Vidalia Project at
6 ** http://www.torproject.org/projects/vidalia.html. No part of Vidalia,
7 ** including this file, may be copied, modified, propagated, or distributed
8 ** except according to the terms described in the LICENSE file.
9 */
10 
11 #ifndef _SERVICE_H
12 #define _SERVICE_H
13 
14 #include <QString>
15 #include <QList>
16 #include <QMetaType>
17 
18 
19 class Service
20 {
21 public:
22  /** Default constructor. */
23  Service();
24  /** Constructor to create a new Service with initial settings */
25  Service(QString serviceAddress, QString virtualPort,
26  QString physicalAddressPort, QString serviceDirectory, bool enabled);
27  /** Destructor */
28  virtual ~Service();
29  /** Returns the service Adress of the service */
30  QString serviceAddress() const { return _serviceAddress; }
31  /** Returns the listeningPort of the service */
32  QString virtualPort() const { return _virtualPort; }
33  /** Returns the physical Adresse and the local Port of the service */
34  QString physicalAddressPort() const { return _physicalAddressPort; }
35  /** Returns the service directory of the service */
36  QString serviceDirectory() const { return _serviceDirectory; }
37  /** Returns the deployed status of a service */
38  bool enabled() const { return _enabled; }
39  /** Returns the additional options of a service e.g. excludeNodes */
40  QString additionalServiceOptions() const
41  { return _additionalServiceOptions; }
42  /** Sets the adress of a service */
43  void setServiceAddress(QString serviceAddress);
44  /** Sets the listening port of a service */
45  void setVirtualPort(QString virtualPort);
46  /** Sets the physical Adress and the local Port of a service */
48  /** Sets the service directory of a service */
50  /** Sets the deployed status a service */
51  void setEnabled(bool enabled);
52  /** Sets the additional options of a service e.g. excludeNodes */
53  void setAdditionalServiceOptions(QString options);
54  /** Writes service class data from <b>myObj</b> to the QDataStream
55  * <b>out</b>. */
56  friend QDataStream& operator<<(QDataStream &out, const Service &myObj);
57  /** Reads service class data in from the QDataStream <b>in</b> and
58  populates * the <b>myObj</b> object accordingly. */
59  friend QDataStream& operator>>(QDataStream &in, Service &myObj);
60  /** this method creates a string by concatenating the values of the service */
61  QString toString();
62 
63 private:
64  /** The adress of the service */
65  QString _serviceAddress;
66  /** The listening Port of the service */
67  QString _virtualPort;
68  /** The physical Adress and the local port of teh service */
70  /** the directory of the service */
72  /** The Enabled status of the service */
73  bool _enabled;
74  /** Some additional service options, not configured/displayed by Vidalia */
76 
77 };
79 #endif /*SERIVCE_H_*/
80 
Service::setPhysicalAddressPort
void setPhysicalAddressPort(QString physicalAddressPort)
Definition: Service.cpp:54
Service::setServiceAddress
void setServiceAddress(QString serviceAddress)
Definition: Service.cpp:42
Service::_serviceAddress
QString _serviceAddress
Definition: Service.h:65
Service::_virtualPort
QString _virtualPort
Definition: Service.h:67
Service::_enabled
bool _enabled
Definition: Service.h:73
Service::serviceAddress
QString serviceAddress() const
Definition: Service.h:30
Service::~Service
virtual ~Service()
Definition: Service.cpp:31
Service::setServiceDirectory
void setServiceDirectory(QString serviceDirectory)
Definition: Service.cpp:60
Service::setAdditionalServiceOptions
void setAdditionalServiceOptions(QString options)
Definition: Service.cpp:66
Service::_physicalAddressPort
QString _physicalAddressPort
Definition: Service.h:69
Service::_additionalServiceOptions
QString _additionalServiceOptions
Definition: Service.h:75
Service
Definition: Service.h:19
Service::physicalAddressPort
QString physicalAddressPort() const
Definition: Service.h:34
Service::operator>>
friend QDataStream & operator>>(QDataStream &in, Service &myObj)
Definition: Service.cpp:87
Service::enabled
bool enabled() const
Definition: Service.h:38
Service::Service
Service()
Definition: Service.cpp:15
Service::_serviceDirectory
QString _serviceDirectory
Definition: Service.h:71
Service::virtualPort
QString virtualPort() const
Definition: Service.h:32
Service::toString
QString toString()
Definition: Service.cpp:114
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(Service)
Service::additionalServiceOptions
QString additionalServiceOptions() const
Definition: Service.h:40
Service::setEnabled
void setEnabled(bool enabled)
Definition: Service.cpp:36
Service::serviceDirectory
QString serviceDirectory() const
Definition: Service.h:36
Service::operator<<
friend QDataStream & operator<<(QDataStream &out, const Service &myObj)
Definition: Service.cpp:73
Service::setVirtualPort
void setVirtualPort(QString virtualPort)
Definition: Service.cpp:48