BALL
1.4.2
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
BALL
VIEW
KERNEL
serverWidget.h
Go to the documentation of this file.
1
// -*- Mode: C++; tab-width: 2; -*-
2
// vi: set ts=2:
3
//
4
5
#ifndef BALL_VIEW_KERNEL_SERVERWIDGET_H
6
#define BALL_VIEW_KERNEL_SERVERWIDGET_H
7
8
#ifndef BALL_COMMON_H
9
# include <
BALL/common.h
>
10
#endif
11
12
#ifndef BALL_DATATYPE_HASHMAP_H
13
# include <
BALL/DATATYPE/hashMap.h
>
14
#endif
15
16
#ifndef BALL_VIEW_KERNEL_MODULARWIDGET_H
17
# include <
BALL/VIEW/KERNEL/modularWidget.h
>
18
#endif
19
20
#ifndef BALL_CONCEPT_OBJECTCREATOR_H
21
# include <
BALL/CONCEPT/objectCreator.h
>
22
#endif
23
24
#ifndef BALL_SYSTEM_NETWORKING_H
25
# include <
BALL/SYSTEM/networking.h
>
26
#endif
27
28
#ifndef BALL_VIEW_KERNEL_THREADS_H
29
# include <
BALL/VIEW/KERNEL/threads.h
>
30
#endif
31
32
#include <QtCore/QTimer>
33
#include <QtGui/QLabel>
34
35
class
QLabel;
36
37
namespace
BALL
38
{
39
class
Composite;
40
41
namespace
VIEW
42
{
43
class
ServerPreferences;
44
class
Preferences;
45
59
class
BALL_VIEW_EXPORT
ServerWidget
60
:
public
QObject
,
61
public
ModularWidget
62
{
63
Q_OBJECT
64
65
public
:
66
67
BALL_EMBEDDABLE
(
ServerWidget
,
ModularWidget
)
68
69
72
73
78
class
BALL_VIEW_EXPORT
NotCompositeObject
: public Exception::GeneralException
79
{
80
public
:
81
82
NotCompositeObject
(
const
char
* file,
int
line);
83
};
84
86
90
class
BALLViewServer
91
:
public
virtual
BALLThread
,
92
public
virtual
TCPServerThread
93
{
94
public
:
95
BALLViewServer
(
ServerWidget
* parent,
Size
port,
bool
restart =
true
);
96
99
void
sendObject()
100
throw
(
NotCompositeObject
);
101
102
virtual
void
run();
103
115
virtual
void
handleConnection();
116
118
void
setLocked(
bool
is_locked);
119
120
protected
:
121
ServerWidget
*
parent_widget_
;
122
Composite
*
received_composite_
;
123
124
typedef
HashMap<unsigned long, Composite *>
CompositeHashMap
;
125
CompositeHashMap
composite_hashmap_
;
126
127
Size
port_
;
128
bool
is_locked_
;
129
};
130
134
142
ServerWidget
(
QWidget
* parent = 0,
const
char
* name = 0);
143
144
// only for Python interface
145
ServerWidget
(
const
ServerWidget
& server);
146
148
151
154
virtual
~
ServerWidget
();
155
160
virtual
void
clear();
162
166
169
virtual
void
activate
() {};
170
173
virtual
void
deactivate
() {};
174
178
void
setPort(
const
int
port);
179
184
int
getPort()
const
;
185
191
void
registerObjectCreator(
const
ObjectCreator
& s);
192
198
void
unregisterObjectCreator();
199
202
ObjectCreator
& getObjectCreator();
203
206
const
ObjectCreator
& getObjectCreator()
const
;
207
215
virtual
void
initializeWidget(
MainControl
& main_control);
216
225
virtual
void
finalizeWidget(
MainControl
& main_control);
226
239
virtual
void
initializePreferencesTab(
Preferences
&preferences);
240
253
virtual
void
finalizePreferencesTab(
Preferences
&preferences);
254
266
virtual
void
applyPreferences();
267
269
272
278
virtual
bool
isValid()
const
;
279
286
virtual
void
dump(std::ostream& s = std::cout,
Size
depth = 0)
const
;
287
295
virtual
void
changeLock(
bool
lock);
296
298
301
public
slots:
302
void
handleLocking(
bool
lock);
303
304
signals:
305
void
lockRequested(
bool
lock);
306
308
private
:
309
311
BALLViewServer
server_
;
312
315
ObjectCreator
*
object_creator_
;
316
317
// the port to bind to
318
int
port_
;
319
320
ServerPreferences
*
server_preferences_
;
321
QLabel *
server_icon_
;
322
static
const
char
*mini_ray_xpm_[];
323
};
324
325
326
# ifndef BALL_NO_INLINE_FUNCTIONS
327
# include <BALL/VIEW/KERNEL/serverWidget.iC>
328
# endif
329
330
}
// namespace VIEW
331
}
// namespace BALL
332
333
#endif // BALL_VIEW_KERNEL_SERVER_H
Generated by
1.8.3.1