#ifndef STARTMENU_HPP
#define STARTMENU_HPP

#include "module.hpp"
#include "options.hpp"
#include "themes.hpp"

class startmenu_item
{
public:
  std::string name;
  std::string action;
  std::string pic;

  startmenu_item(const std::string& n, const std::string& a, const std::string& p);
};

struct startmenu_row
{
  std::string name;
  std::list<startmenu_item> items;
};

class Startmenu : public Module 
{
private:
  Startmenu();
  
  std::list<startmenu_row> startmenu;

  void print_options(const std::string& marking);
  void print(const startmenu_row& row, const startmenu_item& current_item);

  class StartmenuOpts : public Options 
  {
  public:
    StartmenuOpts();
    ~StartmenuOpts();

    void save();
  private:

    void load();
    
    void read_dirs() {};

    Option *a_o, *m_o, *p_o, *g_o;
  };

  bool movie_loaded;
  bool game_loaded;
  bool pictures_loaded;

  bool reload_audio;
  bool reload_movie;
  bool reload_pictures;
  bool reload_game;
  bool reload_epg;

public:
  // singleton
  static Startmenu& get_instance();

  bool audio_loaded;
  bool epg_loaded;
  bool epg_update_running;

  std::string module;
  std::string last_module;

  void generate_startmenu();

  std::string mainloop();

  StartmenuOpts opts;
};

#endif
