/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
 */
package smartrefresh.utils

/**
 * Created on 2024/8/19
 */
public enum RefreshLocationEnum {
    | HEAD
    | MIDDER
    | FOOT

    public operator func ==(that: RefreshLocationEnum): Bool {
        match ((this, that)) {
            case (HEAD, HEAD) => true
            case (MIDDER, MIDDER) => true
            case (FOOT, FOOT) => true
            case _ => false
        }
    }

    public operator func !=(that: RefreshLocationEnum): Bool {
        return !(this == that)
    }
}

public enum RefreshStateEnum {
    | NONE
    | TO_REFRESH
    | REFRESHING
    | REFRESH_FINISH

    public operator func ==(that: RefreshStateEnum): Bool {
        match ((this, that)) {
            case (NONE, NONE) => true
            case (TO_REFRESH, TO_REFRESH) => true
            case (REFRESHING, REFRESHING) => true
            case (REFRESH_FINISH, REFRESH_FINISH) => true
            case _ => false
        }
    }

    public operator func !=(that: RefreshStateEnum): Bool {
        return !(this == that)
    }
}

public enum RefreshPositionEnum {
    | TOP
    | BOTTOM
    | TOP_AND_BOTTOM

    public operator func ==(that: RefreshPositionEnum): Bool {
        match ((this, that)) {
            case (TOP, TOP) => true
            case (BOTTOM, BOTTOM) => true
            case (TOP_AND_BOTTOM, TOP_AND_BOTTOM) => true
            case _ => false
        }
    }

    public operator func !=(that: RefreshPositionEnum): Bool {
        return !(this == that)
    }
}

// 下拉变换样式
public enum SpinnerStyleEnum {
    | TRANSLATE // 平行移动 底部
    | SCALE // 拉伸形变
    | FIXED_BEHIND // 固定在背后固定于顶部

    public operator func ==(that: SpinnerStyleEnum): Bool {
        match ((this, that)) {
            case (TRANSLATE, TRANSLATE) => true
            case (SCALE, SCALE) => true
            case (FIXED_BEHIND, FIXED_BEHIND) => true
            case _ => false
        }
    }

    public operator func !=(that: SpinnerStyleEnum): Bool {
        return !(this == that)
    }
}

public enum StoreHouseDemandEnum {
    | DEMAND_C
    | DEMAND_I
    | DEMAND_T
    | DEMAND_N
    | DEMAND_E

    public operator func ==(that: StoreHouseDemandEnum): Bool {
        match ((this, that)) {
            case (DEMAND_C, DEMAND_C) => true
            case (DEMAND_I, DEMAND_I) => true
            case (DEMAND_T, DEMAND_T) => true
            case (DEMAND_N, DEMAND_N) => true
            case (DEMAND_E, DEMAND_E) => true
            case _ => false
        }
    }

    public operator func !=(that: StoreHouseDemandEnum): Bool {
        return !(this == that)
    }
}

public enum ClassicsSpinnerStyleEnum {
    | TRANSLATE
    | SCALE
    | FIXEDBEHIND

    public operator func ==(that: ClassicsSpinnerStyleEnum): Bool {
        match ((this, that)) {
            case (TRANSLATE, TRANSLATE) => true
            case (SCALE, SCALE) => true
            case (FIXEDBEHIND, FIXEDBEHIND) => true
            case _ => false
        }
    }

    public operator func !=(that: ClassicsSpinnerStyleEnum): Bool {
        return !(this == that)
    }
}