/**********************************************************************
 *
 *   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_CARD_HEADER
#define GTK_CARD_HEADER

#include "pixmap.h"

class Card;

class Player;

namespace GTK_DOKO {
#include <gtk/gtkwidget.h>

  class Cards {
    public:
      // constructor
      Cards(class GTK_GUI* gui_a);
      // inits the cards (loads them)
      void init();

      // the gui
      class GTK_GUI& gui();

      // loads the cards
      bool load();
      bool load(string const directory);
      // loads the back of the cards
      bool back_load();
      bool back_load(string filename);

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

    public:

      // the back  of the cards
      Pixmap const& back() const;
      Pixmap const& back(Player const& player) const;
      // the back  of the cards
      Pixmap& back();
      Pixmap& back(Player const& player);
      // the specific card
      Pixmap const& card(Card const& c) const;
      Pixmap const& card(Card const& c, Player const& player) const;
      // the specific card
      Pixmap& card(Card const& c);
      Pixmap& card(Card const& c, Player const& player);

      // the width of the cards of the player
      unsigned width() const;
      unsigned width(Player const& player) const;
      // the height of the cards of the player
      unsigned height() const;
      unsigned height(Player const& player) const;

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

      vector<vector<vector<Pixmap> > > card_p; // the cards
      vector<Pixmap> back_p; // the back

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

} // namespace GTK_DOKO

#endif // #ifndef GTK_CARD_HEADER
#endif // #ifdef USE_UI_GTK
