/* This file is part of cardwords
   (c) 1999 Tobias Peters
   see file COPYING for the copyright terms.
   
   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 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
*/

// cardwords_gtk_common_card_cell_styles.hh

#ifndef CARDWORDS_GTK_COMMON_CARD_CELL_STYLES_HH
#define CARDWORDS_GTK_COMMON_CARD_CELL_STYLES_HH

#include <gtk--/style.h>
#include <strstream.h>
#include "cardwords_gtk_cellattributetype.hh"

class CardWords_Gtk_Common_Card_Cell_Styles {
public:
  // This class has all styles needed for a CardCell.
  // As a CardCell can have different Sizes, and different
  // Font sizes are needed then for some members of the cardcell.
  // Styles for the cardcell the differ from size to size are members
  // of this struct.
  // Styles that are the same for all sizes are also in this struct,
  // but as static members

  CardWords_Gtk_Common_Card_Cell_Styles (size_t cell_width,
                      size_t cell_height);
  ~CardWords_Gtk_Common_Card_Cell_Styles();

  size_t
  get_cell_width(void) const;
  size_t
  get_cell_height(void) const;
  size_t
  get_frame_thickness(void) const;
  
  void
  change_sizes(size_t cell_width,
               size_t cell_height);

  // The style used for the Labels that inform about the word and letter
  // factors. These are only visible in an empty cell.
  Gtk::Style *
  get_values_font_style(void) const;
  
  // The styles used for the background of the cells:
  static Gtk::Style *
  get_attribute_bg_style(CardWords_Gtk_CellAttributeType type);

  // The styles used for the color of the frame
  static Gtk::Style *
  get_frame_normal_style(void);
  static Gtk::Style *
  get_frame_active_style(void); // used when the cell is selected to hold a
  //                               card in the next move.

  // The style used for the bg of the cards
  static Gtk::Style *
  get_card_bg_style(void);

  // The style used for the bg of cards that are not layed yet:
  static Gtk::Style *
  get_card_pre_bg_style(void);

  // The style used for the bg of cards that have most recently been layed:
  static Gtk::Style *
  get_card_recent_bg_style(void);

  // The style used for the meaning of a wildcard on the card:
  Gtk::Style *
  get_card_wildcard_meaning_style(void) const;
  // The style used for the face value of a card:
  Gtk::Style *
  get_card_face_value_style(void) const;
  // The style used for the points label on the card: 2 digits:
  Gtk::Style *
  get_card_points_narrow_style(void) const;
  // The style used for the points label on the card: 1 digit:
  Gtk::Style *
  get_card_points_wide_style(void) const;
  

private:
  static void
  init_static_styles(void);

  size_t cell_width;
  size_t cell_height;
  size_t frame_thickness;
  size_t value_width, word_factor_height, letter_factor_height;
  
  size_t card_width, card_height;
  size_t face_value_height, face_value_width;
  size_t points_narrow_height, points_wide_height;
  size_t points_narrow_width, points_wide_width;

  // The style used for the Labels that inform about the word and letter
  // factors. These are only visible in an empty cell.
  Gtk::Style * values_font_style;
  
  // The style used for the meaning of a wildcard on the card:
  Gtk::Style * card_wildcard_meaning_style;
  // The style used for the face value of a card:
  Gtk::Style * card_face_value_style;
  // The style used for the points label on the card: 2 digits:
  Gtk::Style * card_points_narrow_style;
  // The style used for the points label on the card: 1 digit:
  Gtk::Style * card_points_wide_style;

  
  // The styles used for the background of the card-table cells:
  static Gtk::Style * attribute_bg_style [CAT_LAST + 1];

  // The styles used for the color of the frame
  static Gtk::Style * frame_normal_style;
  static Gtk::Style * frame_active_style; // used when the cell is selected
  //                                        to hold a card in the next move.

  // The style used for the bg of the cards
  static Gtk::Style * card_bg_style;

  // The style used for the bg of cards that are not layed yet:
  static Gtk::Style * card_pre_bg_style;

  // The style used for the bg of cards that have most recently been layed:
  static Gtk::Style * card_recent_bg_style;
  
};

#endif
