1/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto3";
18
19package aae.calendarsync;
20
21option java_package = "com.android.car.companiondevicesupport.feature.calendarsync.proto";
22option java_multiple_files = true;
23
24// Information about the calendar.
25// Based on
26// https://developer.android.com/reference/android/provider/CalendarContract.Calendars.html
27message Calendar {
28  // The title for the calendar.
29  string title = 1;
30
31  // A unique identifier of the calendar.
32  string uuid = 2;
33
34  // The color of the calendar.
35  Color color = 3;
36
37  // The events associated with the calendar.
38  repeated Event event = 4;
39
40  // The account used to sync the calendar to the device.
41  // This typically represents an email address.
42  string account_name = 5;
43}
44
45// Information about the calendars to be send to the head unit.
46message Calendars {
47  repeated Calendar calendar = 1;
48  TimeZone device_time_zone = 2;
49}
50
51// Information about the calendar event.
52// Based on
53// https://developer.android.com/reference/android/provider/CalendarContract.Events.html
54message Event {
55  // The title for the calendar event.
56  string title = 1;
57
58  // A unique identifier of the calendar event.
59  string external_identifier = 2;
60
61  // The start date of the calendar event.
62  Timestamp start_date = 3;
63
64  // The end date of the calendar event.
65  Timestamp end_date = 4;
66
67  // The time zone for the calendar event.
68  TimeZone time_zone = 5;
69
70  // The time zone for the end time of the calendar event.
71  TimeZone end_time_zone = 6;
72
73  // A boolean value that indicates whether an event is an all-day event.
74  bool is_all_day = 7;
75
76  // The location associated with the calendar event.
77  string location = 8;
78
79  // The description of the event.
80  string description = 9;
81
82  // A secondary color for the event.
83  // Set only if it differs from the calendar color.
84  Color color = 10;
85
86  // Represents a status for a calendar event.
87  enum Status {
88    UNSPECIFIED_STATUS = 0;
89    TENTATIVE = 1;
90    CONFIRMED = 2;
91    CANCELED = 3;
92  }
93  Status status = 11;
94
95  // The organizer associated with the calendar event.
96  // This is typically an email address.
97  string organizer = 12;
98
99  // The attendees associated with the calendar event.
100  repeated Attendee attendee = 13;
101
102  // The date that this calendar event was created.
103  Timestamp creation_date = 14;
104
105  // The date that this calendar event was last modified.
106  Timestamp last_modified_date = 15;
107}
108
109message Color {
110  // A color as an ARGB integer value.
111  int32 argb = 1;
112}
113
114// Representation of an event participant.
115// Based on
116// https://developer.android.com/reference/android/provider/CalendarContract.Attendees
117message Attendee {
118  // The attendee name.
119  string name = 1;
120
121  // The attendee email.
122  string email = 2;
123
124  // Represents the attendee status for an event.
125  enum Status {
126    UNSPECIFIED_STATUS = 0;
127    NONE_STATUS = 1;
128    ACCEPTED = 2;
129    DECLINED = 3;
130    INVITED = 4;
131    TENTATIVE = 5;
132  }
133  Status status = 3;
134
135  // Represents the attendee type for an event.
136  enum Type {
137    UNSPECIFIED_TYPE = 0;
138    NONE_TYPE = 1;
139    OPTIONAL = 2;
140    REQUIRED = 3;
141    RESOURCE = 4;
142  }
143  Type type = 4;
144}
145
146// Timestamp independent of any timezone or local calendar.
147// This is a subset of
148// https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/timestamp.proto
149message Timestamp {
150  // Reserved field.
151  reserved 2;
152
153  // Represents seconds of UTC time since Unix epoch
154  // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
155  // 9999-12-31T23:59:59Z inclusive.
156  int64 seconds = 1;
157}
158
159// Information about the time zone.
160message TimeZone {
161  // The geopolitical reqion ID that identifies this time zone.
162  string name = 1;
163
164  // The difference in seconds between the time zone and Greenwich Mean Time.
165  int64 seconds_from_gmt = 2;
166}
167