include/alp/calendar_dml.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  ******************************************************************************/
00018 #ifndef ALP_CALENDAR_DML_H_DEFINED
00019 #define ALP_CALENDAR_DML_H_DEFINED
00020 #ifdef __cplusplus
00021 extern "C" {
00022 #endif
00023 
00024 #include <sqlite3.h>
00025 #include <stdint.h>
00026 #include <string.h>
00027 #include <time.h>
00028 #include <alp/catmgr_dml.h>
00029 #include <alp/types.h>
00030 #include <alp/sysclass.h>
00031 #include <alp/hs_status.h>
00032 #include <alp/hs_common.h>
00033 #include <alp/hs_change_mgr.h>
00034 #include <glib.h>
00035 
00041 #define ALP_STATUS_CALENDAR_DML_NO_MEM        (ALP_CLASS_CALENDAR_DML | 0x00010000)
00042 #define ALP_STATUS_CALENDAR_DML_NO_RECORDS        (ALP_CLASS_CALENDAR_DML | 0x00020000)
00043 #define ALP_STATUS_CALENDAR_DML_BAD_PARAM         (ALP_CLASS_CALENDAR_DML | 0x00030000)
00044 #define ALP_STATUS_CALENDAR_DML_DATABASE_ERR  (ALP_CLASS_CALENDAR_DML | 0x00040000)
00045 #define ALP_STATUS_CALENDAR_DML_INVALID_LUID  (ALP_CLASS_CALENDAR_DML | 0x00050000)
00046 #define ALP_STATUS_CALENDAR_DML_INTERNAL_ERR  (ALP_CLASS_CALENDAR_DML | 0x00060000)
00047 #define ALP_STATUS_CALENDAR_DML_CHANGEMGR_ERROR  (ALP_CLASS_CALENDAR_DML | 0x00070000)
00048 #define ALP_STATUS_CALENDAR_DML_NOT_VCALENDAR (ALP_CLASS_CALENDAR_DML | 0x00080000)
00049 #define ALP_STATUS_CALENDAR_DML_DB_BUSY       (ALP_CLASS_CALENDAR_DML | 0x00090000)
00050  //=====================================================end errors
00051 
00052 
00053         
00054         
00060 
00061 #define ALP_CALENDAR_OPEN_TO_DATE  "--alp-calendar-date-launch"  //takes time_t as arg
00062         
00063         
00065 #define ALP_CALENDAR_OPEN_TO_EVENT "--alp-calendar-event-launch" //takes AlpLuid as arg
00066 
00068 #define ALP_CALENDAR_OPEN_TO_VIEW "--alp-calendar-view-launch" //takes [DAY|WEEK|MONTH|YEAR|AGENDA] as arg
00069  //=====================================================end launch arguments
00070 
00071         
00072         
00076 #ifndef WIN32
00077 #define ALP_DATAMODEL_NOTIFICATION_TYPE_CALENDARS       "alp/datamodel/calendars"
00078 #else
00079 #define ALP_DATAMODEL_NOTIFICATION_TYPE_CALENDARS       _T("alp/datamodel/calendars")
00080 #endif
00081 
00082 
00089 typedef enum AlpCalendarDmlColumnType {
00090         kCalRowID =0,   //uint32_t Unique ID of the row
00091         kCalRepeatingEvent, // bool true if this event is a repeating event else false
00092         kCalUntimedEvent,   // bool true if this event is an untimed event else false
00093         kCalStartDateTime,  // uint32_t Start Time of the event represented in seconds since 1970
00094         kCalEndDateTime,    // uint32_t End Time of the event represented in seconds since 1970
00095         kCalTimeZone,           // string Timezone for the event. 
00096         kCalTimeZoneCity,       // string Timezone city name for the event. 
00097         kCalTimeAdvance,    // uint32_t Alarm advance time( actual event time - alarm advance time = when the alarm 
00098         kCalTimeAdvanceUnit, // uint32_t aauMinutes = 0, aauHours = 1, aauDays=2
00099         kCalRepeatType, //uint32_t   repeatNone = 0,repeatDaily = 1,repeatWeekly = 2,repeatMonthlyByDay = 3 ,repeatMonthlyByDate = 4,repeatYearly = 5
00100         kCalRepeatEndDate, //uint32_t end date of the repeating event
00101         kCalRepeatFrequency, // uint32_t frequency of the repating event. // i.e. value = 2 - repeats every 2 days if repeatType daily
00102         kCalRepeatOn, // // uint8_T monthlyByDay and repeatWeekly type events only. Day mask each bit will be 1 if repats on that day of the week.
00103         kCalRepeatStartOfWeek, // uint32_t Weekly repeating events only.
00104         kCalExceptionDates, // blob - contains array of uint32_t values repesenting the exceptions for a repeating event
00105         kCalDescription, // string - description fo the event
00106         kCalLocation, // string - event location
00107         kCalNote, //- string Note attached to the event
00108         kCalEventType, // uint32_t eventNormal = 0, eventAllDay = 1,eventNoTime = 2, eventMeeting = 3
00109         kCalContactID,// uint32_t Unique LUID of the contact  for a Birthday/Anniv type events. Currently unused
00110         kCalAttendeeList, // string -list of attendees separated by ; 
00111         kCalSubject, // subject of the meeting event. currently unused
00112         kCalIsPrivate, // bool - true if private event else false
00113         kCalSmartJoinInfo // used ofr chat events. currently unused.
00114 }AlpCalendarDmlColumnType;
00115 
00116 typedef time_t TimeType;
00117 typedef time_t DateType;
00118 typedef time_t DateTimeType;
00119  //=====================================================end data types  
00121 
00122 
00123 
00154 alp_status_t  alp_calendar_dml_open(AlpDmlH *dmlH, bool changeTrackingOn);
00155 
00156 
00165 alp_status_t  alp_calendar_dml_close(AlpDmlH dmlH);
00166  //=====================================================end open & close group  
00168 
00169 
00170 
00184 alp_status_t  alp_calendar_dml_item_create(AlpDmlItemH *eventH);
00185 
00186 
00194 alp_status_t  alp_calendar_dml_item_destroy(AlpDmlItemH eventH);
00195 
00196 
00206 alp_status_t  alp_calendar_dml_item_set_int32(AlpDmlItemH eventH, AlpCalendarDmlColumnType column, const uint32_t* value);
00207 
00208 
00216 alp_status_t  alp_calendar_dml_item_set_string(AlpDmlItemH eventH, AlpCalendarDmlColumnType column,  const char* value);
00217 
00218 
00227 alp_status_t  alp_calendar_dml_item_set_blob(AlpDmlItemH eventH, AlpCalendarDmlColumnType column,  const void* value, int32_t size);
00228  //=====================================================end item group     
00230 
00245 alp_status_t  alp_calendar_dml_insert(AlpDmlH dmlH, AlpDmlItemH eventH,AlpLuid *eventLuid );
00246 
00247 
00254 alp_status_t  alp_calendar_dml_update(AlpDmlH dmlH, AlpDmlItemH eventH);
00255 
00256 
00265 alp_status_t  alp_calendar_dml_delete(AlpDmlH dmlH, AlpLuid eventLuid);
00266  //=====================================================end write group
00268 
00269 
00270 
00301 alp_status_t    alp_calendar_dml_statement_begin(
00302                                                   AlpDmlH dmlH, AlpLuid eventLuid, AlpDmlStatementH *stmtH,
00303                                                   uint32_t categoryLUID, bool unfiled, DateTimeType startTime,
00304                                                   DateTimeType endTime, const char *orderBy,
00305                                                   int32_t *numResults);
00306 
00307 
00316 alp_status_t  alp_calendar_dml_statement_next_new(AlpDmlStatementH *stmtH);
00317 
00327 alp_status_t  alp_calendar_dml_statement_next(AlpDmlH dmlH,
00328                           AlpDmlStatementH *stmtH) __attribute ((deprecated));
00329 
00330 
00340 alp_status_t  alp_calendar_dml_statement_end_new(AlpDmlStatementH stmt);
00341 
00351 alp_status_t  alp_calendar_dml_statement_end(AlpDmlH dmlH,
00352                           AlpDmlStatementH stmt) __attribute((deprecated));
00353 
00354 
00363 alp_status_t  alp_calendar_dml_statement_get_int32(AlpDmlStatementH stmtH, AlpCalendarDmlColumnType column, uint32_t* value);
00364 
00365 
00375 alp_status_t  alp_calendar_dml_statement_get_string(AlpDmlStatementH stmtH, AlpCalendarDmlColumnType column, bool copy, char** value);
00376 
00377 
00388 alp_status_t  alp_calendar_dml_statement_get_blob(AlpDmlStatementH stmtH, AlpCalendarDmlColumnType column, bool copy, void** value, int32_t* size);
00389 
00390 
00401 alp_status_t alp_calendar_dml_get_item(AlpDmlH dmlH, AlpLuid itemLuid, AlpDmlStatementH *stmtH);
00402 
00403 
00414 alp_status_t    alp_calendar_dml_search_begin(
00415                                                   AlpDmlH dmlH, AlpDmlStatementH *stmtH,
00416                                                   const char *search_string,
00417                                                   int32_t *numResults);
00418 
00420 alp_status_t    alp_calendar_dml_search_statement_begin(
00421                                                   AlpDmlH dml, AlpDmlStatementH *stmtH,
00422                                                   const char *search_string,
00423                                                   int32_t *numResults) __attribute((deprecated));
00424 
00425 
00442 alp_status_t alp_calendar_dml_read_from_vCal_file(AlpDmlH dmlH, int theDataFd,
00443                         bool fromExgMgr, bool forModify, GList** eventLuids );
00444 
00446 alp_status_t alp_calendar_dml_events_from_vCal_file(AlpDmlH dmlH, int theDataFd,
00447             bool fromExgMgr, GList** eventIDs ) __attribute ((deprecated));
00448 
00449 
00467 alp_status_t alp_calendar_dml_read_from_vCal_buffer(AlpDmlH dmlH, const uint8_t* dataBuf, uint32_t size,
00468                         bool fromExgMgr, bool forModify, GList** eventLuids);
00469 
00472 alp_status_t alp_calendar_dml_events_from_vCal_buffer(AlpDmlH dmlH, char* dataBuf,
00473               bool fromExgMgr, GList** eventIDs) __attribute((deprecated));
00474 
00475 
00488 alp_status_t alp_calendar_dml_write_to_vCal_file(AlpDmlH dmlH, int theDataFd,
00489                         bool toExgMgr, const GList* eventLuids );
00490 
00492 alp_status_t alp_calendar_dml_events_to_vCal_file(AlpDmlH dmlH, int theDataFd,
00493                         bool toExgMgr, GList* eventIDs ) __attribute((deprecated));
00494 
00507 alp_status_t alp_calendar_dml_write_to_vCal_buffer(AlpDmlH dmlH, uint8_t** dataBuf, uint32_t* size,
00508                         bool toExgMgr, const GList* eventLuids );
00509 
00511 alp_status_t alp_calendar_dml_events_to_vCal_buffer(AlpDmlH dmlH, uint8_t** dataBuf, uint32_t* size,
00512                         bool toExgMgr, GList* eventIDs ) __attribute((deprecated));
00513  //=====================================================end read group
00515 
00516 
00517 
00532 alp_status_t    alp_calendar_dml_transaction_begin(AlpDmlH dmlH, bool exclusive);
00533 
00534 
00542 alp_status_t    alp_calendar_dml_transaction_end(AlpDmlH dmlH);
00543 
00544 
00551 alp_status_t     alp_calendar_dml_transaction_rollback(AlpDmlH dmlH);
00552  //=====================================================end transactions group
00554 
00555 
00556 
00574 alp_status_t alp_calendar_dml_add_memberships(
00575                       AlpDmlH dmlH, AlpLuid eventLuid,
00576                       const AlpLuid *categoryLuids,
00577                       AlpLuid membershipLuid,
00578                       uint32_t numCategoryLuids);
00579 
00581 alp_status_t alp_calendar_dml_memberships_add(
00582                       AlpDmlH dmlH, AlpLuid eventLuid,
00583                       const AlpLuid *categoryIDs,
00584                       AlpLuid membershipLuid,
00585                       uint32_t numCategoryIDs) __attribute((deprecated));
00586 
00587 
00601 alp_status_t alp_calendar_dml_remove_memberships(
00602                       AlpDmlH dmlH, AlpLuid eventLuid,
00603                       const AlpLuid *categoryLuids,
00604                       AlpLuid membershipLuid,
00605                       uint32_t numCategoryLuids);
00606 
00608 alp_status_t alp_calendar_dml_memberships_remove(
00609                       AlpDmlH dmlH, AlpLuid eventLuid,
00610                       const AlpLuid *categoryIDs,
00611                       AlpLuid membershipLuid,
00612                       uint32_t numCategoryIDs) __attribute((deprecated));
00613  //=====================================================end memberships group
00615 
00616 
00617 
00631 AlpDmlH alp_calendar_dml_get_catmgr_handle(AlpDmlH dmlH);
00632 
00633  //=====================================================end utility group
00635  //=====================================================end API
00637 
00638 #ifdef __cplusplus
00639 }
00640 #endif
00641 
00642 #endif
00643 

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.