package com.avg.zaap.crashlibrary;

import android.content.Context;
import android.content.Intent;

import com.avg.zaap.crashlibrary.core.helper.process.IProcessHelper;

import java.io.File;

/**
 * This interface defines the default behaviour for the Crash Library dependency factories.
 * <p>
 * Created by marek.osvald on 12.5.2016.
 */
public interface ICrashLibFactory {

    /**
     * Returns an instance of file.
     *
     * @param dir  file directory
     * @param name name of file
     * @return an instance of file
     */
    File getFile(File dir, String name);

    /**
     * Returns an instance of CrashUncaughtExceptionHandler.
     *
     * @param context android context
     * @return an instance of CrashUncaughtExceptionHandler
     */
    Thread.UncaughtExceptionHandler getCrashUncaughtExceptionHandler(Context context);

    /**
     * Returns Android Intent for given context and service class.
     *
     * @param context      Android application context
     * @param serviceClass crash reporting service class
     * @return Android Intent for given context and service class
     */
    Intent getIntent(Context context, Class<CrashReportingService> serviceClass);

    /**
     * Returns an instance of process helper.
     *
     * @return an instance of process helper
     */
    IProcessHelper getProcessHelper();

}
