2020-10-09 13:53:58 +00:00
|
|
|
package oppen.ariane.io.bookmarks
|
2020-09-07 21:15:18 +00:00
|
|
|
|
|
|
|
import android.content.Context
|
|
|
|
|
|
|
|
interface BookmarksDatasource {
|
2020-09-11 21:02:54 +00:00
|
|
|
|
2020-09-07 21:15:18 +00:00
|
|
|
fun get(onBookmarks: (List<Bookmark>) -> Unit)
|
|
|
|
fun add(bookmark: Bookmark, onAdded: () -> Unit)
|
|
|
|
fun delete(bookmark: Bookmark, onDelete: () -> Unit)
|
|
|
|
|
2020-09-11 21:02:54 +00:00
|
|
|
fun moveUp(bookmark: Bookmark, onMoved: () -> Unit)
|
|
|
|
fun moveDown(bookmark: Bookmark, onMoved: () -> Unit)
|
2020-10-09 13:53:58 +00:00
|
|
|
fun update(bookmark: Bookmark, label: String?, uri: String?, onUpdate: () -> Unit)
|
2020-09-11 21:02:54 +00:00
|
|
|
|
2020-09-07 21:15:18 +00:00
|
|
|
companion object{
|
|
|
|
fun getDefault(applicationContext: Context): BookmarksDatasource{
|
|
|
|
return RoomBookmarks(applicationContext)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|