/*! \file
 * \brief A DetectedObjectSizeRestrictionMessage contains Detected Object Size Restrictions of a Device.
 *
 * \copyright
 * COPYRIGHT NOTICE: (c) 2017-2022 Neonode Technologies AB. All rights reserved.
 */

#ifndef MESSAGE_DETECTEDOBJECTSIZERESTRICTIONMESSAGE_DETECTEDOBJECTSIZERESTRICTIONMESSAGE_H
#define MESSAGE_DETECTEDOBJECTSIZERESTRICTIONMESSAGE_DETECTEDOBJECTSIZERESTRICTIONMESSAGE_H 1

#ifndef ZFORCECOMMON_H
    #error Please include "zForceCommon.h" before this file.
#endif // ZFORCECOMMON_H

/*!
 * \brief This structure represents a detected object size restriction message.
 *
 * This structure represents a message which indicates if a device has detected object size restriction on and for
 * which minimum and maximum sizes.
 */
struct DetectedObjectSizeRestrictionMessage
{
    /*!
     * The Message Type of the Message.
     * \n\n
     * Inherited from Message base class.
	 */
    MessageType  MessageType;
    /*!
     * The Message Group of the Message.
     * \n\n
     * Inherited from Message base class.
	 */
    MessageGroup MessageGroup;
    /*!
     * If an error occurred, this is True.
     * \n\n
     * Inherited from Message base class.
	 */
    bool         Error;
    /*!
     * Error Code, valid when Error == true.
     * \n\n
     * Inherited from Message base class.
	 */
    int          ErrorCode;
    /*!
     * Unique serial number for this message.
     * \n\n
     * Inherited from Message base class.
	 */
    uint64_t     SerialNumber;
    /*!
     * Destructor.
     * \n\n
     * Inherited from Message base class.
	 */
    void         ( * Destructor)(Message * self);
    uint32_t     MinimumSize;    //!< Minimum size for device to detect.
    uint32_t     MaximumSize;    //!< Maximum size for device to detect.
    bool         HasMinimumSize; //!< True when MinimumSize is valid.
    bool         HasMaximumSize; //!< True when MaximumSize is valid.
};

#ifdef __cplusplus
extern "C"
{
#endif // __cplusplus

/*!
 * \brief Internal constructor for DetectedObjectSizeRestrictionMessage.
 *
 * Internal constructor for DetectedObjectSizeRestrictionMessage.
 * Do not use this constructor, always use the factory creator.
 * \n\n
 * On failure, errno is set.
 * - ::EOUTOFMEMORY - Out of memory.
 * - ::EINVALIDSIZE - Invalid size.
 *
 * \param messageGroup MessageGroup of Message.
 * \param size If this is used as a base class for another class, set size to non-zero.
 *
 * \return Pointer to DetectedObjectSizeRestrictionMessage.
 */
DLLINTERNAL DetectedObjectSizeRestrictionMessage * DetectedObjectSizeRestrictionMessage_New
                                                       (MessageGroup messageGroup, uint32_t size);

#ifdef __cplusplus
}
#endif // __cplusplus

#endif // MESSAGE_DETECTEDOBJECTSIZERESTRICTIONMESSAGE_DETECTEDOBJECTSIZERESTRICTIONMESSAGE_H
