2 Copyright (C) 2003 Jasem Mutlaq (mutlaqja@ikarustech.com)
5 This application is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
14 #include <kdialogbase.h>
18 #include "indielement.h"
51 class QSocketNotifier
;
54 /*************************************************************************
57 ** INDI_ELEMENT <----------------------------------------
59 ** -----> INDI_PROPERTY |
61 ** -----> INDI_GROUP |
65 Device Manager INDI Menu
66 **************************************************************************/
70 class INDI_D
: public KDialogBase
74 INDI_D(INDIMenu
*parentMenu
, DeviceManager
*parentManager
, QString inName
, QString inLabel
);
77 QString name
; /* device name */
78 QString label
; /* device label */
79 QVBox
*deviceVBox
; /* device tab frame */
80 QTabWidget
*groupContainer
; /* Groups within the device */
81 QTextEdit
*msgST_w
; /* scrolled text for messages */
82 unsigned char *dataBuffer
; /* Generic buffer */
83 //QScrollView *sv; /* Scroll view */
84 //QVBoxLayout *mainLayout;
85 //QVBox *propertyLayout;
86 //QSpacerItem *vSpacer;
87 //QSpacerItem *hSpacer;
90 //QHBoxLayout *buttonLayout;
91 INDIStdDevice
*stdDev
;
93 QPtrList
<INDI_G
> gl
; /* list of pointers to groups */
99 DeviceManager
*parentMgr
;
101 enum DTypes
{ DATA_FITS
, DATA_STREAM
, DATA_OTHER
};
103 /*****************************************************************
105 ******************************************************************/
106 int buildTextGUI (XMLEle
*root
, char errmsg
[]);
107 int buildNumberGUI (XMLEle
*root
, char errmsg
[]);
108 int buildSwitchesGUI(XMLEle
*root
, char errmsg
[]);
109 int buildMenuGUI (INDI_P
*pp
, XMLEle
*root
, char errmsg
[]);
110 int buildLightsGUI (XMLEle
*root
, char errmsg
[]);
111 int buildBLOBGUI (XMLEle
*root
, char errmsg
[]);
113 /*****************************************************************
115 ******************************************************************/
116 INDI_P
* addProperty (XMLEle
*root
, char errmsg
[]);
118 /*****************************************************************
120 ******************************************************************/
121 INDI_P
* findProp (QString name
);
122 INDI_E
* findElem (QString name
);
123 INDI_G
* findGroup (QString grouptag
, int create
, char errmsg
[]);
124 int findPerm (INDI_P
*pp
, XMLEle
*root
, PPerm
*permp
, char errmsg
[]);
126 /*****************************************************************
128 ******************************************************************/
129 int setValue (INDI_P
*pp
, XMLEle
*root
, char errmsg
[]);
130 int setLabelState (INDI_P
*pp
, XMLEle
*root
, char errmsg
[]);
131 int setTextValue (INDI_P
*pp
, XMLEle
*root
, char errmsg
[]);
132 int setBLOB (INDI_P
*pp
, XMLEle
* root
, char errmsg
[]);
134 int newValue (INDI_P
*pp
, XMLEle
*root
, char errmsg
[]);
135 int newTextValue (INDI_P
*pp
, XMLEle
*root
, char errmsg
[]);
137 int setAnyCmd (XMLEle
*root
, char errmsg
[]);
138 int newAnyCmd (XMLEle
*root
, char errmsg
[]);
140 int removeProperty(INDI_P
*pp
);
142 /*****************************************************************
144 ******************************************************************/
145 int crackLightState (char *name
, PState
*psp
);
146 int crackSwitchState (char *name
, PState
*psp
);
148 /*****************************************************************
150 ******************************************************************/
151 int processBlob(INDI_E
*blobEL
, XMLEle
*ep
, char errmsg
[]);
153 /*****************************************************************
154 * INDI standard property policy
155 ******************************************************************/
157 void registerProperty(INDI_P
*pp
);
158 bool isINDIStd(INDI_P
*pp
);