;; -*- scheme -*-
;; Enumerations and flags ...
;;------------------------------------------------------------------------------
;; Boxed type definitions
;;------------------------------------------------------------------------------
(define-enum SourceType
  (in-module "ECal")
  (c-name "ECalSourceType")
  ;(gtype-id "E_TYPE_CAL_SOURCE_TYPE")
  (values
    '("event" "E_CAL_SOURCE_TYPE_EVENT")
    '("todo" "E_CAL_SOURCE_TYPE_TODO")
    '("journal" "E_CAL_SOURCE_TYPE_JOURNAL")
  )
)

(define-enum ComponentVType
  (in-module "ECal")
  (c-name "ECalComponentVType")
;  (gtype-id "E_TYPE_CAL_COMPONENT_VTYPE")
  (values
;    '("no-type" "E_CAL_COMPONENT_NO_TYPE")
    '("event" "E_CAL_COMPONENT_EVENT")
    '("todo" "E_CAL_COMPONENT_TODO")
    '("journal" "E_CAL_COMPONENT_JOURNAL")
    '("freebusy" "E_CAL_COMPONENT_FREEBUSY")
    '("timezone" "E_CAL_COMPONENT_TIMEZONE")
  )
)

(define-enum icalproperty_status
  (in-module "ECal")
  (c-name "icalproperty_status")
  (values
   '("x" "ICAL_STATUS_X")
   '("tentative" "ICAL_STATUS_TENTATIVE")
   '("confirmed" "ICAL_STATUS_CONFIRMED")
   '("completed" "ICAL_STATUS_COMPLETED")
   '("needsaction" "ICAL_STATUS_NEEDSACTION")
   '("cancelled" "ICAL_STATUS_CANCELLED")
   '("inprocess" "ICAL_STATUS_INPROCESS")
   '("draft" "ICAL_STATUS_DRAFT")
   '("final" "ICAL_STATUS_FINAL")
   '("none" "ICAL_STATUS_NONE")
))

;;------------------------------------------------------------------------------
;; Object Definitions
;;------------------------------------------------------------------------------

(define-object ECal
  (in-module "ECal")
  (parent "GObject")
  (c-name "ECal")
  (gtype-id "E_TYPE_CAL")
)

(define-object ECalComponent
  (in-module "ECal")
  (parent "GObject")
  (c-name "ECalComponent")
  (gtype-id "E_TYPE_CAL_COMPONENT")
)

;;------------------------------------------------------------------------------
;; ECal
;;------------------------------------------------------------------------------
(define-method get_all_objects
  (of-object "ECal")
  (c-name "evo_cal_source_get_all_objects")
  (return-type "GList*")
  (parameters
  )
)

(define-method remove_object
  (of-object "ECal")
  (c-name "evo_cal_source_remove_object")
  (return-type "gboolean")
  (parameters
    '("ECalComponent*" "obj")
  )
)

(define-method update_object
  (of-object "ECal")
  (c-name "evo_cal_source_update_object")
  (return-type "gboolean")
  (parameters
    '("ECalComponent*" "obj")
  )
)

(define-method add_object
  (of-object "ECal")
  (c-name "evo_cal_source_add_object")
  (return-type "char*")
  (parameters
    '("ECalComponent*" "obj")
  )
)

(define-method get_object
  (of-object "ECal")
  (c-name "evo_cal_source_get_object")
  (return-type "ECalComponent*")
  (parameters
    '("const-char*" "uid")
    '("const-char*" "rid")
  )
)

(define-method get_object_as_string
  (of-object "ECal")
  (c-name "e_cal_get_component_as_string")
  (return-type "char*")
  (parameters
    '("icalcomponent*" "icalcomp")
  )
)

(define-method get_uid
  (of-object "ECal")
  (c-name "evo_cal_source_get_uid")
  (return-type "char*")
  (parameters
  )
)

;;------------------------------------------------------------------------------
;; ECalComponent
;;------------------------------------------------------------------------------
(define-function e_cal_component_new
  (c-name "e_cal_component_new")
  (is-constructor-of "ECalComponent")
  (return-type "ECalComponent*")
  (parameters
    '("const-char*" "icard")
    '("ECalComponentVType" "type")
  )

)

(define-method get_as_string
  (of-object "ECalComponent")
  (c-name "e_cal_component_get_as_string")
  (return-type "char*")
)

(define-method get_uid
  (of-object "ECalComponent")
  (c-name "evo_cal_component_get_uid")
  (return-type "char*")
)

;(define-method set_uid
;  (of-object "ECalComponent")
;  (c-name "e_cal_component_set_uid")
;  (return-type "none")
;  (parameters
;    '("const-char*" "uid")
;  )
;)

(define-method get_modified
  (of-object "ECalComponent")
  (c-name "evo_cal_component_get_modified")
  (return-type "glong")
)

(define-method set_modified
  (of-object "ECalComponent")
  (c-name "evo_cal_component_set_modified")
  (return-type "none")
  (parameters
    '("glong" "seconds")
  )
)

(define-method get_due
  (of-object "ECalComponent")
  (c-name "evo_cal_component_get_due")
  (return-type "glong")
)

(define-method set_due
  (of-object "ECalComponent")
  (c-name "evo_cal_component_set_due")
  (return-type "none")
  (parameters
    '("glong" "seconds" (null-ok))
  )
)

(define-method get_categories_list
  (of-object "ECalComponent")
  (c-name "evo_cal_component_get_categories_list")
  (return-type "GSList*")
  (parameters
  )
)

(define-method set_categories_list
  (of-object "ECalComponent")
  (c-name "evo_cal_component_set_categories_list")
  (return-type "none")
  (parameters
    '("GSList*" "categories")
  )
)

(define-method get_url
  (of-object "ECalComponent")
  (c-name "evo_cal_component_get_url")
  (return-type "char*")
  (parameters
  )
)

(define-method set_url
  (of-object "ECalComponent")
  (c-name "evo_cal_component_set_url")
  (return-type "none")
  (parameters
    '("const-char*" "url" (null-ok))
  )
)

(define-method get_summary
  (of-object "ECalComponent")
  (c-name "evo_cal_component_get_summary")
  (return-type "char*")
  (parameters
  )
)

(define-method set_summary
  (of-object "ECalComponent")
  (c-name "evo_cal_component_set_summary")
  (return-type "none")
  (parameters
    '("const-char*" "summary")
  )
)

(define-method get_priority
  (of-object "ECalComponent")
  (c-name "evo_cal_component_get_priority")
  (return-type "int")
  (parameters
  )
)

(define-method set_priority
  (of-object "ECalComponent")
  (c-name "evo_cal_component_set_priority")
  (return-type "none")
  (parameters
    '("int" "priority")
  )
)

(define-method get_description
  (of-object "ECalComponent")
  (c-name "evo_cal_component_get_description")
  (return-type "char*")
  (parameters
  )
)

(define-method set_description
  (of-object "ECalComponent")
  (c-name "evo_cal_component_set_description")
  (return-type "none")
  (parameters
    '("const-char*" "summary")
  )
)

(define-method get_status
  (of-object "ECalComponent")
  (c-name "evo_cal_component_get_status")
  (return-type "icalproperty_status")
  (parameters
  )
)

(define-method set_status
  (of-object "ECalComponent")
  (c-name "evo_cal_component_set_status")
  (return-type "none")
  (parameters
    '("icalproperty_status" "status")
  )
)

;;------------------------------------------------------------------------------
;; evo-environment
;;------------------------------------------------------------------------------
(define-function list_calendars
  (c-name "evo_environment_list_calendars")
  (return-type "GList*")
  (parameters
  )
)

(define-function list_task_sources
  (c-name "evo_environment_list_task_sources")
  (return-type "GList*")
  (parameters
  )
)

(define-function list_memo_sources
  (c-name "evo_environment_list_memo_sources")
  (return-type "GList*")
  (parameters
  )
)

(define-function open_calendar_source
  (c-name "evo_cal_source_open_source")
  (return-type "ECal*")
  (parameters
    '("const-char*" "uri")
    '("ECalSourceType" "type")
  )
)

(define-function open_calendar_source_new_with_absolute_uri
  (c-name "evo_cal_source_open_new_with_absolute_uri")
  (return-type "ECal*")
  (parameters
    '("const-char*" "name")
    '("const-char*" "uri")
    '("ECalSourceType" "type")
  )
)


