Initial working baulkTerm-daemon
[baulk.git] / src / Server / client.h
blobcbd65232d46312872af0519fe6c63fe9b3758c3c
1 // Baulk - Information Server - Client
2 //
3 // Baulk - Copyright (C) 2008 - Jacob Alexander
4 //
5 // Baulk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // any later version, including version 3 of the License.
9 //
10 // Baulk is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef __INFORMATIONCLIENT_H
19 #define __INFORMATIONCLIENT_H
21 #include <stdlib.h>
23 #include <QLocalServer>
24 #include <QLocalSocket>
25 #include <QObject>
27 #include "packet.h"
29 /**
30 * @author Jacob Alexander (HaaTa)
32 * Responsible for Communicating with the InformationServer
34 * Provides an interface for sending/recieving information to/from
35 * different instances of Baulk.
37 class InformationClient : public QObject {
38 Q_OBJECT
40 public:
41 InformationClient( QString call, QObject *parent = 0 );
42 ~InformationClient();
44 void connectToServer();
45 void requestId();
46 void requestStartNewHostInstance();
48 int id() const { return currentId; }
50 public slots:
51 void incomingData();
53 private:
54 int currentId;
56 Packet *incomingPacket;
58 QLocalSocket *socket;
59 QString serverName;
61 QString errorName() const { return tr("InformationClient"); }
63 void clientRequest();
64 void newId( int newId );
65 void outgoingData( QString data );
68 #endif