osx compiler was complaining about non-virtual destructors in the interface structs...
[deb_libcec.git] / src / lib / adapter / AdapterCommunication.h
index 9762926cc10a23e0561b96914c13b2ba4fac2aa8..38d0a13b0369bf40d6726029ef195d21bceb24a6 100644 (file)
@@ -46,9 +46,12 @@ namespace CEC
     ADAPTER_MESSAGE_STATE_ERROR                 /**< an error occured */
   } cec_adapter_message_state;
 
-  struct IAdapterCommunicationCallback
+  class IAdapterCommunicationCallback
   {
   public:
+    IAdapterCommunicationCallback(void) {}
+    virtual ~IAdapterCommunicationCallback(void) {}
+
     /*!
      * @brief Callback method for IAdapterCommunication, called when a new cec_command is received
      * @param command The command that has been received
@@ -57,9 +60,12 @@ namespace CEC
     virtual bool OnCommandReceived(const cec_command &command) = 0;
   };
 
-  struct IAdapterCommunication
+  class IAdapterCommunication
   {
   public:
+    IAdapterCommunication(void) {}
+    virtual ~IAdapterCommunication(void) {}
+
     /*!
      * @brief Open a connection to the CEC adapter
      * @param cb The callback struct. if set to NULL, the Read() method has to be used to read commands. if set, OnCommandReceived() will be called for each command that was received
@@ -136,5 +142,22 @@ namespace CEC
      * @return True when the control mode has been set, false otherwise.
      */
     virtual bool SetControlledMode(bool controlled) = 0;
+
+    /*!
+     * @brief Persist the given configuration in adapter (if supported)
+     * @brief The configuration to store.
+     * @return True when the configuration was persisted, false otherwise.
+     */
+    virtual bool PersistConfiguration(libcec_configuration *configuration) = 0;
+
+    /*!
+     * @return The name of the port
+     */
+    virtual CStdString GetPortName(void) = 0;
+
+    /*!
+     * @return The physical address, if the adapter supports this. 0 otherwise.
+     */
+    virtual uint16_t GetPhysicalAddress(void) = 0;
   };
 };