DBus-C++
Desktop Communication Bus System
Summary
Download
Tracker
Mailing Lists
Wiki
libdbus-c++ Documentation
0.9.0
Files
Data Structures
Globals
Main Page
include
dbus-c++
connection.h
Go to the documentation of this file.
1
/*
2
*
3
* D-Bus++ - C++ bindings for D-Bus
4
*
5
* Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com>
6
*
7
*
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License as published by the Free Software Foundation; either
11
* version 2.1 of the License, or (at your option) any later version.
12
*
13
* This library is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
17
*
18
* You should have received a copy of the GNU Lesser General Public
19
* License along with this library; if not, write to the Free Software
20
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
*
22
*/
23
24
25
#ifndef __DBUSXX_CONNECTION_H
26
#define __DBUSXX_CONNECTION_H
27
28
#include <list>
29
30
#include "
api.h
"
31
#include "
types.h
"
32
#include "
util.h
"
33
#include "
message.h
"
34
#include "
pendingcall.h
"
35
36
namespace
DBus
37
{
38
39
class
Connection
;
40
41
typedef
Slot<bool, const Message &>
MessageSlot
;
42
43
typedef
std::list<Connection>
ConnectionList
;
44
45
class
ObjectAdaptor
;
46
class
Dispatcher
;
47
48
class
DXXAPI
Connection
49
{
50
public
:
51
52
static
Connection
SystemBus();
53
54
static
Connection
SessionBus();
55
56
static
Connection
ActivationBus();
57
58
struct
Private;
59
60
typedef
std::list<Private *>
PrivatePList
;
61
62
Connection
(Private *);
63
64
Connection
(
const
char
*address,
bool
priv =
true
);
65
66
Connection
(
const
Connection
&c);
67
68
virtual
~
Connection
();
69
70
Dispatcher
*setup(
Dispatcher
*);
71
72
bool
operator == (
const
Connection
&)
const
;
73
130
void
add_match(
const
char
*rule);
131
144
void
remove_match(
const
char
*rule,
bool
throw_on_error);
145
157
bool
add_filter(
MessageSlot
&s);
158
168
void
remove_filter(
MessageSlot
&s);
169
200
bool
unique_name(
const
char
*n);
201
217
const
char
*unique_name()
const
;
218
263
bool
register_bus();
264
276
bool
connected()
const
;
277
315
void
disconnect();
316
329
void
exit_on_disconnect(
bool
exit);
330
334
void
flush();
335
356
bool
send(
const
Message
&msg,
unsigned
int
*serial = NULL);
357
383
Message
send_blocking(
Message
&msg,
int
timeout = -1);
384
410
PendingCall
send_async(
Message
&msg,
int
timeout = -1);
411
412
void
request_name(
const
char
*name,
int
flags = 0);
413
414
unsigned
long
sender_unix_uid(
const
char
*sender);
415
429
bool
has_name(
const
char
*name);
430
447
bool
start_service(
const
char
*name,
unsigned
long
flags);
448
449
const
std::vector<std::string>& names();
450
451
void
set_timeout(
int
timeout);
452
453
int
get_timeout();
454
455
private
:
456
457
DXXAPILOCAL
void
init();
458
459
private
:
460
461
RefPtrI<Private>
_pvt
;
462
int
_timeout
;
463
464
friend
class
ObjectAdaptor
;
// needed in order to register object paths for a connection
465
};
466
467
}
/* namespace DBus */
468
469
#endif//__DBUSXX_CONNECTION_H