+
+/**
+ * hildon_date_editor_set_year:
+ * @editor: the @HildonDateEditor widget
+ * @year: year
+ *
+ * This function sets the year shown in the editor.
+ *
+ * Return: Returns TRUE if the year is valid.
+ **/
+gboolean hildon_date_editor_set_year(HildonDateEditor *editor, guint year)
+{
+ HildonDateEditorPrivate *priv;
+ g_return_val_if_fail( HILDON_IS_DATE_EDITOR(editor), FALSE );
+ priv = HILDON_DATE_EDITOR_GET_PRIVATE(editor);
+
+ if (g_date_valid_dmy(priv->day, priv->month, year))
+ {
+ GDate date;
+ gchar str[MAX_DATE_LEN + 1];
+ priv->year = year;
+ g_date_set_dmy(&date, priv->day, priv->month, year);
+
+ g_date_strftime(str, MAX_DATE_LEN, "%EY", &date);
+ gtk_entry_set_text(GTK_ENTRY(priv->y_entry), str);
+
+ g_object_notify(G_OBJECT(editor), "year");
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/**
+ * hildon_date_editor_set_month:
+ * @editor: the @HildonDateEditor widget
+ * @month: month
+ *
+ * This function sets the month shown in the editor.
+ *
+ * Return: Returns TRUE if the month is valid.
+ **/
+gboolean hildon_date_editor_set_month(HildonDateEditor *editor, guint month)
+{
+ HildonDateEditorPrivate *priv;
+ g_return_val_if_fail( HILDON_IS_DATE_EDITOR(editor), FALSE );
+ priv = HILDON_DATE_EDITOR_GET_PRIVATE(editor);
+
+ if (g_date_valid_dmy(priv->day, month, priv->year))
+ {
+ GDate date;
+ gchar str[MAX_DATE_LEN + 1];
+ priv->month = month;
+ g_date_set_dmy(&date, priv->day, month, priv->year);
+
+ g_date_strftime(str, MAX_DATE_LEN, "%m", &date);
+ gtk_entry_set_text(GTK_ENTRY(priv->m_entry), str);
+
+ g_object_notify(G_OBJECT(editor), "month");
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/**
+ * hildon_date_editor_set_day:
+ * @editor: the @HildonDateEditor widget
+ * @day: day
+ *
+ * This function sets the day shown in the editor.
+ *
+ * Return: Returns TRUE if the day is valid.
+ **/
+gboolean hildon_date_editor_set_day(HildonDateEditor *editor, guint day)
+{
+ HildonDateEditorPrivate *priv;
+
+ g_return_val_if_fail( HILDON_IS_DATE_EDITOR(editor), FALSE );
+ priv = HILDON_DATE_EDITOR_GET_PRIVATE(editor);
+
+ if (g_date_valid_dmy(day, priv->month, priv->year))
+ {
+ GDate date;
+ gchar str[MAX_DATE_LEN + 1];
+ priv->day = day;
+ g_date_set_dmy(&date, day, priv->month, priv->year);
+
+ g_date_strftime(str, MAX_DATE_LEN, "%d", &date);
+ gtk_entry_set_text(GTK_ENTRY(priv->d_entry), str);
+
+ g_object_notify(G_OBJECT(editor), "day");
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/**
+ * hildon_date_editor_get_year:
+ * @editor: the @HildonDateEditor widget
+ *
+ * This function gets the year shown in the editor.
+ *
+ * Return: Returns the current year shown in the editor.
+ **/
+guint hildon_date_editor_get_year(HildonDateEditor *editor)
+{
+ HildonDateEditorPrivate *priv;
+ g_return_val_if_fail( HILDON_IS_DATE_EDITOR(editor), 0 );
+ priv = HILDON_DATE_EDITOR_GET_PRIVATE(editor);
+ return priv->year;
+}
+
+/**
+ * hildon_date_editor_get_month:
+ * @editor: the @HildonDateEditor widget
+ *
+ * This function gets the month shown in the editor.
+ *
+ * Return: Returns the current month shown in the editor.
+ **/
+
+guint hildon_date_editor_get_month(HildonDateEditor *editor)
+{
+ HildonDateEditorPrivate *priv;
+ g_return_val_if_fail( HILDON_IS_DATE_EDITOR(editor), 0 );
+ priv = HILDON_DATE_EDITOR_GET_PRIVATE(editor);
+ return priv->month;
+}
+
+/**
+ * hildon_date_editor_get_day:
+ * @editor: the @HildonDateEditor widget
+ *
+ * This function gets the day shown in the editor.
+ *
+ * Return: Returns the current day shown in the editor.
+ **/
+
+guint hildon_date_editor_get_day(HildonDateEditor *editor)
+{
+ HildonDateEditorPrivate *priv;
+ g_return_val_if_fail( HILDON_IS_DATE_EDITOR(editor), 0 );
+ priv = HILDON_DATE_EDITOR_GET_PRIVATE(editor);
+ return priv->day;
+}