#pragma once #include "indiapi.h" #include "indidevapi.h" #include "indibasetypes.h" #ifdef SWIG // api version for swig %include "indiapi.h" #endif #define MAXRBUF 2048 /** @namespace INDI * @brief Namespace to encapsulate INDI client, drivers, and mediator classes. * * Developers can subclass the base devices class to implement device specific functionality. This ensures interoperability and consistency among devices within the same family * and reduces code overhead. * * * * @author Jasem Mutlaq * @author Gerry Rozema */ namespace INDI { class BaseMediator; class BaseClient; class BaseClientQt; class BaseDevice; class DefaultDevice; class FilterInterface; class RotatorInterface; class GuiderInterface; class FocuserInterface; class WeatherInterface; class SensorInterface; class DomeInterface; class DustCapInterface; class LightBoxInterface; class CCD; class Spectrograph; class Detector; class Telescope; class FilterWheel; class Focuser; class Rotator; class Dome; class GPS; class Weather; class USBDevice; class Property; class PropertySwitch; class PropertyNumber; class PropertyText; class PropertyLight; class Controller; class Logger; } /** @class INDI::BaseMediator * @brief Meditates event notification as generated by driver and passed to clients. */ class INDI::BaseMediator { public: virtual ~BaseMediator() = default; public: /** @brief Emmited when a new device is created from INDI server. * @param baseDevice BaseDevice instance. */ virtual void newDevice(INDI::BaseDevice baseDevice); /** @brief Emmited when a device is deleted from INDI server. * @param baseDevice BaseDevice instance. */ virtual void removeDevice(INDI::BaseDevice baseDevice); public: /** @brief Emmited when a new property is created for an INDI driver. * @param property Property container. */ virtual void newProperty(INDI::Property property); /** @brief Emmited when a new property value arrives from INDI server. * @param property Property container. */ virtual void updateProperty(INDI::Property property); /** @brief Emmited when a property is deleted for an INDI driver. * @param property Property container. */ virtual void removeProperty(INDI::Property property); public: /** @brief Emmited when a new message arrives from INDI server. * @param baseDevice BaseDevice instance the message is sent to. * @param messageID ID of the message that can be used to retrieve the message from the device's messageQueue() function. */ virtual void newMessage(INDI::BaseDevice baseDevice, int messageID); public: /** @brief Emmited when the server is connected. */ virtual void serverConnected(); /** @brief Emmited when the server gets disconnected. * @param exit_code 0 if client was requested to disconnect from server. -1 if connection to server is terminated due to remote server disconnection. */ virtual void serverDisconnected(int exit_code); public: // deprecated interface #if INDI_VERSION_MAJOR < 2 /** @brief Emmited when a new device is created from INDI server. * @param dp Pointer to the base device instance */ virtual void newDevice(INDI::BaseDevice *dp); // deprecated /** @brief Emmited when a device is deleted from INDI server. * @param dp Pointer to the base device instance. */ virtual void removeDevice(INDI::BaseDevice *dp); // deprecated /** @brief Emmited when a new property is created for an INDI driver. * @param property Pointer to the Property Container */ virtual void newProperty(INDI::Property *property); // deprecated /** @brief Emmited when a property is deleted for an INDI driver. * @param property Pointer to the Property Container to remove. */ virtual void removeProperty(INDI::Property *property); // deprecated /** @brief Emmited when a new switch value arrives from INDI server. * @param svp Pointer to a switch vector property. */ virtual void newSwitch(ISwitchVectorProperty *svp); // deprecated /** @brief Emmited when a new number value arrives from INDI server. * @param nvp Pointer to a number vector property. */ virtual void newNumber(INumberVectorProperty *nvp); // deprecated /** @brief Emmited when a new text value arrives from INDI server. * @param tvp Pointer to a text vector property. */ virtual void newText(ITextVectorProperty *tvp); // deprecated /** @brief Emmited when a new light value arrives from INDI server. * @param lvp Pointer to a light vector property. */ virtual void newLight(ILightVectorProperty *lvp); // deprecated /** @brief Emmited when a new property value arrives from INDI server. * @param bp Pointer to filled and process BLOB. */ virtual void newBLOB(IBLOB *bp); // deprecated /** @brief Emmited when a new message arrives from INDI server. * @param dp pointer to the INDI device the message is sent to. * @param messageID ID of the message that can be used to retrieve the message from the device's messageQueue() function. */ virtual void newMessage(INDI::BaseDevice *dp, int messageID); // deprecated #endif };