Instances

A table containing one entry per task instance. This table is writable in order to allow modification of single instances of a task. Write operations to this table will be converted into operations on overrides and forwarded to the task table.

Note: The DTSTART, DUE values of instances of recurring tasks represent the actual instance values, i.e. they are different for each instance (DURATION is always null).

Also, none of the instances are recurring themselves, so RRULE, RDATE and EXDATE are always null.

TODO: Insert all instances of recurring tasks.

The following operations are supported:

Insert

Note, the data of an insert must not contain the fields RRULE, RDATE or EXDATE. If the new instance belongs to an existing task the data must contain the fields ORIGINAL_INSTANCE_ID and ORIGINAL_INSTANCE_TIME. Also note, this table supports writing DURATION (if the instance has a DTSTART), but reading it back will always return a nullDURATION and a non-nullDUE date. Reading the task in the tasks table will, however, return the original DURATION.

If there already is an instance (with or without override) for the given ORIGINAL_INSTANCE_ID and ORIGINAL_INSTANCE_TIME an exception is thrown.

absent or emptyA new non-recurring task is created with the given values.
a valid Tasks row _IDAn RDATE for the given ORIGINAL_INSTANCE_TIME time is added to the given master task, any EXDATE for this time is removed. The task is inserted as an override to the given master. No fields are inherited though. ORIGINAL_INSTANCE_ALLDAY will be set to IS_ALLDAY of the master.

Note, if the given master is non-recurring, this operation will turn it into a recurring task.

invalid Tasks row _IDAn exception is thrown.

Update

Note, the data of an update must not contain any fields related to recurrence (RRULE, RDATE, EXDATE, ORIGINAL_INSTANCE_ID, ORIGINAL_INSTANCE_TIME and ORIGINAL_INSTANCE_ALLDAY). Also note, this table supports writing DURATION (if the instance has a DTSTART), but reading it back will always return a nullDURATION and a non-nullDUE date. Reading the task in the tasks table will, however, return the original DURATION.

Recurring master taskA new override is created with the given data.

Note, any fields which are not provided are inherited from the master, except for DTSTART and DUE which will be inherited from the instance and DURATION, RRULE, RDATE and EXDATE which are set to null. ORIGINAL_INSTANCE_ID, ORIGINAL_INSTANCE_TIME and ORIGINAL_INSTANCE_ALLDAY will be set accordingly.

Single instance taskThe task is updated with the given values.
Recurrence override with existing masterThe task is updated with the given values.
Recurrence override without existing masterThe task is updated with the given values.

Delete

Recurring master taskAn EXDATE for this instance is added, any RDATE for this instance is removed. The instance row is removed.

TODO: mark the task deleted if the remaining recurrence set is empty

Single instance taskThe _DELETED flag of the task is set.
Recurrence override with existing masterThe _DELETED flag of the override is set, an EXDATE for this instance is added to the master, any RDATE for this instance is removed from the master. TODO: mark the master deleted if the remaining recurrence set of the master is empty
Recurrence override without existing masterThe _DELETED flag of the task is set.

Author

Yannic Ahrens

Marten Gajda

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
val _COUNT: String = "_count"
Link copied to clipboard
val _ID: String = "_id"
The row id of a task.
Link copied to clipboard
val ACCOUNT_NAME: String = "account_name"
The name of the account the task belongs to.
Link copied to clipboard
val ACCOUNT_TYPE: String = "account_type"
The type of the account the task belongs to.
Link copied to clipboard
val CLASSIFICATION: String = "class"
The classification of a task.
Link copied to clipboard
Classification value for confidential tasks.
Link copied to clipboard
Link copied to clipboard
Classification value for private tasks.
Link copied to clipboard
Classification value for public tasks.
Link copied to clipboard
val COMPLETED: String = "completed"
Date of completion of this task in milliseconds since the epoch or null if this task has not been completed yet.
Link copied to clipboard
val COMPLETED_IS_ALLDAY: String = "completed_is_allday"
Indicates that the date of completion is an all-day date.
Link copied to clipboard
val CONTENT_URI_PATH: String = "instances"
Link copied to clipboard
val CREATED: String = "created"
When this task has been created in milliseconds since the epoch.
Link copied to clipboard
val DEFAULT_SORT_ORDER: String = "instance_due_sorting"
Link copied to clipboard
val DESCRIPTION: String = "description"
The description of a task.
Link copied to clipboard
val DISTANCE_FROM_CURRENT: String = "distance_from_current"
The distance of the instance from the current one.
Link copied to clipboard
val DTSTART: String = "dtstart"
When this task starts in milliseconds since the epoch.
Link copied to clipboard
val DUE: String = "due"
When this task is due in milliseconds since the epoch.
Link copied to clipboard
val DURATION: String = "duration"
The duration of this task.
Link copied to clipboard
val EXDATE: String = "exdate"
A comma separated list of time Strings in RFC 5545 format (see RFC 5545 Section 3.3.4 and RFC 5545 Section 3.3.5) that contains dates of exceptions of a recurring task.
Link copied to clipboard
val GEO: String = "geo"
A geographic location related to the task.
Link copied to clipboard
val HAS_ALARMS: String = "has_alarms"
Indicates how many alarms a task has.
Link copied to clipboard
val HAS_PROPERTIES: String = "has_properties"
Indicates that this task has extended properties like attachments, alarms or relations.
Link copied to clipboard
val INSTANCE_DUE: String = "instance_due"
The due date of an instance in milliseconds since the epoch or null if the instance has no due date.
Link copied to clipboard
val INSTANCE_DUE_SORTING: String = "instance_due_sorting"
This column should be used in an order clause to sort instances by due date.
Link copied to clipboard
val INSTANCE_DURATION: String = "instance_duration"
The duration of an instance in milliseconds or null if the instance has only one of start or due date or none of both.
Link copied to clipboard
val INSTANCE_ORIGINAL_TIME: String = "instance_original_time"
The start of the original instance as specified in the master task.
Link copied to clipboard
val INSTANCE_START: String = "instance_start"
The start date of an instance in milliseconds since the epoch or null if the instance has no start date.
Link copied to clipboard
val INSTANCE_START_SORTING: String = "instance_start_sorting"
This column should be used in an order clause to sort instances by start date.
Link copied to clipboard
val IS_ALLDAY: String = "is_allday"
Boolean: flag that indicates that this is an all-day task.
Link copied to clipboard
val IS_CLOSED: String = "is_closed"
A flag that indicates a task is closed (no more work has to be done).
Link copied to clipboard
val IS_NEW: String = "is_new"
A flag that indicates a task is new (i.e.
Link copied to clipboard
val LAST_MODIFIED: String = "last_modified"
When this task had been modified the last time in milliseconds since the epoch.
Link copied to clipboard
val LIST_ACCESS_LEVEL: String = "list_access_level"
The access level of the list this task belongs.
Link copied to clipboard
val LIST_COLOR: String = "list_color"
The color of the list this task belongs to as integer (0xaarrggbb).
Link copied to clipboard
val LIST_ID: String = "list_id"
The id of the list this task belongs to.
Link copied to clipboard
val LIST_NAME: String = "list_name"
The name of the list this task belongs to as integer (0xaarrggbb).
Link copied to clipboard
val LIST_OWNER: String = "list_owner"
The owner of the list this task belongs.
Link copied to clipboard
val LOCATION: String = "location"
The location of the task.
Link copied to clipboard
val ORGANIZER: String = "organizer"
The email address of the organizer if any, null otherwise.
Link copied to clipboard
val ORIGINAL_INSTANCE_ALLDAY: String = "original_instance_allday"
A flag indicating that the original instance was an all-day task.
Link copied to clipboard
val ORIGINAL_INSTANCE_ID: String = "original_instance_id"
The row id of the original event if this is an exception, null otherwise.
Link copied to clipboard
val ORIGINAL_INSTANCE_SYNC_ID: String = "original_instance_sync_id"
The _sync_id of the original event if this is an exception, null otherwise.
Link copied to clipboard
val ORIGINAL_INSTANCE_TIME: String = "original_instance_time"
The time in milliseconds since the Epoch of the original instance that is overridden by this instance or null if this task is not a recurring instance.
Link copied to clipboard
val PARENT_ID: String = "parent_id"
The row id of the parent task.
Link copied to clipboard
val PERCENT_COMPLETE: String = "percent_complete"
A number between 0 and 100 that indicates the progress of the task or null.
Link copied to clipboard
val PINNED: String = "pinned"
Indicates that this task has been pinned to the notification area.
Link copied to clipboard
val PRIORITY: String = "priority"
The priority of a task.
Link copied to clipboard
The default value of PRIORITY.
Link copied to clipboard
val RDATE: String = "rdate"
A comma separated list of time Strings in RFC 5545 format (see RFC 5545 Section 3.3.4 and RFC 5545 Section 3.3.5) that contains dates of instances of e recurring task.
Link copied to clipboard
val RRULE: String = "rrule"
A recurrence rule as specified in RFC 5545 Section 3.3.10.
Link copied to clipboard
val SORTING: String = "sorting"
The sorting of this task under it's parent task.
Link copied to clipboard
val STATUS: String = "status"
The status of this task.
Link copied to clipboard
A specific status indicating that the task has been cancelled.
Link copied to clipboard
A specific status indicating that the task is completed.
Link copied to clipboard
The default status is "needs action".
Link copied to clipboard
A specific status indicating that some work has been done.
Link copied to clipboard
A specific status indicating that nothing has been done yet.
Link copied to clipboard
val TASK_COLOR: String = "task_color"
An individual color for this task in the format 0xaarrggbb or null to use LIST_COLOR instead.
Link copied to clipboard
val TASK_ID: String = "task_id"
_ID of task this instance belongs to.
Link copied to clipboard
val TITLE: String = "title"
The title of the task.
Link copied to clipboard
val TZ: String = "tz"
String: An Olson Id of the time zone of this task.
Link copied to clipboard
val URL: String = "url"
The URL iCalendar field for this task.
Link copied to clipboard
val VERSION: String = "version"
The local version number of this task.
Link copied to clipboard
val VISIBLE: String = "visible"
The visibility of the list this task belongs.

Functions

Link copied to clipboard
open fun getContentUri(authority: String): Uri
Get the instances content Uri using the given authority.