using Toolbox.Docking.Api.Control;

namespace Toolbox.Docking.Api.Objects.Profiler
{
    /// <summary>
    /// Factory for constructing a Toolbox profiler object.
    /// </summary>
    public interface ITbProfilerFactory: ITbObjectFactory
    {
        /// <summary>
        /// Specifies the profiler type.
        /// </summary>
        TbCategoryType ProfilerType { get; }

        /// <summary>
        /// Returns all the categories of the profiler
        /// </summary>
        TbProfilingCategories AllCategories { get; }

        /// <summary>
        /// If the results are unchangable (can be cached in TB database) this is the unique key representing the profiler state.
        /// If results depends on options or something else which makes them not cachable return null
        /// </summary>
        int? Hash { get; }

        /// <summary>
        /// Return a link to a HTML file in the local filesystem with more information on the category.
        /// This is used by the Client's user interface.
        /// </summary>
        /// <param name="category">The name of the category</param>
        /// <returns>
        /// Full file name to an HTML file (to be displayed by a Web control)
        /// </returns>
        string GetLiteratureForCategory(string category);


        /// <summary>
        /// Returns an initialized, ready to use Toolbox profiler.
        /// </summary>
        /// <param name="task">Task responsible for the object initialization</param>
        /// <returns>
        /// The initialized Toolbox profiler
        /// </returns>
        ITbProfiler GetProfiler(ITbWorkTask task);
    }
}