#ifndef LISTBOX_H
#define LISTBOX_H

#include <stdint.h>
#include "SDL.h"

#include "Button.h"
#include "../graphics/shippingHandler.h"
#include "../graphics/GraphicTransformation.h"
#include "Input.h"

#include <vector>
#include <string>
using namespace std;

//this contains items in a vertically-scrolling list.

class ListBox : public Button {
 public:
  ListBox ();
  ~ListBox ();
  ListBox(const ListBox & other);

  void setGraphicHighlightFontColor (uint8_t, uint8_t, uint8_t);
  uint8_t getGraphicHighlightFontColorR();
  uint8_t getGraphicHighlightFontColorG();
  uint8_t getGraphicHighlightFontColorB();

  GraphicTransformation & getGraphicTransformation ();
  void setGraphicTransformation (GraphicTransformation &);

  uint16_t getVerticalPadding();
  void setVerticalPadding (uint16_t);

  uint16_t getHorizontalPadding();
  void setHorizontalPadding (uint16_t);

  const string & getFontName ();
  uint16_t getFontSize ();
  void setFont (const string &, uint16_t);

  const string & getGraphicFrameBackground ();
  void setGraphicFrameBackground (const string &);

  const string & getGraphicFrameUpArrow ();
  void setGraphicFrameUpArrow (const string &);

  const string & getGraphicFrameDownArrow ();
  void setGraphicFrameDownArrow (const string &);

  const string & getGraphicFrameScrollWindow ();
  void setGraphicFrameScrollWindow (const string &);

  const string & getGraphicFrameScrollBar ();
  void setGraphicFrameScrollBar (const string &);

  const string & getGraphicFrameSelected ();
  void setGraphicFrameSelected (const string &);

  void setElementHit (uint8_t);
  int16_t getElementHit ();
  void clearElementHit ();

  uint8_t getScrollPosition();
  void setScrollPosition(uint8_t);

  bool scrollUp(int=0);
  bool scrollDown(int);

  void operator=(const ListBox &other);

 private:
  GraphicTransformation gt;
  uint8_t colR, colG, colB;
  uint16_t vertPadding, horizPadding, fontSize;
  string fontName, frameBackground, frameUp, frameDown, frameScrollWindow, frameScrollBar, frameSelected;
  bool validElementSelected;
  uint8_t elementIndex;
  uint8_t scrollPosition;
};
#endif
