include/alp/timezoneselector.h

Go to the documentation of this file.
00001 /******************************************************************************
00002  * Copyright (c) 1999-2008 ACCESS CO., LTD. All rights reserved.
00003  * Copyright (c) 2006 PalmSource, Inc (an ACCESS company). All rights reserved.
00004  *****************************************************************************/
00011 #ifndef __ALP_TIMEZONE_SELECTOR_H__
00012 #define __ALP_TIMEZONE_SELECTOR_H__
00013 
00014 #include <gdk/gdk.h>
00015 #include <gtk/gtk.h>
00016 #include <alp/types.h>
00017 #include <alp/sysclass.h>
00018 
00019 
00020 G_BEGIN_DECLS
00021 
00027 /* @{ */
00028 
00029 
00030 #define ALP_STATUS_TIMEZONE_DML                   (ALP_CLASS_TIMEZONE  | 0x00010000) 
00031 #define ALP_STATUS_TIMEZONE_API                   (ALP_CLASS_TIMEZONE  | 0x00020000) 
00032 
00033 #define ALP_STATUS_TZ_DML_BAD_PARAM       (ALP_STATUS_TIMEZONE_DML | 0x00000100)
00034 #define ALP_STATUS_TZ_DML_NO_MEMORY       (ALP_STATUS_TIMEZONE_DML | 0x00000200)
00035 #define ALP_STATUS_TZ_DML_INTERNAL_ERROR  (ALP_STATUS_TIMEZONE_DML | 0x00000300)
00036 #define ALP_STATUS_TZ_DML_NO_RECORDS      (ALP_STATUS_TIMEZONE_DML | 0x00000400)
00037 #define ALP_STATUS_TZ_DML_INVALID_LUID    (ALP_STATUS_TIMEZONE_DML | 0x00000500)
00038 #define ALP_STATUS_TZ_DML_DATABASE_ERROR  (ALP_STATUS_TIMEZONE_DML | 0x00000600)
00039 #define ALP_STATUS_TZ_DML_DUPLICATE       (ALP_STATUS_TIMEZONE_DML | 0x00000700)
00040 #define ALP_STATUS_TZ_DML_CORRUPT         (ALP_STATUS_TIMEZONE_DML | 0x00000800)
00041 #define ALP_STATUS_TZ_DML_EXISTS          (ALP_STATUS_TIMEZONE_DML | 0x00000900)
00042 
00043 
00044 #define ALP_STATUS_TZ_API_BAD_PARAM               (ALP_STATUS_TIMEZONE_API  | 0x00000100) 
00045 #define ALP_STATUS_TZ_API_NO_LOCATION             (ALP_STATUS_TIMEZONE_API  | 0x00000200) 
00046 #define ALP_STATUS_TZ_API_NO_ZONE                 (ALP_STATUS_TIMEZONE_API  | 0x00000300) 
00047 
00048 #define ALP_TYPE_TIMEZONE_SELECTOR              (alp_timezone_selector_get_type())
00049 #define ALP_TIMEZONE_SELECTOR(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), ALP_TYPE_TIMEZONE_SELECTOR, AlpTimeZoneSelector))
00050 #define ALP_TIMEZONE_SELECTOR_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), ALP_TYPE_TIMEZONE_SELECTOR, AlpTimeZoneSelectorClass))
00051 #define ALP_IS_TIMEZONE_SELECTOR(obj)   (G_TYPE_CHECK_INSTANCE_TYPE((obj), ALP_TYPE_TIMEZONE_SELECTOR))
00052 #define ALP_IS_TIMEZONE_SELECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ALP_TYPE_TIMEZONE_SELECTOR))
00053 #define ALP_TIMEZONE_SELECTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), ALP_TYPE_TIMEZONE_SELECTOR, AlpTimeZoneSelectorClass))
00054 
00057 
00058 #define ALP_NOTIFY_EVENT_TIMEZONE_CHANGE_TZ     "alp/timezone/change/tz"
00059 
00060 
00061 
00062 typedef struct _AlpTimeZoneSelector AlpTimeZoneSelector;
00063 typedef struct _AlpTimeZoneSelectorClass AlpTimeZoneSelectorClass;
00064 
00065 struct _AlpTimeZoneSelectorClass
00066 {
00067         GtkComboBoxClass parent_class;
00068 
00069         /* signals */
00070         void (*database_changed)(AlpTimeZoneSelector *selector);
00071 };
00072 
00073 struct _AlpTimeZoneSelector 
00074 {
00075         GtkComboBox widget;
00076 
00077         struct AlpTimeZoneSelectorPrivate *priv;
00078         
00079 };
00080 
00082 typedef struct _AlpTimeZoneLocInfo AlpTimeZoneLocInfo;
00083 struct _AlpTimeZoneLocInfo
00084 {
00085         gchar *location;
00086         gchar *zone;
00087         gfloat latitude;
00088         gfloat longitude;
00089 };
00090 
00091 
00097 GType alp_timezone_selector_get_type(void);
00098 
00105 GtkWidget *
00106 alp_timezone_selector_new(gboolean self_update,GtkWindow* pwindow);
00107 
00116 alp_status_t 
00117 alp_timezone_selector_dml_get_infos(GPtrArray **informations);
00118 
00128 alp_status_t 
00129 alp_timezone_selector_dml_get_loc_timezone(const gchar *location, gchar **zone);
00130 
00140 alp_status_t 
00141 alp_timezone_selector_dml_get_tz_location(const gchar *zone, gchar **location);
00151 alp_status_t 
00152 alp_timezone_selector_dml_get_loc_info(const gchar *location,  AlpTimeZoneLocInfo **info);
00153 
00154 
00162 gint
00163 alp_timezone_selector_get_active(AlpTimeZoneSelector *selector);
00164 
00165 
00173 gchar * 
00174 alp_timezone_selector_get_active_location(AlpTimeZoneSelector *selector);
00175 
00185 alp_status_t
00186 alp_timezone_selector_get_active_timezone(AlpTimeZoneSelector *selector, gchar **zone);
00187 
00188 
00189 
00199 alp_status_t
00200 alp_timezone_selector_get_active_info(AlpTimeZoneSelector *selector, AlpTimeZoneLocInfo ** info );
00201 
00202 
00210 void 
00211 alp_timezone_selector_set_active(AlpTimeZoneSelector *selector, gint index);
00212 
00213 
00223 alp_status_t 
00224 alp_timezone_dml_get_sys_location_tz(const gchar *location, gchar **zone);
00225 
00235 alp_status_t 
00236 alp_timezone_dml_get_sys_tz_location(const gchar *zone, gchar **location);
00237 
00249 alp_status_t 
00250 alp_timezone_dml_get_user_tz_locations(const gchar *zone, GList **locations_list);
00251 
00260 gint 
00261 alp_timezone_selector_set_location_active(AlpTimeZoneSelector *selector, const gchar *location);
00262 
00263 
00276 alp_status_t
00277 alp_timezone_selector_set_list(AlpTimeZoneSelector *other_selector);
00278 
00287 void        
00288 alp_timezone_selector_prepend_text(AlpTimeZoneSelector *selector, const gchar *text);
00289 
00290 /* @} */
00291 #if 1
00292 void
00293 alp_timezone_add_location_do_dialog( GtkButton *button, gpointer user_data );
00294 #endif
00295 
00296 extern void
00297 prv_tz_selector_changed(AlpTimeZoneSelector *selector);
00298 
00299 
00300 G_END_DECLS
00301 
00302 #endif /* __ALP_TIMEZONE_SELECTOR_H__ */
00303 
00304 
00305 

Generated on Wed Jul 30 07:06:39 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.