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
20{
21public:
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 */
42 /** Sets the adress of a service */
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
63private:
64 /** The adress of the service */
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 */
74 /** Some additional service options, not configured/displayed by Vidalia */
76
77};
79#endif /*SERIVCE_H_*/
80
Q_DECLARE_METATYPE(Service)
QString virtualPort() const
Definition: Service.h:32
void setAdditionalServiceOptions(QString options)
Definition: Service.cpp:66
void setEnabled(bool enabled)
Definition: Service.cpp:36
void setVirtualPort(QString virtualPort)
Definition: Service.cpp:48
QString _serviceDirectory
Definition: Service.h:71
QString physicalAddressPort() const
Definition: Service.h:34
void setServiceAddress(QString serviceAddress)
Definition: Service.cpp:42
void setServiceDirectory(QString serviceDirectory)
Definition: Service.cpp:60
QString serviceDirectory() const
Definition: Service.h:36
QString additionalServiceOptions() const
Definition: Service.h:40
friend QDataStream & operator<<(QDataStream &out, const Service &myObj)
Definition: Service.cpp:73
friend QDataStream & operator>>(QDataStream &in, Service &myObj)
Definition: Service.cpp:87
QString toString()
Definition: Service.cpp:114
bool enabled() const
Definition: Service.h:38
QString _virtualPort
Definition: Service.h:67
void setPhysicalAddressPort(QString physicalAddressPort)
Definition: Service.cpp:54
QString serviceAddress() const
Definition: Service.h:30
QString _additionalServiceOptions
Definition: Service.h:75
QString _serviceAddress
Definition: Service.h:65
Service()
Definition: Service.cpp:15
QString _physicalAddressPort
Definition: Service.h:69
bool _enabled
Definition: Service.h:73
virtual ~Service()
Definition: Service.cpp:31