using System;
using System.Collections.Generic;
using System.Linq;

namespace MarkdownRenderer
{
    internal static class StyleSheetStore
    {
        public static readonly IReadOnlyList<StyleSheetEntry> BuiltInEntries = new[]
        {
            new StyleSheetEntry
            {
                Id = new Guid("57fe5e26-d2e0-4749-b600-6fecab8d5b38"),
                Name = "Smark(Lightweight)",
                Remark = "Smark orignal style sheet, remove embedded font",
                BodyClass = string.Empty,
                Css = Properties.Resources.SmarkLightweightStyleSheet, //TODO: Create an CSS3 optimized version
            }
            , new StyleSheetEntry
            {
                Id = new Guid("6dc00ae4-597f-4990-af51-fc46c5c06d70"),
                Name = "Smark",
                Remark = "Smark orignal style sheet, embedded all resources",
                BodyClass = string.Empty,
                Css = Properties.Resources.SmarkStyleSheet, //TODO: Create an CSS3 optimized version
            }
            , new StyleSheetEntry
            {
                Id = new Guid("a792d18d-4f8d-4c71-9e76-d506660cc2e4"),
                Name = "GitHub",
                Remark = "A GitHub Markdown CSS replicate by sindresorhus",
                BodyClass = "markdown-body",
                Css = Properties.Resources.GitHubStyleSheet,
            },
        };

        private static StyleSheetEntry[] _customEntries = new StyleSheetEntry[0];

        public static StyleSheetEntry[] GetEntries()
        {
            //TODO: Load from store impl
            return _customEntries.ToArray();
        }

        public static void SaveEntries(StyleSheetEntry[] customEntries)
        {
            //TODO: Save to store impl
            _customEntries = customEntries.ToArray();
        }
    }

    internal class StyleSheetEntry
    {
        public Guid Id { get; set; }
        public string Name { get; set; }
        public string Remark { get; set; }
        public string BodyClass { get; set; }
        public string Css { get; set; }
    }
}
