#pragma once

#include "sacn/extended.h"

#include <QVariant>
#include <QVector>

class QSacnUniverse; // forward declare

using discoveredUniverse = sACN::EXTENDED::DISCOVERY::discoveredUniverse;

/**
 * @brief The MultiverseItem class
 */
class MultiverseItem
{
public:
  explicit MultiverseItem(MultiverseItem* parentItem = nullptr,
                          QSacnUniverse* universe = nullptr,
                          discoveredUniverse* discovery = nullptr);
  virtual ~MultiverseItem();

  void appendChild(MultiverseItem* child);
  void removeChild(MultiverseItem* child);
  void removeChildren();
  void setOverrideData(QVariant data);
  void createChildren();

  MultiverseItem * child(int row);
  int childCount() const;
  int childRow(int column, const QVariant &data) const;
  QVariant data(int column, int role = Qt::DisplayRole) const;
  Qt::ItemFlags flags(int column, Qt::ItemFlags base) const;
  int row() const;
  MultiverseItem * parentItem();

private:
  QVector<MultiverseItem*> childItems_;
  QSacnUniverse* universe_;
  discoveredUniverse* discovery_;
  MultiverseItem* parentItem_;
  QVariant override_data_;
};

Q_DECLARE_METATYPE(discoveredUniverse*)


