BALL 1.5.0
Loading...
Searching...
No Matches
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
14#endif
15
16#ifndef BALL_VIEW_KERNEL_MODULARWIDGET_H
18#endif
19
20#ifndef BALL_CONCEPT_OBJECTCREATOR_H
22#endif
23
24#ifndef BALL_SYSTEM_NETWORKING_H
26#endif
27
28#ifndef BALL_VIEW_KERNEL_THREADS_H
30#endif
31
32#include <QtCore/QTimer>
33#include <QtWidgets/QLabel>
34
35class QLabel;
36
37namespace BALL
38{
39 class Composite;
40
41 namespace VIEW
42 {
43 class ServerPreferences;
44 class Preferences;
45
60 : public QObject,
61 public ModularWidget
62 {
63 Q_OBJECT
64
65 public:
66
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
91 : public virtual BALLThread,
92 public virtual TCPServerThread
93 {
94 public:
95 BALLViewServer(ServerWidget* parent, Size port, bool restart = true);
96
101
102 virtual void run();
103
115 virtual void handleConnection();
116
118 void setLocked(bool is_locked);
119
120 protected:
123
126
129 };
130
134
142 ServerWidget(QWidget* parent = 0, const char* name = 0);
143
144 // only for Python interface
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
192
199
203
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
#define BALL_EMBEDDABLE(TYPE, BASE)
Definition embeddable.h:31
HashMap class based on the STL map (containing serveral convenience functions)
Definition hashMap.h:74
void handleLocking(bool lock)
virtual void applyPreferences()
virtual void dump(std::ostream &s=std::cout, Size depth=0) const
virtual void initializePreferencesTab(Preferences &preferences)
virtual void finalizePreferencesTab(Preferences &preferences)
virtual void initializeWidget(MainControl &main_control)
const ObjectCreator & getObjectCreator() const
void setPort(const int port)
void lockRequested(bool lock)
virtual bool isValid() const
ObjectCreator & getObjectCreator()
ServerWidget(const ServerWidget &server)
virtual void deactivate()
virtual void changeLock(bool lock)
virtual void finalizeWidget(MainControl &main_control)
ServerWidget(QWidget *parent=0, const char *name=0)
void registerObjectCreator(const ObjectCreator &s)
NotCompositeObject(const char *file, int line)
BALLViewServer(ServerWidget *parent, Size port, bool restart=true)
HashMap< unsigned long, Composite * > CompositeHashMap
#define BALL_DEPRECATED
#define BALL_VIEW_EXPORT