From 6895ba2f1891a01fdb0aa2007f3e70412778510b Mon Sep 17 00:00:00 2001 From: Viktor Richter Date: Mon, 23 Jun 2014 10:02:47 +0200 Subject: [PATCH] added calendar types following rfc 2445 --- proto/sandbox/rst/calendar/Attendee.proto | 189 +++++++++++++++ .../sandbox/rst/calendar/CalendarComponents.proto | 31 +++ proto/sandbox/rst/calendar/DateTime.proto | 66 ++++++ proto/sandbox/rst/calendar/Entry.proto | 243 ++++++++++++++++++++ proto/sandbox/rst/calendar/Event.proto | 100 ++++++++ proto/sandbox/rst/calendar/Observance.proto | 84 +++++++ proto/sandbox/rst/calendar/Organizer.proto | 55 +++++ proto/sandbox/rst/calendar/Recurrence.proto | 54 +++++ proto/sandbox/rst/calendar/RecurrenceId.proto | 90 ++++++++ proto/sandbox/rst/calendar/RecurrenceRule.proto | 228 ++++++++++++++++++ proto/sandbox/rst/calendar/Relationship.proto | 56 +++++ proto/sandbox/rst/calendar/RequestStatus.proto | 63 +++++ proto/sandbox/rst/calendar/TimeZone.proto | 78 +++++++ proto/sandbox/rst/calendar/Todo.proto | 97 ++++++++ 14 files changed, 1434 insertions(+) create mode 100644 proto/sandbox/rst/calendar/Attendee.proto create mode 100644 proto/sandbox/rst/calendar/CalendarComponents.proto create mode 100644 proto/sandbox/rst/calendar/DateTime.proto create mode 100644 proto/sandbox/rst/calendar/Entry.proto create mode 100644 proto/sandbox/rst/calendar/Event.proto create mode 100644 proto/sandbox/rst/calendar/Observance.proto create mode 100644 proto/sandbox/rst/calendar/Organizer.proto create mode 100644 proto/sandbox/rst/calendar/Recurrence.proto create mode 100644 proto/sandbox/rst/calendar/RecurrenceId.proto create mode 100644 proto/sandbox/rst/calendar/RecurrenceRule.proto create mode 100644 proto/sandbox/rst/calendar/Relationship.proto create mode 100644 proto/sandbox/rst/calendar/RequestStatus.proto create mode 100644 proto/sandbox/rst/calendar/TimeZone.proto create mode 100644 proto/sandbox/rst/calendar/Todo.proto diff --git a/proto/sandbox/rst/calendar/Attendee.proto b/proto/sandbox/rst/calendar/Attendee.proto new file mode 100644 index 0000000..01ede5f --- /dev/null +++ b/proto/sandbox/rst/calendar/Attendee.proto @@ -0,0 +1,189 @@ +package rst.calendar; + +option java_outer_classname = "AttendeeType"; + +/** +* A description of an Attendee of a calendar component. +* +* This message represents an ATTENDEE property in RFC 2445. +* +* For a documentation of the RFC 2445 iCalendar specification visit +* http://www.ietf.org/rfc/rfc2445.txt +* +* @author Viktor Richter +*/ +message Attendee { + + /** + * Used to identify the type of a calendar user specified by an + * attendee definition. An attendee at a calender event does + * not inevitably have to be a person. It also can be a group + * room or different noteworthy physical resource. + * + * This enum represents the possible values of a CUTYPE in RFC 2445 + */ + enum UserType { + + /** + * The attendee is an individual. + */ + INDIVIDUAL = 1; + + /** + * The attendee is a group of individuals. + */ + GROUP = 2; + + /** + * The attendee is a physical resource. + */ + RESOURCE = 3; + + /** + * The attendee is a room. + */ + ROOM = 4; + } + + /** + * Used to specify the participation role of an attendee. + * + * This enum represents the possible values of a ROLE in RFC 2445 + */ + enum Role { + + /** + * Chair of the calendar entity. + */ + CHAIR = 1; + + /** + * Someone whose participation is required. + */ + REQUIRED_PARTICIPANT = 2; + + /** + * Someone whose participation is optional. + */ + OPTIONAL_PARTICIPANT = 3; + + /** + * Someone whose participation is for information purposes only. + */ + NON_PARTICIPANT = 4; + } + + /** + * Used to specify the participation status of an attendee. + * + * This enum represents the possible values of a PARTSTAT in RFC 2445 + */ + enum ParticipatonStatus { + + /** + * The attendee has yet to react. + */ + NEEDS_ACTION = 1; + + /** + * The attendee has accepted the participation. + */ + ACCEPTED = 2; + + /** + * The attendee has declined the participation. + */ + DECLINED = 3; + } + + /** + * Specifies the attendees calendar user address as URI, which can for + * example be a MAILTO. + * + * This field corresponds to the cal-address of an attendee in RFC 2445 + */ + required string calendar_adress = 1; + + /** + * Specifies what type of calendar user this attendee is. + * An attendee can be a person, group, room or resource. + * + * This field corresponds to the cutypeparam of an attendee in RFC 2445 + */ + optional UserType calendar_user_type = 6 [default = INDIVIDUAL]; + + /** + * Specifies the groups the attendee belongs to via a list of URIs. + * + * This field corresponds to the memberparam of an attendee in RFC 2445. + * The original memberparam is a single string holding the uris as a comma + * separated list of double quoted uris. + */ + repeated string member = 7; + + /** + * Specifies the participation role of the attendee. + * + * This field corresponds to the roleparam of an attendee in RFC 2445 + */ + optional Role participation_role = 8 [default = REQUIRED_PARTICIPANT]; + + /** + * Specifies the participation status of the attendee. + * + * This field corresponds to the partstatparam of an attendee in RFC 2445 + */ + optional ParticipatonStatus participation_status = 9 [default = NEEDS_ACTION]; + + /** + * Specifies whether the favor of a reply is requested. + * + * This field corresponds to the rsvpparam of an attendee in RFC 2445 + */ + optional bool reply_requested = 10 [default = false]; + + /** + * An URI specifying a user to whom this participation was delegated. + * + * This field corresponds to the deltoparam of an attendee in RFC 2445 + */ + optional string delegated_to = 11; + + /** + * An URI specifying a user from which this participation was delegated. + * + * This field corresponds to the delfromparam of an attendee in RFC 2445 + */ + optional string delegated_from = 12; + + /** + * Specifies another user that is acting on behalf of the attendee + * + * This field corresponds to the sentbyparam of an attendee in RFC 2445 + */ + optional string sent_by = 4; + + /** + * Specifies the common or display name of the attendee. + * + * This field corresponds to the cnparam of an attendee in RFC 2445 + */ + optional string common_name = 2; + + /** + * Specifies a reference (uri) to the directory entry associated with the + * calendar user acting as attendee. + * + * This field corresponds to the dirparam of an attendee in RFC 2445 + */ + optional string directory = 3; + + /** + * Specifies the language as defined in http://www.ietf.org/rfc/rfc1766.txt. + * If specified the language applies to the common_name field. + * + * This field corresponds to the languageparam of an attendee in RFC 2445 + */ + optional string language = 5; + +} diff --git a/proto/sandbox/rst/calendar/CalendarComponents.proto b/proto/sandbox/rst/calendar/CalendarComponents.proto new file mode 100644 index 0000000..d7df60f --- /dev/null +++ b/proto/sandbox/rst/calendar/CalendarComponents.proto @@ -0,0 +1,31 @@ +package rst.calendar; + +import "rst/calendar/TimeZone.proto"; +import "rst/calendar/Event.proto"; +import "rst/calendar/Todo.proto"; + +option java_outer_classname = "CalendarComponentsType"; + +/** +* A container message for multiple calendar components. +* +* @author Viktor Richter +*/ +message CalendarComponents { + + /** + * A set of TimeZones + */ + repeated TimeZone timezones = 1; + + /** + * A set of Events + */ + repeated Event events = 2; + + /** + * A set of Todos + */ + repeated Todo todos = 3; + +} diff --git a/proto/sandbox/rst/calendar/DateTime.proto b/proto/sandbox/rst/calendar/DateTime.proto new file mode 100644 index 0000000..16b375c --- /dev/null +++ b/proto/sandbox/rst/calendar/DateTime.proto @@ -0,0 +1,66 @@ +package rst.calendar; + +option java_outer_classname = "DateTimeType"; + +/** +* A description of date and time of day. +* +* This message represents a DATE-TIME property in RFC 2445. +* +* For a documentation of the RFC 2445 iCalendar specification visit +* http://www.ietf.org/rfc/rfc2445.txt +* +* @author Viktor Richter +*/ +message DateTime { + + /** + * A DateTime can have one of the three following forms. + */ + enum Type { + + /** + * UTC that this time is meant to be in absolute Coordinated Universal + * Time. + */ + UTC = 1; + + /** + * FLOATING is used to specify time which is not bound to any time zone. + * + * Example: Dinner may always be at 6pm regardless of the current time + * zone. + */ + FLOATING = 2; + + /** + * LOCAL specifies that this time is bound to a specific time zone. + * + * This additionally requires the timezone_id field to be set. + */ + LOCAL = 3; + + } + + /** + * Specifies whether this time is floating, utc or local. + */ + optional Type date_time_type = 1 [default = UTC]; + + /** + * Specifies the time zone to which this time is bound. + * + * The value of timezone_id must match the timezone_id of a known or + * attached TimeZone definition. + * + * This field MUST be specified when DateTimeType is LOCAL. + * In all other cases it has no meaning. + */ + optional string timezone_id = 2 [default = "UTC"]; + + /** + * The time since epoch (01.01.1970 at 00:00 UTC) in milliseconds. + */ + optional uint64 milliseconds_since_epoch = 3 [default = 0]; + +} diff --git a/proto/sandbox/rst/calendar/Entry.proto b/proto/sandbox/rst/calendar/Entry.proto new file mode 100644 index 0000000..ee7d226 --- /dev/null +++ b/proto/sandbox/rst/calendar/Entry.proto @@ -0,0 +1,243 @@ +package rst.calendar; + +import "rst/calendar/TimeZone.proto"; +import "rst/calendar/DateTime.proto"; +import "rst/calendar/RecurrenceId.proto"; +import "rst/calendar/Attendee.proto"; +import "rst/calendar/Organizer.proto"; +import "rst/calendar/Recurrence.proto"; +import "rst/calendar/RequestStatus.proto"; +import "rst/calendar/Relationship.proto"; + +option java_outer_classname = "EntryType"; + +/** +* A description of a calendar entry holding the common properties of +* VEVENT and VTODO components from RFC 2445. +* +* For a documentation of the RFC 2445 iCalendar specification visit +* http://www.ietf.org/rfc/rfc2445.txt +* +* @author Viktor Richter +*/ +message Entry { + + /** + * This enum is used to restrict access or visibility of of the entry. + * + * It represents the possible values of a CLASS in RFC 2445 + */ + enum Visibility { + + /** + * The entry can be seen by everyone. + */ + PUBLIC = 1; + + /** + * The entry is private. + */ + PRIVATE = 2; + + /** + * The entry is confidential. + */ + CONFIDENTIAL = 3; + } + + /** + * Specifies the visibility classification of this entry. + * + * This field corresponds to the class property of an entry in RFC 2445. + */ + optional Visibility visibility = 1 [default = PUBLIC]; + + /** + * Specifies when the entry was created in utc time. + * + * More precisely: Tells when the entry was first created in the + * calendar store. + * + * This field corresponds to the created property of an entry in RFC 2445. + */ + //@constraint(value.type == DateTime.Type.UTC) + optional DateTime created_utc = 2; + + /** + * A more complete description of the entry. + * + * This field corresponds to the description property of an entry in + * RFC 2445. + */ + optional string description = 3; + + /** + * Specifies when the entry starts. + * + * This field corresponds to the dtstart property of an entry in RFC 2445. + */ + optional DateTime date_time_start = 4; + + /** + * Specifies the global position of the associated activity. + * + * This field corresponds to the latitude part of the geo property of an + * entry in RFC 2445. + */ + optional double geo_latitude = 5 [default = 0.]; + + /** + * Specifies the global position of the associated activity. + * + * This field corresponds to the longitude part of the geo property of an + * entry in RFC 2445. + */ + optional double geo_longitude = 6 [default = 0.]; + + /** + * Specifies when the entry was modified the last time in utc time. + * + * More precisely: Tells when the entry was last modified in the + * calendar store. + * + * This field corresponds to the last-mod property of an entry in RFC 2445. + */ + //@constraint(value.type == DateTime.Type.UTC) + optional DateTime last_modified = 7; + + /** + * Specifies where the entry will take place. + * + * This field corresponds to the location property of an entry in RFC 2445. + */ + optional string location = 8; + + /** + * Defines the organizer of the entry. + * + * This field corresponds to the organizer property of an entry in RFC 2445. + */ + optional Organizer organizer = 9; + + /** + * The priority of the entry as an integer between 0 and 9. + * + * 0 means not defined, 1 means highest, 9 means lowest priority. + * + * This field corresponds to the priority property of an entry in RFC 2445. + */ + //@constraint(0 <= value <= 9) + optional uint32 priority = 10 [default = 0]; + + /** + * Specifies when the entry was created. + * + * More precise: When the iCalendar object representation of the calendar + * service information was created or last modified. + * + * This field corresponds to the dtstamp property of an entry in RFC 2445. + */ + optional DateTime date_time_stamp = 11; + + /** + * This is incremented every time the entry is changed significantly. + * + * This field corresponds to the seq property of an entry in RFC 2445. + */ + optional uint32 sequence_number = 12 [default = 0]; + + /** + * A short summary or the subject of the entry. + * + * This field corresponds to the summary property of an entry in RFC 2445. + */ + optional string summary = 13; + + /** + * The globally unique id of the entry. + * + * This field corresponds to the uid property of an entry in RFC 2445. + */ + optional string uid = 14; + + /** + * The Uniform Resource Locator associated with this entry. + * + * This field corresponds to the url property of an entry in RFC 2445. + */ + optional string url = 15; + + /** + * Combined with uid and sequence, this can be used to reference a specific + * entry in a recurrence set. + * + * This field corresponds to the recurid property of an entry in RFC 2445. + */ + optional RecurrenceId recurrence_id = 16; + + /** + * This provides a means to attach a document via URI or binary attachment + * as string. + * + * This field corresponds to the attach property of an entry in RFC 2445. + */ + repeated string attach = 17; + + /** + * Specifies attendees to this entry. + * + * This field corresponds to the attendee property of an entry in RFC 2445. + */ + repeated Attendee attendees = 18; + + /** + * A list of categories, this entry is associated with. + * + * This field corresponds to the categories property of an entry in RFC 2445. + */ + repeated string categories = 19; + + /** + * Provides a comment to this entry. + * + * This field corresponds to the comment property of an entry in RFC 2445. + */ + repeated string comments = 20; + + /** + * Contact information or reference to contact information. + * + * This field corresponds to the contact property of an entry in RFC 2445. + */ + repeated string contacts = 21; + + /** + * Specifies a set of dates when the entry is. + * + * This field corresponds to rdate, rrule, exdate and exrule properties of + * an entry in RFC 2445. + */ + optional Recurrence recurrence = 22; + + /** + * Holds the status code of a scheduling request. + * + * This field corresponds to the rstatus property of an entry in RFC 2445. + */ + repeated RequestStatus request_status = 23; + + /** + * Represents relationships to other calendar components. + * + * This field corresponds to the related property of an entry in RFC 2445. + */ + repeated Relationship related = 24; + + /** + * Specifies the equipment or resources needed for this entry. + * + * This field corresponds to the resources property of an entry in RFC 2445. + */ + repeated string resources = 25; + +} diff --git a/proto/sandbox/rst/calendar/Event.proto b/proto/sandbox/rst/calendar/Event.proto new file mode 100644 index 0000000..5b4f36e --- /dev/null +++ b/proto/sandbox/rst/calendar/Event.proto @@ -0,0 +1,100 @@ +package rst.calendar; + +import "rst/calendar/DateTime.proto"; +import "rst/calendar/Entry.proto"; + +option java_outer_classname = "EventType"; + +/** +* A description of a calendar event following the iCalendar definitions. +* +* This message represents a VEVENT component in RFC 2445. +* +* For a documentation of the RFC 2445 iCalendar specification visit +* http://www.ietf.org/rfc/rfc2445.txt +* +* @author Viktor Richter +*/ +message Event { + + /** + * The overall status of an event. + */ + enum EventStatus { + + /** + * Used for tentative events. + */ + TENTATIVE = 1; + + /** + * Used for confirmed events. + */ + CONFIRMED = 2; + + /** + * Used for canceled events. + */ + CANCELED = 3; + } + + /** + * The transparency of an event. + */ + enum Transparency { + + /** + * Used for events which do not consume time in the calendar. + */ + TRANSPARENT = 1; + + /** + * Used for events which actually consume time in the calendar. + */ + OPAQUE = 2; + } + + /** + * This field holds all properties that Event has in common with Todo. + * + * It corresponds to the following properties: class, created, description, + * dtstamp, dtstart, geo, last-mod, location, organizer, priority, seq, + * summary, uid, url, recurid, attach, attendee, categories, comment, + * contact, exdate, exrule, rstatus, related, resources, rdate and rrule + * int the VTODO component in RFC 2445. + */ + optional Entry entry = 1; + + /** + * The overall status of the event. + * + * This field corresponds to the status property of VEVENT in RFC 2445. + */ + optional EventStatus event_status = 2 [default = CONFIRMED]; + + /** + * Specifies whether this event is transparent to busy-time searches or not. + * + * This field corresponds to the transp property of VEVENT in RFC 2445. + * corresponds to TRANSP + */ + optional Transparency transparency = 3 [default = OPAQUE]; + + /** + * Specifies the date and time when the event ends. + * Either end_date_time or duration can be specified but not both at the + * same time. + * + * This field corresponds to the dtend property of VEVENT in RFC 2445. + */ + optional DateTime end_date_time = 4; + + /** + * Specifies the duration of the event in milliseconds. + * Either end_date_time or duration can be specified but not both at the + * same time. + * + * This field corresponds to the duration property of VEVENT in RFC 2445. + */ + optional sint64 duration = 5; +} diff --git a/proto/sandbox/rst/calendar/Observance.proto b/proto/sandbox/rst/calendar/Observance.proto new file mode 100644 index 0000000..1029832 --- /dev/null +++ b/proto/sandbox/rst/calendar/Observance.proto @@ -0,0 +1,84 @@ +package rst.calendar; + +import "rst/calendar/DateTime.proto"; +import "rst/calendar/Recurrence.proto"; + +option java_outer_classname = "ObservanceType"; + +/** +* A description of a shift in a time zone following the iCalendar definitions. +* Observances are used to describe standard-daylight changes for a time zone. +* +* This message represents a tzprop property in RFC 2445. +* +* For a documentation of the RFC 2445 iCalendar specification visit +* http://www.ietf.org/rfc/rfc2445.txt +* +* @author Viktor Richter +*/ +message Observance { + + /** + * This enum tells whether the observance describes a daylight (summer) + * or standard (winter) time. + */ + enum Type { + + /** + * An observance setting the time zone to standard (winter) time. + */ + STANDARD = 1; + + /** + * An observance setting the time zone to daylight (summer) time. + */ + DAYLIGHT = 2; + } + + /** + * This field tells of which type this observance is STANDARD (winter) or + * DAYLIGHT (summer). + */ + required Type type = 3 [default = STANDARD]; + + /** + * Specifies when the Observance begins (since when it is in use) in + * utc-time. + * + * This field corresponds to dtstart of a tzprop in RFC 2445. + */ + required DateTime start_utc = 4; + + /** + * Specifies the name of the observance. + * + * This field corresponds to tzname of a tzprop in RFC 2445. + */ + optional string name = 6; + + /** + * Specifies a set of dates when the observance gets active. + * + * This field corresponds to rdate and rrule of a tzprop in RFC 2445. + * + * The exclude_dates and exclude_rules of this recurrence should be ignored. + */ + optional Recurrence recurrence = 7; + + /** + * Specifies the time offset in use before the observance is active in + * milliseconds. + * + * This field corresponds to tzoffsetfrom of a tzprop in RFC 2445. + */ + required sint64 offset_from = 8 [default = 0]; + + /** + * Specifies the time offset in use while observance is active in + * milliseconds + * + * This field corresponds to tzoffsetto of a tzprop in RFC 2445. + */ + required sint64 offset_to = 9 [default = 0]; + +} diff --git a/proto/sandbox/rst/calendar/Organizer.proto b/proto/sandbox/rst/calendar/Organizer.proto new file mode 100644 index 0000000..b18526a --- /dev/null +++ b/proto/sandbox/rst/calendar/Organizer.proto @@ -0,0 +1,55 @@ +package rst.calendar; + +option java_outer_classname = "OrganizerType"; + +/** +* A description of a organizer of a calendar component. +* +* This message represents a ORGANIZER property in RFC 2445. +* +* For a documentation of the RFC 2445 iCalendar specification visit +* http://www.ietf.org/rfc/rfc2445.txt +* +* @author Viktor Richter +*/ +message Organizer { + + /** + * Specifies the organizers calendar user address as URI. + * Can for example be a MAILTO. + * + * This field corresponds to cal-address of an ORGANIZER in RFC 2445. + */ + required string calendar_adress = 1; + + /** + * Specifies the common or display name of the organizer. + * + * This field corresponds to cnparam of an ORGANIZER in RFC 2445. + */ + optional string common_name = 2; + + /** + * Specifies a reference (uri) to the directory entry associated with the + * calendar user acting as organizer. + * + * This field corresponds to dirparam of an ORGANIZER in RFC 2445. + */ + optional string directory = 3; + + /** + * Specifies another user that is acting on behalf of the organizer. + * + * This field corresponds to sentbyparam of an ORGANIZER in RFC 2445. + */ + optional string sent_by = 4; + + /** + * Specifies the language as defined in http://www.ietf.org/rfc/rfc1766.txt. + * If specified the language applies to the common_name field. + * + * This field corresponds to languageparam of an ORGANIZER in RFC 2445. + */ + optional string language = 5; + +} diff --git a/proto/sandbox/rst/calendar/Recurrence.proto b/proto/sandbox/rst/calendar/Recurrence.proto new file mode 100644 index 0000000..1b824ec --- /dev/null +++ b/proto/sandbox/rst/calendar/Recurrence.proto @@ -0,0 +1,54 @@ +package rst.calendar; + +import "rst/calendar/DateTime.proto"; +import "rst/calendar/RecurrenceRule.proto"; + +option java_outer_classname = "RecurrenceType"; + +/** +* A description of a recurrence following the iCalendar definitions. +* can be used to generate a set of dates. +* +* The final set of dates is created by combining all dates from +* recurrence_dates and recurrence_rules and removing all dates generated +* by exclude_dates and exclude_rules. +* +* This message combines a representation of repeating RDATE, RRULE, EXDATE and +* EXRULE properties in RFC 2445. +* +* For a documentation of the RFC 2445 iCalendar specification visit +* http://www.ietf.org/rfc/rfc2445.txt +* +* @author Viktor Richter +*/ +message Recurrence { + + /** + * Specifies a set of specific dates to include. + * + * This field represents a set of RDATE in RFC 2445. + */ + repeated DateTime recurrence_dates = 1; + + /** + * Specifies a set of rules that generate dates to include. + * + * This field represents a set of RRULE in RFC 2445. + */ + repeated RecurrenceRule recurrence_rules = 2; + + /** + * Specifies a set of dates to exclude. + * + * This field represents a set of EXDATE in RFC 2445. + */ + repeated DateTime exclude_dates = 3; + + /** + * Specifies a set of rules that generate dates to exclude. + * + * This field represents a set of EXRULE in RFC 2445. + */ + repeated RecurrenceRule exclude_rules = 4; + +} diff --git a/proto/sandbox/rst/calendar/RecurrenceId.proto b/proto/sandbox/rst/calendar/RecurrenceId.proto new file mode 100644 index 0000000..b5b91f3 --- /dev/null +++ b/proto/sandbox/rst/calendar/RecurrenceId.proto @@ -0,0 +1,90 @@ +package rst.calendar; + +import "rst/calendar/DateTime.proto"; + +option java_outer_classname = "RecurrenceIdType"; + +/** +* The recurrence id can be used to reference a single component out of a +* recurring component set. +* +* While the UID of a component references its whole recurrence set the +* combination of the UID with a RecurrenceId can be used to point to a +* specific instance within this set. +* +* This message represents a RECURRENCE-ID property in RFC 2445. +* +* For a documentation of the RFC 2445 iCalendar specification visit +* http://www.ietf.org/rfc/rfc2445.txt +* +* @author Viktor Richter +*/ +message RecurrenceId { + + /** + * Specifies whether this RecurrenceId uses a date or a date-time. + */ + enum Type { + + /** + * Specifies a date and time. + */ + DATE_TIME = 1; + + /** + * Specifies a date (whole day). + */ + DATE = 2; + } + + + /** + * Specifies whether this RecurrenceId references a single instance or + * the same with all prior or future instances. + * + * This enum corresponds to the RANGE parameter in RFC 2445. + */ + enum Range { + + /** + * Specifies a single instance. + */ + SINGLE = 1; + + /** + * Specifies an instance and all instances following it. + */ + THIS_AND_FUTURE = 2; + + /** + * Specifies a instance and all instances prior to it. + */ + THIS_AND_PRIOR = 3; + } + + /** + * Specifies whether the id should be interpreted as a date with time + * or as a date, ignoring time. + * + * This field corresponds to the VALUE part of a ridparam property RFC 2445. + */ + optional Type type = 1 [default = DATE_TIME]; + + /** + * Specifies whether a single instance or set is referenced. + * + * This field corresponds to the rangeparam part of a ridparam + * property RFC 2445. + */ + optional Range range = 2 [default = SINGLE]; + + /** + * Specifies ReferenceId value as a DateTime this should match the date value + * of an instance in the recurrence set. + * + * This field corresponds to the ridval part of a RECURRENCE-ID + * property RFC 2445. + */ + optional DateTime rid = 3; + +} diff --git a/proto/sandbox/rst/calendar/RecurrenceRule.proto b/proto/sandbox/rst/calendar/RecurrenceRule.proto new file mode 100644 index 0000000..31065de --- /dev/null +++ b/proto/sandbox/rst/calendar/RecurrenceRule.proto @@ -0,0 +1,228 @@ +package rst.calendar; + +import "rst/calendar/DateTime.proto"; + +option java_outer_classname = "RecurrenceRuleType"; + +/** +* Specifies a rule or repeating pattern for recurring components. +* +* This message represents a RECUR property in RFC 2445. +* +* For a documentation of the RFC 2445 iCalendar specification visit +* http://www.ietf.org/rfc/rfc2445.txt +* +* @author Viktor Richter +*/ +message RecurrenceRule { + + /** + * This enum defines a frequency of the recurrence (How often does it recur). + */ + enum Frequency { + + /** + * Every second. + */ + SECONDLY = 1; + + /** + * Every minute. + */ + MINUTELY = 2; + + /** + * Every hour. + */ + HOURLY = 3; + + /** + * Every day. + */ + DAILY = 4; + + /** + * Every week. + */ + WEEKLY = 5; + + /** + * Every month. + */ + MONTHLY = 6; + + /** + * Every year. + */ + YEARLY = 7; + + } + + /** + * This enum defines a day in within the week. + */ + enum Weekday { + + /** + * Sunday. + */ + SUNDAY = 1; + + /** + * Monday. + */ + MONDAY = 2; + + /** + * Tuesday. + */ + TUESDAY = 3; + + /** + * Wednesday. + */ + WEDNESDAY = 4; + + /** + * Thursday. + */ + THURSDAY = 5; + + /** + * Friday. + */ + FRIDAY = 6; + + /** + * Saturday. + */ + SATURDAY = 7; + } + + /** + * Specifies the end date of the recurrence in utc. Either this or count may + * be specified but not both at the same time. + * + * This field corresponds to the UNTIL part of a recur value in RFC 2445. + */ + optional DateTime until_date_utc = 2; + + /** + * Specifies the recurrence count. Either this or until_date_utc may + * be specified but not both at the same time. + * + * This field corresponds to the COUNT part of a recur value in RFC 2445. + */ + optional uint32 count = 3; + + /** + * Specifies the frequency of the recurrence. + * + * This field corresponds to the freq part of a recur value in RFC 2445. + */ + required Frequency frequency = 4 [default = YEARLY]; + + /** + * Tells how often the rule repeats. + * + * Example: interval = n and frequency = weekly means every n'th week + * + * This field corresponds to the INTERVAL part of a recur value in RFC 2445. + */ + optional uint32 interval = 5 [default = 1]; + + /** + * A list of occurrence seconds. + * + * This field corresponds to the BYSECOND part of a recur value in RFC 2445. + */ + //@constraint(0 <= value < 60) + repeated uint32 by_second = 6; + + /** + * A list of occurrence minutes. + * + * This field corresponds to the BYMINUTE part of a recur value in RFC 2445. + */ + //@constraint(0 <= value < 60) + repeated uint32 by_minute = 7; + + /** + * A list of occurrence hours. + * + * This field corresponds to the BYHOUR part of a recur value in RFC 2445. + */ + //@constraint(0 <= value < 24) + repeated uint32 by_hour = 8; + + /** + * A list of occurrence weekdays. + * + * This field corresponds to the BYDAY part of a recur value in RFC 2445. + */ + repeated Weekday by_week_day = 9; + + /** + * A list of occurrence days. + * + * Example: frequency = MONTHLY, by_week_day = MO and by_day_n = -1 + * means the last Monday of the month. + * + * This field corresponds to the BYDAY part of a recur value in RFC 2445. + */ + repeated sint32 by_day_number = 10; + + /** + * A list of occurrence days of the month. If by_moth_day is negative, it is + * counted from the end of the month. + * + * This field corresponds to the BYMONTHDAY part of a recur value in RFC 2445. + */ + //@constraint(-31 <= value <= 31) + repeated sint32 by_month_day = 11; + + /** + * A list of occurrence days of the year. If by_year_day is negative, it is + * counted from the end of the year. + * + * This field corresponds to the BYYEARDAY part of a recur value in RFC 2445. + */ + //@constraint(-366 <= value <= 366) + repeated sint32 by_year_day = 12; + + /** + * A list of occurrence weeks of the year. If by_week_number is negative, + * it is counted from the end of the year. + * + * This field corresponds to the BYWEEKNO part of a recur value in RFC 2445. + */ + //@constraint(-53 <= value <= 53) + repeated sint32 by_week_number = 13; + + /** + * A list of occurrence months. If by_month is negative, it is counted + * from the end of the year. + * + * This field corresponds to the BYMONTH part of a recur value in RFC 2445. + */ + //@constraint(1 <= value <= 31) + repeated uint32 by_month = 14; + + /** + * Further filters the set by specifying which exact occurrences to use. + * + * Example: frequency = MONTHLY, by_week_day=FRIDAY and + * by_set_pos = -1 specifies the last Friday of the month. + * + * This field corresponds to the BYSETPOS part of a recur value in RFC 2445. + */ + repeated sint32 by_set_pos = 15; + + /** + * Specifies which day is the first day of the week. + * + * This field corresponds to the WKST part of a recur value in RFC 2445. + */ + optional Weekday week_start = 16 [default = MONDAY]; + +} diff --git a/proto/sandbox/rst/calendar/Relationship.proto b/proto/sandbox/rst/calendar/Relationship.proto new file mode 100644 index 0000000..17ad9d1 --- /dev/null +++ b/proto/sandbox/rst/calendar/Relationship.proto @@ -0,0 +1,56 @@ +package rst.calendar; + +option java_outer_classname = "RelationshipType"; + +/** +* This is used to specify relationships between calendar components. +* +* This message represents a RELATED-TO property in RFC 2445. +* +* For a documentation of the RFC 2445 iCalendar specification visit +* http://www.ietf.org/rfc/rfc2445.txt +* +* @author Viktor Richter +*/ +message Relationship { + + /** + * Specifies the type of the relationship. + * + * This enum represents the possible values of a reltypeparam in RFC 2445. + */ + enum Type { + + /** + * The component is a subordinate of the referenced component. + */ + PARENT = 1; + + /** + * The component is a superior of the referenced component. + */ + CHILD = 2; + + /** + * The component is a peer of the referenced component. + */ + SIBLING = 3; + } + + /** + * The type of relationship to the referenced component. + * + * + * This field corresponds to the reltypeparam parameter in RFC 2445. + */ + optional Type relationship_type = 1 [default = PARENT]; + + /** + * The unique identifier of the related component. This should + * typically be its uid. + * + * This field corresponds to the text part of related property in RFC 2445. + */ + required string uid = 2; + +} diff --git a/proto/sandbox/rst/calendar/RequestStatus.proto b/proto/sandbox/rst/calendar/RequestStatus.proto new file mode 100644 index 0000000..743ab73 --- /dev/null +++ b/proto/sandbox/rst/calendar/RequestStatus.proto @@ -0,0 +1,63 @@ +package rst.calendar; + +option java_outer_classname = "RequestStatusType"; + +/** +* A description of a status code used in scheduling requests. +* +* This message represents a REQUEST-STATUS property in RFC 2445. +* +* For a documentation of the RFC 2445 iCalendar specification visit +* http://www.ietf.org/rfc/rfc2445.txt +* +* @author Viktor Richter +*/ +message RequestStatus { + + /** + * Specifies the language used in the status code as defined in + * http://www.ietf.org/rfc/rfc1766.txt. + * + * This field corresponds to the languageparm parameter of REQUEST-STATUS + * in RFC 2445. + */ + optional string language = 1; + + /** + * A hierarchical numeric status code as string. + * 3-tuple of integers separated by a period character. + * example: "3.1.2" + * + * The level of the integer corresponds to the level of status code + * granularity (least granularity to highest from left to right). + * + * The return status interpretation of the leftmost integer is following: + * 1.xx preliminary success, completion is pending + * 2.xx completed successfully + * 3.xx not successful, error in the syntax or semantic of the request + * 4.xx scheduling error, an error occurred within the calendaring service + * not directly related to the request itself. + * + * This field corresponds to the statcode parameter of REQUEST-STATUS + * in RFC 2445. + */ + required string status_code = 2; + + /** + * A status description text. + * + * This field corresponds to the statdesc parameter of REQUEST-STATUS + * in RFC 2445. + */ + required string status_description = 3; + + /** + * Exception data as text. Can be the offending property name and value or + * a complete property line. + * + * This field corresponds to the extdata parameter of REQUEST-STATUS + * in RFC 2445. + */ + required string exception_text_data = 4; + +} diff --git a/proto/sandbox/rst/calendar/TimeZone.proto b/proto/sandbox/rst/calendar/TimeZone.proto new file mode 100644 index 0000000..c706ba8 --- /dev/null +++ b/proto/sandbox/rst/calendar/TimeZone.proto @@ -0,0 +1,78 @@ +package rst.calendar; + +import "rst/calendar/DateTime.proto"; +import "rst/calendar/Observance.proto"; + +option java_outer_classname = "TimeZoneType"; + +/** +* A description of a TimeZone following the icalendar definitions. +* The TimeZone must at least hold it timezone_id and one standards or daylights +* Observance. +* +* This message represents a VTIMEZONE component in RFC 2445. +* +* For a documentation of the RFC 2445 iCalendar specification visit +* http://www.ietf.org/rfc/rfc2445.txt +* +* @author Viktor Richter +*/ +//@constraint(len(.standards) + len(.daylights) > 0) +message TimeZone { + + /** + * The id of the time zone. This should be unique. + * + * This field corresponds to the tzid parameter of VTIMEZONE in RFC 2445. + */ + required string timezone_id = 1; + + /** + * Specifies when the time zone was modified the last time in utc time. + * + * More precisely: Tells when this time zone data was last modified + * in the calendar store. + * + * This field corresponds to the last-mod parameter of VTIMEZONE in RFC 2445. + */ + //@constraint(value.type == DateTime.Type.UTC) + optional DateTime last_modified_utc = 2; + + /** + * Specifies a network location where an up to date version of this time zone + * can be retrieved. + * + * This field corresponds to the tzurl parameter of VTIMEZONE in RFC 2445. + */ + optional string timezone_url = 3; + + /** + * The location to which this time zone applies. This can define where the + * TimeZone is applied. + * + * Example: "Europe/Berlin" for the TimeZone that is used in Berlin, + * in Germany + * + * This is a field corresponding to X-LIC-LOCATION, which is not in RFC 2445. + */ + optional string x_location = 4; + + /** + * A collection of standard-observances for this TimeZone. Defines all its + * 'winter' times. + * + * This field corresponds to the standardc parameter of VTIMEZONE in + * RFC 2445. + */ + repeated Observance standards = 5; + + /** + * A collection of daylight-observances for this TimeZone. Defines all its + * 'summer' times. + * + * This field corresponds to the daylightc parameter of VTIMEZONE in + * RFC 2445. + */ + repeated Observance daylights = 6; + +} diff --git a/proto/sandbox/rst/calendar/Todo.proto b/proto/sandbox/rst/calendar/Todo.proto new file mode 100644 index 0000000..e7d1320 --- /dev/null +++ b/proto/sandbox/rst/calendar/Todo.proto @@ -0,0 +1,97 @@ +package rst.calendar; + +import "rst/calendar/DateTime.proto"; +import "rst/calendar/Entry.proto"; + +option java_outer_classname = "TodoType"; + +/** +* A description of an calendar todo following the icalendar definitions. +* +* This message represents a VTODO component in RFC 2445. +* +* For a documentation of the RFC 2445 iCalendar specification visit +* http://www.ietf.org/rfc/rfc2445.txt +* +* @author Viktor Richter +*/ +message Todo { + + /** + * The overall status of a todo. + */ + enum TodoStatus { + + /** + * Used for todos that need an action. + */ + NEEDS_ACTION = 1; + + /** + * Used for completed todos. + */ + COMPLETED = 2; + + /** + * Used for todos that are currently in process of. + */ + IN_PROCESS = 3; + + /** + * Used for canceled todos. + */ + CANCELED = 4; + } + + /** + * This field holds all properties that Todo has in common with Event. + * + * It corresponds to the following properties: class, created, description, + * dtstamp, dtstart, geo, last-mod, location, organizer, priority, seq, + * summary, uid, url, recurid, attach, attendee, categories, comment, + * contact, exdate, exrule, rstatus, related, resources, rdate and rrule + * int the VTODO component in RFC 2445. + */ + optional Entry entry = 1; + + /** + * Specifies the date and time this Todo was completed in utc. + * + * This field corresponds to the completed property of VTODO in RFC 2445. + */ + //@constraint(value.type == DateTime.Type.UTC) + optional DateTime completed_utc = 2; + + /** + * Specifies the completion status of the Todo in percent as a positive + * integer (0-100). + * + * This field corresponds to the completed property of VTODO in RFC 2445. + */ + //@constraint(0 <= value <= 100) + optional uint32 percent = 3 [default = 0]; + + /** + * The overall status of the Todo. + * + * This field corresponds to the status property of VTODO in RFC 2445. + */ + optional TodoStatus todo_status = 4 [default = NEEDS_ACTION]; + + /** + * Specifies due which date the Todo needs to be done. + * Either due or duration can be specified but not both at the same time. + * + * This field corresponds to the due property of VTODO in RFC 2445. + */ + optional DateTime due = 5; + + /** + * Specifies the duration of the Todo in milliseconds. + * Either due or duration can be specified but not both at the same time. + * + * This field corresponds to the duration property of VTODO in RFC 2445. + */ + optional sint64 duration = 6; + +} -- 1.7.9.5