BALL
1.5.0
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 <QtWidgets/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_DEPRECATED
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_DEPRECATED
BALL_VIEW_EXPORT
NotCompositeObject
: public Exception::GeneralException
79
{
80
public
:
81
82
NotCompositeObject
(
const
char
* file,
int
line);
83
};
84
86
90
class
BALL_DEPRECATED
BALLViewServer
91
:
public
virtual
BALLThread
,
92
public
virtual
TCPServerThread
93
{
94
public
:
95
BALLViewServer
(
ServerWidget
* parent,
Size
port,
bool
restart =
true
);
96
100
void
sendObject();
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
Q_SLOTS:
302
void
handleLocking(
bool
lock);
303
304
Q_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
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition:
COMMON/global.h:52
BALL::ObjectCreator
Definition:
objectCreator.h:35
hashMap.h
QWidget
BALL::HashMap< unsigned long, Composite * >
BALL::VIEW::BALLThread
Definition:
threads.h:70
objectCreator.h
BALL::VIEW::ServerWidget::BALLViewServer::CompositeHashMap
HashMap< unsigned long, Composite * > CompositeHashMap
Definition:
serverWidget.h:124
BALL_SIZE_TYPE
BALL_EMBEDDABLE
#define BALL_EMBEDDABLE(TYPE, BASE)
Definition:
embeddable.h:31
networking.h
QObject
BALL
Definition:
constants.h:12
BALL::VIEW::ServerWidget::deactivate
virtual void deactivate()
Definition:
serverWidget.h:173
BALL::VIEW::ServerWidget::NotCompositeObject
Definition:
serverWidget.h:78
BALL_DEPRECATED
#define BALL_DEPRECATED
Definition:
COMMON/global.h:64
modularWidget.h
BALL::VIEW::MainControl
Definition:
mainControl.h:114
BALL::VIEW::ServerWidget::BALLViewServer::parent_widget_
ServerWidget * parent_widget_
Definition:
serverWidget.h:121
BALL::VIEW::ServerWidget
Definition:
serverWidget.h:59
BALL::VIEW::ServerWidget::BALLViewServer::port_
Size port_
Definition:
serverWidget.h:127
common.h
BALL::VIEW::ModularWidget
Definition:
modularWidget.h:60
BALL::Composite
Definition:
composite.h:71
BALL::VIEW::ServerWidget::BALLViewServer
Definition:
serverWidget.h:90
BALL::TCPServerThread
Definition:
networking.h:94
threads.h
BALL::VIEW::Preferences
Definition:
preferences.h:40
BALL::VIEW::ServerPreferences
Definition:
serverPreferences.h:37
BALL::VIEW::ServerWidget::BALLViewServer::composite_hashmap_
CompositeHashMap composite_hashmap_
Definition:
serverWidget.h:125
BALL::VIEW::ServerWidget::BALLViewServer::is_locked_
bool is_locked_
Definition:
serverWidget.h:128
BALL::VIEW::ServerWidget::activate
virtual void activate()
Definition:
serverWidget.h:169
BALL::VIEW::ServerWidget::BALLViewServer::received_composite_
Composite * received_composite_
Definition:
serverWidget.h:122
Generated by
1.8.16