Platforms to show: All Mac Windows Linux Cross-Platform

Back to CalCalendarStoreMBS class.

CalCalendarStoreMBS.calendars as CalCalendarMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
An array of all the user's calendars, represented as CalCalendars.
Example
dim c as new CalCalendarStoreMBS
dim ca() as CalCalendarMBS

ca=c.calendars
for each cc as CalCalendarMBS in ca
MsgBox cc.Title+EndOfLine+cc.type+EndOfLine+cc.notes
next

If the user has iCal data from a previous version of Mac OS X, but has not launched iCal in 10.5, this will return an array of empty calendars. iCal needs to be launched at least once in order to migrate the user's calendar data.

If no calendar data from any version of Mac OS X exists, then this method will create and return two default calendars, named Home and Work.

Some examples using this method:

CalCalendarStoreMBS.calendarWithTitle(Title as string) as CalCalendarMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 14.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Queries all calendars and searches for one with the given title.
Example
dim cs as new CalCalendarStoreMBS

// delete one
dim c as CalCalendarMBS = cs.calendarWithTitle("Just Testing")
dim e as NSErrorMBS
if cs.removeCalendar(c, e) then
MsgBox "deleted"
else
MsgBox "Failed to remove: "+e.LocalizedDescription
end if

Title comparison is case insensitive.
Returns nil on any error.

CalCalendarStoreMBS.calendarWithUID(UID as string) as CalCalendarMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 7.7 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The calendar associated with the specific UID.

If no record with this UID exists, nil is returned.

CalCalendarStoreMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 7.7 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The class for the calendar storage.

This is the main class. Keep an object of it around as long as you use the calendar classes.

CalCalendarStoreMBS.events(StartDate as date, EndDate as date) as CalEventMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This method returns an array of all the CalEvents which match the condition.
Example
dim c as new CalCalendarStoreMBS

dim i,count as Integer
dim ta() as CalEventMBS
dim ct as CalEventMBS

dim sd as new date
dim ed as new date

ed.day=ed.day+1
// events within the next 24 hours

ta=c.events(sd,ed)
for each ct in ta
msgbox ct.Title+EndOfLine+ct.location+EndOfLine+ct.startDate.LongDate+" "+ct.startDate.LongTime
next

This is the function which uses all calendars.

For performance reasons, this method will only return occurrences of repeating events that fall within a specific four year timespan. If the date range between the startDate and endDate is greater than four years, then the timespan containing recurrences is always the first four years of date range.

See also:

CalCalendarStoreMBS.events(StartDate as date, EndDate as date, calendar as CalCalendarMBS) as CalEventMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This method returns an array of all the CalEvents which match the condition.
Example
// init
dim s as new CalCalendarStoreMBS

// find calendar by name
dim myCalendar as CalCalendarMBS
dim calendars() as CalCalendarMBS = s.calendars

for each ca as CalCalendarMBS in calendars
if ca.Title = "Private Events" then
myCalendar=ca
exit
end if
next

// Get date range for today
dim Startdate as new date
dim Enddate as new date

Startdate.hour = 0
Startdate.Minute = 0
Startdate.Second = 0

Enddate.hour = 23
Enddate.minute = 59
Enddate.second = 59

// Query events on this calendar
dim events() as CalEventMBS = s.events(Startdate,Enddate, myCalendar)

// Display result
dim lines(-1) as string
for each e as CalEventMBS in events
lines.Append e.Title
next

MsgBox Join(lines,EndOfLine)

For performance reasons, this method will only return occurrences of repeating events that fall within a specific four year timespan. If the date range between the startDate and endDate is greater than four years, then the timespan containing recurrences is always the first four years of date range.

See also:

CalCalendarStoreMBS.events(StartDate as date, EndDate as date, calendars() as CalCalendarMBS) as CalEventMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This method returns an array of all the CalEvents which match the condition.

For performance reasons, this method will only return occurrences of repeating events that fall within a specific four year timespan. If the date range between the startDate and endDate is greater than four years, then the timespan containing recurrences is always the first four years of date range.

See also:

CalCalendarStoreMBS.events(StartDate as date, EndDate as date, eventUID as string) as CalEventMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This method returns an array of all the CalEvents which match the condition.

This is the function which uses all calendars.

For performance reasons, this method will only return occurrences of repeating events that fall within a specific four year timespan. If the date range between the startDate and endDate is greater than four years, then the timespan containing recurrences is always the first four years of date range.

See also:

CalCalendarStoreMBS.events(StartDate as date, EndDate as date, eventUID as string, calendar as CalCalendarMBS) as CalEventMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This method returns an array of all the CalEvents which match the condition.

For performance reasons, this method will only return occurrences of repeating events that fall within a specific four year timespan. If the date range between the startDate and endDate is greater than four years, then the timespan containing recurrences is always the first four years of date range.

See also:

CalCalendarStoreMBS.events(StartDate as date, EndDate as date, eventUID as string, calendars() as CalCalendarMBS) as CalEventMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This method returns an array of all the CalEvents which match the condition.

For performance reasons, this method will only return occurrences of repeating events that fall within a specific four year timespan. If the date range between the startDate and endDate is greater than four years, then the timespan containing recurrences is always the first four years of date range.

See also:

CalCalendarStoreMBS.eventsMT(StartDate as date, EndDate as date, calendars() as CalCalendarMBS = nil) as CalEventMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 16.5 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This method returns an array of all the CalEvents which match the condition.

For performance reasons, this method will only return occurrences of repeating events that fall within a specific four year timespan. If the date range between the startDate and endDate is greater than four years, then the timespan containing recurrences is always the first four years of date range.

If calendars array is nil, we use all calendars.

The work is performed on a preemptive thread, so this function does not block the application and can yield time to other Xojo threads. Must be called in a Xojo thread to enjoy benefits. If called in main thread will block, but keep other background threads running.

CalCalendarStoreMBS.eventWithUID(UID as string, occurrence as date) as CalEventMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 7.7 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Searches the event with the given unique ID.
Example
// connect to calendar storage
dim c as new CalCalendarStoreMBS

// find event with given UID
dim e as CalEventMBS = c.eventWithUID("M2CD-6-1-EEB42862-8BD6-4880-AF91-4AEEADD900B6", nil)

// and display title
MsgBox e.Title

Returns nil on any error.

uid: The unique identifier of an event.
date: The date of a recurring event. Pass nil if the event is not recurring.

Returns a CalEvent object that matches the specified unique identifier and date. Returns nil if the event is not found, or the event is recurring and date is not specified.

Available in Mac OS X v10.5 and later.

CalCalendarStoreMBS.removeCalendar(calendar as CalCalendarMBS, byref error as NSErrorMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 7.7 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Deletes a calendar.
Example
dim cs as new CalCalendarStoreMBS

// before

dim calendars1() as CalCalendarMBS = cs.calendars
dim list1() as string

for each c1 as CalCalendarMBS in calendars1
list1.Append c1.Title
next

MsgBox Join(list1, EndOfLine)

// delete one
dim c as CalCalendarMBS = cs.calendarWithTitle("Just Testing")
dim e as NSErrorMBS
if cs.removeCalendar(c, e) then
MsgBox "deleted"
else
MsgBox "Failed to remove: "+e.LocalizedDescription
end if

// after
dim calendars2() as CalCalendarMBS = cs.calendars
dim list2() as string

for each c2 as CalCalendarMBS in calendars2
list2.Append c2.Title
next

MsgBox Join(list2, EndOfLine)

Return

CalCalendarStoreMBS.removeEvent(theEvent as CalEventMBS, span as Integer, byref error as NSErrorMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 7.7 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Removes the event from the calendar.
Example
// start a connection to the calendar database
dim s as new CalCalendarStoreMBS

// needed for the error details
dim e as NSErrorMBS

// create a new calendar event
dim c as new CalEventMBS

dim calendars() as CalCalendarMBS = s.calendars

// set properties
c.Title="new Event"
c.startDate=new date
c.calendar=calendars(0) // add to first calendar

dim d as new date
d.hour=d.hour+1
c.endDate=d

// save event
call s.saveEvent(c,s.CalSpanAllEvents, e)
if e<>nil then
MsgBox e.localizedDescription
else
MsgBox "New event was created with UID: "+c.uid

e = nil

// and delete it
if s.removeEvent(c, s.CalSpanAllEvents, e) then
MsgBox "Event deleted."
else
MsgBox e.localizedDescription
end if

end if

Returns true on success and false on failure.
Error is stored in the error object.

CalCalendarStoreMBS.removeTask(task as CalTaskMBS, byref error as NSErrorMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 7.7 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Removes the task from the calendar.

Returns true on success and false on failure.
Error is stored in the error object.

CalCalendarStoreMBS.saveCalendar(calendar as CalCalendarMBS, byref error as NSErrorMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 7.7 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Writes changes to calendar.
Example
dim cs as new CalCalendarStoreMBS
dim c as new CalCalendarMBS

c.Title = "Just Testing"

dim e as NSErrorMBS
if cs.saveCalendar(c, e) then
MsgBox "OK"
else
MsgBox "Failed "+e.LocalizedDescription
end if

The saveCalendar and the removeCalendar calendars allow the client to add, modify, and remove calendars in the user's calendar store. saveCalendar should be used both to add a new calendar to the calendar store, and to modify a calendar already in the store.

The only calendars that can be added with this API are local calendars; it is not possible to add subscribed or CalDAV calendars, or the birthday calendar.

Changes made to a CalCalendar are not persisted until that calendar has been passed to saveCalendar. If saveCalendar is not called, the changes will be lost.

CalCalendarStoreMBS.saveEvent(theEvent as CalEventMBS, span as Integer, byref error as NSErrorMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 7.7 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This method allows the client to add or modify events in the user's calendar store.

This method should be used both to add a new event to the calendar store, and to modify an event already in the calendar store.
If the event being saved is a repeating event, the second argument is used to describe whether the change being made should apply to future occurrences of that event, all occurrences, or only this instance. This is analogous to options on the dialog iCal presents when a user modifies a recurring event (though iCal's UI does not provide a way to change all events, past and present).

Changes made to a CalEvent are not persisted until that event has been passed to saveEvent. If saveEvent is not called, the changes will be lost.

Applying changes to all events or all future events may cause the UID or the occurrence date of the event to change.

CalCalendarStoreMBS.saveTask(task as CalTaskMBS, byref error as NSErrorMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 7.7 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Saves the specified task to the calendar store.
Example
dim s as new CalCalendarStoreMBS
dim t as new CalTaskMBS
dim a() as CalCalendarMBS = s.calendars
dim d as new date

d.Month = d.Month + 1

t.calendar = a(0)
t.Title = "Test"
t.URL = "http://www.mbsplugins.de/"
t.priority = t.CalPriorityMedium
t.dueDate = d
t.notes = "just a test"
t.isCompleted = false

dim e as NSErrorMBS
if s.saveTask(t, e) then
MsgBox "saved"
else
MsgBox "failed to save"
end if

task: The task to save.
error: If this method returns false, an NSError object describing the error.

Returns true on success; otherwise, returns false and sets the error argument to an NSError object describing the error.

Use this method to save new task objects and modifications to existing task objects. Changes to task objects are not persistent until this method is invoked. The calendar property needs to be set before attempting to save a task.

Available in Mac OS X v10.5 and later.

CalCalendarStoreMBS.tasks as CalTaskMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This method returns an array of all the CalTasks.

This is the function which uses all calendars.

See also:

CalCalendarStoreMBS.tasks(calendar as CalCalendarMBS) as CalTaskMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This method returns an array of all the CalTasks which match the condition.

See also:

CalCalendarStoreMBS.tasks(calendars() as CalCalendarMBS) as CalTaskMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This method returns an array of all the CalTasks which match the condition.

See also:

CalCalendarStoreMBS.TasksCompletedSince(completedSince as date) as CalTaskMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This method returns an array of all the CalTasks which match the condition.

This is the function which uses all calendars.

See also:

CalCalendarStoreMBS.TasksCompletedSince(completedSince as date, calendar as CalCalendarMBS) as CalTaskMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This method returns an array of all the CalTasks which match the condition.

See also:

CalCalendarStoreMBS.TasksCompletedSince(completedSince as date, calendars() as CalCalendarMBS) as CalTaskMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This method returns an array of all the CalTasks which match the condition.

See also:

CalCalendarStoreMBS.taskWithUID(UID as string) as CalTaskMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 7.7 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Searches the task with the given unique ID.

Returns nil on any error.

CalCalendarStoreMBS.UncompletedTasks as CalTaskMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This method returns an array of all the CalTasks which match the condition.
Example
dim c as new CalCalendarStoreMBS

dim ta() as CalTaskMBS = c.UncompletedTasks

for each ct as CalTaskMBS in ta
msgbox ct.Title+EndOfLine+str(ct.priority)+EndOfLine+ct.dueDate.LongDate
next

This is the function which uses all calendars.

See also:

Some examples using this method:

CalCalendarStoreMBS.UncompletedTasks(calendar as CalCalendarMBS) as CalTaskMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This method returns an array of all the CalTasks which match the condition.

See also:

CalCalendarStoreMBS.UncompletedTasks(calendars() as CalCalendarMBS) as CalTaskMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This method returns an array of all the CalTasks which match the condition.

See also:

CalCalendarStoreMBS.UncompletedTasksDueBefore(dueDate as date) as CalTaskMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This method returns an array of all the CalTasks which match the condition.

This is the function which uses all calendars.

See also:

CalCalendarStoreMBS.UncompletedTasksDueBefore(dueDate as date, calendar as CalCalendarMBS) as CalTaskMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This method returns an array of all the CalTasks which match the condition.

See also:

CalCalendarStoreMBS.UncompletedTasksDueBefore(dueDate as date, calendars() as CalCalendarMBS) as CalTaskMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Calendar MBS MacFrameworks Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This method returns an array of all the CalTasks which match the condition.

See also:

The items on this page are in the following plugins: MBS MacFrameworks Plugin.


The biggest plugin in space...