Sophie

Sophie

distrib > Mandriva > 2010.2 > i586 > by-pkgid > 9601c7beb4ff23e834bfa171795ed560 > files > 285

vidalia-0.2.9-1mdv2010.1.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Vidalia: Service.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="dir_b47abd1aad201a152869566145babb61.html">src</a>&nbsp;&raquo;&nbsp;<a class="el" href="dir_695ba8f8357372e02d38c40b3c6dbe81.html">vidalia</a>&nbsp;&raquo;&nbsp;<a class="el" href="dir_738aec08306f4b898e01f7a551299457.html">config</a>
  </div>
</div>
<div class="contents">
<h1>Service.h</h1><a href="_service_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment">**  This file is part of Vidalia, and is subject to the license terms in the</span>
<a name="l00003"></a>00003 <span class="comment">**  LICENSE file, found in the top level directory of this distribution. If you</span>
<a name="l00004"></a>00004 <span class="comment">**  did not receive the LICENSE file with this file, you may obtain it from the</span>
<a name="l00005"></a>00005 <span class="comment">**  Vidalia source package distributed by the Vidalia Project at</span>
<a name="l00006"></a>00006 <span class="comment">**  http://www.vidalia-project.net/. No part of Vidalia, including this file,</span>
<a name="l00007"></a>00007 <span class="comment">**  may be copied, modified, propagated, or distributed except according to the</span>
<a name="l00008"></a>00008 <span class="comment">**  terms described in the LICENSE file.</span>
<a name="l00009"></a>00009 <span class="comment">*/</span>
<a name="l00010"></a>00010 
<a name="l00011"></a>00011 <span class="preprocessor">#ifndef _SERVICE_H</span>
<a name="l00012"></a>00012 <span class="preprocessor"></span><span class="preprocessor">#define _SERVICE_H</span>
<a name="l00013"></a>00013 <span class="preprocessor"></span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;QString&gt;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;QList&gt;</span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;QMetaType&gt;</span>
<a name="l00017"></a>00017 
<a name="l00018"></a>00018 
<a name="l00019"></a><a class="code" href="class_service.html">00019</a> <span class="keyword">class </span><a class="code" href="class_service.html">Service</a>
<a name="l00020"></a>00020 {
<a name="l00021"></a>00021 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00022"></a>00022 <span class="comment">  /** Default constructor. */</span>
<a name="l00023"></a>00023   <a class="code" href="class_service.html#acc246c9f7ed3c51e2d91d10fe257513f">Service</a>();<span class="comment"></span>
<a name="l00024"></a>00024 <span class="comment">  /** Constructor to create a new Service with initial settings */</span>
<a name="l00025"></a>00025   <a class="code" href="class_service.html#acc246c9f7ed3c51e2d91d10fe257513f">Service</a>(QString <a class="code" href="class_service.html#a3a2658b480a8e85624a2489620874bce">serviceAddress</a>, QString <a class="code" href="class_service.html#aea9c2bece5e597613aa38ac0930a7e77">virtualPort</a>,
<a name="l00026"></a>00026    QString <a class="code" href="class_service.html#a3a6c7c4f2726761e319b5f14a545b5d6">physicalAddressPort</a>, QString <a class="code" href="class_service.html#a637c140798a9fd640915781fe1828907">serviceDirectory</a>, <span class="keywordtype">bool</span> <a class="code" href="class_service.html#aef9f50c7e6b18fd504ed8e1a68f2a46c">enabled</a>);<span class="comment"></span>
<a name="l00027"></a>00027 <span class="comment">  /** Destructor */</span>
<a name="l00028"></a>00028   <span class="keyword">virtual</span> <a class="code" href="class_service.html#af6c3577b59652ac817d1d76aaccee904">~Service</a>();<span class="comment"></span>
<a name="l00029"></a>00029 <span class="comment">  /** Returns the service Adress of the service */</span>
<a name="l00030"></a><a class="code" href="class_service.html#a3a2658b480a8e85624a2489620874bce">00030</a>   QString <a class="code" href="class_service.html#a3a2658b480a8e85624a2489620874bce">serviceAddress</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="class_service.html#ac5a275edff8388b1f008eef54fc24832">_serviceAddress</a>; }<span class="comment"></span>
<a name="l00031"></a>00031 <span class="comment">  /** Returns the listeningPort of the service */</span>
<a name="l00032"></a><a class="code" href="class_service.html#aea9c2bece5e597613aa38ac0930a7e77">00032</a>   QString <a class="code" href="class_service.html#aea9c2bece5e597613aa38ac0930a7e77">virtualPort</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="class_service.html#a9078c614529b395b8a5909d0ccf68b28">_virtualPort</a>; }<span class="comment"></span>
<a name="l00033"></a>00033 <span class="comment">  /** Returns the physical Adresse and the local Port of the service */</span>
<a name="l00034"></a><a class="code" href="class_service.html#a3a6c7c4f2726761e319b5f14a545b5d6">00034</a>   QString <a class="code" href="class_service.html#a3a6c7c4f2726761e319b5f14a545b5d6">physicalAddressPort</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="class_service.html#add804af423f30e80038bce290542b1b4">_physicalAddressPort</a>; }<span class="comment"></span>
<a name="l00035"></a>00035 <span class="comment">  /** Returns the service directory of the service */</span>
<a name="l00036"></a><a class="code" href="class_service.html#a637c140798a9fd640915781fe1828907">00036</a>   QString <a class="code" href="class_service.html#a637c140798a9fd640915781fe1828907">serviceDirectory</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="class_service.html#a1a2a554a4078585139d48f6c9f624781">_serviceDirectory</a>; }<span class="comment"></span>
<a name="l00037"></a>00037 <span class="comment">  /** Returns the deployed status of a service */</span>
<a name="l00038"></a><a class="code" href="class_service.html#aef9f50c7e6b18fd504ed8e1a68f2a46c">00038</a>   <span class="keywordtype">bool</span> <a class="code" href="class_service.html#aef9f50c7e6b18fd504ed8e1a68f2a46c">enabled</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="class_service.html#ade2a8e62b4b91a888a2b37389e508702">_enabled</a>; }<span class="comment"></span>
<a name="l00039"></a>00039 <span class="comment">  /** Returns the additional options of a service e.g. excludeNodes */</span>
<a name="l00040"></a><a class="code" href="class_service.html#a3cb14491d454716b934a858c4b2b86de">00040</a>   QString <a class="code" href="class_service.html#a3cb14491d454716b934a858c4b2b86de">additionalServiceOptions</a>()<span class="keyword"> const</span>
<a name="l00041"></a>00041 <span class="keyword">   </span>{ <span class="keywordflow">return</span> <a class="code" href="class_service.html#ab609a784c85c35f19112eb3d7bfbac04">_additionalServiceOptions</a>; }<span class="comment"></span>
<a name="l00042"></a>00042 <span class="comment">  /** Sets the adress of a service */</span>
<a name="l00043"></a>00043   <span class="keywordtype">void</span> <a class="code" href="class_service.html#a37fcb4c961ec93a75959d3aa15350c36">setServiceAddress</a>(QString serviceAddress);<span class="comment"></span>
<a name="l00044"></a>00044 <span class="comment">  /** Sets the listening port of a service */</span>
<a name="l00045"></a>00045   <span class="keywordtype">void</span> <a class="code" href="class_service.html#a18d8888704b5ea541ca4c2044e71fe7f">setVirtualPort</a>(QString virtualPort);<span class="comment"></span>
<a name="l00046"></a>00046 <span class="comment">  /** Sets the physical Adress and the local Port of a service */</span>
<a name="l00047"></a>00047   <span class="keywordtype">void</span> <a class="code" href="class_service.html#a96bcc6eb04e84dd8cefa764e30f32c86">setPhysicalAddressPort</a>(QString physicalAddressPort);<span class="comment"></span>
<a name="l00048"></a>00048 <span class="comment">  /** Sets the service directory of a service */</span>
<a name="l00049"></a>00049   <span class="keywordtype">void</span> <a class="code" href="class_service.html#a3afd6a55ad5b67873e761048f5219a5a">setServiceDirectory</a>(QString serviceDirectory);<span class="comment"></span>
<a name="l00050"></a>00050 <span class="comment">  /** Sets the deployed status a service */</span>
<a name="l00051"></a>00051   <span class="keywordtype">void</span> <a class="code" href="class_service.html#a1764fb4b447daa44741d09f0d88dc336">setEnabled</a>(<span class="keywordtype">bool</span> enabled);<span class="comment"></span>
<a name="l00052"></a>00052 <span class="comment">  /** Sets the additional options of a service e.g. excludeNodes */</span>
<a name="l00053"></a>00053   <span class="keywordtype">void</span> <a class="code" href="class_service.html#a13110e175d38f18fadbee75a3e97988b">setAdditionalServiceOptions</a>(QString options);<span class="comment"></span>
<a name="l00054"></a>00054 <span class="comment">  /** Writes service class data from &lt;b&gt;myObj&lt;/b&gt; to the QDataStream</span>
<a name="l00055"></a>00055 <span class="comment">  * &lt;b&gt;out&lt;/b&gt;. */</span>
<a name="l00056"></a>00056   <span class="keyword">friend</span> QDataStream&amp; <a class="code" href="class_service.html#a8e330dcc8ca3e2fa1f31b4a913342dcf">operator&lt;&lt;</a>(QDataStream &amp;out, <span class="keyword">const</span> <a class="code" href="class_service.html">Service</a> &amp;myObj);<span class="comment"></span>
<a name="l00057"></a>00057 <span class="comment">  /** Reads service class data in from the QDataStream &lt;b&gt;in&lt;/b&gt; and</span>
<a name="l00058"></a>00058 <span class="comment">  populates * the &lt;b&gt;myObj&lt;/b&gt; object accordingly. */</span>
<a name="l00059"></a>00059   <span class="keyword">friend</span> QDataStream&amp; <a class="code" href="class_service.html#a7a67d278b3544843cc60663920e7dd25">operator&gt;&gt;</a>(QDataStream &amp;in, <a class="code" href="class_service.html">Service</a> &amp;myObj);<span class="comment"></span>
<a name="l00060"></a>00060 <span class="comment">  /** this method creates a string by concatenating the values of the service */</span>
<a name="l00061"></a>00061   QString <a class="code" href="class_service.html#a6e895467f1c027bcb087b9368000d4cf">toString</a>();
<a name="l00062"></a>00062 
<a name="l00063"></a>00063 <span class="keyword">private</span>:<span class="comment"></span>
<a name="l00064"></a>00064 <span class="comment">  /** The adress of the service */</span>
<a name="l00065"></a><a class="code" href="class_service.html#ac5a275edff8388b1f008eef54fc24832">00065</a>   QString <a class="code" href="class_service.html#ac5a275edff8388b1f008eef54fc24832">_serviceAddress</a>;<span class="comment"></span>
<a name="l00066"></a>00066 <span class="comment">  /** The listening Port of the service */</span>
<a name="l00067"></a><a class="code" href="class_service.html#a9078c614529b395b8a5909d0ccf68b28">00067</a>   QString <a class="code" href="class_service.html#a9078c614529b395b8a5909d0ccf68b28">_virtualPort</a>;<span class="comment"></span>
<a name="l00068"></a>00068 <span class="comment">  /** The physical Adress and the local port of teh service */</span>
<a name="l00069"></a><a class="code" href="class_service.html#add804af423f30e80038bce290542b1b4">00069</a>   QString <a class="code" href="class_service.html#add804af423f30e80038bce290542b1b4">_physicalAddressPort</a>;<span class="comment"></span>
<a name="l00070"></a>00070 <span class="comment">  /** the directory of the service */</span>
<a name="l00071"></a><a class="code" href="class_service.html#a1a2a554a4078585139d48f6c9f624781">00071</a>   QString <a class="code" href="class_service.html#a1a2a554a4078585139d48f6c9f624781">_serviceDirectory</a>;<span class="comment"></span>
<a name="l00072"></a>00072 <span class="comment">  /** The Enabled status of the service */</span>
<a name="l00073"></a><a class="code" href="class_service.html#ade2a8e62b4b91a888a2b37389e508702">00073</a>   <span class="keywordtype">bool</span> <a class="code" href="class_service.html#ade2a8e62b4b91a888a2b37389e508702">_enabled</a>;<span class="comment"></span>
<a name="l00074"></a>00074 <span class="comment">  /** Some additional service options, not configured/displayed by Vidalia */</span>
<a name="l00075"></a><a class="code" href="class_service.html#ab609a784c85c35f19112eb3d7bfbac04">00075</a>   QString <a class="code" href="class_service.html#ab609a784c85c35f19112eb3d7bfbac04">_additionalServiceOptions</a>;
<a name="l00076"></a>00076 
<a name="l00077"></a>00077 };
<a name="l00078"></a>00078 <a class="code" href="_bootstrap_status_8h.html#afaaf387126a2702e569ea02dabb890d0">Q_DECLARE_METATYPE</a>(<a class="code" href="class_service.html">Service</a>);
<a name="l00079"></a>00079 <span class="preprocessor">#endif </span><span class="comment">/*SERIVCE_H_*/</span>
<a name="l00080"></a>00080 
</pre></div></div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Mon Aug 30 22:58:54 2010 for Vidalia by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>