package com.all.pdfreader.pro.app.model

import java.io.File

sealed class FileActionEvent {
    data class Rename(val renameResult: RenameResult) : FileActionEvent()
    data class Delete(val deleteResult: DeleteResult) : FileActionEvent()
    data class DeleteAll(val status: Status, val deleteResult: DeleteResult? = null) : FileActionEvent() {
        enum class Status { START, COMPLETE }
    }
    data class Favorite(val isFavorite: Boolean) : FileActionEvent()
    data class Duplicate(val file: File?) : FileActionEvent()

    // 成功或失败结果，只在完成事件时有值
    data class SetPassword(val status: Status, val success: Boolean? = null) : FileActionEvent() {
        enum class Status { START, COMPLETE }
    }

    data class RemovePassword(val status: Status, val success: Boolean? = null) :
        FileActionEvent() {
        enum class Status { START, COMPLETE }
    }

    //只做通知，不携带任何数据，使用object。
    object NoticeReload : FileActionEvent()

    data class SetColorInversion(val b: Boolean) : FileActionEvent()
    data class SetPageFling(val b: Boolean) : FileActionEvent()
    data class SetSwipeVertical(val b: Boolean) : FileActionEvent()

    data class GotoPage(val number: Int): FileActionEvent()

    data class AddBookmark(val success: Boolean) : FileActionEvent()
    data class UpdateBookmark(val success: Boolean) : FileActionEvent()
    data class DeleteBookmark(val success: Boolean) : FileActionEvent()
    data class DeleteAllBookmark(val success: Boolean) : FileActionEvent()
}