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.
12 #ifndef INDIPROPERTY_H
13 #define INDIPROPERTY_H
15 #include "indielement.h"
19 class INDIStdProperty
;
34 class INDI_P
: public QObject
38 INDI_P(INDI_G
*parentGroup
, QString inName
);
41 QString name
; /* property name */
42 QString label
; /* property label */
44 INDI_G
*pg
; /* parent group */
45 KPopupMenu
*assosiatedPopup
; /* assosiated popup menu, if any */
46 INDIStdProperty
*indistd
; /* Assosciated std routines class */
47 double timeout
; /* timeout, seconds */
48 PState state
; /* state light code */
49 KLed
*light
; /* state LED */
50 PPerm perm
; /* permissions wrt client */
51 PGui guitype
; /* type of GUI, if any */
54 int stdID
; /* Standard property ID, if any */
56 QLabel
*label_w
; /* Label widget */
57 QPushButton
*set_w
; /* set button */
59 QSpacerItem
*HorSpacer
; /* Horizontal spacer */
60 QHBoxLayout
*PHBox
; /* Horizontal container */
61 QVBoxLayout
*PVBox
; /* Vertical container */
63 QButtonGroup
*groupB
; /* group button for radio and check boxes (Elements) */
64 KComboBox
*om_w
; /* Combo box for menu */
66 QPtrList
<INDI_E
> el
; /* list of elements */
69 void drawLt(PState lstate
);
71 /* First step in adding a new GUI element */
72 void addGUI(XMLEle
*root
);
74 /* Set Property's parent group */
75 void setGroup(INDI_G
*parentGroup
) { pg
= parentGroup
; }
77 /* Find an element within the property */
78 INDI_E
* findElement(QString elementName
);
79 /* Search for an element, and if found, evaluate its state */
80 bool isOn(QString component
);
83 int buildTextGUI (XMLEle
*root
, char errmsg
[]);
84 int buildNumberGUI (XMLEle
*root
, char errmsg
[]);
85 int buildSwitchesGUI(XMLEle
*root
, char errmsg
[]);
86 int buildMenuGUI (XMLEle
*root
, char errmsg
[]);
87 int buildLightsGUI (XMLEle
*root
, char errmsg
[]);
88 int buildBLOBGUI (XMLEle
*root
, char errmsg
[]);
90 /* Setup the 'set' button in the property */
91 void setupSetButton(QString caption
);
93 /* Turn a switch on */
94 void activateSwitch(QString name
);
98 void newSwitch(int id
);
100 void convertSwitch(int id
);