File size: 4,118 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
using System;

namespace VersOne.Epub.Schema
{
    /// <summary>
    /// <para>Creator of the book. Represents the name of a person, organization, etc. responsible for the creation of the content of the EPUB book.</para>
    /// <para>
    /// See <see href="https://www.w3.org/TR/epub-33/#sec-opf-dccreator" />,
    /// <see href="https://idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.2.2" />,
    /// and <see href="http://purl.org/dc/elements/1.1/creator" /> for more information.
    /// </para>
    /// </summary>
    public class EpubMetadataCreator
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="EpubMetadataCreator" /> class.
        /// </summary>
        /// <param name="creator">The name of the creator as the author intends it to be displayed to a user.</param>
        /// <param name="id">The unique ID of this EPUB metadata creator item.</param>
        /// <param name="fileAs">The normalized form of the name of the creator for sorting.</param>
        /// <param name="role">The creator's role which indicates the function the creator played in the creation of the content of the EPUB book.</param>
        /// <param name="textDirection">The text direction for the name of this creator or <c>null</c> if the creator doesn't specify a text direction.</param>
        /// <param name="language">The language for the name of this creator or <c>null</c> if the creator doesn't specify the language.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="creator" /> parameter is <c>null</c>.</exception>
        public EpubMetadataCreator(string creator, string? id = null, string? fileAs = null, string? role = null, EpubTextDirection? textDirection = null, string? language = null)
        {
            Creator = creator ?? throw new ArgumentNullException(nameof(creator));
            Id = id;
            FileAs = fileAs;
            Role = role;
            TextDirection = textDirection;
            Language = language;
        }

        /// <summary>
        /// <para>Gets the name of the creator as the author intends it to be displayed to a user.</para>
        /// <para>See <see href="https://www.w3.org/TR/epub-33/#sec-opf-dccreator" /> for more information.</para>
        /// </summary>
        public string Creator { get; }

        /// <summary>
        /// <para>Gets the unique ID of this EPUB metadata creator item.</para>
        /// <para>See <see href="https://www.w3.org/TR/epub-33/#attrdef-id" /> for more information.</para>
        /// </summary>
        public string? Id { get; }

        /// <summary>
        /// <para>Gets the normalized form of the name of the creator for sorting.</para>
        /// <para>
        /// See <see href="https://www.w3.org/TR/epub-33/#file-as" />
        /// and <see href="https://www.w3.org/TR/epub-33/#sec-opf-dccreator" /> for more information.
        /// </para>
        /// </summary>
        public string? FileAs { get; }

        /// <summary>
        /// <para>Gets the creator's role which indicates the function the creator played in the creation of the content of the EPUB book.</para>
        /// <para>
        /// See <see href="https://www.w3.org/TR/epub-33/#role" />
        /// and <see href="https://www.w3.org/TR/epub-33/#sec-opf-dccreator" /> for more information.
        /// </para>
        /// </summary>
        public string? Role { get; }

        /// <summary>
        /// <para>Gets the text direction for the name of this creator or <c>null</c> if the creator doesn't specify a text direction.</para>
        /// <para>See <see href="https://www.w3.org/TR/epub-33/#attrdef-dir" /> for more information.</para>
        /// </summary>
        public EpubTextDirection? TextDirection { get; }

        /// <summary>
        /// <para>Gets the language for the name of this creator or <c>null</c> if the creator doesn't specify the language.</para>
        /// <para>See <see href="https://www.w3.org/TR/epub-33/#attrdef-xml-lang" /> for more information.</para>
        /// </summary>
        public string? Language { get; }
    }
}