Kstars

indigroup.h
1 /*
2  SPDX-FileCopyrightText: 2003 Jasem Mutlaq <[email protected]>
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 
16 class INDI_P;
17 class INDI_D;
18 
19 class QFrame;
20 class QVBoxLayout;
21 class QSpacerItem;
22 class 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  */
30 class 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 };
int count(const T &value) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Jun 9 2023 04:02:22 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.