Loading src/main/java/at/bitfire/ical4android/AndroidCalendar.kt +9 −0 Original line number Diff line number Diff line Loading @@ -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 ) { Loading Loading @@ -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() Loading src/main/java/at/bitfire/ical4android/AndroidTaskList.kt +7 −0 Original line number Diff line number Diff line Loading @@ -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() Loading Loading
src/main/java/at/bitfire/ical4android/AndroidCalendar.kt +9 −0 Original line number Diff line number Diff line Loading @@ -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 ) { Loading Loading @@ -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() Loading
src/main/java/at/bitfire/ical4android/AndroidTaskList.kt +7 −0 Original line number Diff line number Diff line Loading @@ -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() Loading