00001
00002
00003 #ifndef _LIBGNOMEUIMM_DATEEDIT_H
00004 #define _LIBGNOMEUIMM_DATEEDIT_H
00005
00006 #include <glibmm.h>
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include <time.h>
00030 #include <gtkmm/box.h>
00031 #include <libgnomeui/gnometypebuiltins.h>
00032 #include <libgnomeui/gnome-dateedit.h>
00033
00034
00035 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00036 typedef struct _GnomeDateEdit GnomeDateEdit;
00037 typedef struct _GnomeDateEditClass GnomeDateEditClass;
00038 #endif
00039
00040
00041 namespace Gnome
00042 {
00043
00044 namespace UI
00045 { class DateEdit_Class; }
00046
00047 }
00048 namespace Gnome
00049 {
00050
00051 namespace UI
00052 {
00053
00067 enum DateEditFlags
00068 {
00069 DATE_EDIT_SHOW_TIME = 1 << 0,
00070 DATE_EDIT_24_HR = 1 << 1,
00071 DATE_EDIT_WEEK_STARTS_ON_MONDAY = 1 << 2
00072 };
00073
00075 inline DateEditFlags operator|(DateEditFlags lhs, DateEditFlags rhs)
00076 { return static_cast<DateEditFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
00077
00079 inline DateEditFlags operator&(DateEditFlags lhs, DateEditFlags rhs)
00080 { return static_cast<DateEditFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
00081
00083 inline DateEditFlags operator^(DateEditFlags lhs, DateEditFlags rhs)
00084 { return static_cast<DateEditFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
00085
00087 inline DateEditFlags operator~(DateEditFlags flags)
00088 { return static_cast<DateEditFlags>(~static_cast<unsigned>(flags)); }
00089
00091 inline DateEditFlags& operator|=(DateEditFlags& lhs, DateEditFlags rhs)
00092 { return (lhs = static_cast<DateEditFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
00093
00095 inline DateEditFlags& operator&=(DateEditFlags& lhs, DateEditFlags rhs)
00096 { return (lhs = static_cast<DateEditFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
00097
00099 inline DateEditFlags& operator^=(DateEditFlags& lhs, DateEditFlags rhs)
00100 { return (lhs = static_cast<DateEditFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
00101
00102 }
00103
00104 }
00105
00106
00107 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00108 namespace Glib
00109 {
00110
00111 template <>
00112 class Value<Gnome::UI::DateEditFlags> : public Glib::Value_Flags<Gnome::UI::DateEditFlags>
00113 {
00114 public:
00115 static GType value_type() G_GNUC_CONST;
00116 };
00117
00118 }
00119 #endif
00120
00121
00122 namespace Gnome
00123 {
00124
00125 namespace UI
00126 {
00127
00128
00134 class DateEdit : public Gtk::HBox
00135 {
00136 public:
00137 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00138 typedef DateEdit CppObjectType;
00139 typedef DateEdit_Class CppClassType;
00140 typedef GnomeDateEdit BaseObjectType;
00141 typedef GnomeDateEditClass BaseClassType;
00142 #endif
00143
00144 virtual ~DateEdit();
00145
00146 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00147
00148 private:
00149 friend class DateEdit_Class;
00150 static CppClassType dateedit_class_;
00151
00152
00153 DateEdit(const DateEdit&);
00154 DateEdit& operator=(const DateEdit&);
00155
00156 protected:
00157 explicit DateEdit(const Glib::ConstructParams& construct_params);
00158 explicit DateEdit(GnomeDateEdit* castitem);
00159
00160 #endif
00161
00162 public:
00163 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00164 static GType get_type() G_GNUC_CONST;
00165 static GType get_base_type() G_GNUC_CONST;
00166 #endif
00167
00169 GnomeDateEdit* gobj() { return reinterpret_cast<GnomeDateEdit*>(gobject_); }
00170
00172 const GnomeDateEdit* gobj() const { return reinterpret_cast<GnomeDateEdit*>(gobject_); }
00173
00174
00175 public:
00176
00177
00178 protected:
00179
00180
00181
00182 virtual void on_date_changed();
00183 virtual void on_time_changed();
00184
00185
00186 private:
00187
00188
00189 public:
00190 DateEdit(time_t, bool show_time = true, bool use_24_format = true);
00191 DateEdit(time_t the_time = 0, DateEditFlags flags = DATE_EDIT_SHOW_TIME);
00192
00193
00194 void set_time(time_t the_time);
00195
00196 time_t get_time() const;
00197
00198 void set_popup_range(int low_hour, int up_hour);
00199
00200 void set_flags(DateEditFlags flags);
00201
00202 DateEditFlags get_flags() const;
00203
00204 time_t get_initial_time() const;
00205
00206
00211 Glib::SignalProxy0<void> signal_date_changed();
00212
00213
00218 Glib::SignalProxy0<void> signal_time_changed();
00219
00220
00226 Glib::PropertyProxy<gulong> property_time();
00227
00233 Glib::PropertyProxy<DateEditFlags> property_dateedit_flags();
00234
00240 Glib::PropertyProxy<int> property_lower_hour();
00241
00247 Glib::PropertyProxy<int> property_upper_hour();
00248
00254 Glib::PropertyProxy<gulong> property_initial_time();
00255
00256
00257 };
00258
00259 }
00260 }
00261
00262 namespace Glib
00263 {
00265 Gnome::UI::DateEdit* wrap(GnomeDateEdit* object, bool take_copy = false);
00266 }
00267 #endif
00268