Fork me on GitHub
2.15.20
FGx
A cross-platform launcher for FlightGear
telnetslave.h
Go to the documentation of this file.
1 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-
2 // FGx FlightGear Launcher // telnetslave.h
3 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-
4 // (c) 2010-2012
5 // Yves Sablonier, Pete Morgan
6 // Geoff McLane
7 // GNU GPLv2, see main.cpp and shipped licence.txt for further information
8 
9 #ifndef TELNETSLAVE_H
10 #define TELNETSLAVE_H
11 
12 #include <QObject>
13 #include <QString>
14 #include <QQueue>
15 #include <QTcpSocket>
16 
17 /*
18 void connected ()
19 void disconnected ()
20 void error ( QAbstractSocket::SocketError socketError )
21 void hostFound ()
22 void proxyAuthenticationRequired ( const QNetworkProxy & proxy, QAuthenticator * authenticator )
23 void stateChanged ( QAbstractSocket::SocketState socketState )
24 */
25 
26 class TelnetSlave : public QObject
27 {
28 Q_OBJECT
29 public:
30  explicit TelnetSlave(QObject *parent = 0);
31 
32  QString hostAddress;
33  int port;
34  QQueue<QString> que;
35 
37 
38  bool in_request;
39 
40  void telnet_connect(QString address, int port);
41  void telnet_disconnect();
42  void get_node(QString path);
43  void set_property(QString path, QString value);
44 
45  void add_que(QString node);
46 
47 private:
48  QTcpSocket *socket;
49 
50 signals:
51  void telnet_error(QAbstractSocket::SocketError, QString);
52  void telnet_connected(bool);
53 
54  void props_folder(QString, QString);
55  void props_value(QString, QString, QString, QString);
56  //void telnet_data(Q);
57 
58 public slots:
59  void on_connected();
60  void on_ready_read();
61  void on_disconnected();
62  void on_error(QAbstractSocket::SocketError);
63  void on_host_found();
64  void on_state_changed(QAbstractSocket::SocketState);
65 };
66 
67 #endif // TELNETSLAVE_H
void props_value(QString, QString, QString, QString)
QQueue< QString > que
Definition: telnetslave.h:34
QString current_node_path
Definition: telnetslave.h:36
void on_ready_read()
Definition: telnetslave.cpp:96
void props_folder(QString, QString)
void on_connected()
void on_host_found()
void on_error(QAbstractSocket::SocketError)
void get_node(QString path)
Definition: telnetslave.cpp:75
void on_disconnected()
QTcpSocket * socket
Definition: telnetslave.h:48
bool in_request
Definition: telnetslave.h:38
void telnet_connect(QString address, int port)
Definition: telnetslave.cpp:43
void add_que(QString node)
Definition: telnetslave.cpp:67
void on_state_changed(QAbstractSocket::SocketState)
void telnet_disconnect()
Definition: telnetslave.cpp:52
TelnetSlave(QObject *parent=0)
Definition: telnetslave.cpp:18
void telnet_error(QAbstractSocket::SocketError, QString)
void set_property(QString path, QString value)
Definition: telnetslave.cpp:56
QString hostAddress
Definition: telnetslave.h:32
void telnet_connected(bool)