There is now a partially functional block display in the aesalon GUI.
[aesalon.git] / src / gui / ActiveSession.h
blobfe65adf56a352a7278e1bb81f23d7122ee66186d
1 #ifndef AESALON_GUI_ACTIVE_SESSION_H
2 #define AESALON_GUI_ACTIVE_SESSION_H
4 #include <QWidget>
5 #include <QTabWidget>
7 #include "Session.h"
8 #include "ActiveSessionSocket.h"
9 #include "ActiveSessionOverview.h"
10 #include "ActiveSessionBlockView.h"
12 #include "platform/Memory.h"
14 namespace Aesalon {
15 namespace GUI {
17 class ActiveSession : public QTabWidget { Q_OBJECT
18 public:
19 enum status_e {
20 INITIALIZING,
21 WAITING_FOR_CONNECTION,
22 CONNECTED,
23 CONNECTION_CLOSED
25 private:
26 Session *session;
28 Platform::Memory *memory;
29 ActiveSessionSocket *socket;
30 ActiveSessionOverview *overview;
31 ActiveSessionBlockView *block_view;
33 status_e status;
34 void set_status(status_e new_status) {
35 if(new_status == status) return;
36 status = new_status;
37 emit status_changed(get_status_as_string());
39 public:
40 ActiveSession(Session *session, QWidget *parent = 0);
41 virtual ~ActiveSession();
43 void execute();
45 Platform::Memory *get_memory() const { return memory; }
47 status_e get_status() const { return status; }
48 QString get_status_as_string() const;
50 void connect_to(QString host, int port);
51 public slots:
52 void terminate_session() { emit close_session(this); }
53 void socket_connection();
54 void socket_disconnection();
55 signals:
56 void close_session(ActiveSession *session);
57 void status_changed(QString new_status);
60 } // namespace GUI
61 } // namespace Aesalon
63 #endif