using System;

namespace Toolbox.Docking.Api.ExtraActions
{
    /// <summary>
    /// Description for a Toolbox extra action.
    /// </summary>
    [Serializable]
    public sealed class TbExtraActionDefinition
    {
        /// <summary>
        /// Create in instance of ExtraActionDefinition
        /// </summary>
        /// <param name="caption">Caption for the extra action.</param>
        /// <param name="guid">Unique identifier for the extra action.</param>
        /// <param name="target">Target for the extra action. Controls where in the UI the action will be available and to what it will pertain to.</param>
        /// <param name="clientModule">Optional client side module name.</param>
        public TbExtraActionDefinition(string caption, Guid guid, TbExtraActionTarget target, string clientModule=null)
        {
            Caption = caption;
            Guid = guid;
            ClientModule = clientModule;
            Target = target;
        }

        /// <summary>
        ///     Caption of this action
        /// </summary>
        public string Caption { get; }

        /// <summary>
        ///     ID of this action
        /// </summary>
        public Guid Guid { get; }

        /// <summary>
        ///     If this is empty the client directly call server to execute action
        ///     If contains a name of client's module (IToolboxPlugin) then this module is just executed without any call to server
        /// </summary>
        public string ClientModule { get; }

        /// <summary>
        /// Target of this action. 
        /// </summary>
        public TbExtraActionTarget Target { get; }
    }
}