Skip to content

Commit f1b412a

Browse files
committed
Add accessibility metadata.
1 parent 7a1f02c commit f1b412a

File tree

9 files changed

+312
-154
lines changed

9 files changed

+312
-154
lines changed
Lines changed: 277 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,277 @@
1+
package org.thepalaceproject.webpub.core
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
4+
import com.fasterxml.jackson.annotation.JsonProperty
5+
6+
/**
7+
* @see "https://github.com/readium/webpub-manifest/blob/master/schema/a11y.schema.json"
8+
*/
9+
10+
@JsonIgnoreProperties(ignoreUnknown = true)
11+
data class WPMAccessibility(
12+
@JsonProperty("conformsTo")
13+
val conformsTo : List<String> = listOf(),
14+
15+
@JsonProperty("exemption")
16+
val exemption : Exemption? = null,
17+
18+
@JsonProperty("accessMode")
19+
val accessMode : List<AccessMode> = listOf(),
20+
21+
@JsonProperty("accessModeSufficient")
22+
val accessModeSufficient : List<List<AccessModeSufficient>> = listOf(),
23+
24+
@JsonProperty("feature")
25+
val feature : List<Feature> = listOf(),
26+
27+
@JsonProperty("hazard")
28+
val hazard : List<Hazard> = listOf(),
29+
30+
@JsonProperty("certification")
31+
val certification : Certification? = null,
32+
33+
@JsonProperty("summary")
34+
val summary : String? = null
35+
) {
36+
37+
enum class Exemption {
38+
@JsonProperty("eaa-disproportionate-burden")
39+
EAA_DISPROPORTIONATE_BURDEN,
40+
41+
@JsonProperty("eaa-fundamental-alteration")
42+
EAA_FUNDAMENTAL_ALTERATION,
43+
44+
@JsonProperty("eaa-microenterprise")
45+
EAA_MICROENTERPRISE
46+
}
47+
48+
enum class AccessMode {
49+
@JsonProperty("auditory")
50+
AUDITORY,
51+
52+
@JsonProperty("chartOnVisual")
53+
CHART_ON_VISUAL,
54+
55+
@JsonProperty("chemOnVisual")
56+
CHEM_ON_VISUAL,
57+
58+
@JsonProperty("colorDependent")
59+
COLOR_DEPENDENT,
60+
61+
@JsonProperty("diagramOnVisual")
62+
DIAGRAM_ON_VISUAL,
63+
64+
@JsonProperty("mathOnVisual")
65+
MATH_ON_VISUAL,
66+
67+
@JsonProperty("musicOnVisual")
68+
MUSIC_ON_VISUAL,
69+
70+
@JsonProperty("tactile")
71+
TACTILE,
72+
73+
@JsonProperty("textOnVisual")
74+
TEXT_ON_VISUAL,
75+
76+
@JsonProperty("textual")
77+
TEXTUAL,
78+
79+
@JsonProperty("visual")
80+
VISUAL
81+
}
82+
83+
enum class AccessModeSufficient {
84+
@JsonProperty("auditory")
85+
AUDITORY,
86+
87+
@JsonProperty("tactile")
88+
TACTILE,
89+
90+
@JsonProperty("textual")
91+
TEXTUAL,
92+
93+
@JsonProperty("visual")
94+
VISUAL
95+
}
96+
97+
enum class Feature {
98+
@JsonProperty("annotations")
99+
ANNOTATIONS,
100+
101+
@JsonProperty("ARIA")
102+
ARIA,
103+
104+
@JsonProperty("bookmarks")
105+
BOOKMARKS,
106+
107+
@JsonProperty("index")
108+
INDEX,
109+
110+
@JsonProperty("pageBreakMarkers")
111+
PAGE_BREAK_MARKERS,
112+
113+
@JsonProperty("printPageNumbers")
114+
PRINT_PAGE_NUMBERS,
115+
116+
@JsonProperty("pageNavigation")
117+
PAGE_NAVIGATION,
118+
119+
@JsonProperty("readingOrder")
120+
READING_ORDER,
121+
122+
@JsonProperty("structuralNavigation")
123+
STRUCTURAL_NAVIGATION,
124+
125+
@JsonProperty("tableOfContents")
126+
TABLE_OF_CONTENTS,
127+
128+
@JsonProperty("taggedPDF")
129+
TAGGED_PDF,
130+
131+
@JsonProperty("alternativeText")
132+
ALTERNATIVE_TEXT,
133+
134+
@JsonProperty("audioDescription")
135+
AUDIO_DESCRIPTION,
136+
137+
@JsonProperty("closeCaptions")
138+
CLOSE_CAPTIONS,
139+
140+
@JsonProperty("captions")
141+
CAPTIONS,
142+
143+
@JsonProperty("describedMath")
144+
DESCRIBED_MATH,
145+
146+
@JsonProperty("longDescription")
147+
LONG_DESCRIPTION,
148+
149+
@JsonProperty("openCaptions")
150+
OPEN_CAPTIONS,
151+
152+
@JsonProperty("signLanguage")
153+
SIGN_LANGUAGE,
154+
155+
@JsonProperty("transcript")
156+
TRANSCRIPT,
157+
158+
@JsonProperty("displayTransformability")
159+
DISPLAY_TRANSFORMABILITY,
160+
161+
@JsonProperty("synchronizedAudioText")
162+
SYNCHRONIZED_AUDIO_TEXT,
163+
164+
@JsonProperty("timingControl")
165+
TIMING_CONTROL,
166+
167+
@JsonProperty("unlocked")
168+
UNLOCKED,
169+
170+
@JsonProperty("ChemML")
171+
CHEM_ML,
172+
173+
@JsonProperty("latex")
174+
LATEX,
175+
176+
@JsonProperty("latex-chemistry")
177+
LATEX_CHEMISTRY,
178+
179+
@JsonProperty("MathML")
180+
MATH_ML,
181+
182+
@JsonProperty("MathML-chemistry")
183+
MATH_ML_CHEMISTRY,
184+
185+
@JsonProperty("ttsMarkup")
186+
TTS_MARKUP,
187+
188+
@JsonProperty("highContrastAudio")
189+
HIGH_CONTRAST_AUDIO,
190+
191+
@JsonProperty("highContrastDisplay")
192+
HIGH_CONTRAST_DISPLAY,
193+
194+
@JsonProperty("largePrint")
195+
LARGE_PRINT,
196+
197+
@JsonProperty("braille")
198+
BRAILLE,
199+
200+
@JsonProperty("tactileGraphic")
201+
TACTILE_GRAPHIC,
202+
203+
@JsonProperty("tactileObject")
204+
TACTILE_OBJECT,
205+
206+
@JsonProperty("fullRubyAnnotations")
207+
FULL_RUBY_ANNOTATIONS,
208+
209+
@JsonProperty("horizontalWriting")
210+
HORIZONTAL_WRITING,
211+
212+
@JsonProperty("rubyAnnotations")
213+
RUBY_ANNOTATIONS,
214+
215+
@JsonProperty("verticalWriting")
216+
VERTICAL_WRITING,
217+
218+
@JsonProperty("withAdditionalWordSegmentation")
219+
WITH_ADDITIONAL_WORD_SEGMENTATION,
220+
221+
@JsonProperty("withoutAdditionalWordSegmentation")
222+
WITHOUT_ADDITIONAL_WORD_SEGMENTATION,
223+
224+
@JsonProperty("none")
225+
NONE,
226+
227+
@JsonProperty("unknown")
228+
UNKNOWN
229+
}
230+
231+
enum class Hazard {
232+
@JsonProperty("flashing")
233+
FLASHING,
234+
235+
@JsonProperty("motionSimulation")
236+
MOTION_SIMULATION,
237+
238+
@JsonProperty("sound")
239+
SOUND,
240+
241+
@JsonProperty("none")
242+
NONE,
243+
244+
@JsonProperty("noFlashingHazard")
245+
NO_FLASHING_HAZARD,
246+
247+
@JsonProperty("noMotionSimulationHazard")
248+
NO_MOTION_SIMULATION_HAZARD,
249+
250+
@JsonProperty("noSoundHazard")
251+
NO_SOUND_HAZARD,
252+
253+
@JsonProperty("unknown")
254+
UNKNOWN,
255+
256+
@JsonProperty("unknownFlashingHazard")
257+
UNKNOWN_FLASHING_HAZARD,
258+
259+
@JsonProperty("unknownMotionSimulationHazard")
260+
UNKNOWN_MOTION_SIMULATION_HAZARD,
261+
262+
@JsonProperty("unknownSoundHazard")
263+
UNKNOWN_SOUND_HAZARD
264+
}
265+
266+
@JsonIgnoreProperties(ignoreUnknown = true)
267+
data class Certification(
268+
@JsonProperty("certifiedBy")
269+
val certifiedBy : String? = null,
270+
271+
@JsonProperty("credential")
272+
val credential : String? = null,
273+
274+
@JsonProperty("report")
275+
val report : String? = null
276+
)
277+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
package org.thepalaceproject.webpub.core
22

3+
import com.fasterxml.jackson.annotation.JsonProperty
4+
35
/**
46
* @see "https://github.com/readium/webpub-manifest/blob/master/schema/metadata.schema.json"
57
*/
68

79
enum class WPMLayout {
10+
@JsonProperty("fixed")
811
FIXED,
12+
13+
@JsonProperty("reflowable")
914
REFLOWABLE,
15+
16+
@JsonProperty("scrolled")
1017
SCROLLED
1118
}

org.thepalaceproject.webpub.core/src/main/kotlin/org/thepalaceproject/webpub/core/WPMLayoutDeserializer.kt

Lines changed: 0 additions & 52 deletions
This file was deleted.

org.thepalaceproject.webpub.core/src/main/kotlin/org/thepalaceproject/webpub/core/WPMLayoutSerializer.kt

Lines changed: 0 additions & 25 deletions
This file was deleted.

org.thepalaceproject.webpub.core/src/main/kotlin/org/thepalaceproject/webpub/core/WPMMetadata.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ data class WPMMetadata @JsonCreator constructor(
6767
)
6868
val altIdentifier : URI?,
6969

70+
/**
71+
* The accessibility metadata.
72+
*/
73+
74+
@JsonProperty(
75+
value = "accessibility"
76+
)
77+
val accessibility : WPMAccessibility?,
78+
7079
/**
7180
* The time the publication was last modified.
7281
*/

0 commit comments

Comments
 (0)