Commit 675241e9 authored by Ricki Hirner's avatar Ricki Hirner

KDoc

parent 6372af79
......@@ -28,6 +28,8 @@ abstract class AndroidCalendar<out T: AndroidEvent>(
val account: Account,
val provider: ContentProviderClient,
val eventFactory: AndroidEventFactory<T>,
/** the calendar ID ([CalendarContract.Calendars._ID]) **/
val id: Long
) {
......@@ -145,6 +147,13 @@ abstract class AndroidCalendar<out T: AndroidEvent>(
fun delete() = provider.delete(calendarSyncURI(), null, null)
/**
* Queries events from this calendar. Adds a WHERE clause that restricts the
* query to [Events.CALENDAR_ID] = [id].
* @param where selection
* @param whereArgs arguments for selection
* @return events from this calendar which match the selection
*/
fun queryEvents(where: String? = null, whereArgs: Array<String>? = null): List<T> {
val where = "(${where ?: "1"}) AND " + Events.CALENDAR_ID + "=?"
val whereArgs = (whereArgs ?: arrayOf()) + id.toString()
......
......@@ -106,6 +106,13 @@ abstract class AndroidTaskList<out T: AndroidTask>(
fun delete() = provider.client.delete(taskListSyncUri(), null, null)
/**
* Queries tasks from this task list. Adds a WHERE clause that restricts the
* query to [Tasks.LIST_ID] = [id].
* @param where selection
* @param whereArgs arguments for selection
* @return events from this task list which match the selection
*/
fun queryTasks(where: String? = null, whereArgs: Array<String>? = null): List<T> {
val where = "(${where ?: "1"}) AND ${Tasks.LIST_ID}=?"
val whereArgs = (whereArgs ?: arrayOf()) + id.toString()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment