package ctbrec.ui.sites.chaturbate;

import java.io.IOException;

import ctbrec.sites.chaturbate.Chaturbate;
import ctbrec.ui.sites.AbstractSiteUi;
import ctbrec.ui.sites.ConfigUI;
import ctbrec.ui.tabs.TabProvider;

public class ChaturbateSiteUi extends AbstractSiteUi {

    private final Chaturbate chaturbate;
    private ChaturbateTabProvider tabProvider;
    private ChaturbateConfigUi configUi;

    public ChaturbateSiteUi(Chaturbate chaturbate) {
        this.chaturbate = chaturbate;
    }

    @Override
    public TabProvider getTabProvider() {
        if (tabProvider == null) {
            tabProvider = new ChaturbateTabProvider(chaturbate);
        }
        return tabProvider;
    }

    @Override
    public ConfigUI getConfigUI() {
        if (configUi == null) {
            configUi = new ChaturbateConfigUi(chaturbate);
        }
        return configUi;
    }

    @Override
    public synchronized boolean login() throws IOException {
        return chaturbate.login();
    }

}
