Kstars

indigroup.h
1/*
2 SPDX-FileCopyrightText: 2003 Jasem Mutlaq <mutlaqja@ikarustech.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include <indiproperty.h>
10
11#include <QString>
12#include <QList>
13#include <QScrollArea>
14#include <QPointer>
15
16class INDI_P;
17class INDI_D;
18
19class QFrame;
20class QVBoxLayout;
21class QSpacerItem;
22class QScrollArea;
23
24/**
25 * @class INDI_G
26 * INDI_G represents a collection of INDI properties that share a common group. The group is usually represented in the GUI as a separate tab with the device tab.
27 *
28 * @author Jasem Mutlaq
29 */
30class INDI_G: public QScrollArea
31{
32 public:
33 INDI_G(INDI_D *idv, const QString &inName);
34
35 bool addProperty(const INDI::Property newProperty);
36
37 bool removeProperty(const QString &name);
38 INDI_P *getProperty(const QString &name) const;
39 QFrame *getContainer() const
40 {
41 return m_PropertiesContainer;
42 }
43 const QString &getName() const
44 {
45 return name;
46 }
47
48 INDI_D *getDevice() const
49 {
50 return dp;
51 }
52
53 QList<INDI_P *> getProperties() const
54 {
55 return m_PropertiesList;
56 }
57
58 int size() const
59 {
60 return m_PropertiesList.count();
61 }
62
63 private:
64 // Group name
65 QString name;
66 // Parent device
67 INDI_D *dp {nullptr};
68 // Properties container
69 QPointer<QFrame> m_PropertiesContainer;
70 // Properties layout
71 QPointer<QVBoxLayout> m_PropertiesLayout;
72 // Vertical spacer
73 QSpacerItem *m_VerticalSpacer {nullptr};
74 QList<INDI_P *> m_PropertiesList;
75 bool m_Dirty { false };
76};
INDI_D represents an INDI GUI Device.
Definition indidevice.h:35
INDI_G represents a collection of INDI properties that share a common group.
Definition indigroup.h:31
INDI_P represents a single INDI property (Switch, Text, Number, Light, or BLOB).
qsizetype count() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:19:03 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.