-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathdatebook.h
142 lines (122 loc) · 4.72 KB
/
datebook.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/*******************************************************************************
* datebook.h
* A module of J-Pilot http://jpilot.org
*
* Copyright (C) 1999-2014 by Judd Montgomery
*
* 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; version 2 of the License.
*
* 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
******************************************************************************/
#ifndef __DATEBOOK_H__
#define __DATEBOOK_H__
#include <stdio.h>
#include <pi-datebook.h>
#include <pi-calendar.h>
#include "utils.h"
#ifdef ENABLE_DATEBK
/* These defines depend on the defaults being zero so that the structure
being zeroed out sets the defaults (0) */
# define DB3_TAG_TYPE_NONE 0
# define DB3_TAG_TYPE_DBplus 1
# define DB3_TAG_TYPE_DB3 3
# define DB3_TAG_TYPE_DB4 4
# define DB3_REGULAR 0
# define DB3_FLOAT 1
# define DB3_FLOAT_COMPLETE 2
# define DB3_FLOAT_DONE 3
# define DB3_FONT_NONE 0
# define DB3_FONT_BOLD 1
# define DB3_FONT_LARGE 2
# define DB3_FONT_LARGE_BOLD 3
# define DB3_SPAN_MID_NO 0
# define DB3_SPAN_MID_YES 1
# define DB3_LINK_NO 0
# define DB3_LINK_YES 1
struct db4_struct {
int floating_event;
/* The following are db3 and greater only tags */
int custom_font;
int category;
int icon;
int spans_midnight;
int time_zone;
/* The following are db4 and greater only tags */
int link;
int advance; /* I don't understand this and next field yet */
int last_date; /* This may need to be a struct tm (not sure yet) */
int custom_alarm_sound;
int color;
/* This isn't datebk specific */
char *note; /* points to where the note starts after the tag (or null) */
};
#endif
int datebook_print(int type);
int datebook_import(GtkWidget *window);
int datebook_cleanup(void);
void free_AppointmentList(AppointmentList **al);
/*
* If Null is passed in for date, then all appointments will be returned.
* total_records returns total records in database (can pass in NULL).
* returns number of records in list.
*/
int get_days_appointments(AppointmentList **al_out, struct tm *date,
int *total_records);
/*
* If Null is passed in for date, then all appointments will be returned
* modified, deleted and private, 0 for no, 1 for yes, 2 for use prefs.
* total_records returns total records in database (can pass in NULL).
* returns number of records in list.
*/
int get_days_appointments2(AppointmentList **appointment_list, struct tm *now,
int modified, int deleted, int privates,
int *total_records);
/* This function removes appointments from the list that obviously will not
* occur in this month. Skip privates will ignore private records.
*/
int weed_datebook_list(AppointmentList **al, int mon, int year,
int skip_privates, int *mask);
int weed_calendar_event_list(CalendarEventList **cel, int mon, int year,
int skip_privates, int *mask);
/* Year is years since 1900 */
/* Mon is 0-11 */
/* Day is 1-31 */
/* */
int datebook_add_exception(struct CalendarEvent *cale, int year, int mon, int day);
int get_calendar_or_datebook_app_info(struct CalendarAppInfo *cai, long datebook_version);
int copy_calendar_event(const struct CalendarEvent *source,
struct CalendarEvent **dest);
/* returns a bit mask where bit 1 is day one, etc. Bit is set if an */
/* appointment occurs on that day, 0 if not. */
int appointment_on_day_list(int mon, int year, int *mask,
int category, int datebook_version);
/*
* returns 1 if an appointment does occur/re-occur on dat
* else returns 0
*/
unsigned int isApptOnDate(struct Appointment *a, struct tm *date);
unsigned int calendar_isApptOnDate(struct CalendarEvent *cale, struct tm *date);
int compareTimesToDay(struct tm *tm1, struct tm *tm2);
#ifdef ENABLE_DATEBK
/* Returns a bitmask
* 0 if not a floating OR
* bitmask:
* 1 if float,
* 2 if completed float
* 16 if float has a note
*/
int db3_parse_tag(char *note, int *type, struct db4_struct *db4);
int db3_has_tags(struct Appointment *a);
int db3_which_icon(struct Appointment *a);
#endif
int datebook_export(GtkWidget *window);
#endif