Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

KDoc

parent 6372af79
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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()
+7 −0
Original line number Diff line number Diff line
@@ -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()