datetime_base.h

Go to the documentation of this file.
00001 #ifndef DATETIME_BASE_H
00002 #define DATETIME_BASE_H
00003 
00004 /*
00005  * File Name: datetime_base.h
00006  */
00007 
00008 /*
00009  * This file is part of settings.
00010  *
00011  * settings is free software: you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation, either version 2 of the License, or
00014  * (at your option) any later version.
00015  *
00016  * settings is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program. If not, see <http://www.gnu.org/licenses/>.
00023  */
00024 
00025 /**
00026  * Copyright (C) 2009 iRex Technologies B.V.
00027  * All rights reserved.
00028  */
00029  
00030 /* 
00031  * Create and init the date/time widgets. 
00032  * User can use keys to set the date/time and moving the focus.
00033  */
00034 
00035 #include <time.h>
00036 
00037 #include <glib.h>
00038 #include <gtk/gtk.h>
00039 
00040 // Data of data/time.
00041 typedef struct
00042 {
00043     time_t orig_datetime;
00044     time_t cur_datetime;
00045 } DateTimeSettings;
00046 
00047 typedef struct
00048 {
00049     GtkWidget * parent;          // The container widget 
00050                                  // holding all datetime base widgets.
00051     
00052     GtkWidget * label_timezone;  // Widgets related with timezone.
00053     GtkWidget * label_timezone_desc;
00054     GtkWidget * timezone_button;
00055     GtkWidget * label_dst_desc;
00056     GtkWidget * dst_button;    
00057 
00058     GtkWidget * label_time;      // Widgets related with time.
00059     GtkWidget * label_time_desc;
00060     GtkWidget * hour_button;
00061     GtkWidget * minute_button;
00062     GtkWidget * am_pm_button;    // NULL means using 24h clock.
00063 
00064     GtkWidget * label_date;      // Widgets related with date.
00065     GtkWidget * label_date_desc;
00066     GtkWidget * year_button;
00067     GtkWidget * month_button;
00068     GtkWidget * day_button;
00069 
00070     GtkWidget * hidden_button;
00071 
00072     gboolean is_portrait;        // in portrait or landscape mode?
00073     gboolean twelve_clock;
00074 } DateTimeWidgets;
00075 
00076 
00077 void datetime_base_create_widgets(DateTimeWidgets * widgets,
00078                                   DateTimeSettings * data);
00079 
00080 void datetime_base_locale_changed(DateTimeWidgets * widgets, DateTimeSettings * data);
00081 
00082 void datetime_base_load_datetime(DateTimeSettings * data);
00083 gboolean datetime_base_save_datetime(DateTimeWidgets * widgets, 
00084                                      DateTimeSettings * data);
00085 
00086 #endif // DATETIME_BASE_H
Generated by  doxygen 1.6.2-20100208