GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

calendar.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2002-2004 The GFC Development Team. 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00023 00024 #ifndef GFC_GTK_CALENDAR_HH 00025 #define GFC_GTK_CALENDAR_HH 00026 00027 #ifndef GFC_GTK_WIDGET_HH 00028 #include <gfc/gtk/widget.hh> 00029 #endif 00030 00031 #ifndef __GTK_CALENDAR_H__ 00032 #include <gtk/gtkcalendar.h> 00033 #endif 00034 00035 namespace GFC { 00036 00037 namespace Gtk { 00038 00041 00042 enum CalendarDisplayOptions 00043 { 00044 CALENDAR_SHOW_HEADING = GTK_CALENDAR_SHOW_HEADING, 00046 CALENDAR_SHOW_DAY_NAMES = GTK_CALENDAR_SHOW_DAY_NAMES, 00048 CALENDAR_NO_MONTH_CHANGE = GTK_CALENDAR_NO_MONTH_CHANGE, 00050 CALENDAR_SHOW_WEEK_NUMBERS = GTK_CALENDAR_SHOW_WEEK_NUMBERS, 00052 CALENDAR_WEEK_START_MONDAY = GTK_CALENDAR_WEEK_START_MONDAY 00054 }; 00055 00057 00058 typedef unsigned int CalendarDisplayOptionsField; 00059 00071 00072 class Calendar : public Widget 00073 { 00074 friend class G::Object; 00075 00076 Calendar(const Calendar&); 00077 Calendar& operator=(const Calendar&); 00078 00079 protected: 00082 00083 explicit Calendar(GtkCalendar *calendar, bool owns_reference = false); 00090 00094 00095 typedef G::Signal<void> MonthChangedSignalType; 00096 typedef G::SignalProxy<TypeInstance, MonthChangedSignalType> MonthChangedSignalProxy; 00097 static const MonthChangedSignalType month_changed_signal; 00102 00103 typedef G::Signal<void> DaySelectedSignalType; 00104 typedef G::SignalProxy<TypeInstance, DaySelectedSignalType> DaySelectedSignalProxy; 00105 static const DaySelectedSignalType day_selected_signal; 00110 00111 typedef G::Signal<void> DaySelectedDoubleClickSignalType; 00112 typedef G::SignalProxy<TypeInstance, DaySelectedDoubleClickSignalType> DaySelectedDoubleClickSignalProxy; 00113 static const DaySelectedDoubleClickSignalType day_selected_double_click_signal; 00118 00119 typedef G::Signal<void> PrevMonthSignalType; 00120 typedef G::SignalProxy<TypeInstance, PrevMonthSignalType> PrevMonthSignalProxy; 00121 static const PrevMonthSignalType prev_month_signal; 00126 00127 typedef G::Signal<void> NextMonthSignalType; 00128 typedef G::SignalProxy<TypeInstance, NextMonthSignalType> NextMonthSignalProxy; 00129 static const NextMonthSignalType next_month_signal; 00134 00135 typedef G::Signal<void> PrevYearSignalType; 00136 typedef G::SignalProxy<TypeInstance, PrevYearSignalType> PrevYearSignalProxy; 00137 static const PrevYearSignalType prev_year_signal; 00142 00143 typedef G::Signal<void> NextYearSignalType; 00144 typedef G::SignalProxy<TypeInstance, NextYearSignalType> NextYearSignalProxy; 00145 static const NextYearSignalType next_year_signal; 00150 00152 00153 public: 00156 00157 Calendar(); 00159 00160 explicit Calendar(CalendarDisplayOptionsField flags); 00165 00166 virtual ~Calendar(); 00168 00172 00173 GtkCalendar* gtk_calendar() const; 00175 00176 operator GtkCalendar* () const; 00178 00179 int year() const; 00181 00182 int month() const; 00184 00185 int day() const; 00187 00188 int num_marked_dates() const; 00190 00191 std::vector<bool> marked_date() const; 00193 00194 void get_date(int *year, int *month, int *day) const; 00199 00200 CalendarDisplayOptionsField get_display_options() const; 00203 00207 00208 bool select_month(int month, int year); 00213 00214 void select_day(int day); 00217 00218 bool mark_day(int day); 00222 00223 bool unmark_day(int day); 00227 00228 void clear_marks(); 00230 00231 void set_display_options(CalendarDisplayOptionsField flags); 00234 00235 void freeze(); 00237 00238 void thaw(); 00240 00244 00245 const MonthChangedSignalProxy sig_month_changed(); 00247 00248 const DaySelectedSignalProxy sig_day_selected(); 00250 00251 const DaySelectedDoubleClickSignalProxy sig_day_selected_double_click(); 00253 00254 const PrevMonthSignalProxy sig_prev_month(); 00256 00257 const NextMonthSignalProxy sig_next_month(); 00259 00260 const PrevYearSignalProxy sig_prev_year(); 00262 00263 const NextYearSignalProxy sig_next_year(); 00265 00267 }; 00268 00269 } // namespace Gtk 00270 00271 } // namespace GFC 00272 00273 #include <gfc/gtk/inline/calendar.inl> 00274 00275 #endif // GFC_GTK_CALENDAR_HH 00276

Generated on Tue Aug 24 00:34:30 2004 for GFC-UI by doxygen 1.3.8