summaryrefslogtreecommitdiff
path: root/src/Net-ICal-Libical/lib/Net/ICal/Libical.pm
blob: 61970c2997b91dc7dbb574d0d32124d48558ffd5 (plain)
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
#!/usr/bin/perl
#======================================================================
# FILE: Libical.pm
# CREATOR: eric
#
# (C) COPYRIGHT 2000, Eric Busboom <eric@civicknowledge.com>
#
# This library is free software; you can redistribute it and/or modify
# it under the terms of either:
#
#    The LGPL as published by the Free Software Foundation, version
#    2.1, available at: https://www.gnu.org/licenses/lgpl-2.1.html
#
# Or:
#
#    The Mozilla Public License Version 2.0. You may obtain a copy of
#    the License at https://www.mozilla.org/MPL/
#======================================================================

# This part of this file was automatically generated by SWIG

require Net::ICal::Libical::Component;
require Net::ICal::Libical::Property;
require Net::ICal::Libical::Time;
require Net::ICal::Libical::Duration;

package Net::ICal::Libical;
require Exporter;
require DynaLoader;
@ISA = qw(Exporter DynaLoader);
package Net::ICal::Libical;
bootstrap Net::ICal::Libical;
var_Net__ICal__Libical_init();
@EXPORT = qw( );

$VERSION = "0.01";

1;




sub validate_component {
  my $comp_str = shift;


  my $c = Net::ICal::Libical::icalparser_parse_string($comp_str);
  my $out;

  die "Failed to parse component" if !$c;

  my $r = Net::ICal::Libical::icalrestriction_check($c);

  $out = Net::ICal::Libical::icalcomponent_as_ical_string($c);

  Net::ICal::Libical::icalcomponent_free($c);

  return $out;

}


sub generate_occurrences {
  my $rule = shift;
  my $start = shift;
  my $count = shift;

  my @out;

  my $array = Net::ICal::Libical::icallangbind_new_array(25);

  Net::ICal::Libical::icalrecur_expand_recurrence($rule,$start,
                                                  $count,$array);

  for($i = 0; $i<$count; $i++){
    my $t = Net::ICal::Libical::icallangbind_access_array($array,$i);
    if($t != 0) {
      push(@out,$t);
    }

  }

  Net::ICal::Libical::icallangbind_free_array($array);

  return @out;
}


# The remaining code is just the interface declarations for a complete
# perl binding to libical. Currently, it is looking for an author....





1;

__END__

#""" Represent iCalendar DATE, TIME and DATE-TIME ""

package Net::ICal::Libical::Time;
@ISA = (Property);

sub new {}

#"""Updates value and value_type based on the (internal) self.tt."""
sub _update_value { }

# " Return true if this is a valid time "
sub valid { }

# """ Return or set time in seconds past POSIX epoch"""
sub utc_seconds {}

# """ Return or set boolean indicating if time is in UTC """
sub is_utc {}

# Get/Set booll indicating is time is a date
sub is_date(self,v=None):

#"" Return or set the timezone string for this time """
sub timezone {}

#"" Get or set the seconds component of this time """
sub second {}
sub minute {}
sub hour {}
sub day {}
sub month {}
sub year {}

# How dow you over load +,- in perl?

# Add duration to time = time
sub __add__{}

# Subtract time from time = duration
# Subtract duration from time = time
sub __sub__(self,o):


package Net::ICal::Libical::Duration(Property):
@ISA = (Property);

sub new {}
sub _update_value {}
#"Return true if this is a valid duration"
sub valid {}
# """Return or set duration in seconds"""
sub seconds {}


#"""Represent a span of time"""

package Net::ICal::Libical::Period;
@ISA = (Property);

sub new{}

sub _end_is_duration {}
sub _end_is_time {}
sub _update_value {}

#"Return true if this is a valid period"
sub valid {}

#Return or set start time of the period. The start time may be
#expressed as an RFC2445 format string or an instance of Time.
#The return value is an instance of Time
sub start {}

#Return or set end time of the period. The end time may be
#expressed as an RFC2445 format string or an instance of Time.
#The return value is an instance of Time.

#If the Period has a duration set, but not an end time, this
#method will caluculate the end time from the duration.
sub end {}

#Return or set the duration of the period. The duration may be
#expressed as an RFC2445 format string or an instance of Duration.
#The return value is an instance of Duration.
#If the period has an end time set, but not a duration, this
#method will calculate the duration from the end time.
sub duration{}

# Get set the timezone for the period. Basically returns self->dict{TZID}
sub timezone(self,v=None):


# Represents the value and all parameters of an attendee
package Net::ICal::Libical::Attendee(Property):
@ISA = (Property);

sub new{}

# Methods for accessing enumerated parameters
sub cn {}
sub cutype {}
sub dir {}
sub delegated_from {}
sub delegated_to {}
sub language {}
sub member {}
sub partstat {}
sub role {}
sub rsvp {}
sub sent_by {}


package Net::ICal::Libical::Organizer;
@ISA = (Property)
# Methods for accessing enumerated parameters
sub cn{}
sub dir{}
sub language {}
sub sent_by {}

package Net::ICal::Libical::Recurrence_Id;
@ISA= (Property)

package Net::ICal::Libical::Attach;
@ISA= (Property)

package Net::ICal::Libical::Event;
@ISA= (Component)

sub component_type {}

#"Returns a copy of the object."
sub clone {}

#Sets or returns the value of the DTEND property.
#Usage:
#dtend(time_obj)             # Set the value using a Time object
#dtend('19970101T123000Z')   # Set the value as an iCalendar string
#dtend(982362522)            # Set the value using seconds (time_t)
#dtend()                     # Return a Time
#
#If the dtend value is being set and duration() has a value, the
#duration property will be removed.
sub dtend{}

#Sets or returns the value of the duration property.
#Usage:
#duration(dur_obj)       # Set the value using a Duration object
#duration("P3DT12H")     # Set value as an iCalendar string
#duration(3600)          # Set duration using seconds
#duration()              # Return a duration
#
#If the duration value is being set and dtend() has a value, the dtend
#property will be removed.
sub duration{}

#Sets attendees or returns a list of Attendee objects.
sub attendees {}

#Sets or gets the value of the ORGANIZER property.
#Usage:
#organizer(orgObj)              # Set value using an organizer object
#organizer('MAILTO:jd@not.com') # Set value using a CAL-ADDRESS string
#organizer()                    # Return a CAL-ADDRESS string
sub organizer{}

#"Sets or gets the SUMMARY value of the Event."
sub summary{}

#Sets or gets the UID of the Event.
sub uid{}

#Sets or gets the value for the RECURRENCE-ID property.
#Usage:
#Recurrence_id(recIdObj)             # Set using a Recurrence_Id object
#Recurrence_id("19700801T133000")    # Set using an iCalendar string
#Recurrence_id(8349873494)           # Set using seconds from epoch
#Recurrence_id()                     # Return a Time
sub recurrence_id{}

#Sets or gets the SEQUENCE value of the Event.
#Usage:
#sequence(1)     # Set the value using an integer
#sequence('2')   # Set the value using a string containing an integer
#sequence()      # Return an integer
sub sequence{}

#Sets or returns the value of the LAST-MODIFIED property.
#Usage:
#lastmodified(time_obj)          # Set the value using a Time object
#lastmodified('19970101T123000Z')# Set using an iCalendar string
#lastmodified(982362522)         # Set using seconds
#lastmodified()                  # Return a Time
sub lastmodified{}



#Sets or returns the value of the CREATED property.
#Usage:
#created(time_obj)           # Set the value using a Time object
#created('19970101T123000Z') # Set using an iCalendar string
#created(982362522)          # Set using seconds
#created()                   # Return a Time
sub created {}


sub related_to{}
sub comment{}

"Sets or returns the value of the DESCRIPTION property."

sub description {}

#Sets categories or returns a list of Attendee objects.
sub categories {}

sub attach{}

#Represents a set of event occurrences. This
#package controls a component's RRULE, EXRULE, RDATE and EXDATE
#properties and can produce from them a set of occurrences.
package Net::ICal::Libical::RecurrenceSet:


#Include a date or rule to the set.
#Use date= or pass in a
#Time instance to include a date. Included dates will add an
#RDATE property or will remove an EXDATE property of the same
#date.
#Use rule= or pass in a string to include a rule. Included
#rules with either add a RRULE property or remove an EXRULE
#property.

sub include{}

#Exclude date or rule to the set.
#Use date= or pass in a Time instance to exclude a
#date. Excluded dates will add an EXDATE property or will remove
#an RDATE property of the same date.
#Use rule= or pass in a string to exclude a rule. Excluded
#rules with either add an EXRULE property or remove an RRULE
#property.
sub exclude{}

#Return 'count' occurrences as a tuple of Time instances.
sub occurrences{}

package Net::ICal::Libical::Store;
sub new{}
sub path{}
sub mark{}
sub commit{}
sub addComponent{}
sub removeComponent{}
sub countComponents{}
sub select{}
sub clearSelect{}
sub fetch{}
sub fetchMatchK{}
sub modify{}
sub currentComponent{}
sub firstComponent{}
sub nextComponent{}


package Net::ICal::Libical::FileStore;
@ISA = (Store)
sub new{}
sub path{}
sub mark{}
sub commit{}
sub addComponent{}
sub removeComponent{}
sub countComponents{}
sub select{}
sub clearSelect{}
sub fetch{}
sub fetchMatchK{}
sub modify{}
sub currentComponent{}
sub firstComponent{}
sub nextComponent{}


1;