moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kstars / kstars / devicemanager.h
blob53c9d78d0cac04cc84a444ded6e0a4dd3074e366
1 /* Device Manager
2 Copyright (C) 2003 Jasem Mutlaq (mutlaqja@ikarustech.com)
4 This application is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 JM Changelog
10 2004-16-1: Start
14 #ifndef DEVICEMANAGER_H
15 #define DEVICEMANAGER_H
17 #include "indielement.h"
19 class INDIMenu;
20 class INDI_P;
21 class INDI_D;
23 class QSocketNotifier;
25 // INDI device manager
26 class DeviceManager : public QObject
28 Q_OBJECT
29 public:
30 DeviceManager(INDIMenu *INDIparent, int inID);
31 ~DeviceManager();
33 INDIMenu *parent;
35 QPtrList<INDI_D> indi_dev;
37 int mgrID;
38 int serverFD;
39 FILE *serverFP;
40 LilXML *XMLParser;
41 QSocketNotifier *sNotifier;
42 QString host;
43 QString port;
45 int dispatchCommand (XMLEle *root, char errmsg[]);
47 INDI_D * addDevice (XMLEle *dep , char errmsg[]);
48 INDI_D * findDev (XMLEle *root, int create, char errmsg[]);
50 /*****************************************************************
51 * Send to server
52 ******************************************************************/
53 void sendNewText (INDI_P *pp);
54 void sendNewNumber (INDI_P *pp);
55 void sendNewSwitch (INDI_P *pp, int index);
56 void startBlob (QString devName, QString propName, QString timestamp);
57 void sendOneBlob(QString blobName, unsigned int blobSize, QString blobFormat, unsigned char * blobBuffer);
58 void finishBlob();
60 /*****************************************************************
61 * Misc.
62 ******************************************************************/
63 int delPropertyCmd (XMLEle *root, char errmsg[]);
64 int removeDevice (QString devName, char errmsg[]);
65 INDI_D * findDev (QString devName, char errmsg[]);
67 int messageCmd (XMLEle *root, char errmsg[]);
68 void checkMsg (XMLEle *root, INDI_D *dp);
69 void doMsg (XMLEle *msg , INDI_D *dp);
71 bool indiConnect (QString inHost, QString inPort);
73 public slots:
74 void dataReceived();
76 signals:
77 void newDevice();
81 #endif