Sophie

Sophie

distrib > Mandriva > 2010.0 > x86_64 > media > main-release > by-pkgid > 909356775d9f2fd0157654b1f4c89fe9 > files > 27

decibel-0.7.1-0.889077.2mdv2010.0.x86_64.rpm

<head>
<title>Decibel Demos</title>
</head>
<body>

<p>
<em><b>Note:</b> You might want to also check <a href="http://techbase.kde.org/index.php?title=Development/Tutorials/Decibel/GettingStarted">Decibel's Gitting Started Tutorial</a> at <a href="http://techbase.kde.org/index.php?title=Welcome_to_KDE_TechBase">KDE Techbase</a>.</em>
</p>

<p>
<em><b>Note:</b> Decibel is no IM client. You can not use Decibel to chat with
your friends without additional software!</em>
</p>

<p>
<em><b>Note:</b> Decibel is software under active development. This
release is meant as a proof-of-concept implementation and was made
public for developers to look at. This release is not meant for
end users.
</em>
</p>

<p>
<em><b>Note:</b> This guide assumes that you have the Gabble connection
manager from Telepathy installed. Other connection managers like haze, butterfly
and others should work as well but are not as well tested.
</em>
</p>

<h1>Requirements</h1>
<p>
All demos require the decibel daemon to be up and running. After
building Decibel this daemon is located in
<code>src/server/decibel</code>. The daemon does (so far) not fork and
blocks the terminal it is run from: Very useful behaviour when debugging.
</p>
<p>
The Decibel daemon in turn requires a D-Bus session bus. Please see
the manual page of <code>dbus-launch</code> if you need help setting
up this service.
</p>

<h1>Walkthrough</h1>
<p>
This section gives a recommendation on which demos to run.
<ul>
<li>Store one of your registered accounts in the Decibel account manager
(see decibel_registeraccount_demo).
</li>
<li>List the stored accounts and note down the account handle
(see decibel_listaccounts_demo).
</li>
<li>Set the presence state of the account using the decibel_setpresence_demo.
</li>
<li>Connect to the account using some other account and your favourite
IM Client. Send a "ping?" message. Decibel will respond with a "pong!"
(see decibel_simpleclient_demo).
</li>
<li>Use Decibel to connect to your other account
(see decibel_chatstarter_demo).
</li>
</ul>
</p>

<h1>Accounthandling</h1>
<p>
The demos in <code>demos/accounthandling</code> are showing how to
manipulate the account storage of the Decibel daemon. They can be used
as simple command line tools to manipulate accounts known to Decibel.
</p>

<h2>decibel_registeraccount_demo</h2>
<p>
<b>Warning:</b> At this time passwords that are part of the account
data are stored in clear text in the configuration files of the
Decibel daemon. This will be fixed before Decibel 1.0.
</p>
<p>
This demo registers an account with the Decibel daemon. Note that this
command does <em>not</em> create new accounts and can only register
already existing accounts with Decibel.
</p>
<p>
The demo expects several sets of key-value pairs. These are of the
following form: <code>key=type:value</code> where type is either
<code>i</code> for integer values, <code>b> for bools (true or false)
or <code>s</code> for string values.  Other types are not supported by
this simplistic demo.
</p>
<p>
You must register all the keys the connection manager you wish to use
for the account requires (see the documentation of the connection manager
for a complete list). In addition to those settings Decibel requires a
further key-value pair: <code>decibel_protocol</code> of type
<code>s</code> containing the protocol this account is for.
</p>

<h2>decibel_deleteaccount_demo</h2>
<p>
This demo removes a account from Decibel's account storage. This demo
expects a account handle (see decibel_listaccounts_demo) and removes
the account associated with that handle.
</p>

<h2>decibel_listaccounts_demo</h2>
<p>
The listaccounts demo prints a list of all accounts known to Decibel
together with the account handle associated with it. It expects no
parameters.
</p>

<h2>decibel_setpresence_demo</h2>
<p>
This demo is used to manipulate the presence state of an account
managed by Decibel.
</p>
<p>
It expects two parameters and accepts an optional third. The first is
the handle to the account to change (see decibel_listaccounts_demo).
The second is the new presence level. This is an integer value in the
range of 1 to 6. 1 is Offline, 2 Available, 3 Away, 4 XA, 5 Hidden and 6
Busy.
</p>
<p>
The optional third argument is a presence message.
</p>
<p>
<b>Warning:</b> Changing the presence state from 1 to any other valid
value causes Decibel to create a connection to the server the account
is for. Changing from a valid value not equal to 1 to 1 disconnects
the account again.
</p>


<h1>Protocolhandling</h1>
<p>
The demos in <code>demos/protocolhandling</code> can be used to examine
various settings on the Telepathy Connection Managers.
</p>

<h2>decibel_listcms_demo</h2>
<p>
This demo lists all Telepathy Connection Managers installed in the
system. This demo does not expect any parameters.
</p>

<h2>decibel_supportedprotocols_demo</h2>
<p>
This demo lists all protocols supported by Telepathy Connection Managers
installed on the system. This demo does not expect any parameters.
</p>

<h2>decibel_listcmsfor_demo</h2>
<p>
This demo lists all Telepathy Connection Managers installed in the
system that support a protocol. This protocol has to be given as the
first parameter to the demo.
</p>

<h2>decibel_defaultcmfor_demo</h2>
<p>
This demo expects a protocol name as its only argument. It
reports the Telepathy connection manager configured in
Decibel to handle all connections made using this protocol.
</p>

<h2>decibel_setdefaultcmfor_demo</h2>
<p>
This demo expects two parameters. The first is a protocol name and the
second a name of a Telepathy Connection Manager installed.
</p>
<p>
Using this demo the Connection Manager used by Decibel to handle a
protocol can be changed. By default one of the possible Connection
Managers is chosen for each protocol supported.
</p>


<h1>Contacthandling</h1>
<p>
The demos in <code>demos/contacthandling</code> can be used to create
connections to contacts. Decibel communicates with the users personal
information management (PIM) system to get contact data and identifies
contacts by the IDs they got in that system.
</p>
<p>
<b>Note:</b> At this point in time the integration of Decibel with
the PIM system is not implemented yet. The SimplisticContactConnector
is a really simplistic contact management tool. It reads contact data
from an INI file in <code>~/.decibel_contact_data.ini</code>. For the
contacthandling demos to work you need to set up some contacts in this
file. See <code>docs/examples/decibel_contact_data.ini</code> for an
example file.
</p>

<h2>decibel_chatstarter_demo</h2>
<p>
This demo expects an account handle (see decibel_listaccounts_demo) and
a contact ID from the connected PIM system (or the INI file of the
SimplisticContactConnector).
</p>
<p>
I will cause Decibel to bring up the account associated with the
account handle checks whether the contact of the given ID is on line and
sends him a little ping-message.
</p>


<h1>simpleclient</h1>
<p>
By default the decibel_simpleclient_demo is started on incoming jabber
connections by the Decibel daemon. It uses D-Bus activation for this,
so a .service file needs to be installed into a D-Bus service directory.
During installation Decibel creates such a file (in <code>
demos/simpleclient</code> of the build directory) and installs it
into <code>share/dbus-1/services</code>. If the simpleclient is not
started on incoming jabber channels, then you might want to copy the
.service file into the <code>~/.local/dbus-1/services</code> directory
and try again.
</p>
<p>
As its name advertises this client is pretty simple: It sends a "pong!"
message in response to every "ping?" message it receives.
</p>

</body>