moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kstars / kstars / indiproperty.h
blob727aa2e0e7d17a0da8673c5dab4eaf7ebd6821d8
1 /* INDI Property
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"
18 class INDI_G;
19 class INDIStdProperty;
21 class KPopupMenu;
22 class KComboBox;
23 class KLed;
25 class QLabel;
26 class QPushButton;
27 class QHBoxLayout;
28 class QVBoxLayout;
29 class QButtonGroup;
33 /* INDI property */
34 class INDI_P : public QObject
36 Q_OBJECT
37 public:
38 INDI_P(INDI_G *parentGroup, QString inName);
39 ~INDI_P();
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 */
68 /* Draw state LED */
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);
82 /* Build Functions */
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);
96 public slots:
97 void newText();
98 void newSwitch(int id);
99 void newBlob();
100 void convertSwitch(int id);
102 signals:
103 void okState();
107 #endif