/**********************************************************************
 *
 *   FreeDoko a Doppelkopf-Game
 *    
 *   Copyright (C) 2001-2004  by Diether Knof and Borg Enders
 *
 *   This program is free software; you can redistribute it and/or 
 *   modify it under the terms of the GNU General Public License as 
 *   published by the Free Software Foundation; either version 2 of 
 *   the License, or (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details. 
 *   You can find this license in the file 'gpl.txt'.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
 *   MA  02111-1307  USA
 *
 *  Contact:
 *    Diether Knof dknof@gmx.de
 *    Borg Enders  borg@borgsoft.de
 *
 **********************************************************************/

#ifdef USE_UI_GTK
#ifndef GTK_ICON_HEADER
#define GTK_ICON_HEADER

#include "pixmap.h"

#include "../../game/game.h"
class Player;

namespace GTK_DOKO {


  class Icons {
    public:
      enum Type {
	NONE,
	RE,
	CONTRA,
	FIVE_NINES,
	SIX_KINGS,
	FOX_HIGHEST_TRUMP,
	GENSCHER,
	MARRIAGE,
	MARRIAGE_FOREIGN,
	MARRIAGE_TRUMP,
	MARRIAGE_COLOR,
	MARRIAGE_CLUB,
	MARRIAGE_SPADE,
	MARRIAGE_HEART,
	POVERTY,
	POVERTY_TRUMPS_0,
	POVERTY_TRUMPS_1,
	POVERTY_TRUMPS_2,
	POVERTY_TRUMPS_3,
	SWINES_CLUB,
	SWINES_SPADE,
	SWINES_HEART,
	SWINES_DIAMOND,
	HYPERSWINES_CLUB,
	HYPERSWINES_SPADE,
	HYPERSWINES_HEART,
	HYPERSWINES_DIAMOND,
	SWINES_HYPERSWINES_CLUB,
	SWINES_HYPERSWINES_SPADE,
	SWINES_HYPERSWINES_HEART,
	SWINES_HYPERSWINES_DIAMOND,
	SOLO_CLUB,
	SOLO_SPADE,
	SOLO_HEART,
	SOLO_DIAMOND,
	SOLO_JACK,
	SOLO_QUEEN,
	SOLO_KING,
	SOLO_QUEEN_JACK,
	SOLO_KING_JACK,
	SOLO_KING_QUEEN,
	SOLO_KOEHLER,
	SOLO_MEATLESS,
	NO_120,
	NO_90,
	NO_60,
	NO_30,
	NO_0
      };
      static unsigned const NUMBER_OF_TYPES; // number of icons

    public:
      // constructor
      Icons(class GTK_GUI* gui_a);

      // inits the icons (loads them)
      void init();

      // the gui
      class GTK_GUI& gui();

      // loads the icons
      bool load();
      bool load(string const directory);

    private:
      // loads a card and rotates it if requested
      bool icon_load_and_rotate(vector<Pixmap>& icon,
				string const& filename);

    public:

      // the specific icon
      Pixmap const& icon(const Type type) const;
      Pixmap const& icon(const Type type, Player const& player) const;
      // the specific icon
      Pixmap& icon(const Type type, Player const& player);
      Pixmap& icon(const Type type);
      // the specific gametype icon
      Pixmap& icon(const GAMETYPE::GameType gametype, Player const& player);
      Pixmap& icon(const GAMETYPE::GameType gametype);
      // the specific marriage selector icon
      Pixmap& icon(const MARRIAGE_SELECTOR::MarriageSelector marriage_selector,
		   Player const& player);
      Pixmap& icon(const MARRIAGE_SELECTOR::MarriageSelector marriage_selector);
      // the specific team icon
      Pixmap& icon(const TEAM::Team team, Player const& player);
      Pixmap& icon(const TEAM::Team team);
      // the specific announcement icon
      Pixmap& icon(Announcement const& announcement, Player const& player);
      Pixmap& icon(Announcement const& announcement);
      // the specific swines icon
      Pixmap& swines(const Card::Color color, Player const& player);
      Pixmap& swines(const Card::Color color);
      // the specific hyperswines icon
      Pixmap& hyperswines(const Card::Color color, Player const& player);
      Pixmap& hyperswines(const Card::Color color);
      // the specific swines-hyperswines icon
      Pixmap& swines_hyperswines(const Card::Color color, Player const& player);
      Pixmap& swines_hyperswines(const Card::Color color);

      // the maximum width of the icons of the player
      unsigned width_max() const;
      unsigned width_max(Player const& player) const;
      // the maximum height of the icons of the player
      unsigned height_max() const;
      unsigned height_max(Player const& player) const;

    private:
      class GTK_GUI* const gui_p; // the gui

      vector<vector<Pixmap> > icon_p; // the icons

    private: // not to be used
      Icons();
      Icons(Icons const&);
      Icons& operator=(Icons const&);
  }; // class Icon

} // namespace GTK_DOKO

#endif // #ifndef GTK_ICON_HEADER
#endif // #ifdef USE_UI_GTK
