Kstars

blobmanager.h
1 /*
2  SPDX-FileCopyrightText: 2018 Jasem Mutlaq <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #ifdef USE_QT5_INDI
10 #include <baseclientqt.h>
11 #else
12 #include <baseclient.h>
13 #include <QObject>
14 #endif
15 
16 class DeviceInfo;
17 class DriverInfo;
18 class ServerManager;
19 
20 /**
21  * @class BlobManager
22  * BlobManager manages connection to INDI server to handle a specific BLOB.
23  *
24  * BlobManager is a subclass of INDI::BaseClient class part of the INDI Library.
25  *
26  * @author Jasem Mutlaq
27  * @version 1.0
28  */
29 #ifdef USE_QT5_INDI
30 class BlobManager : public INDI::BaseClientQt
31 #else
32 class BlobManager : public QObject, public INDI::BaseClient
33 #endif
34 {
35  Q_OBJECT
36  Q_PROPERTY(QString device MEMBER m_Device)
37  Q_PROPERTY(QString property MEMBER m_Property)
38  Q_PROPERTY(bool enabled READ enabled WRITE setEnabled)
39 
40  public:
41  BlobManager(QObject *parent, const QString &host, int port, const QString &device, const QString &prop);
42  virtual ~BlobManager() override = default;
43 
44  bool enabled() { return m_Enabled; }
45  void setEnabled(bool enabled);
46 
47  protected:
48  virtual void newDevice(INDI::BaseDevice *device) override;
49  virtual void newProperty(INDI::Property *) override {}
50  virtual void removeProperty(INDI::Property *) override {}
51  virtual void removeDevice(INDI::BaseDevice *) override {}
52  virtual void newSwitch(ISwitchVectorProperty *) override {}
53  virtual void newNumber(INumberVectorProperty *) override {}
54  virtual void newBLOB(IBLOB *bp) override;
55  virtual void newText(ITextVectorProperty *) override {}
56  virtual void newLight(ILightVectorProperty *) override {}
57  virtual void newMessage(INDI::BaseDevice *, int) override {}
58 
59 #if INDI_VERSION_MAJOR >= 1 && INDI_VERSION_MINOR >= 5
60  virtual void newUniversalMessage(std::string) override {}
61 #endif
62 
63  virtual void serverConnected() override {}
64  virtual void serverDisconnected(int exit_code) override;
65 
66  signals:
67  void newINDIBLOB(IBLOB *bp);
68  void connected();
69  void connectionFailure();
70 
71  private:
72  QString m_Device;
73  QString m_Property;
74  bool m_Enabled { true };
75 };
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
ScriptableExtension * host() const
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:52 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.