/* 
 * Diplomová práce ÚSI VUT 
 * Forenzní analýza webového prohlížeče
 *
 * Autor: Michal Bača
 * Datum: 20.5.2015
 */
package yafft.Utils;

import java.nio.file.FileSystems;
import java.nio.file.Path;

/**
 *
 * @author michal
 */
public class ImportExportOptions {

    static private Boolean history;
    static private Boolean cookies;
    static private Boolean passwords;
    static private Boolean bookmarks;
    static private Boolean downloads;
    static private Boolean forms;

    static private Boolean createCopyAndExit = false; //just read and export and finish; not showing anything
    static private Boolean exportEverything = true; //vs export just selected item of data (ir just selected cookie)

    static private Boolean consoleOutput = true; //mirror the output to console

    static private Path exportDirectory = null;
    static private Path workingDirectory = null;

    static private HostInfo hostInfo;

    static private FFProfile profile = null;
    static private int profieIndex;

    public static Boolean getHistory() {
        return history;
    }

    public static int getProfieIndex() {
        return profieIndex;
    }

    public static void setProfieIndex(int profieIndex) {
        ImportExportOptions.profieIndex = profieIndex;
    }

    public static void setHistory(Boolean history) {
        ImportExportOptions.history = history;
    }

    public static Boolean getCookies() {
        return cookies;
    }

    public static void setCookies(Boolean cookies) {
        ImportExportOptions.cookies = cookies;
    }

    public static Boolean getPasswords() {
        return passwords;
    }

    public static void setPasswords(Boolean passwords) {
        ImportExportOptions.passwords = passwords;
    }

    public static Boolean getBookmarks() {
        return bookmarks;
    }

    public static void setBookmarks(Boolean bookmarks) {
        ImportExportOptions.bookmarks = bookmarks;
    }

    public static Boolean getDownloads() {
        return downloads;
    }

    public static void setDownloads(Boolean downloads) {
        ImportExportOptions.downloads = downloads;
    }

    public static Boolean getForms() {
        return forms;
    }

    public static void setForms(Boolean forms) {
        ImportExportOptions.forms = forms;
    }

    public static Boolean getCreateCopyAndExit() {
        return createCopyAndExit;
    }

    public static void setCreateCopyAndExit(Boolean createCopyAndExit) {
        ImportExportOptions.createCopyAndExit = createCopyAndExit;
    }

    public static Boolean getExportEverything() {
        return exportEverything;
    }

    public static void setExportEverything(Boolean exportEverything) {
        ImportExportOptions.exportEverything = exportEverything;
    }

    public static Path getExportDirectory() {
        if (exportDirectory == null) {

            return FileSystems.getDefault().getPath(System.getProperty("user.home"));

        }
        return exportDirectory;
    }

    public static void setExportDirectory(Path exportDirectory) {
        ImportExportOptions.exportDirectory = exportDirectory;
    }

    public static Boolean getConsoleOutput() {
        return consoleOutput;
    }

    public static void setConsoleOutput(Boolean consoleOutput) {
        ImportExportOptions.consoleOutput = consoleOutput;
    }

    public static HostInfo getHostInfo() {
        return hostInfo;
    }

    public static void setHostInfo(HostInfo hostInfo) {
        ImportExportOptions.hostInfo = hostInfo;
    }

    public static FFProfile getProfile() {
        return profile;
    }

    public static void setProfile(FFProfile profile) {
        ImportExportOptions.profile = profile;
    }

    public static void print() {
        System.out.println("ImportExportOptions:");
        System.out.println("History:" + history);
    }

    public static Path getWorkingDirectory() {
        return workingDirectory;
    }

    public static void setWorkingDirectory(Path workingDirectory) {
        ImportExportOptions.workingDirectory = workingDirectory;
    }

    public ImportExportOptions() {
        ImportExportOptions.history = false;
        ImportExportOptions.cookies = false;
        ImportExportOptions.passwords = false;
        ImportExportOptions.bookmarks = false;
        ImportExportOptions.downloads = false;
        ImportExportOptions.forms = false;

    }

    public ImportExportOptions(Path p) {
        ImportExportOptions.history = false;
        ImportExportOptions.cookies = false;
        ImportExportOptions.passwords = false;
        ImportExportOptions.bookmarks = false;
        ImportExportOptions.downloads = false;
        ImportExportOptions.forms = false;
        
        ImportExportOptions.exportDirectory = p;

    }

    public void setAll(Boolean b) {
        ImportExportOptions.history = b;
        ImportExportOptions.cookies = b;
        ImportExportOptions.passwords = b;
        ImportExportOptions.bookmarks = b;
        ImportExportOptions.downloads = b;
        ImportExportOptions.forms = b;

    }

}
