DBus-1-TQt
1.0
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
tqdbusconnection_p.h
Go to the documentation of this file.
1
/* qdbusconnection_p.h TQT_DBusConnection private object
2
*
3
* Copyright (C) 2005 Harald Fernengel <harry@kdevelop.org>
4
* Copyright (C) 2005 Kevin Krammer <kevin.krammer@gmx.at>
5
*
6
* Licensed under the Academic Free License version 2.1
7
*
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version.
12
*
13
* This program 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
16
* GNU General Public License for more details.
17
*
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
21
* USA.
22
*
23
*/
24
25
//
26
// W A R N I N G
27
// -------------
28
//
29
// This file is not part of the public API. This header file may
30
// change from version to version without notice, or even be
31
// removed.
32
//
33
// We mean it.
34
//
35
//
36
37
#ifndef TQDBUSCONNECTION_P_H
38
#define TQDBUSCONNECTION_P_H
39
40
#include <tqguardedptr.h>
41
#include <tqmap.h>
42
#include <tqobject.h>
43
#include <tqvaluelist.h>
44
45
#include <dbus/dbus.h>
46
47
#include "
tqdbusatomic.h
"
48
#include "
tqdbuserror.h
"
49
#include "
tqdbusobject.h
"
50
#include "
tqdbusmessage.h
"
51
52
class
TQT_DBusMessage
;
53
class
TQSocketNotifier;
54
class
TQTimer;
55
class
TQTimerEvent;
56
57
struct
DBusConnection;
58
struct
DBusServer;
59
60
class
TQT_DBusResultInfo
61
{
62
public
:
63
TQT_DBusMessage
message
;
64
TQObject*
receiver
;
65
TQCString
method
;
66
};
67
typedef
TQValueList<TQT_DBusResultInfo>
TQT_DBusResultInfoList
;
68
69
class
TQT_DBusConnectionPrivate
:
public
TQObject
70
{
71
Q_OBJECT
72
73
74
public
:
75
TQT_DBusConnectionPrivate
(TQObject *parent = 0);
76
~TQT_DBusConnectionPrivate
();
77
78
void
bindToApplication
();
79
80
void
setConnection
(DBusConnection *
connection
);
81
void
setServer
(DBusServer *
server
);
82
void
closeConnection
();
83
void
timerEvent
(TQTimerEvent *e);
84
85
bool
handleSignal
(DBusMessage *msg);
86
bool
handleObjectCall
(DBusMessage *message);
87
bool
handleError
();
88
89
void
emitPendingCallReply
(
const
TQT_DBusMessage
& message);
90
91
signals:
92
void
dbusSignal
(
const
TQT_DBusMessage
& message);
93
94
void
dbusPendingCallReply
(
const
TQT_DBusMessage
& message);
95
96
public
slots:
97
void
socketRead
(
int
);
98
void
socketWrite
(
int
);
99
100
void
objectDestroyed
(TQObject*
object
);
101
102
void
purgeRemovedWatches
();
103
104
void
scheduleDispatch
();
105
void
dispatch
();
106
107
public
:
108
DBusError
error
;
109
TQT_DBusError
lastError
;
110
111
enum
ConnectionMode
{
InvalidMode
,
ServerMode
,
ClientMode
};
112
113
// FIXME TQAtomic ref;
114
Atomic
ref
;
115
ConnectionMode
mode
;
116
DBusConnection *
connection
;
117
DBusServer *
server
;
118
119
TQTimer*
dispatcher
;
120
121
static
int
messageMetaType
;
122
static
int
registerMessageMetaType
();
123
int
sendWithReplyAsync
(
const
TQT_DBusMessage
&message, TQObject *receiver,
124
const
char
*method);
125
void
flush
();
126
127
struct
Watcher
128
{
129
Watcher
():
watch
(0),
read
(0),
write
(0) {}
130
DBusWatch *
watch
;
131
TQSocketNotifier *
read
;
132
TQSocketNotifier *
write
;
133
};
134
// FIXME typedef TQMultiHash<int, Watcher> WatcherHash;
135
typedef
TQValueList<Watcher>
WatcherList
;
136
WatcherList
removedWatches
;
137
typedef
TQMap<int, WatcherList>
WatcherHash
;
138
WatcherHash
watchers
;
139
140
// FIXME typedef TQHash<int, DBusTimeout *> TimeoutHash;
141
typedef
TQMap<int, DBusTimeout*>
TimeoutHash
;
142
TimeoutHash
timeouts
;
143
144
typedef
TQMap<TQString, TQT_DBusObjectBase*>
ObjectMap
;
145
ObjectMap
registeredObjects
;
146
147
TQValueList<DBusTimeout *>
pendingTimeouts
;
148
149
struct
TQT_DBusPendingCall
150
{
151
TQGuardedPtr<TQObject>
receiver
;
152
TQCString
method
;
153
DBusPendingCall *
pending
;
154
};
155
typedef
TQMap<DBusPendingCall*, TQT_DBusPendingCall*>
PendingCallMap
;
156
PendingCallMap
pendingCalls
;
157
158
typedef
TQValueList<TQT_DBusMessage>
PendingMessagesForEmit
;
159
PendingMessagesForEmit
pendingMessages
;
160
161
bool
inDispatch
;
162
163
TQT_DBusResultInfoList
m_resultEmissionQueue
;
164
165
public
:
166
void
newMethodInResultEmissionQueue
();
167
168
private
slots:
169
void
transmitResultEmissionQueue
();
170
void
transmitMessageEmissionQueue
();
171
172
private
:
173
TQTimer*
m_resultEmissionQueueTimer
;
174
TQTimer*
m_messageEmissionQueueTimer
;
175
};
176
177
#endif
build
buildd
dbus-1-tqt-14.1.0~r197
src
tqdbusconnection_p.h
Generated on Mon Feb 3 2020 00:28:22 for DBus-1-TQt by
1.8.1.2