using System;

namespace Volpe.Cafe.Resources
{
    /// <summary>
    /// Defines supported icon themes to use with various controls within the application, such as with file menus,
    /// toolbars, and message boxes.
    /// </summary>
    [Serializable]
    public enum IconTheme
    {
        /// <summary>Specifies a Glaze icon theme.</summary>
        Glaze = 0,

        /// <summary>Specifies a default icon theme. The current default icon theme is <see cref="Glaze"/>.</summary>
        Default = Glaze
    }

    /// <summary>
    /// Specifies all available icon dimensions supported by each <see cref="IconTheme"/>.
    /// </summary>
    [Serializable]
    public enum IconSize
    {
        /// <summary>Specifies an <see cref="IconTheme"/> size of 22x22 pixels.</summary>
        x22 = 22,
        /// <summary>Specifies an <see cref="IconTheme"/> size of 32x32 pixels.</summary>
        x32 = 32,
        /// <summary>Specifies an <see cref="IconTheme"/> size of 48x48 pixels.</summary>
        x48 = 48,
        /// <summary>Specifies an <see cref="IconTheme"/> size of 64x64 pixels.</summary>
        x64 = 64,

        /// <summary>Specifies a default icon size. The current default icon size is <see cref="x22"/>.</summary>
        Default = x22
    }

    /// <summary>
    /// Specifies all icon names defined within each <see cref="IconTheme"/>.
    /// </summary>
    [Serializable]
    public enum IconName
    {
        /// <summary>Indicates that no icon is specified.</summary>
        None = -1,

        /// <summary>Specifies an "apply.png" icon.</summary>
        Apply = 0,
        /// <summary>Specifies a "browse.png" icon.</summary>
        Browse,
        /// <summary>Specifies a "cancel.png" icon.</summary>
        Cancel,
        /// <summary>Specifies a "configure.png" icon.</summary>
        Configure,
        /// <summary>Specifies a "document.png" icon.</summary>
        Document,
        /// <summary>Specifies an "error.png" icon.</summary>
        Error,
        /// <summary>Specifies an "exit.png" icon.</summary>
        Exit,
        /// <summary>Specifies a "file_close.png" icon.</summary>
        FileClose,
        /// <summary>Specifies a "file_new.png" icon.</summary>
        FileNew,
        /// <summary>Specifies a "file_open.png" icon.</summary>
        FileOpen,
        /// <summary>Specifies a "file_save.png" icon.</summary>
        FileSave,
        /// <summary>Specifies a "file_saveas.png" icon.</summary>
        FileSaveAs,
        /// <summary>Specifies a "find.png" icon.</summary>
        Find,
        /// <summary>Specifies a "folder.png" icon.</summary>
        Folder,
        /// <summary>Specifies an "info.png" icon.</summary>
        Info,
        /// <summary>Specifies a "model_manual.png" icon.</summary>
        ModelManual,
        /// <summary>Specifies a "model_ref.png" icon.</summary>
        ModelRef,
        /// <summary>Specifies a "model_ref_cs.png" icon.</summary>
        ModelRefCS,
        /// <summary>Specifies a "next.png" icon.</summary>
        Next,
        /// <summary>Specifies an "ok.png" icon.</summary>
        OK,
        /// <summary>Specifies a "pause_model.png" icon.</summary>
        PauseModel,
        /// <summary>Specifies a "previous.png" icon.</summary>
        Previous,
        /// <summary>Specifies a "refresh.png" icon.</summary>
        Refresh,
        /// <summary>Specifies a "start_model.png" icon.</summary>
        StartModel,
        /// <summary>Specifies a "stop_model.png" icon.</summary>
        StopModel,
        /// <summary>Specifies a "warning.png" icon.</summary>
        Warning,
        /// <summary>Specifies a "window_fullscreen.png" icon.</summary>
        WindowFullscreen,
        /// <summary>Specifies a "window_restore.png" icon.</summary>
        WindowRestore,
        /// <summary>Specifies a "zoom.png" icon.</summary>
        Zoom,
        /// <summary>Specifies a "zoom_minus.png" icon.</summary>
        ZoomMinus,
        /// <summary>Specifies a "zoom_plus.png" icon.</summary>
        ZoomPlus,
        /// <summary>Specifies a "zoom_restore.png" icon.</summary>
        ZoomRestore
    }

    /// <summary>
    /// Defines embedded resource files provided by this assembly.
    /// </summary>
    public enum EmbeddedResources
    {
        // >>> LOCATED UNDER: ./Software Manual
        /// <summary>Specifies a "./Software Manual/SoftwareManual.zip" resource file.</summary>
        SoftwareManual = 0,

        // >>> LOCATED UNDER: ./Rtf
        /// <summary>Specifies a "./Rtf/Notice.rtf" resource file.</summary>
        NoticeRtf,
        /// <summary>Specifies a "./Rtf/Warnings.rtf" resource file.</summary>
        WarningsRtf,
        /// <summary>Specifies a "./Rtf/About.rtf" resource file.</summary>
        AboutRtf,

        // >>> LOCATED UNDER: ./License
        /// <summary>Specifies a "./License/GNU-LGPL-2.1.txt" resource file.</summary>
        GNU_LGPL,
        /// <summary>Specifies a "./License/ExcelDataReader.txt" resource file.</summary>
        ExcelDataReaderLicense,

        // >>> LOCATED UNDER: ./Vehicle Simulation
        /// <summary>Specifies a "./Vehicle Simulation/SimulationDatabase.zip" resource file.</summary>
        SimulationDatabase
    }

    #region <<< Helper Classes >>>

    /// <summary>
    /// Provides extension methods for various enumerations.
    /// </summary>
    [Serializable]
    public static class EnumExtensions
    {
        /// <summary>
        /// Returns the name string (as defined by this assembly) associated with the given embedded resource.
        /// </summary>
        public static string GetResourceName(this EmbeddedResources resource)
        {
            switch (resource)
            {
                case EmbeddedResources.SoftwareManual        : return "SoftwareManual.zip";
                case EmbeddedResources.NoticeRtf             : return "Notice.rtf";
                case EmbeddedResources.WarningsRtf           : return "Warnings.rtf";
                case EmbeddedResources.AboutRtf              : return "About.rtf";
                case EmbeddedResources.GNU_LGPL              : return "GNU-LGPL-2.1.txt";
                case EmbeddedResources.ExcelDataReaderLicense: return "ExcelDataReader.txt";
                case EmbeddedResources.SimulationDatabase    : return "SimulationDatabase.zip";
            }

            // unsupported resource
            return null;
        }

    }

    #endregion
}
