summaryrefslogtreecommitdiff
path: root/applets/clock/calendar-client.h
diff options
context:
space:
mode:
authorPerberos <[email protected]>2011-12-01 22:56:10 -0300
committerPerberos <[email protected]>2011-12-01 22:56:10 -0300
commitc51ef797a707f4e2c6f9688d4378f2b0e9898a66 (patch)
tree019ae92bb53c19b30077545cb14743cbd1b57aef /applets/clock/calendar-client.h
downloadmate-panel-c51ef797a707f4e2c6f9688d4378f2b0e9898a66.tar.bz2
mate-panel-c51ef797a707f4e2c6f9688d4378f2b0e9898a66.tar.xz
moving from https://github.com/perberos/mate-desktop-environment
Diffstat (limited to 'applets/clock/calendar-client.h')
-rw-r--r--applets/clock/calendar-client.h153
1 files changed, 153 insertions, 0 deletions
diff --git a/applets/clock/calendar-client.h b/applets/clock/calendar-client.h
new file mode 100644
index 00000000..9d502ba0
--- /dev/null
+++ b/applets/clock/calendar-client.h
@@ -0,0 +1,153 @@
+/*
+ * Copyright (C) 2004 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * Authors:
+ * Mark McLoughlin <[email protected]>
+ * William Jon McCann <[email protected]>
+ * Martin Grimme <[email protected]>
+ * Christian Kellner <[email protected]>
+ */
+
+#ifndef __CALENDAR_CLIENT_H__
+#define __CALENDAR_CLIENT_H__
+
+#include <glib-object.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum
+{
+ CALENDAR_EVENT_APPOINTMENT = 1 << 0,
+ CALENDAR_EVENT_TASK = 1 << 1,
+ CALENDAR_EVENT_ALL = (1 << 2) - 1
+} CalendarEventType;
+
+#define CALENDAR_TYPE_CLIENT (calendar_client_get_type ())
+#define CALENDAR_CLIENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CALENDAR_TYPE_CLIENT, CalendarClient))
+#define CALENDAR_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), CALENDAR_TYPE_CLIENT, CalendarClientClass))
+#define CALENDAR_IS_CLIENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CALENDAR_TYPE_CLIENT))
+#define CALENDAR_IS_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CALENDAR_TYPE_CLIENT))
+#define CALENDAR_CLIENT_GET_CLASS(o)(G_TYPE_INSTANCE_GET_CLASS ((o), CALENDAR_TYPE_CLIENT, CalendarClientClass))
+
+typedef struct _CalendarClient CalendarClient;
+typedef struct _CalendarClientClass CalendarClientClass;
+typedef struct _CalendarClientPrivate CalendarClientPrivate;
+
+struct _CalendarClient
+{
+ GObject parent;
+ CalendarClientPrivate *priv;
+};
+
+struct _CalendarClientClass
+{
+ GObjectClass parent_class;
+
+ void (* appointments_changed) (CalendarClient *client);
+ void (* tasks_changed) (CalendarClient *client);
+};
+
+
+typedef struct
+{
+ time_t start_time;
+ time_t end_time;
+} CalendarOccurrence;
+
+typedef struct
+{
+ char *uid;
+ char *rid;
+ char *uri;
+ char *summary;
+ char *description;
+ char *color_string;
+ time_t start_time;
+ time_t end_time;
+ guint is_all_day : 1;
+
+ /* Only used internally */
+ GSList *occurrences;
+} CalendarAppointment;
+
+typedef struct
+{
+ char *uid;
+ char *summary;
+ char *description;
+ char *color_string;
+ char *url;
+ time_t start_time;
+ time_t due_time;
+ guint percent_complete;
+ time_t completed_time;
+ int priority;
+} CalendarTask;
+
+typedef struct
+{
+ union
+ {
+ CalendarAppointment appointment;
+ CalendarTask task;
+ } event;
+ CalendarEventType type;
+} CalendarEvent;
+
+#define CALENDAR_EVENT(e) ((CalendarEvent *)(e))
+#define CALENDAR_APPOINTMENT(e) ((CalendarAppointment *)(e))
+#define CALENDAR_TASK(e) ((CalendarTask *)(e))
+
+typedef void (* CalendarDayIter) (CalendarClient *client,
+ guint day,
+ gpointer user_data);
+
+
+GType calendar_client_get_type (void) G_GNUC_CONST;
+CalendarClient *calendar_client_new (void);
+
+void calendar_client_get_date (CalendarClient *client,
+ guint *year,
+ guint *month,
+ guint *day);
+void calendar_client_select_month (CalendarClient *client,
+ guint month,
+ guint year);
+void calendar_client_select_day (CalendarClient *client,
+ guint day);
+
+GSList *calendar_client_get_events (CalendarClient *client,
+ CalendarEventType event_mask);
+void calendar_client_foreach_appointment_day (CalendarClient *client,
+ CalendarDayIter iter_func,
+ gpointer user_data);
+
+void calendar_client_set_task_completed (CalendarClient *client,
+ char *task_uid,
+ gboolean task_completed,
+ guint percent_complete);
+
+void calendar_event_free (CalendarEvent *event);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __CALENDAR_CLIENT_H__ */