#ifndef __GRT_STRING_LIST_MODEL_H__
#define __GRT_STRING_LIST_MODEL_H__

#include "grt/grt_string_list_model.h"
#include "Grt.h"
#include "IconManager.h"
#include "TreeModel.h"
#include "GrtTemplates.h"

#pragma make_public(::bec::GrtStringListModel)

namespace MySQL {
namespace Grt {

public ref class GrtStringListModel : public MySQL::Grt::ListModel
{
public:
  enum class Columns {
    Name = ::bec::GrtStringListModel::Name
  };

  GrtStringListModel(::bec::GrtStringListModel *inn)
    : MySQL::Grt::ListModel(inn), free_inner(false)
  {}

  GrtStringListModel()
    : MySQL::Grt::ListModel(new ::bec::GrtStringListModel()), free_inner(true)
  {}

  ~GrtStringListModel()
  {
    if (free_inner)
      delete inner;
  }

  ::bec::GrtStringListModel *get_unmanaged_object()
  { return static_cast<::bec::GrtStringListModel *>(inner); }

  void add_item(String^ item, int id)
  { get_unmanaged_object()->add_item(NativeToCppString(item), id); }

  void remove_items(List<int>^ item_indexes)
  { get_unmanaged_object()->remove_items(IntListToCppVector(item_indexes)); }

  void remove_item(int index)
  { get_unmanaged_object()->remove_item(index); }

  void copy_items_to_val_masks_list(List<int>^ item_indexes)
  { get_unmanaged_object()->copy_items_to_val_masks_list(IntListToCppVector(item_indexes)); }

  void items_val_mask(String ^items_val_mask)
  { get_unmanaged_object()->items_val_mask(NativeToCppString(items_val_mask)); }

  void invalidate()
  { get_unmanaged_object()->invalidate(); }

  int total_items_count()
  { return get_unmanaged_object()->total_items_count(); }

  int active_items_count()
  { return get_unmanaged_object()->active_items_count(); }

  //std::vector<std::string> items() const;
  //List<String ^>^ items()

private:
  bool free_inner;
};

} // namespace Grt
} // namespace MySQL

#endif // __GRT_STRING_LIST_MODEL_H__
