/
Video.purs
437 lines (233 loc) · 12 KB
/
Video.purs
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
module Control.Google.Apps.Slides.Video (
alignOnPage,
bringForward,
bringToFront,
duplicate,
getBorder,
getConnectionSites,
getDescription,
getHeight,
getInherentHeight,
getInherentWidth,
getLeft,
getObjectId,
getPageElementType,
getParentGroup,
getParentPage,
getRotation,
getSource,
getThumbnailUrl,
getTitle,
getTop,
getTransform,
getUrl,
getVideoId,
getWidth,
preconcatenateTransform,
remove,
scaleHeight,
scaleWidth,
select,
selectWithBoolean,
sendBackward,
sendToBack,
setDescription,
setHeight,
setLeft,
setRotation,
setTitle,
setTop,
setTransform,
setWidth
) where
import Prelude (Unit, unit)
import Effect (Effect)
import Data.Google.Apps.Slides.AlignmentPosition as SlidesAlignmentPosition
import Data.Google.Apps.Slides.AffineTransform as SlidesAffineTransform
import Data.Google.Apps.Slides.Video as SlidesVideo
import Data.Google.Apps.Slides.PageElement as SlidesPageElement
import Data.Google.Apps.Slides.Border as SlidesBorder
import Data.Google.Apps.Slides.ConnectionSite as SlidesConnectionSite
import Data.Google.Apps.Slides.PageElementType as SlidesPageElementType
import Data.Google.Apps.Slides.Group as SlidesGroup
import Data.Google.Apps.Slides.Page as SlidesPage
import Data.Google.Apps.Slides.VideoSourceType as SlidesVideoSourceType
foreign import alignOnPageImpl :: SlidesAlignmentPosition.AlignmentPositionForeign -> SlidesVideo.Video -> Effect SlidesVideo.Video
-- Some type is not directly accessible in the runtime.
-- TODO: Implement this
-- alignOnPage :: SlidesAlignmentPosition.AlignmentPosition -> SlidesVideo.Video -> Effect SlidesVideo.Video
alignOnPage :: Unit
alignOnPage = unit
foreign import bringForwardImpl :: SlidesVideo.Video -> Effect SlidesVideo.Video
-- | Brings the page element forward on the page by one element.
bringForward :: SlidesVideo.Video -> Effect SlidesVideo.Video
bringForward p' = bringForwardImpl p'
foreign import bringToFrontImpl :: SlidesVideo.Video -> Effect SlidesVideo.Video
-- | Brings the page element to the front of the page.
bringToFront :: SlidesVideo.Video -> Effect SlidesVideo.Video
bringToFront p' = bringToFrontImpl p'
foreign import duplicateImpl :: SlidesVideo.Video -> Effect SlidesPageElement.PageElement
-- | Duplicates the page element.
duplicate :: SlidesVideo.Video -> Effect SlidesPageElement.PageElement
duplicate p' = duplicateImpl p'
foreign import getBorderImpl :: SlidesVideo.Video -> Effect SlidesBorder.Border
-- | Returns the Border of the video.
getBorder :: SlidesVideo.Video -> Effect SlidesBorder.Border
getBorder p' = getBorderImpl p'
foreign import getConnectionSitesImpl :: SlidesVideo.Video -> Effect SlidesConnectionSite.ConnectionSite
-- | Returns the list of ConnectionSites on the page element, or an empty list if
-- | the page element does not have any connection sites.
getConnectionSites :: SlidesVideo.Video -> Effect SlidesConnectionSite.ConnectionSite
getConnectionSites p' = getConnectionSitesImpl p'
foreign import getDescriptionImpl :: SlidesVideo.Video -> Effect String
-- | Returns the page element's description.
getDescription :: SlidesVideo.Video -> Effect String
getDescription p' = getDescriptionImpl p'
foreign import getHeightImpl :: SlidesVideo.Video -> Effect Number
-- | Gets the element's height in points, which is the height of the element's
-- | bounding box when the element has no rotation.
getHeight :: SlidesVideo.Video -> Effect Number
getHeight p' = getHeightImpl p'
foreign import getInherentHeightImpl :: SlidesVideo.Video -> Effect Number
-- | Returns the element's inherent height in points.
getInherentHeight :: SlidesVideo.Video -> Effect Number
getInherentHeight p' = getInherentHeightImpl p'
foreign import getInherentWidthImpl :: SlidesVideo.Video -> Effect Number
-- | Returns the element's inherent width in points.
getInherentWidth :: SlidesVideo.Video -> Effect Number
getInherentWidth p' = getInherentWidthImpl p'
foreign import getLeftImpl :: SlidesVideo.Video -> Effect Number
-- | Returns the element's horizontal position in points, measured from the upper-
-- | left corner of the page when the element has no rotation.
getLeft :: SlidesVideo.Video -> Effect Number
getLeft p' = getLeftImpl p'
foreign import getObjectIdImpl :: SlidesVideo.Video -> Effect String
-- | Returns the unique ID for this object.
getObjectId :: SlidesVideo.Video -> Effect String
getObjectId p' = getObjectIdImpl p'
foreign import getPageElementTypeImpl :: SlidesVideo.Video -> Effect SlidesPageElementType.PageElementTypeForeign
-- Some type is not directly accessible in the runtime.
-- TODO: Implement this
-- getPageElementType :: SlidesVideo.Video -> Effect SlidesPageElementType.PageElementType
getPageElementType :: Unit
getPageElementType = unit
foreign import getParentGroupImpl :: SlidesVideo.Video -> Effect SlidesGroup.Group
-- | Returns the group this page element belongs to, or null if the element is not
-- | in a group.
getParentGroup :: SlidesVideo.Video -> Effect SlidesGroup.Group
getParentGroup p' = getParentGroupImpl p'
foreign import getParentPageImpl :: SlidesVideo.Video -> Effect SlidesPage.Page
-- | Returns the page this page element is on.
getParentPage :: SlidesVideo.Video -> Effect SlidesPage.Page
getParentPage p' = getParentPageImpl p'
foreign import getRotationImpl :: SlidesVideo.Video -> Effect Number
-- | Returns the element's clockwise rotation angle around its center in degrees,
-- | where zero degrees means no rotation.
getRotation :: SlidesVideo.Video -> Effect Number
getRotation p' = getRotationImpl p'
foreign import getSourceImpl :: SlidesVideo.Video -> Effect SlidesVideoSourceType.VideoSourceTypeForeign
-- Some type is not directly accessible in the runtime.
-- TODO: Implement this
-- getSource :: SlidesVideo.Video -> Effect SlidesVideoSourceType.VideoSourceType
getSource :: Unit
getSource = unit
foreign import getThumbnailUrlImpl :: SlidesVideo.Video -> Effect String
-- | Gets an URL to the video thumbnail.
getThumbnailUrl :: SlidesVideo.Video -> Effect String
getThumbnailUrl p' = getThumbnailUrlImpl p'
foreign import getTitleImpl :: SlidesVideo.Video -> Effect String
-- | Returns the page element's title.
getTitle :: SlidesVideo.Video -> Effect String
getTitle p' = getTitleImpl p'
foreign import getTopImpl :: SlidesVideo.Video -> Effect Number
-- | Gets the element's vertical position in points, measured from the upper-left
-- | corner of the page when the element has no rotation.
getTop :: SlidesVideo.Video -> Effect Number
getTop p' = getTopImpl p'
foreign import getTransformImpl :: SlidesVideo.Video -> Effect SlidesAffineTransform.AffineTransform
-- | Returns the page element's transform.
getTransform :: SlidesVideo.Video -> Effect SlidesAffineTransform.AffineTransform
getTransform p' = getTransformImpl p'
foreign import getUrlImpl :: SlidesVideo.Video -> Effect String
-- | Gets an URL to the video.
getUrl :: SlidesVideo.Video -> Effect String
getUrl p' = getUrlImpl p'
foreign import getVideoIdImpl :: SlidesVideo.Video -> Effect String
-- | Gets the video source's unique identifier for this video.
getVideoId :: SlidesVideo.Video -> Effect String
getVideoId p' = getVideoIdImpl p'
foreign import getWidthImpl :: SlidesVideo.Video -> Effect Number
-- | Returns the element's width in points, which is the width of the element's
-- | bounding box when the element has no rotation.
getWidth :: SlidesVideo.Video -> Effect Number
getWidth p' = getWidthImpl p'
foreign import preconcatenateTransformImpl :: SlidesAffineTransform.AffineTransform -> SlidesVideo.Video -> Effect SlidesVideo.Video
-- | Preconcatenates the provided transform to the existing transform of the page
-- | element.
preconcatenateTransform :: SlidesAffineTransform.AffineTransform -> SlidesVideo.Video -> Effect SlidesVideo.Video
preconcatenateTransform transform p' = preconcatenateTransformImpl transform p'
foreign import removeImpl :: SlidesVideo.Video -> Effect Unit
-- | Removes the page element.
remove :: SlidesVideo.Video -> Effect Unit
remove p' = removeImpl p'
foreign import scaleHeightImpl :: Number -> SlidesVideo.Video -> Effect SlidesVideo.Video
-- | Scales the element's height by the specified ratio.
scaleHeight :: Number -> SlidesVideo.Video -> Effect SlidesVideo.Video
scaleHeight ratio p' = scaleHeightImpl ratio p'
foreign import scaleWidthImpl :: Number -> SlidesVideo.Video -> Effect SlidesVideo.Video
-- | Scales the element's width by the specified ratio.
scaleWidth :: Number -> SlidesVideo.Video -> Effect SlidesVideo.Video
scaleWidth ratio p' = scaleWidthImpl ratio p'
foreign import selectImpl :: SlidesVideo.Video -> Effect Unit
-- | Selects only the PageElement in the active presentation and removes any
-- | previous selection.
select :: SlidesVideo.Video -> Effect Unit
select p' = selectImpl p'
foreign import selectWithBooleanImpl :: Boolean -> SlidesVideo.Video -> Effect Unit
-- | Selects the PageElement in the active presentation.
selectWithBoolean :: Boolean -> SlidesVideo.Video -> Effect Unit
selectWithBoolean replace p' = selectWithBooleanImpl replace p'
foreign import sendBackwardImpl :: SlidesVideo.Video -> Effect SlidesVideo.Video
-- | Sends the page element backward on the page by one element.
sendBackward :: SlidesVideo.Video -> Effect SlidesVideo.Video
sendBackward p' = sendBackwardImpl p'
foreign import sendToBackImpl :: SlidesVideo.Video -> Effect SlidesVideo.Video
-- | Sends the page element to the back of the page.
sendToBack :: SlidesVideo.Video -> Effect SlidesVideo.Video
sendToBack p' = sendToBackImpl p'
foreign import setDescriptionImpl :: String -> SlidesVideo.Video -> Effect SlidesVideo.Video
-- | Sets the page element's alt text description.
setDescription :: String -> SlidesVideo.Video -> Effect SlidesVideo.Video
setDescription description p' = setDescriptionImpl description p'
foreign import setHeightImpl :: Number -> SlidesVideo.Video -> Effect SlidesVideo.Video
-- | Sets the element's height in points, which is the height of the element's
-- | bounding box when the element has no rotation.
setHeight :: Number -> SlidesVideo.Video -> Effect SlidesVideo.Video
setHeight height p' = setHeightImpl height p'
foreign import setLeftImpl :: Number -> SlidesVideo.Video -> Effect SlidesVideo.Video
-- | Sets the element's horizontal position in points, measured from the upper-
-- | left corner of the page when the element has no rotation.
setLeft :: Number -> SlidesVideo.Video -> Effect SlidesVideo.Video
setLeft left p' = setLeftImpl left p'
foreign import setRotationImpl :: Number -> SlidesVideo.Video -> Effect SlidesVideo.Video
-- | Sets the element's clockwise rotation angle around its center in degrees.
setRotation :: Number -> SlidesVideo.Video -> Effect SlidesVideo.Video
setRotation angle p' = setRotationImpl angle p'
foreign import setTitleImpl :: String -> SlidesVideo.Video -> Effect SlidesVideo.Video
-- | Sets the page element's alt text title.
setTitle :: String -> SlidesVideo.Video -> Effect SlidesVideo.Video
setTitle title p' = setTitleImpl title p'
foreign import setTopImpl :: Number -> SlidesVideo.Video -> Effect SlidesVideo.Video
-- | Sets the element's vertical position in points, measured from the upper-left
-- | corner of the page when the element has no rotation.
setTop :: Number -> SlidesVideo.Video -> Effect SlidesVideo.Video
setTop top p' = setTopImpl top p'
foreign import setTransformImpl :: SlidesAffineTransform.AffineTransform -> SlidesVideo.Video -> Effect SlidesVideo.Video
-- | Sets the transform of the page element with the provided transform.
setTransform :: SlidesAffineTransform.AffineTransform -> SlidesVideo.Video -> Effect SlidesVideo.Video
setTransform transform p' = setTransformImpl transform p'
foreign import setWidthImpl :: Number -> SlidesVideo.Video -> Effect SlidesVideo.Video
-- | Sets the element's width in points, which is the width of the element's
-- | bounding box when the element has no rotation.
setWidth :: Number -> SlidesVideo.Video -> Effect SlidesVideo.Video
setWidth width p' = setWidthImpl width p'