Adding the HildonCalendar based on Gtk Calendar. This effectively changes the license...
[hildon] / src / hildon-date-editor.c
index a4e9ab9..5213810 100644 (file)
 /**
  * SECTION:hildon-date-editor
  * @short_description: A widget which queries a date from user or opens
- * a HildonCalendarPopup
+ * a HildonCalendarPopup.
  * @see_also: #HildonCalendarPopup, #HildonTimeEditor
  * 
  * HildonDateEditor is a widget with three entry fields (day, month,
  * year) and an icon (button): clicking on the icon opens up a
  * HildonCalendarPopup.
+ *
+ * <example>
+ * <programlisting>
+ * gint y, m, d;
+ * <!-- -->
+ * date_editor = hildon_date_editor_new ();
+ * <!-- -->
+ * hildon_date_editor_get_date(date_editor, &amp;y, &amp;m, &amp;d);
+ * <!-- -->
+ * </programlisting>
+ * </example>
+ *
  */
 
 #ifdef                                          HAVE_CONFIG_H
@@ -40,6 +52,7 @@
 #include                                        "hildon-date-editor.h"
 #include                                        <glib.h>
 #include                                        <gtk/gtk.h>
+#include                                        <gtk/gtkenums.h>
 #include                                        <gdk/gdkkeysyms.h>
 #include                                        <time.h>
 #include                                        <stdlib.h>
@@ -47,7 +60,6 @@
 #include                                        <string.h>
 #include                                        "hildon-calendar-popup.h"
 #include                                        "hildon-defines.h"
-#include                                        "hildon-input-mode-hint.h"
 #include                                        "hildon-private.h"
 #include                                        "hildon-marshalers.h"
 #include                                        "hildon-enum-types.h"
@@ -118,7 +130,7 @@ hildon_date_editor_entry_focus_out              (GtkWidget *widget,
 
 static gboolean
 hildon_date_editor_date_error                   (HildonDateEditor *editor, 
-                                                HildonDateTimeError type);
+                                                 HildonDateTimeError type);
 
 static gboolean 
 hildon_date_editor_entry_focus_in               (GtkWidget *widget,
@@ -247,8 +259,8 @@ hildon_date_editor_class_init                   (HildonDateEditorClass *editor_c
             g_param_spec_uint ("year",
                 "Current year",
                 "Current year",
-                1, 2100,
-                2005,
+                1, 10000,
+                2007,
                 G_PARAM_READABLE | G_PARAM_WRITABLE));
 
     /**
@@ -286,7 +298,7 @@ hildon_date_editor_class_init                   (HildonDateEditorClass *editor_c
             g_param_spec_uint ("min-year",
                 "Minimum valid year",
                 "Minimum valid year",
-                1, 3000,
+                1, 10000,
                 DEFAULT_MIN_YEAR,
                 G_PARAM_READWRITE));
 
@@ -299,7 +311,7 @@ hildon_date_editor_class_init                   (HildonDateEditorClass *editor_c
             g_param_spec_uint ("max-year",
                 "Maximum valid year",
                 "Maximum valid year",
-                1, 3000,
+                1, 10000,
                 DEFAULT_MAX_YEAR,
                 G_PARAM_READWRITE));
 }
@@ -313,7 +325,7 @@ real_set_calendar_icon_state                    (HildonDateEditorPrivate *priv,
     g_assert (priv);
 
     gtk_image_set_from_icon_name (GTK_IMAGE (priv->calendar_icon),
-            pressed ? "qgn_widg_datedit_pr" : "qgn_widg_datedit", HILDON_ICON_SIZE_WIDG);
+            pressed ? "qgn_widg_datedit_pr" : "qgn_widg_datedit", HILDON_ICON_SIZE_SMALL);
 
     priv->calendar_icon_pressed = pressed;
 }
@@ -437,12 +449,12 @@ hildon_date_editor_init                         (HildonDateEditor *editor)
     priv->m_entry = gtk_entry_new ();
     priv->y_entry = gtk_entry_new ();
 
-    g_object_set (G_OBJECT(priv->d_entry), "input-mode", 
-            HILDON_INPUT_MODE_HINT_NUMERIC, NULL);
-    g_object_set (G_OBJECT(priv->m_entry), "input-mode", 
-            HILDON_INPUT_MODE_HINT_NUMERIC, NULL);
-    g_object_set (G_OBJECT(priv->y_entry), "input-mode", 
-            HILDON_INPUT_MODE_HINT_NUMERIC, NULL);
+    g_object_set (G_OBJECT(priv->d_entry), "hildon-input-mode", 
+            HILDON_GTK_INPUT_MODE_NUMERIC, NULL);
+    g_object_set (G_OBJECT(priv->m_entry), "hildon-input-mode", 
+            HILDON_GTK_INPUT_MODE_NUMERIC, NULL);
+    g_object_set (G_OBJECT(priv->y_entry), "hildon-input-mode", 
+            HILDON_GTK_INPUT_MODE_NUMERIC, NULL);
 
     /* set entry look */
     gtk_entry_set_width_chars (GTK_ENTRY (priv->d_entry), DAY_ENTRY_WIDTH);
@@ -767,9 +779,10 @@ hildon_date_editor_set_date                     (HildonDateEditor *editor,
  * @month: month
  * @day: day
  *
- * Returns: the year, month, and day currently on the
- * date editor. You can pass NULL to any of the pointers if
+ * Gets the date represented by the date editor.
+ * You can pass NULL to any of the pointers if
  * you're not interested in obtaining it. 
+ *
  */
 void 
 hildon_date_editor_get_date                     (HildonDateEditor *date,