/* 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 Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
 */

_CONFIGINCLUDE(gtkmmconfig.h)

#include <gtkmm/widget.h>
#include <glibmm/datetime.h>

_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/widget_p.h)

namespace Gtk
{

_CC_INCLUDE(gtk/gtk.h)

/** Displays a Gregorian calendar, one month at a time.
 *
 * The selected date can be retrieved from a `%Gtk::Calendar` using
 * get_date(). It can be altered with set_date().
 *
 * To place a visual marker on a particular day, use
 * mark_day() and to remove the marker, unmark_day(). Alternative, all
 * marks can be cleared with clear_marks().
 *
 * Users should be aware that, although the Gregorian calendar is the
 * legal calendar in most countries, it was adopted progressively
 * between 1582 and 1929. Display before these dates is likely to be
 * historically incorrect.
 *
 * # Shortcuts and Gestures
 *
 * `%Gtk::Calendar` supports the following gestures:
 *
 * - Scrolling up or down will switch to the previous or next month.
 * - Date strings can be dropped for setting the current day.
 *
 * The %Calendar widget looks like this:
 * @image html calendar1.png
 *
 * @ingroup Widgets
 */
class GTKMM_API Calendar : public Widget
{
  _CLASS_GTKOBJECT(Calendar, GtkCalendar, GTK_CALENDAR, Gtk::Widget, GtkWidget, , , GTKMM_API)
public:
  _CTOR_DEFAULT

  _WRAP_METHOD(void select_day(const Glib::DateTime& day), gtk_calendar_select_day,
    deprecated "4.20: Use set_date() instead.")
  _WRAP_METHOD(void mark_day(guint day), gtk_calendar_mark_day)
  _WRAP_METHOD(void unmark_day(guint day), gtk_calendar_unmark_day)
  _WRAP_METHOD(void clear_marks(), gtk_calendar_clear_marks)

  _WRAP_METHOD(void set_show_week_numbers(bool value = true), gtk_calendar_set_show_week_numbers)
  _WRAP_METHOD(bool get_show_week_numbers() const, gtk_calendar_get_show_week_numbers)
  _WRAP_METHOD(void set_show_heading(bool value = true), gtk_calendar_set_show_heading)
  _WRAP_METHOD(bool get_show_heading() const, gtk_calendar_get_show_heading)
  _WRAP_METHOD(void set_show_day_names(bool value = true), gtk_calendar_set_show_day_names)
  _WRAP_METHOD(bool get_show_day_names() const, gtk_calendar_get_show_day_names)

  _WRAP_METHOD(void set_day(int day), gtk_calendar_set_day)
  _WRAP_METHOD(int get_day() const, gtk_calendar_get_day)
  _WRAP_METHOD(void set_month(int month), gtk_calendar_set_month)
  _WRAP_METHOD(int get_month() const, gtk_calendar_get_month)
  _WRAP_METHOD(void set_year(int year), gtk_calendar_set_year)
  _WRAP_METHOD(int get_year() const, gtk_calendar_get_year)

  _WRAP_METHOD(void set_date(const Glib::DateTime& day), gtk_calendar_set_date)
  _WRAP_METHOD(Glib::DateTime get_date() const, gtk_calendar_get_date)

  _WRAP_METHOD(bool get_day_is_marked(guint day) const, gtk_calendar_get_day_is_marked)

  // no_default_handler because GtkCalendarClass is private.
  _WRAP_SIGNAL(void day_selected(), "day_selected", no_default_handler)
  _WRAP_SIGNAL(void prev_month(), "prev_month", no_default_handler)
  _WRAP_SIGNAL(void next_month(), "next_month", no_default_handler)
  _WRAP_SIGNAL(void prev_year(), "prev_year", no_default_handler)
  _WRAP_SIGNAL(void next_year(), "next_year", no_default_handler)

  _WRAP_PROPERTY("date", Glib::DateTime, newin "4,20")
  _WRAP_PROPERTY("year", int,
    deprecated "4.20: This property will be removed in GTK 5. Use property_date() instead.")
  _WRAP_PROPERTY("month", int,
    deprecated "4.20: This property will be removed in GTK 5. Use property_date() instead.")
  _WRAP_PROPERTY("day", int,
    deprecated "4.20: This property will be removed in GTK 5. Use property_date() instead.")
  _WRAP_PROPERTY("show-heading", bool)
  _WRAP_PROPERTY("show-day-names", bool)
  _WRAP_PROPERTY("show-week-numbers", bool)
};

} // namespace Gtk
