using System.Collections.Generic;
using Toolbox.Docking.Api.Control;
using Toolbox.Docking.Api.Objects.Calculator;
using Toolbox.Docking.Api.Objects.Metabolism;
using Toolbox.Docking.Api.Objects.Profiler;
using Toolbox.Docking.Api.Objects.Qsar;

namespace Toolbox.Docking.Api.Objects
{
    /// <summary>
    /// Base declaration for Toolbox object factories. 
    /// Contains all common static information for set of Toolbox objects.
    /// All properties <b>should</b> return valid values even before the call of <see cref="ITbObjectFactory.InitFactory"/>. 
    /// </summary>
    public interface ITbObjectFactory
    {
        /// <summary>
        /// Provides the object identification. This would be used throughout the application. 
        /// For visualization and accounting purposes.
        /// </summary>
        TbObjectId ObjectId { get; }

        /// <summary>
        /// Provides the metadata describing the object's capabilities/constraints. 
        /// </summary>
        TbObjectFlags Flags { get; }

        /// <summary>
        /// Object containing the about information for the Toolbox object. This will be displayed
        /// on various places within the Toolbox Client's UI most often via an About button.
        /// </summary>
        TbObjectAbout ObjectAbout { get; }

        /// <summary>
        /// Initializes the factory. The method should be called once. 
        /// </summary>
        /// <param name="errorLog">Used to return error log to the calling method.</param>
        /// <param name="initTask">Provides basic workflow control as well as access to Toolbox services.</param>
        /// <returns>
        /// Returns true if the initialization was successful. Factory initialization is used in 
        /// IObjectFactory descendants (e.g. <see cref="ITbCalculatorFactory"/>, <see cref="ITbMetabolismFactory"/>, <see cref="ITbProfilerFactory"/>, <see cref="ITbQsarFactory"/>)
        /// to have the necessary initializations performed. Only after initialization the IObjectFactory descendants'
        /// methods return a valid result.
        /// </returns>
        bool InitFactory(IList<string> errorLog, ITbInitTask initTask);
    }
}