/*
 * SPDX-FileCopyrightText: 2004 Copyright contributors to the cppTango project
 *
 * SPDX-License-Identifier: LGPL-3.0-or-later
 */

#ifndef TANGO_SERVER_IMAGEATTR_H
#define TANGO_SERVER_IMAGEATTR_H

#include <tango/common/tango_const.h>
#include <tango/server/Attr.h>
#include <tango/server/MultiClassAttribute.h>
#include <tango/server/SpectrumAttr.h>

#include <memory>
#include <string>
#include <vector>

namespace Tango
{

/**
 * User class to create a two dimensions attribute object.
 *
 * Information from this class and information fetched out from the Tango
 * database allows the Tango core software to create the Attribute object
 * for the attribute created by the user.
 *
 *
 * @headerfile tango.h
 * @ingroup Server
 */

class ImageAttr : public SpectrumAttr
{
  public:
    /**@name Constructors
     * Two constructors are defined for this class */
    //@{
    /**
     * Constructs a newly allocated ImageAttr object.
     * The attribute display level is set to OPERATOR.
     * The attribute write type is set to READ
     *
     * @param     name    The attribute name
     * @param    data_type    The attribute data type
     * @param    max_x    The attribute maximum x dimension
     * @param    max_y    The attribute maximum y dimension
     *
     */
    ImageAttr(const char *name, long data_type, long max_x, long max_y);

    /**
     * Constructs a newly allocated ImageAttr object.
     * The attribute display level is set to OPERATOR.
     *
     * @param     name    The attribute name
     * @param    data_type    The attribute data type
     * @param    w_type  The attribute write type (READ, WRITE, READ_WRITE)
     * @param    max_x    The attribute maximum x dimension
     * @param    max_y    The attribute maximum y dimension
     *
     */
    ImageAttr(const char *name, long data_type, Tango::AttrWriteType w_type, long max_x, long max_y);

    /**
     * Constructs a newly allocated ImageAttr object.
     * The attribute write type is set to READ
     *
     * @param     name    The attribute name
     * @param    data_type    The attribute data type
     * @param    max_x    The attribute maximum x dimension
     * @param    max_y    The attribute maximum y dimension
     * @param    level    The attribute display type
     *
     */
    ImageAttr(const char *name, long data_type, long max_x, long max_y, Tango::DispLevel level);

    /**
     * Constructs a newly allocated ImageAttr object.
     *
     * @param     name    The attribute name
     * @param    data_type    The attribute data type
     * @param    w_type  The attribute write type (READ, WRITE, READ_WRITE)
     * @param    max_x    The attribute maximum x dimension
     * @param    max_y    The attribute maximum y dimension
     * @param    level    The attribute display type
     *
     */
    ImageAttr(
        const char *name, long data_type, Tango::AttrWriteType w_type, long max_x, long max_y, Tango::DispLevel level);

    /**
     * Constructs a newly allocated ImageAttr object.
     *
     * @param     name    The attribute name
     *
     */

    ImageAttr(const char *name) :
        SpectrumAttr(name)
    {
    }

    //@}

    /**@name Destructor
     * Only one destructor is defined for this class */
    //@{
    /**
     * The object destructor.
     */
    ~ImageAttr() override { }

    //@}

    /// @privatesection
    ImageAttr(const ImageAttr &);

    long get_max_y()
    {
        return max_y;
    }

  protected:
    /// @privatesection
    long max_y;

  private:
    class ImageAttrExt
    {
    };

    std::unique_ptr<ImageAttrExt> ext; // Class extension
};

} // namespace Tango

#endif // _IMAGEATTRW_H
