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
12class QCloseEvent;
13class QHideEvent;
14class QPushButton;
15class QShowEvent;
16class QString;
17class QTabWidget;
18class QVBoxLayout;
19
20class INDI_D;
21
22class ClientManager;
23class 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 */
33class GUIManager : public QWidget
34{
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;
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};
ClientManager manages connection to INDI server, creation of devices, and receiving/sending propertie...
DeviceInfo is simple class to hold DriverInfo and INDI::BaseDevice associated with a particular devic...
Definition deviceinfo.h:21
GUIManager creates the INDI Control Panel upon receiving a new device.
Definition guimanager.h:34
INDI_D represents an INDI GUI Device.
Definition indidevice.h:35
qsizetype size() const const
Q_OBJECTQ_OBJECT
QObject * parent() const const
ApplicationState
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.