/* * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __TIZEN_SOCIAL_CALENDAR_PRIVATE_H__ #define __TIZEN_SOCIAL_CALENDAR_PRIVATE_H__ #include #include "calendar_types.h" #include "calendar_private.h" #include "calendar.h" #ifdef __cplusplus extern "C" { #endif /** * @internal */ typedef struct GList calendar_list_s; typedef struct { int event_type; void* user_data; } calendar_event_legacy_s; typedef struct { calendar_event_legacy_s* event_legacy; } calendar_event_s; typedef struct { int index; /**< Record index */ int account_id; /**< Account_id */ int cal_type; /**< Calendar event type */ int sch_category; /**< Category of schedule */ char* summary; /**< Summary, appointment, task: subject, birthday:Name */ char* description; /**< Description,appointment, task: description, anniversary,holiday:occasion*/ char* location; /**< Location */ GList* meeting_category; /**< collection of categories */ bool all_day_event; /**< All day event flag */ struct tm start_date_time; /**< schedule:start time, anniv,holiday,birthday,memo,todo: date */ struct tm end_date_time; /**< end time */ struct tm alarm_time; /**< alarm time */ int remind_tick; /**< Alarms before remindTick */ int remind_tick_unit; /**< Remind tick unit */ char* alarm_tone; /**< Alert Sound File Name */ int alarm_type; /**< Alert type(see 'cal_alert_type_t') */ int alarm_id; /**< Alarm id */ int repeat_term; /**< Repeat term */ int repeat_interval; /**< Interval of repeat term */ int repeat_occurrences; /**< occurrences of repeat */ struct tm repeat_end_date; /**< End date for repeat */ int sun_moon; /**< Using sun or lunar calendar */ int week_start; /**< Start day of a week */ char* week_flag;//[DAY_OF_A_WEEK + 1]; /**< Indicate which day is select in a week */ int day_date; /**< 0- for weekday(sun,mon,etc.), 1- for specific day(1,2.. Etc) */ struct tm last_modified_time; /**< for PC Sync */ bool missed; /**< Miss alarm flag */ int task_status; /**< current task status */ int priority; /**< Priority */ int timezone; /**< timezone of task */ int file_id; /**< file id for attach or alarm tone*/ int contact_id; /**< contact id for birthday in contact list */ GList* attendee_list; /**< collection of attendee */ int busy_status; /**< ACS, G : Flag of busy or not */ int visibility; /**< ACS, G : The visibility of the task item (normal, presonal, private, confidential). */ int meeting_status; /**< ACS, G : The status of the meeting. */ char* uid; /**< ACS, G : Unique ID of the meeting item */ char* organizer_name; /**< ACS, G : Name of organizer(author) */ char* organizer_email; /**< ACS, G : Email of organizer */ int calendar_type; /**< ACS, G : Type(all,phone,google) of calendar */ char* gcal_id; /**< G : Server id of calendar */ bool deleted; /**< G : Flag for deleted */ char* updated; /**< G : Updated time stamp */ int location_type; /**< G : Location type */ char* location_summary; /**< G : A simple string value that can be used as a representation of this location */ char* etag; /**< G : ETAG of this event */ int calendar_id; /**< G : id to map from calendar table */ int sync_status; /**< G : Indication for event entry whether added/ modified/ deleted */ char* edit_uri; /**< G : EditUri for google calendar */ char* gevent_id; /**< G : Server id of an event */ int dst; /**< dst of event */ int original_event_id; /**< original event id for recurrency exception */ double latitude; double longitude; char* tz_name; int is_deleted; }calendar_schedule_s; typedef struct { int v_type; void* user_data; }calendar_attendee_s; typedef struct { int event_id; char* attendee_name; char* attendee_email; int attendee_status; int attendee_type; int attendee_ct_index; int is_deleted; }_cal_participant_info_t; GList* _calendar_glist_next_until_not_deleted(GList* list); int _calendar_get_account_db_id(int calendar_db_id); void _calendar_parse_color(char* color_string, unsigned char* red, unsigned char* green, unsigned char* blue); /** * Internal Macros */ #define _calendar_safe_strdup(_srcx_) (NULL != _srcx_) ? strdup(_srcx_):NULL #define _calendar_safe_free(_srcx_) { if(NULL != _srcx_) free(_srcx_); } #define CALENDAR_NULL_ARG_CHECK(_arg_) do { \ if(_arg_ == NULL) { \ LOGE("[%s] CALENDAR_ERROR_INVALID_PARAMETER(0x%08x)", __FUNCTION__, CALENDAR_ERROR_INVALID_PARAMETER); \ return CALENDAR_ERROR_INVALID_PARAMETER; \ } \ }while(0) #define CALENDAR_INVALID_ARG_CHECK(_condition_) do { \ if(_condition_) { \ LOGE("[%s] CALENDAR_ERROR_INVALID_PARAMETER(0x%08x)", __FUNCTION__, CALENDAR_ERROR_INVALID_PARAMETER); \ return CALENDAR_ERROR_INVALID_PARAMETER; \ } \ }while(0) #ifdef __cplusplus } #endif #endif //__TIZEN_SOCIAL_CALENDAR_PRIVATE_H__