index.html
Main Page
|
modules.html
Modules
|
namespaces.html
Namespace List
|
hierarchy.html
Class Hierarchy
|
annotated.html
Data Structures
|
dirs.html
Directories
|
files.html
File List
|
namespacemembers.html
Namespace Members
|
functions.html
Data Fields
|
pages.html
Related Pages
dir_000003.html
qt
server.cpp
00001
// -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002
/* server.h: Qt wrapper for DBusServer
00003
*
00004
* Copyright (C) 2003  Zack Rusin <zack@kde.org>
00005
*
00006
* Licensed under the Academic Free License version 2.0
00007
*
00008
* This program is free software; you can redistribute it and/or modify
00009
* it under the terms of the GNU General Public License as published by
00010
* the Free Software Foundation; either version 2 of the License, or
00011
* (at your option) any later version.
00012
*
00013
* This program is distributed in the hope that it will be useful,
00014
* but WITHOUT ANY WARRANTY; without even the implied warranty of
00015
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016
* GNU General Public License for more details.
00017
*
00018
* You should have received a copy of the GNU General Public License
00019
* along with this program; if not, write to the Free Software
00020
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021
*
00022
*/
00023
#include "server.h"
00024
#include "connection.h"
00025
00026
#include "integrator.h"
00027
using
classDBusQt_1_1Internal_1_1Integrator.html
DBusQt::Internal::Integrator
;
00028
00029
namespace
DBusQt
00030 {
00031
structDBusQt_1_1Server_1_1Private.html
00032
struct
structDBusQt_1_1Server_1_1Private.html
Server::Private
{
structDBusQt_1_1Server_1_1Private.html#a0
00033
structDBusQt_1_1Server_1_1Private.html#a0
Private
() :
structDBusQt_1_1Server_1_1Private.html#o0
integrator
( 0 ),
structDBusQt_1_1Server_1_1Private.html#o1
server
( 0 )
00034     {}
00035
structDBusQt_1_1Server_1_1Private.html#o0
00036
classDBusQt_1_1Internal_1_1Integrator.html
Integrator
*
structDBusQt_1_1Server_1_1Private.html#o0
integrator
;
structDBusQt_1_1Server_1_1Private.html#o1
00037
structDBusServer.html
DBusServer
*
structDBusQt_1_1Server_1_1Private.html#o1
server
;
structDBusQt_1_1Server_1_1Private.html#o2
00038
structDBusError.html
DBusError
structDBusQt_1_1Server_1_1Private.html#o2
error
;
00039 };
00040
classDBusQt_1_1Server.html#a0
00041
classDBusQt_1_1Server.html#a0
Server::Server
(
const
QString& addr, QObject *parent )
00042   : QObject( parent )
00043 {
00044   d =
new
structDBusQt_1_1Server_1_1Private.html
Private
;
00045
00046
if
( !addr.isEmpty() ) {
00047     init( addr );
00048   }
00049 }
00050
classDBusQt_1_1Server.html#a1
00051
classDBusQt_1_1Server.html#a1
Server::~Server
()
00052 {
00053
delete
d;
00054 }
00055
classDBusQt_1_1Server.html#a2
00056
bool
classDBusQt_1_1Server.html#a2
Server::isConnected
()
const
00057
{
00058
return
group__DBusServer.html#ga7
dbus_server_get_is_connected
( d->
structDBusQt_1_1Server_1_1Private.html#o1
server
);
00059 }
00060
classDBusQt_1_1Server.html#i1
00061
void
classDBusQt_1_1Server.html#i1
Server::disconnect
()
00062 {
00063
group__DBusServer.html#ga6
dbus_server_disconnect
( d->
structDBusQt_1_1Server_1_1Private.html#o1
server
);
00064 }
00065
classDBusQt_1_1Server.html#a3
00066
QString
classDBusQt_1_1Server.html#a3
Server::address
()
const
00067
{
00068
//FIXME: leak?
00069
return
group__DBusServer.html#ga8
dbus_server_get_address
( d->
structDBusQt_1_1Server_1_1Private.html#o1
server
);
00070 }
00071
classDBusQt_1_1Server.html#i0
00072
void
classDBusQt_1_1Server.html#i0
Server::listen
(
const
QString& addr )
00073 {
00074
if
( !d->
structDBusQt_1_1Server_1_1Private.html#o1
server
) {
00075     init( addr );
00076   }
00077 }
00078
00079
void
Server::init(
const
QString& addr )
00080 {
00081   d->
structDBusQt_1_1Server_1_1Private.html#o1
server
=
group__DBusServer.html#ga1
dbus_server_listen
( addr.ascii(),  &d->
structDBusQt_1_1Server_1_1Private.html#o2
error
);
00082   d->
structDBusQt_1_1Server_1_1Private.html#o0
integrator
=
new
classDBusQt_1_1Internal_1_1Integrator.html
Integrator
( d->
structDBusQt_1_1Server_1_1Private.html#o1
server
,
this
);
00083   connect( d->
structDBusQt_1_1Server_1_1Private.html#o0
integrator
, SIGNAL(newConnection(
classDBusQt_1_1Connection.html
Connection
*)),
00084            SIGNAL(newConnection(
classDBusQt_1_1Connection.html
Connection
*)) );
00085 }
00086
00087 }
00088
00089
00090
#include "server.moc"
Generated on Tue Sep 13 00:15:27 2005 for D-BUS by
http://www.doxygen.org/index.html
doxygen
1.4.4
