/* $Id: calendar.hg,v 1.6 2006/02/25 12:38:11 murrayc Exp $ */

/* calendar.h
 * 
 * Copyright (C) 1998-2002 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <gtkmm/widget.h>
#include <glibmm/date.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/widget_p.h)


namespace Gtk
{

_CC_INCLUDE(gtk/gtktypebuiltins.h)
_WRAP_ENUM(CalendarDisplayOptions, GtkCalendarDisplayOptions)

/** Display a calendar and/or allow the user to select a date.
 *
 * This is a widget that displays a calendar, one month at a time.
 *
 * The month and year currently displayed can be altered with
 * select_month().  The exact day can be selected from the displayed month
 * using select_day().
 *
 * The way in which the calendar itself is displayed can be altered using
 * set_display_options().
 *
 * The selected date can be retrieved from a GtkCalendar using get_date().
 *
 * If performing many 'mark' operations, the calendar can be frozen to
 * prevent flicker, using freeze(), and 'thawed' again using thaw().
 *
 * @ingroup Widgets
 */
class Calendar : public Widget
{
  _CLASS_GTKOBJECT(Calendar,GtkCalendar,GTK_CALENDAR,Gtk::Widget,GtkWidget)
public:
  _CTOR_DEFAULT
  
  _WRAP_METHOD(int select_month(guint month, guint year), gtk_calendar_select_month)
  _WRAP_METHOD(void select_day(guint day), gtk_calendar_select_day)
  _WRAP_METHOD(int mark_day(guint day), gtk_calendar_mark_day)
  _WRAP_METHOD(int unmark_day(guint day), gtk_calendar_unmark_day)
  _WRAP_METHOD(void clear_marks(), gtk_calendar_clear_marks)

  _WRAP_METHOD(void display_options(CalendarDisplayOptions flags), gtk_calendar_display_options, deprecated)

  _WRAP_METHOD(void set_display_options(CalendarDisplayOptions flags), gtk_calendar_set_display_options)
  _WRAP_METHOD(CalendarDisplayOptions get_display_options() const, gtk_calendar_get_display_options)

  _WRAP_METHOD(void get_date(guint& year, guint& month, guint& day) const, gtk_calendar_get_date)
  // Additional method not in GTK (#350584)
  /** Get the date as Glib::Date
   *
   * @param date Referenz to set the date
   */
  void get_date(Glib::Date& date) const;
  
  _WRAP_METHOD(void freeze(), gtk_calendar_freeze)
  _WRAP_METHOD(void thaw(), gtk_calendar_thaw)

  _WRAP_SIGNAL(void month_changed(), "month_changed")
  _WRAP_SIGNAL(void day_selected(), "day_selected")
  _WRAP_SIGNAL(void day_selected_double_click(), "day_selected_double_click")
  _WRAP_SIGNAL(void prev_month(), "prev_month")
  _WRAP_SIGNAL(void next_month(), "next_month")
  _WRAP_SIGNAL(void prev_year(), "prev_year")
  _WRAP_SIGNAL(void next_year(), "next_year")
};

} /* namespace Gtk */

