mirror of https://git.sr.ht/~oppen/ariane
20 lines
630 B
Kotlin
20 lines
630 B
Kotlin
package oppen.ariane.io.bookmarks
|
|
|
|
import android.content.Context
|
|
|
|
interface BookmarksDatasource {
|
|
|
|
fun get(onBookmarks: (List<Bookmark>) -> Unit)
|
|
fun add(bookmark: Bookmark, onAdded: () -> Unit)
|
|
fun delete(bookmark: Bookmark, onDelete: () -> Unit)
|
|
|
|
fun moveUp(bookmark: Bookmark, onMoved: () -> Unit)
|
|
fun moveDown(bookmark: Bookmark, onMoved: () -> Unit)
|
|
fun update(bookmark: Bookmark, label: String?, uri: String?, onUpdate: () -> Unit)
|
|
|
|
companion object{
|
|
fun getDefault(applicationContext: Context): BookmarksDatasource{
|
|
return RoomBookmarks(applicationContext)
|
|
}
|
|
}
|
|
} |