aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-cal-model.h
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/e-cal-model.h')
-rw-r--r--calendar/gui/e-cal-model.h249
1 files changed, 156 insertions, 93 deletions
diff --git a/calendar/gui/e-cal-model.h b/calendar/gui/e-cal-model.h
index adaf736494..c5fffd3cd6 100644
--- a/calendar/gui/e-cal-model.h
+++ b/calendar/gui/e-cal-model.h
@@ -29,16 +29,47 @@
#include <table/e-table-model.h>
#include <libecal/e-cal.h>
#include "e-cell-date-edit-text.h"
+#include <shell/e-shell-settings.h>
-G_BEGIN_DECLS
+/* Standard GObject macros */
+#define E_TYPE_CAL_MODEL \
+ (e_cal_model_get_type ())
+#define E_CAL_MODEL(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), E_TYPE_CAL_MODEL, ECalModel))
+#define E_CAL_MODEL_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), E_TYPE_CAL_MODEL, ECalModelClass))
+#define E_IS_CAL_MODEL(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), E_TYPE_CAL_MODEL))
+#define E_IS_CAL_MODEL_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), E_TYPE_CAL_MODEL))
+#define E_CAL_MODEL_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), E_TYPE_CAL_MODEL, ECalModelClass))
-#define E_TYPE_CAL_MODEL (e_cal_model_get_type ())
-#define E_CAL_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CAL_MODEL, ECalModel))
-#define E_CAL_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CAL_MODEL, ECalModelClass))
-#define E_IS_CAL_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CAL_MODEL))
-#define E_IS_CAL_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_CAL_MODEL))
+/* Standard GObject macros */
+#define E_TYPE_CAL_MODEL_COMPONENT \
+ (e_cal_model_component_get_type ())
+#define E_CAL_MODEL_COMPONENT(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), E_TYPE_CAL_MODEL_COMPONENT, ECalModelComponent))
+#define E_CAL_MODEL_COMPONENT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), E_TYPE_CAL_MODEL_COMPONENT, ECalModelComponentClass))
+#define E_IS_CAL_MODEL_COMPONENT(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), E_TYPE_CAL_MODEL_COMPONENT))
+#define E_IS_CAL_MODEL_COMPONENT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), E_TYPE_CAL_MODEL_COMPONENT))
+#define E_CAL_MODEL_COMPONENT_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), E_TYPE_CAL_MODEL_COMPONENT, ECalModelComponentClass))
-typedef struct _ECalModelPrivate ECalModelPrivate;
+G_BEGIN_DECLS
typedef enum {
/* If you add new items here or reorder them, you have to update the
@@ -63,12 +94,9 @@ typedef enum {
E_CAL_MODEL_FLAGS_EXPAND_RECURRENCES = 0x01
} ECalModelFlags;
-#define E_TYPE_CAL_MODEL_COMPONENT (e_cal_model_component_get_type ())
-#define E_CAL_MODEL_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CAL_MODEL_COMPONENT, ECalModelComponent))
-#define E_CAL_MODEL_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CAL_MODEL_COMPONENT, \
- ECalComponentClass))
-#define E_IS_CAL_MODEL_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CAL_MODEL_COMPONENT))
-#define E_IS_CAL_MODEL_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_CAL_MODEL_COMPONENT))
+typedef struct _ECalModel ECalModel;
+typedef struct _ECalModelClass ECalModelClass;
+typedef struct _ECalModelPrivate ECalModelPrivate;
typedef struct _ECalModelComponent ECalModelComponent;
typedef struct _ECalModelComponentClass ECalModelComponentClass;
@@ -104,94 +132,129 @@ typedef struct {
gpointer cb_data;
} ECalModelGenerateInstancesData;
-typedef struct _ECalModel {
+struct _ECalModel {
ETableModel model;
ECalModelPrivate *priv;
-} ECalModel;
+};
-typedef struct {
+struct _ECalModelClass {
ETableModelClass parent_class;
/* virtual methods */
- const gchar * (* get_color_for_component) (ECalModel *model, ECalModelComponent *comp_data);
- void (* fill_component_from_model) (ECalModel *model, ECalModelComponent *comp_data,
- ETableModel *source_model, gint row);
+ const gchar * (*get_color_for_component)
+ (ECalModel *model,
+ ECalModelComponent *comp_data);
+ void (*fill_component_from_model)
+ (ECalModel *model,
+ ECalModelComponent *comp_data,
+ ETableModel *source_model,
+ gint row);
/* Signals */
- void (* time_range_changed) (ECalModel *model, time_t start, time_t end);
- void (* row_appended) (ECalModel *model);
- void (* comps_deleted) (ECalModel *model, gpointer list);
- void (* cal_view_progress) (ECalModel *model, const gchar *message, gint progress, ECalSourceType type);
- void (* cal_view_done) (ECalModel *model, ECalendarStatus status, ECalSourceType type);
-} ECalModelClass;
-
-typedef time_t (*ECalModelDefaultTimeFunc)(ECalModel *model, gpointer user_data);
-
-GType e_cal_model_get_type (void);
-GType e_cal_model_component_get_type (void);
-icalcomponent_kind e_cal_model_get_component_kind (ECalModel *model);
-void e_cal_model_set_component_kind (ECalModel *model,
- icalcomponent_kind kind);
-ECalModelFlags e_cal_model_get_flags (ECalModel *model);
-void e_cal_model_set_flags (ECalModel *model,
- ECalModelFlags flags);
-icaltimezone *e_cal_model_get_timezone (ECalModel *model);
-void e_cal_model_set_timezone (ECalModel *model,
- icaltimezone *zone);
-void e_cal_model_set_default_category (ECalModel *model,
- const gchar *default_cat);
-gboolean e_cal_model_get_use_24_hour_format (ECalModel *model);
-void e_cal_model_set_use_24_hour_format (ECalModel *model,
- gboolean use24);
-ECal *e_cal_model_get_default_client (ECalModel *model);
-void e_cal_model_set_default_client (ECalModel *model,
- ECal *client);
-GList *e_cal_model_get_client_list (ECalModel *model);
-ECal *e_cal_model_get_client_for_uri (ECalModel *model,
- const gchar *uri);
-void e_cal_model_add_client (ECalModel *model,
- ECal *client);
-void e_cal_model_remove_client (ECalModel *model,
- ECal *client);
-void e_cal_model_remove_all_clients (ECalModel *model);
-void e_cal_model_get_time_range (ECalModel *model,
- time_t *start,
- time_t *end);
-void e_cal_model_set_time_range (ECalModel *model,
- time_t start,
- time_t end);
-const gchar *e_cal_model_get_search_query (ECalModel *model);
-void e_cal_model_set_search_query (ECalModel *model,
- const gchar *sexp);
-icalcomponent *e_cal_model_create_component_with_defaults (ECalModel *model, gboolean all_day);
-const gchar *e_cal_model_get_color_for_component (ECalModel *model,
- ECalModelComponent *comp_data);
-gboolean e_cal_model_get_rgb_color_for_component (ECalModel *model,
- ECalModelComponent *comp_data,
- double *red,
- double *green,
- double *blue);
-ECalModelComponent *e_cal_model_get_component_at (ECalModel *model,
- gint row);
-ECalModelComponent *e_cal_model_get_component_for_uid (ECalModel *model,
- const ECalComponentId *id);
-gchar *e_cal_model_date_value_to_string (ECalModel *model,
- const void *value);
-ECalModelComponent *e_cal_model_copy_component_data (ECalModelComponent *comp_data);
-void e_cal_model_free_component_data (ECalModelComponent *comp_data);
-void e_cal_model_generate_instances (ECalModel *model,
- time_t start,
- time_t end,
- ECalRecurInstanceFn cb,
- gpointer cb_data);
-GPtrArray * e_cal_model_get_object_array (ECalModel *model);
-void e_cal_model_set_instance_times (ECalModelComponent *comp_data, const icaltimezone *zone);
-void e_cal_model_set_search_query_with_time_range (ECalModel *model, const gchar *sexp, time_t start, time_t end);
-
-gboolean e_cal_model_test_row_editable (ECalModel *model, gint row);
-
-void e_cal_model_set_default_time_func (ECalModel *model, ECalModelDefaultTimeFunc func, gpointer user_data);
+ void (*time_range_changed) (ECalModel *model,
+ time_t start,
+ time_t end);
+ void (*row_appended) (ECalModel *model);
+ void (*comps_deleted) (ECalModel *model,
+ gpointer list);
+ void (*cal_view_progress) (ECalModel *model,
+ const gchar *message,
+ gint progress,
+ ECalSourceType type);
+ void (*cal_view_done) (ECalModel *model,
+ ECalendarStatus status,
+ ECalSourceType type);
+};
+
+typedef time_t (*ECalModelDefaultTimeFunc) (ECalModel *model, gpointer user_data);
+
+GType e_cal_model_get_type (void);
+GType e_cal_model_component_get_type (void);
+EShellSettings *e_cal_model_get_shell_settings (ECalModel *model);
+icalcomponent_kind
+ e_cal_model_get_component_kind (ECalModel *model);
+void e_cal_model_set_component_kind (ECalModel *model,
+ icalcomponent_kind kind);
+ECalModelFlags e_cal_model_get_flags (ECalModel *model);
+void e_cal_model_set_flags (ECalModel *model,
+ ECalModelFlags flags);
+icaltimezone * e_cal_model_get_timezone (ECalModel *model);
+void e_cal_model_set_timezone (ECalModel *model,
+ icaltimezone *zone);
+void e_cal_model_set_default_category(ECalModel *model,
+ const gchar *default_cat);
+gboolean e_cal_model_get_use_24_hour_format
+ (ECalModel *model);
+void e_cal_model_set_use_24_hour_format
+ (ECalModel *model,
+ gboolean use24);
+gint e_cal_model_get_week_start_day (ECalModel *model);
+void e_cal_model_set_week_start_day (ECalModel *model,
+ gint week_start_day);
+ECal * e_cal_model_get_default_client (ECalModel *model);
+void e_cal_model_set_default_client (ECalModel *model,
+ ECal *client);
+GList * e_cal_model_get_client_list (ECalModel *model);
+ECal * e_cal_model_get_client_for_uri (ECalModel *model,
+ const gchar *uri);
+void e_cal_model_add_client (ECalModel *model,
+ ECal *client);
+void e_cal_model_remove_client (ECalModel *model,
+ ECal *client);
+void e_cal_model_remove_all_clients (ECalModel *model);
+void e_cal_model_get_time_range (ECalModel *model,
+ time_t *start,
+ time_t *end);
+void e_cal_model_set_time_range (ECalModel *model,
+ time_t start,
+ time_t end);
+const gchar * e_cal_model_get_search_query (ECalModel *model);
+void e_cal_model_set_search_query (ECalModel *model,
+ const gchar *sexp);
+icalcomponent * e_cal_model_create_component_with_defaults
+ (ECalModel *model,
+ gboolean all_day);
+const gchar * e_cal_model_get_color_for_component
+ (ECalModel *model,
+ ECalModelComponent *comp_data);
+gboolean e_cal_model_get_rgb_color_for_component
+ (ECalModel *model,
+ ECalModelComponent *comp_data,
+ gdouble *red,
+ gdouble *green,
+ gdouble *blue);
+ECalModelComponent *
+ e_cal_model_get_component_at (ECalModel *model,
+ gint row);
+ECalModelComponent *
+ e_cal_model_get_component_for_uid
+ (ECalModel *model,
+ const ECalComponentId *id);
+gchar * e_cal_model_date_value_to_string(ECalModel *model,
+ gconstpointer value);
+ECalModelComponent *
+ e_cal_model_copy_component_data (ECalModelComponent *comp_data);
+void e_cal_model_free_component_data (ECalModelComponent *comp_data);
+void e_cal_model_generate_instances (ECalModel *model,
+ time_t start,
+ time_t end,
+ ECalRecurInstanceFn cb,
+ gpointer cb_data);
+GPtrArray * e_cal_model_get_object_array (ECalModel *model);
+void e_cal_model_set_instance_times (ECalModelComponent *comp_data,
+ const icaltimezone *zone);
+void e_cal_model_set_search_query_with_time_range
+ (ECalModel *model,
+ const gchar *sexp,
+ time_t start,
+ time_t end);
+gboolean e_cal_model_test_row_editable (ECalModel *model,
+ gint row);
+void e_cal_model_set_default_time_func
+ (ECalModel *model,
+ ECalModelDefaultTimeFunc func,
+ gpointer user_data);
G_END_DECLS
-#endif
+#endif /* E_CAL_MODEL_H */