/*! \file
 * \brief An SnappingFilterMessage that contains the snapping filter a Device is set to.
 *
 * \copyright
 * COPYRIGHT NOTICE: (c) 2018-2022 Neonode Technologies AB. All rights reserved.
 */

#ifndef MESSAGE_SNAPPINGFILTERMESSAGE_SNAPPINGFILTERMESSAGE_H
#define MESSAGE_SNAPPINGFILTERMESSAGE_SNAPPINGFILTERMESSAGE_H 1

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

/*!
 * \brief This structure represents an snapping filter message.
 *
 * This structure represents a message containing snapping filter information.
 */
struct SnappingFilterMessage
{
    /*!
     * 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);
    bool         Enabled;        //!< True when Snapping Filter is enabled.
    bool         HasEnabled;     //!< True when Enabled is valid.
    uint32_t     LeftInner;      //!< Distance from edge to the inner snapping edge, left side of Touch Active Area.
    uint32_t     LeftOuter;      //!< Distance from edge to the outer snapping edge, left side of Touch Active Area.
    bool         HasLeft;        //!< True when LeftInner & LeftOuter is valid.
    uint32_t     RightInner;     //!< Distance from edge to the inner snapping edge, right side of Touch Active Area.
    uint32_t     RightOuter;     //!< Distance from edge to the outer snapping edge, right side of Touch Active Area.
    bool         HasRight;       //!< True when RightInner & RightOuter is valid.
    uint32_t     TopInner;       //!< Distance from edge to the inner snapping edge, top side of Touch Active Area.
    uint32_t     TopOuter;       //!< Distance from edge to the outer snapping edge, top side of Touch Active Area.
    bool         HasTop;         //!< True when TopInner & TopOuter is valid.
    uint32_t     BottomInner;    //!< Distance from edge to the inner snapping edge, bottom side of Touch Active Area.
    uint32_t     BottomOuter;    //!< Distance from edge to the outer snapping edge, bottom side of Touch Active Area.
    bool         HasBottom;      //!< True when BottomInner & BottomOuter is valid.
};

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

/*!
 * \brief Internal constructor for SnappingFilterMessage.
 *
 * Internal constructor for SnappingFilterMessage.
 * 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 SnappingFilterMessage.
 */
DLLINTERNAL SnappingFilterMessage * SnappingFilterMessage_New (MessageGroup messageGroup, uint32_t size);

#ifdef __cplusplus
}
#endif // __cplusplus

#endif // MESSAGE_SNAPPINGFILTERMESSAGE_SNAPPINGFILTERMESSAGE_H
