00001
00002
00003 #ifndef _LIBGNOMEUIMM_DATEEDIT_H
00004 #define _LIBGNOMEUIMM_DATEEDIT_H
00005
00006
00007 #include <glibmm.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include <time.h>
00031 #include <gtkmm/box.h>
00032 #include <libgnomeui/gnometypebuiltins.h>
00033 #include <libgnomeui/gnome-dateedit.h>
00034
00035
00036 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00037 typedef struct _GnomeDateEdit GnomeDateEdit;
00038 typedef struct _GnomeDateEditClass GnomeDateEditClass;
00039 #endif
00040
00041
00042 namespace Gnome
00043 {
00044
00045 namespace UI
00046 { class DateEdit_Class; }
00047
00048 }
00049 namespace Gnome
00050 {
00051
00052 namespace UI
00053 {
00054
00068 enum DateEditFlags
00069 {
00070 DATE_EDIT_SHOW_TIME = 1 << 0,
00071 DATE_EDIT_24_HR = 1 << 1,
00072 DATE_EDIT_WEEK_STARTS_ON_MONDAY = 1 << 2
00073 };
00074
00076 inline DateEditFlags operator|(DateEditFlags lhs, DateEditFlags rhs)
00077 { return static_cast<DateEditFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
00078
00080 inline DateEditFlags operator&(DateEditFlags lhs, DateEditFlags rhs)
00081 { return static_cast<DateEditFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
00082
00084 inline DateEditFlags operator^(DateEditFlags lhs, DateEditFlags rhs)
00085 { return static_cast<DateEditFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
00086
00088 inline DateEditFlags operator~(DateEditFlags flags)
00089 { return static_cast<DateEditFlags>(~static_cast<unsigned>(flags)); }
00090
00092 inline DateEditFlags& operator|=(DateEditFlags& lhs, DateEditFlags rhs)
00093 { return (lhs = static_cast<DateEditFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
00094
00096 inline DateEditFlags& operator&=(DateEditFlags& lhs, DateEditFlags rhs)
00097 { return (lhs = static_cast<DateEditFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
00098
00100 inline DateEditFlags& operator^=(DateEditFlags& lhs, DateEditFlags rhs)
00101 { return (lhs = static_cast<DateEditFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
00102
00103 }
00104
00105 }
00106
00107
00108 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00109 namespace Glib
00110 {
00111
00112 template <>
00113 class Value<Gnome::UI::DateEditFlags> : public Glib::Value_Flags<Gnome::UI::DateEditFlags>
00114 {
00115 public:
00116 static GType value_type() G_GNUC_CONST;
00117 };
00118
00119 }
00120 #endif
00121
00122
00123 namespace Gnome
00124 {
00125
00126 namespace UI
00127 {
00128
00129
00135 class DateEdit : public Gtk::HBox
00136 {
00137 public:
00138 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00139 typedef DateEdit CppObjectType;
00140 typedef DateEdit_Class CppClassType;
00141 typedef GnomeDateEdit BaseObjectType;
00142 typedef GnomeDateEditClass BaseClassType;
00143 #endif
00144
00145 virtual ~DateEdit();
00146
00147 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00148
00149 private:
00150 friend class DateEdit_Class;
00151 static CppClassType dateedit_class_;
00152
00153
00154 DateEdit(const DateEdit&);
00155 DateEdit& operator=(const DateEdit&);
00156
00157 protected:
00158 explicit DateEdit(const Glib::ConstructParams& construct_params);
00159 explicit DateEdit(GnomeDateEdit* castitem);
00160
00161 #endif
00162
00163 public:
00164 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00165 static GType get_type() G_GNUC_CONST;
00166 static GType get_base_type() G_GNUC_CONST;
00167 #endif
00168
00170 GnomeDateEdit* gobj() { return reinterpret_cast<GnomeDateEdit*>(gobject_); }
00171
00173 const GnomeDateEdit* gobj() const { return reinterpret_cast<GnomeDateEdit*>(gobject_); }
00174
00175
00176 public:
00177
00178
00179 protected:
00180
00181
00182
00183 virtual void on_date_changed();
00184 virtual void on_time_changed();
00185
00186
00187 private:
00188
00189
00190 public:
00191 DateEdit(time_t, bool show_time = true, bool use_24_format = true);
00192 DateEdit(time_t the_time = 0, DateEditFlags flags = DATE_EDIT_SHOW_TIME);
00193
00194
00195 void set_time(time_t the_time);
00196
00197 time_t get_time() const;
00198
00199 void set_popup_range(int low_hour, int up_hour);
00200
00201 void set_flags(DateEditFlags flags);
00202
00203 DateEditFlags get_flags() const;
00204
00205 time_t get_initial_time() const;
00206
00207
00208 Glib::SignalProxy0< void > signal_date_changed();
00209
00210
00211 Glib::SignalProxy0< void > signal_time_changed();
00212
00213
00220 Glib::PropertyProxy<gulong> property_time() ;
00221
00228 Glib::PropertyProxy_ReadOnly<gulong> property_time() const;
00229
00236 Glib::PropertyProxy<DateEditFlags> property_dateedit_flags() ;
00237
00244 Glib::PropertyProxy_ReadOnly<DateEditFlags> property_dateedit_flags() const;
00245
00252 Glib::PropertyProxy<int> property_lower_hour() ;
00253
00260 Glib::PropertyProxy_ReadOnly<int> property_lower_hour() const;
00261
00268 Glib::PropertyProxy<int> property_upper_hour() ;
00269
00276 Glib::PropertyProxy_ReadOnly<int> property_upper_hour() const;
00277
00284 Glib::PropertyProxy<gulong> property_initial_time() ;
00285
00292 Glib::PropertyProxy_ReadOnly<gulong> property_initial_time() const;
00293
00294
00295 };
00296
00297 }
00298 }
00299
00300
00301 namespace Glib
00302 {
00308 Gnome::UI::DateEdit* wrap(GnomeDateEdit* object, bool take_copy = false);
00309 }
00310
00311
00312 #endif
00313