package rasel.lunar.launcher.model

import android.view.View
import rasel.lunar.launcher.R

enum class RssDataType {
    NO_DATA,
    YOUTUBE,
    NewsFeed,
    GURU,
    Most,
    TAGS,
    REDDIT,
    REDDIT_nsfw,
    Dotax,
    FmKorae,
    DcInside,
    RuliWeb,
    Clien,
    TheQoo,
    Arca;

    fun getResId() = when (this) {
        YOUTUBE -> R.drawable.youtube
        REDDIT, REDDIT_nsfw -> R.drawable.reddit
        Dotax -> R.drawable.daum
        FmKorae -> R.drawable.fmk
        DcInside -> R.drawable.dcinside
        Arca -> R.drawable.arca
        else -> {
            0
        }
    }

    fun defaultImgSize() = when (this) {
        YOUTUBE -> 200
        REDDIT_nsfw,GURU,Most -> 360
        else -> { 120 }
    }

    fun getDefaultVisibiliy() = when (this) {
        REDDIT_nsfw,GURU,Most,NewsFeed -> View.GONE
        else -> { View.VISIBLE }
    }
}

interface RssDataInterface {
    fun title() : String
    fun thumbnailUrl() : String
    fun originPage() : String
    fun description() : String
    fun pubDate() : Long
    fun category() : RssDataType
    fun getCho() : String?

}