File size: 4,378 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
79
80
81
82
83
84
using System;

namespace VersOne.Epub.Schema
{
    /// <summary>
    /// <para>Navigation link associated with a <see cref="Epub3NavLi" /> (represented by the &lt;a&gt; HTML tag in the navigation document).</para>
    /// <para>See <see href="https://www.w3.org/TR/epub-33/#sec-nav-def-model" /> for more information.</para>
    /// </summary>
    public class Epub3NavAnchor
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="Epub3NavAnchor" /> class.
        /// </summary>
        /// <param name="href">
        /// An IRI that resolves to a content document or a fragment within the EPUB book (represented by the 'href' HTML attribute in the navigation document)
        /// or <c>null</c> if the anchor doesn't contain an IRI.
        /// </param>
        /// <param name="text">The textual content of the navigation link (represented by the inner content of the &lt;a&gt; HTML tag in the navigation document).</param>
        /// <param name="title">
        /// The alternative title of the navigation link (represented by the 'title' HTML attribute in the navigation document)
        /// or <c>null</c> if the alternative title is not specified.
        /// </param>
        /// <param name="alt">
        /// The alternative text of the navigation link (represented by the 'title' HTML attribute in the navigation document)
        /// or <c>null</c> if the alternative text is not specified.
        /// </param>
        /// <param name="type">
        /// The type of the structural semantics of the navigation link (represented by the 'epub:type' HTML attribute in the navigation document)
        /// or <c>null</c> if the anchor doesn't specify a type.
        /// </param>
        /// <exception cref="ArgumentNullException">The <paramref name="text" /> parameter is <c>null</c>.</exception>
        public Epub3NavAnchor(string? href, string text, string? title = null, string? alt = null, Epub3StructuralSemanticsProperty? type = null)
        {
            Href = href;
            Text = text ?? throw new ArgumentNullException(nameof(text));
            Title = title;
            Alt = alt;
            Type = type;
        }

        /// <summary>
        /// <para>
        /// Gets an IRI that resolves to a content document or a fragment within the EPUB book (represented by the 'href' HTML attribute in the navigation document)
        /// or <c>null</c> if the anchor doesn't contain an IRI.
        /// </para>
        /// <para>See <see href="https://www.w3.org/TR/epub-33/#sec-nav-def-model" /> for more information.</para>
        /// </summary>
        public string? Href { get; }

        /// <summary>
        /// <para>Gets the textual content of the navigation link (represented by the inner content of the &lt;a&gt; HTML tag in the navigation document).</para>
        /// <para>See <see href="https://www.w3.org/TR/epub-33/#sec-nav-def-model" /> for more information.</para>
        /// </summary>
        public string Text { get; }

        /// <summary>
        /// <para>
        /// Gets the alternative title of the navigation link (represented by the 'title' HTML attribute in the navigation document)
        /// or <c>null</c> if the alternative title is not specified.
        /// </para>
        /// <para>See <see href="https://www.w3.org/TR/epub-33/#sec-nav-def-model" /> for more information.</para>
        /// </summary>
        public string? Title { get; }

        /// <summary>
        /// <para>
        /// Gets the alternative text of the navigation link (represented by the 'title' HTML attribute in the navigation document)
        /// or <c>null</c> if the alternative text is not specified.
        /// </para>
        /// <para>See <see href="https://www.w3.org/TR/epub-33/#sec-nav-def-model" /> for more information.</para>
        /// </summary>
        public string? Alt { get; }

        /// <summary>
        /// <para>
        /// Gets the type of the structural semantics of the navigation link (represented by the 'epub:type' HTML attribute in the navigation document)
        /// or <c>null</c> if the anchor doesn't specify a type.
        /// </para>
        /// <para>See <see href="https://www.w3.org/TR/epub-33/#sec-nav-landmarks" /> for more information.</para>
        /// </summary>
        public Epub3StructuralSemanticsProperty? Type { get; }
    }
}