2
// Generated by gtkmmproc -- DO NOT MODIFY!
3
#ifndef _GTKMM_CALENDAR_H
4
#define _GTKMM_CALENDAR_H
6
#include <gtkmmconfig.h>
12
* Copyright (C) 1998-2002 The gtkmm Development Team
14
* This library is free software; you can redistribute it and/or
15
* modify it under the terms of the GNU Lesser General Public
16
* License as published by the Free Software Foundation; either
17
* version 2.1 of the License, or (at your option) any later version.
19
* This library is distributed in the hope that it will be useful,
20
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22
* Lesser General Public License for more details.
24
* You should have received a copy of the GNU Lesser General Public
25
* License along with this library; if not, write to the Free
26
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30
#include <gtkmm/widget.h>
31
#include <glibmm/date.h>
34
#ifndef DOXYGEN_SHOULD_SKIP_THIS
35
typedef struct _GtkCalendar GtkCalendar;
36
typedef struct _GtkCalendarClass GtkCalendarClass;
37
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
41
{ class Calendar_Class; } // namespace Gtk
46
/** @addtogroup gtkmmEnums gtkmm Enums and Flags */
50
* @par Bitwise operators:
51
* <tt>%CalendarDisplayOptions operator|(CalendarDisplayOptions, CalendarDisplayOptions)</tt><br>
52
* <tt>%CalendarDisplayOptions operator&(CalendarDisplayOptions, CalendarDisplayOptions)</tt><br>
53
* <tt>%CalendarDisplayOptions operator^(CalendarDisplayOptions, CalendarDisplayOptions)</tt><br>
54
* <tt>%CalendarDisplayOptions operator~(CalendarDisplayOptions)</tt><br>
55
* <tt>%CalendarDisplayOptions& operator|=(CalendarDisplayOptions&, CalendarDisplayOptions)</tt><br>
56
* <tt>%CalendarDisplayOptions& operator&=(CalendarDisplayOptions&, CalendarDisplayOptions)</tt><br>
57
* <tt>%CalendarDisplayOptions& operator^=(CalendarDisplayOptions&, CalendarDisplayOptions)</tt><br>
59
enum CalendarDisplayOptions
61
CALENDAR_SHOW_HEADING = 1 << 0,
62
CALENDAR_SHOW_DAY_NAMES = 1 << 1,
63
CALENDAR_NO_MONTH_CHANGE = 1 << 2,
64
CALENDAR_SHOW_WEEK_NUMBERS = 1 << 3,
65
CALENDAR_WEEK_START_MONDAY = 1 << 4,
66
CALENDAR_SHOW_DETAILS = 1 << 5
69
/** @ingroup gtkmmEnums */
70
inline CalendarDisplayOptions operator|(CalendarDisplayOptions lhs, CalendarDisplayOptions rhs)
71
{ return static_cast<CalendarDisplayOptions>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
73
/** @ingroup gtkmmEnums */
74
inline CalendarDisplayOptions operator&(CalendarDisplayOptions lhs, CalendarDisplayOptions rhs)
75
{ return static_cast<CalendarDisplayOptions>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
77
/** @ingroup gtkmmEnums */
78
inline CalendarDisplayOptions operator^(CalendarDisplayOptions lhs, CalendarDisplayOptions rhs)
79
{ return static_cast<CalendarDisplayOptions>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
81
/** @ingroup gtkmmEnums */
82
inline CalendarDisplayOptions operator~(CalendarDisplayOptions flags)
83
{ return static_cast<CalendarDisplayOptions>(~static_cast<unsigned>(flags)); }
85
/** @ingroup gtkmmEnums */
86
inline CalendarDisplayOptions& operator|=(CalendarDisplayOptions& lhs, CalendarDisplayOptions rhs)
87
{ return (lhs = static_cast<CalendarDisplayOptions>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
89
/** @ingroup gtkmmEnums */
90
inline CalendarDisplayOptions& operator&=(CalendarDisplayOptions& lhs, CalendarDisplayOptions rhs)
91
{ return (lhs = static_cast<CalendarDisplayOptions>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
93
/** @ingroup gtkmmEnums */
94
inline CalendarDisplayOptions& operator^=(CalendarDisplayOptions& lhs, CalendarDisplayOptions rhs)
95
{ return (lhs = static_cast<CalendarDisplayOptions>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
100
#ifndef DOXYGEN_SHOULD_SKIP_THIS
105
class Value<Gtk::CalendarDisplayOptions> : public Glib::Value_Flags<Gtk::CalendarDisplayOptions>
108
static GType value_type() G_GNUC_CONST;
112
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
119
/** Display a calendar and/or allow the user to select a date.
121
* This is a widget that displays a calendar, one month at a time.
123
* The month and year currently displayed can be altered with
124
* select_month(). The exact day can be selected from the displayed month
125
* using select_day().
127
* The way in which the calendar itself is displayed can be altered using
128
* set_display_options().
130
* The selected date can be retrieved from a GtkCalendar using get_date().
132
* If performing many 'mark' operations, the calendar can be frozen to
133
* prevent flicker, using freeze(), and 'thawed' again using thaw().
135
* The Calendar widget looks like this:
136
* @image html calendar1.png
141
class Calendar : public Widget
144
#ifndef DOXYGEN_SHOULD_SKIP_THIS
145
typedef Calendar CppObjectType;
146
typedef Calendar_Class CppClassType;
147
typedef GtkCalendar BaseObjectType;
148
typedef GtkCalendarClass BaseClassType;
149
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
153
#ifndef DOXYGEN_SHOULD_SKIP_THIS
156
friend class Calendar_Class;
157
static CppClassType calendar_class_;
160
Calendar(const Calendar&);
161
Calendar& operator=(const Calendar&);
164
explicit Calendar(const Glib::ConstructParams& construct_params);
165
explicit Calendar(GtkCalendar* castitem);
167
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
170
#ifndef DOXYGEN_SHOULD_SKIP_THIS
171
static GType get_type() G_GNUC_CONST;
174
static GType get_base_type() G_GNUC_CONST;
177
///Provides access to the underlying C GtkObject.
178
GtkCalendar* gobj() { return reinterpret_cast<GtkCalendar*>(gobject_); }
180
///Provides access to the underlying C GtkObject.
181
const GtkCalendar* gobj() const { return reinterpret_cast<GtkCalendar*>(gobject_); }
185
//C++ methods used to invoke GTK+ virtual functions:
188
//GTK+ Virtual Functions (override these to change behaviour):
190
//Default Signal Handlers::
191
virtual void on_month_changed();
192
virtual void on_day_selected();
193
virtual void on_day_selected_double_click();
194
virtual void on_prev_month();
195
virtual void on_next_month();
196
virtual void on_prev_year();
197
virtual void on_next_year();
206
/** Shifts the calendar to a different month.
208
* Note that this function always returns <tt>true</tt>, and you should
209
* ignore the return value. In GTK+ 3, this function will not
211
* @param month A month number between 0 and 11.
212
* @param year The year the month is in.
213
* @return <tt>true</tt>, always.
215
int select_month(guint month, guint year);
217
/** Selects a day from the current month.
218
* @param day The day number between 1 and 31, or 0 to unselect
219
* the currently selected day.
221
void select_day(guint day);
223
/** Places a visual marker on a particular day.
225
* Note that this function always returns <tt>true</tt>, and you should
226
* ignore the return value. In GTK+ 3, this function will not
228
* @param day The day number to mark between 1 and 31.
229
* @return <tt>true</tt>, always.
231
int mark_day(guint day);
233
/** Removes the visual marker from a particular day.
235
* Note that this function always returns <tt>true</tt>, and you should
236
* ignore the return value. In GTK+ 3, this function will not
238
* @param day The day number to unmark between 1 and 31.
239
* @return <tt>true</tt>, always.
241
int unmark_day(guint day);
243
/** Remove all visual markers.
248
#ifndef GTKMM_DISABLE_DEPRECATED
250
/** Sets display options (whether to display the heading and the month headings).
252
* Deprecated: 2.4: Use set_display_options() instead
253
* @param flags The display options to set.
255
void display_options(CalendarDisplayOptions flags);
256
#endif // GTKMM_DISABLE_DEPRECATED
259
/** Sets display options (whether to display the heading and the month
263
* @param flags The display options to set.
265
void set_display_options(CalendarDisplayOptions flags);
267
/** Returns the current display options of @a calendar.
270
* @return The display options.
272
CalendarDisplayOptions get_display_options() const;
275
/** Obtains the selected date from a Gtk::Calendar.
276
* @param year Location to store the year number, or <tt>0</tt>.
277
* @param month Location to store the month number (between 0 and 11), or <tt>0</tt>.
278
* @param day Location to store the day number (between 1 and 31), or <tt>0</tt>.
280
void get_date(guint& year, guint& month, guint& day) const;
281
// Additional method not in GTK (#350584)
282
/** Get the date as Glib::Date
284
* @param date Referenz to set the date
286
void get_date(Glib::Date& date) const;
288
/** Detail markup handler.
291
* Glib::ustring on_calendar_details(guint year, guint month, guint day);
294
* @param year The year for which details are needed.
295
* @param month The month for which details are needed.
296
* @param day The day of @month for which details are needed.
297
* @result Pango markup with details for the specified day, or an empty string.
299
* This callback function provides Pango markup with detail information for the
300
* specified day. Examples for such details are holidays or appointments. The
301
* function should return an empty string when no information is available.
305
typedef sigc::slot<Glib::ustring, guint, guint, guint> SlotDetails;
307
/** Installs a function which provides Pango markup with detail information
308
* for each day. Examples for such details are holidays or appointments. That
309
* information is shown below each day when show-details is set.
310
* A tooltip containing full detail information is provided if the entire
311
* text could not fit into the details area, or if the show-details property
314
* The size of the details area can be restricted by setting the
315
* detail-width-chars and detail-height-rows properties.
317
* @param slot A callback function providing details for each day.
321
void set_detail_func(const SlotDetails& slot);
324
/** Updates the width of detail cells.
325
* See Gtk::Calendar:detail-width-chars.
328
* @param chars Detail width in characters.
330
void set_detail_width_chars(int chars);
332
/** Updates the height of detail cells.
333
* See Gtk::Calendar:detail-height-rows.
336
* @param rows Detail height in rows.
338
void set_detail_height_rows(int rows);
341
/** Queries the width of detail cells, in characters.
342
* See Gtk::Calendar:detail-width-chars.
345
* @return The width of detail cells, in characters.
347
int get_detail_width_chars() const;
349
/** Queries the height of detail cells, in rows.
350
* See Gtk::Calendar:detail-width-chars.
353
* @return The height of detail cells, in rows.
355
int get_detail_height_rows() const;
358
#ifndef GTKMM_DISABLE_DEPRECATED
360
/** Does nothing. Previously locked the display of the calendar until
361
* it was thawed with thaw().
366
#endif // GTKMM_DISABLE_DEPRECATED
369
#ifndef GTKMM_DISABLE_DEPRECATED
371
/** Does nothing. Previously defrosted a calendar; all the changes made
372
* since the last freeze() were displayed.
377
#endif // GTKMM_DISABLE_DEPRECATED
382
* <tt>void on_my_%month_changed()</tt>
385
Glib::SignalProxy0< void > signal_month_changed();
390
* <tt>void on_my_%day_selected()</tt>
393
Glib::SignalProxy0< void > signal_day_selected();
398
* <tt>void on_my_%day_selected_double_click()</tt>
401
Glib::SignalProxy0< void > signal_day_selected_double_click();
406
* <tt>void on_my_%prev_month()</tt>
409
Glib::SignalProxy0< void > signal_prev_month();
414
* <tt>void on_my_%next_month()</tt>
417
Glib::SignalProxy0< void > signal_next_month();
422
* <tt>void on_my_%prev_year()</tt>
425
Glib::SignalProxy0< void > signal_prev_year();
430
* <tt>void on_my_%next_year()</tt>
433
Glib::SignalProxy0< void > signal_next_year();
436
#ifdef GLIBMM_PROPERTIES_ENABLED
437
/** The selected year.
439
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
440
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
441
* the value of the property changes.
443
Glib::PropertyProxy<int> property_year() ;
444
#endif //#GLIBMM_PROPERTIES_ENABLED
446
#ifdef GLIBMM_PROPERTIES_ENABLED
447
/** The selected year.
449
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
450
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
451
* the value of the property changes.
453
Glib::PropertyProxy_ReadOnly<int> property_year() const;
454
#endif //#GLIBMM_PROPERTIES_ENABLED
456
#ifdef GLIBMM_PROPERTIES_ENABLED
457
/** The selected month (as a number between 0 and 11).
459
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
460
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
461
* the value of the property changes.
463
Glib::PropertyProxy<int> property_month() ;
464
#endif //#GLIBMM_PROPERTIES_ENABLED
466
#ifdef GLIBMM_PROPERTIES_ENABLED
467
/** The selected month (as a number between 0 and 11).
469
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
470
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
471
* the value of the property changes.
473
Glib::PropertyProxy_ReadOnly<int> property_month() const;
474
#endif //#GLIBMM_PROPERTIES_ENABLED
476
#ifdef GLIBMM_PROPERTIES_ENABLED
477
/** The selected day (as a number between 1 and 31, or 0 to unselect the currently selected day).
479
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
480
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
481
* the value of the property changes.
483
Glib::PropertyProxy<int> property_day() ;
484
#endif //#GLIBMM_PROPERTIES_ENABLED
486
#ifdef GLIBMM_PROPERTIES_ENABLED
487
/** The selected day (as a number between 1 and 31, or 0 to unselect the currently selected day).
489
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
490
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
491
* the value of the property changes.
493
Glib::PropertyProxy_ReadOnly<int> property_day() const;
494
#endif //#GLIBMM_PROPERTIES_ENABLED
496
#ifdef GLIBMM_PROPERTIES_ENABLED
497
/** If TRUE, a heading is displayed.
499
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
500
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
501
* the value of the property changes.
503
Glib::PropertyProxy<bool> property_show_heading() ;
504
#endif //#GLIBMM_PROPERTIES_ENABLED
506
#ifdef GLIBMM_PROPERTIES_ENABLED
507
/** If TRUE, a heading is displayed.
509
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
510
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
511
* the value of the property changes.
513
Glib::PropertyProxy_ReadOnly<bool> property_show_heading() const;
514
#endif //#GLIBMM_PROPERTIES_ENABLED
516
#ifdef GLIBMM_PROPERTIES_ENABLED
517
/** If TRUE, day names are displayed.
519
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
520
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
521
* the value of the property changes.
523
Glib::PropertyProxy<bool> property_show_day_names() ;
524
#endif //#GLIBMM_PROPERTIES_ENABLED
526
#ifdef GLIBMM_PROPERTIES_ENABLED
527
/** If TRUE, day names are displayed.
529
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
530
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
531
* the value of the property changes.
533
Glib::PropertyProxy_ReadOnly<bool> property_show_day_names() const;
534
#endif //#GLIBMM_PROPERTIES_ENABLED
536
#ifdef GLIBMM_PROPERTIES_ENABLED
537
/** If TRUE, the selected month cannot be changed.
539
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
540
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
541
* the value of the property changes.
543
Glib::PropertyProxy<bool> property_no_month_change() ;
544
#endif //#GLIBMM_PROPERTIES_ENABLED
546
#ifdef GLIBMM_PROPERTIES_ENABLED
547
/** If TRUE, the selected month cannot be changed.
549
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
550
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
551
* the value of the property changes.
553
Glib::PropertyProxy_ReadOnly<bool> property_no_month_change() const;
554
#endif //#GLIBMM_PROPERTIES_ENABLED
556
#ifdef GLIBMM_PROPERTIES_ENABLED
557
/** If TRUE, week numbers are displayed.
559
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
560
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
561
* the value of the property changes.
563
Glib::PropertyProxy<bool> property_show_week_numbers() ;
564
#endif //#GLIBMM_PROPERTIES_ENABLED
566
#ifdef GLIBMM_PROPERTIES_ENABLED
567
/** If TRUE, week numbers are displayed.
569
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
570
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
571
* the value of the property changes.
573
Glib::PropertyProxy_ReadOnly<bool> property_show_week_numbers() const;
574
#endif //#GLIBMM_PROPERTIES_ENABLED
576
#ifdef GLIBMM_PROPERTIES_ENABLED
577
/** If TRUE, details are shown.
579
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
580
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
581
* the value of the property changes.
583
Glib::PropertyProxy<bool> property_show_details() ;
584
#endif //#GLIBMM_PROPERTIES_ENABLED
586
#ifdef GLIBMM_PROPERTIES_ENABLED
587
/** If TRUE, details are shown.
589
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
590
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
591
* the value of the property changes.
593
Glib::PropertyProxy_ReadOnly<bool> property_show_details() const;
594
#endif //#GLIBMM_PROPERTIES_ENABLED
596
#ifdef GLIBMM_PROPERTIES_ENABLED
597
/** Details width in characters.
599
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
600
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
601
* the value of the property changes.
603
Glib::PropertyProxy<int> property_detail_width_chars() ;
604
#endif //#GLIBMM_PROPERTIES_ENABLED
606
#ifdef GLIBMM_PROPERTIES_ENABLED
607
/** Details width in characters.
609
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
610
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
611
* the value of the property changes.
613
Glib::PropertyProxy_ReadOnly<int> property_detail_width_chars() const;
614
#endif //#GLIBMM_PROPERTIES_ENABLED
616
#ifdef GLIBMM_PROPERTIES_ENABLED
617
/** Details height in rows.
619
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
620
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
621
* the value of the property changes.
623
Glib::PropertyProxy<int> property_detail_height_rows() ;
624
#endif //#GLIBMM_PROPERTIES_ENABLED
626
#ifdef GLIBMM_PROPERTIES_ENABLED
627
/** Details height in rows.
629
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
630
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
631
* the value of the property changes.
633
Glib::PropertyProxy_ReadOnly<int> property_detail_height_rows() const;
634
#endif //#GLIBMM_PROPERTIES_ENABLED
644
/** A Glib::wrap() method for this object.
646
* @param object The C instance.
647
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
648
* @result A C++ instance that wraps this C instance.
650
* @relates Gtk::Calendar
652
Gtk::Calendar* wrap(GtkCalendar* object, bool take_copy = false);
656
#endif /* _GTKMM_CALENDAR_H */