File size: 4,252 Bytes
fab29d7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
namespace VersOne.Epub
{
    /// <summary>
    /// A container for all content files within the EPUB book.
    /// </summary>
    public class EpubContent
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="EpubContent" /> class.
        /// </summary>
        /// <param name="cover">Content file for the cover image of the EPUB book or <c>null</c> if the book doesn't have a cover.</param>
        /// <param name="navigationHtmlFile">EPUB 3 navigation document of the EPUB book or <c>null</c> if the book doesn't have a EPUB 3 navigation document.</param>
        /// <param name="html">All HTML/XHTML content files of the EPUB book.</param>
        /// <param name="css">All CSS files of the EPUB book.</param>
        /// <param name="images">All image files of the EPUB book.</param>
        /// <param name="fonts">All embedded font files of the EPUB book.</param>
        /// <param name="audio">All audio files of the EPUB book.</param>
        /// <param name="allFiles">All content files of the EPUB book.</param>
        public EpubContent(EpubLocalByteContentFile? cover = null, EpubLocalTextContentFile? navigationHtmlFile = null,
            EpubContentCollection<EpubLocalTextContentFile, EpubRemoteTextContentFile>? html = null,
            EpubContentCollection<EpubLocalTextContentFile, EpubRemoteTextContentFile>? css = null,
            EpubContentCollection<EpubLocalByteContentFile, EpubRemoteByteContentFile>? images = null,
            EpubContentCollection<EpubLocalByteContentFile, EpubRemoteByteContentFile>? fonts = null,
            EpubContentCollection<EpubLocalByteContentFile, EpubRemoteByteContentFile>? audio = null,
            EpubContentCollection<EpubLocalContentFile, EpubRemoteContentFile>? allFiles = null)
        {
            Cover = cover;
            NavigationHtmlFile = navigationHtmlFile;
            Html = html ?? new EpubContentCollection<EpubLocalTextContentFile, EpubRemoteTextContentFile>();
            Css = css ?? new EpubContentCollection<EpubLocalTextContentFile, EpubRemoteTextContentFile>();
            Images = images ?? new EpubContentCollection<EpubLocalByteContentFile, EpubRemoteByteContentFile>();
            Fonts = fonts ?? new EpubContentCollection<EpubLocalByteContentFile, EpubRemoteByteContentFile>();
            Audio = audio ?? new EpubContentCollection<EpubLocalByteContentFile, EpubRemoteByteContentFile>();
            AllFiles = allFiles ?? new EpubContentCollection<EpubLocalContentFile, EpubRemoteContentFile>();
        }

        /// <summary>
        /// Gets the content file for the cover image of the EPUB book or <c>null</c> if the book doesn't have a cover.
        /// </summary>
        public EpubLocalByteContentFile? Cover { get; }

        /// <summary>
        /// Gets the EPUB 3 navigation document of the EPUB book or <c>null</c> if the book doesn't have a EPUB 3 navigation document.
        /// </summary>
        public EpubLocalTextContentFile? NavigationHtmlFile { get; }

        /// <summary>
        /// Gets all HTML/XHTML content files of the EPUB book.
        /// </summary>
        public EpubContentCollection<EpubLocalTextContentFile, EpubRemoteTextContentFile> Html { get; }

        /// <summary>
        /// Gets all CSS files of the EPUB book.
        /// </summary>
        public EpubContentCollection<EpubLocalTextContentFile, EpubRemoteTextContentFile> Css { get; }

        /// <summary>
        /// Gets all image files of the EPUB book.
        /// </summary>
        public EpubContentCollection<EpubLocalByteContentFile, EpubRemoteByteContentFile> Images { get; }

        /// <summary>
        /// Gets all embedded font files of the EPUB book.
        /// </summary>
        public EpubContentCollection<EpubLocalByteContentFile, EpubRemoteByteContentFile> Fonts { get; }

        /// <summary>
        /// Gets all audio files of the EPUB book.
        /// </summary>
        public EpubContentCollection<EpubLocalByteContentFile, EpubRemoteByteContentFile> Audio { get; }

        /// <summary>
        /// Gets all content files of the EPUB book.
        /// </summary>
        public EpubContentCollection<EpubLocalContentFile, EpubRemoteContentFile> AllFiles { get; }
    }
}