Kstars

guimanager.h
1 /*
2  SPDX-FileCopyrightText: 2012 Jasem Mutlaq
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include <QList>
10 #include <QWidget>
11 
12 class QCloseEvent;
13 class QHideEvent;
14 class QPushButton;
15 class QShowEvent;
16 class QString;
17 class QTabWidget;
18 class QVBoxLayout;
19 
20 class INDI_D;
21 
22 class ClientManager;
23 class DeviceInfo;
24 
25 /**
26  * @class GUIManager
27  * GUIManager creates the INDI Control Panel upon receiving a new device. Each device is displayed
28  * on a separate tab. The device and property GUI creation is performed dynamically via introspection. As new properties
29  * arrive from the ClientManager, they get created in the GUI.
30  *
31  * @author Jasem Mutlaq
32  */
33 class GUIManager : public QWidget
34 {
35  Q_OBJECT
36  public:
37  static GUIManager *Instance();
38  static void release();
39 
40  void updateStatus(bool toggle_behavior);
41 
42  INDI_D *findGUIDevice(const QString &deviceName);
43 
44  void addClient(ClientManager *cm);
45  void removeClient(ClientManager *cm);
46 
47  QList<INDI_D *> getDevices()
48  {
49  return guidevices;
50  }
51 
52  int size()
53  {
54  return guidevices.size();
55  }
56 
57  protected:
58  void closeEvent(QCloseEvent *) override;
59  void hideEvent(QHideEvent *) override;
60  void showEvent(QShowEvent *) override;
61 
62  private:
63  /*****************************************************************
64  * GUI stuff
65  ******************************************************************/
66  QVBoxLayout *mainLayout;
67  QTabWidget *mainTabWidget;
68  QPushButton *clearB;
69  QPushButton *closeB;
70  GUIManager(QWidget *parent = nullptr);
71  ~GUIManager() override;
72 
73  static GUIManager *_GUIManager;
74  QList<ClientManager *> clients;
75  QList<INDI_D *> guidevices;
76 
77  public slots:
78  void changeAlwaysOnTop(Qt::ApplicationState state);
79  void clearLog();
80  void buildDevice(DeviceInfo *di);
81  void removeDevice(const QString &name);
82 };
Q_OBJECTQ_OBJECT
int size() const const
ApplicationState
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 12 2022 04:00:54 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.