/
TextStyle.purs
408 lines (219 loc) · 14 KB
/
TextStyle.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
module Control.Google.Apps.Slides.TextStyle (
getBackgroundColor,
getBaselineOffset,
getFontFamily,
getFontSize,
getFontWeight,
getForegroundColor,
getLink,
hasLink,
isBackgroundTransparent,
isBold,
isItalic,
isSmallCaps,
isStrikethrough,
isUnderline,
removeLink,
setBackgroundColorWithColor,
setBackgroundColorWithIntegerIntegerInteger,
setBackgroundColorWithString,
setBackgroundColorWithThemecolortype,
setBackgroundColorTransparent,
setBaselineOffset,
setBold,
setFontFamily,
setFontFamilyAndWeight,
setFontSize,
setForegroundColorWithColor,
setForegroundColorWithIntegerIntegerInteger,
setForegroundColorWithString,
setForegroundColorWithThemecolortype,
setItalic,
setLinkSlideWithInteger,
setLinkSlideWithSlide,
setLinkSlideWithSlideposition,
setLinkUrl,
setSmallCaps,
setStrikethrough,
setUnderline
) where
import Prelude (Unit, unit)
import Effect (Effect)
import Data.Google.Apps.Slides.Color as SlidesColor
import Data.Google.Apps.Slides.ThemeColorType as SlidesThemeColorType
import Data.Google.Apps.Slides.TextBaselineOffset as SlidesTextBaselineOffset
import Data.Google.Apps.Slides.Slide as SlidesSlide
import Data.Google.Apps.Slides.SlidePosition as SlidesSlidePosition
import Data.Google.Apps.Slides.Link as SlidesLink
import Data.Google.Apps.Slides.TextStyle as SlidesTextStyle
foreign import getBackgroundColorImpl :: SlidesTextStyle.TextStyle -> Effect SlidesColor.Color
-- | Returns the background color of the text, or null if there are multiple
-- | styles on the text.
getBackgroundColor :: SlidesTextStyle.TextStyle -> Effect SlidesColor.Color
getBackgroundColor p' = getBackgroundColorImpl p'
foreign import getBaselineOffsetImpl :: SlidesTextStyle.TextStyle -> Effect SlidesTextBaselineOffset.TextBaselineOffsetForeign
-- Some type is not directly accessible in the runtime.
-- TODO: Implement this
-- getBaselineOffset :: SlidesTextStyle.TextStyle -> Effect SlidesTextBaselineOffset.TextBaselineOffset
getBaselineOffset :: Unit
getBaselineOffset = unit
foreign import getFontFamilyImpl :: SlidesTextStyle.TextStyle -> Effect String
-- | Returns the font family of the text, or null if there are multiple styles on
-- | the text.
getFontFamily :: SlidesTextStyle.TextStyle -> Effect String
getFontFamily p' = getFontFamilyImpl p'
foreign import getFontSizeImpl :: SlidesTextStyle.TextStyle -> Effect Number
-- | Returns the font size of the text in points, or null if there are multiple
-- | styles on the text.
getFontSize :: SlidesTextStyle.TextStyle -> Effect Number
getFontSize p' = getFontSizeImpl p'
foreign import getFontWeightImpl :: SlidesTextStyle.TextStyle -> Effect Int
-- | Returns the font weight of the text, or null if there are multiple styles on
-- | the text.
getFontWeight :: SlidesTextStyle.TextStyle -> Effect Int
getFontWeight p' = getFontWeightImpl p'
foreign import getForegroundColorImpl :: SlidesTextStyle.TextStyle -> Effect SlidesColor.Color
-- | Returns the foreground color of the text, or null if there are multiple
-- | styles on the text.
getForegroundColor :: SlidesTextStyle.TextStyle -> Effect SlidesColor.Color
getForegroundColor p' = getForegroundColorImpl p'
foreign import getLinkImpl :: SlidesTextStyle.TextStyle -> Effect SlidesLink.Link
-- | Returns the Link on the text, or null if there is no link or if the link is
-- | on part of the text or if there are multiple links.
getLink :: SlidesTextStyle.TextStyle -> Effect SlidesLink.Link
getLink p' = getLinkImpl p'
foreign import hasLinkImpl :: SlidesTextStyle.TextStyle -> Effect Boolean
-- | Returns true if there is link on the text, false if not, or null if the link
-- | is on part of the text or there are multiple links.
hasLink :: SlidesTextStyle.TextStyle -> Effect Boolean
hasLink p' = hasLinkImpl p'
foreign import isBackgroundTransparentImpl :: SlidesTextStyle.TextStyle -> Effect Boolean
-- | Returns true if the background of the text is transparent, false if not, or
-- | null if there are multiple styles on the text.
isBackgroundTransparent :: SlidesTextStyle.TextStyle -> Effect Boolean
isBackgroundTransparent p' = isBackgroundTransparentImpl p'
foreign import isBoldImpl :: SlidesTextStyle.TextStyle -> Effect Boolean
-- | Returns true if the text is rendered as bold, false if not, or null if there
-- | are multiple styles on the text.
isBold :: SlidesTextStyle.TextStyle -> Effect Boolean
isBold p' = isBoldImpl p'
foreign import isItalicImpl :: SlidesTextStyle.TextStyle -> Effect Boolean
-- | Returns true if the text is italicized, false if not, or null if there are
-- | multiple styles on the text.
isItalic :: SlidesTextStyle.TextStyle -> Effect Boolean
isItalic p' = isItalicImpl p'
foreign import isSmallCapsImpl :: SlidesTextStyle.TextStyle -> Effect Boolean
-- | Returns true if the text is in small capital letters, false if not, or null
-- | if there are multiple styles on the text.
isSmallCaps :: SlidesTextStyle.TextStyle -> Effect Boolean
isSmallCaps p' = isSmallCapsImpl p'
foreign import isStrikethroughImpl :: SlidesTextStyle.TextStyle -> Effect Boolean
-- | Returns true if the text is struck through, false if not, or null if there
-- | are multiple styles on the text.
isStrikethrough :: SlidesTextStyle.TextStyle -> Effect Boolean
isStrikethrough p' = isStrikethroughImpl p'
foreign import isUnderlineImpl :: SlidesTextStyle.TextStyle -> Effect Boolean
-- | Returns true if the text is underlined, false if not, or null if there are
-- | multiple styles on the text.
isUnderline :: SlidesTextStyle.TextStyle -> Effect Boolean
isUnderline p' = isUnderlineImpl p'
foreign import removeLinkImpl :: SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
-- | Removes a Link.
removeLink :: SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
removeLink p' = removeLinkImpl p'
foreign import setBackgroundColorWithColorImpl :: SlidesColor.Color -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
-- | Sets the background color of the text.
setBackgroundColorWithColor :: SlidesColor.Color -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
setBackgroundColorWithColor color p' = setBackgroundColorWithColorImpl color p'
foreign import setBackgroundColorWithIntegerIntegerIntegerImpl :: Int -> Int -> Int -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
-- | Sets the background color of the text to the given RGB values from 0 to 255.
setBackgroundColorWithIntegerIntegerInteger :: Int -> Int -> Int -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
setBackgroundColorWithIntegerIntegerInteger red green blue p' = setBackgroundColorWithIntegerIntegerIntegerImpl red green blue p'
foreign import setBackgroundColorWithStringImpl :: String -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
-- | Sets the background color of the text to the given hex color string.
setBackgroundColorWithString :: String -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
setBackgroundColorWithString hexColor p' = setBackgroundColorWithStringImpl hexColor p'
foreign import setBackgroundColorWithThemecolortypeImpl :: SlidesThemeColorType.ThemeColorTypeForeign -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
-- Some type is not directly accessible in the runtime.
-- TODO: Implement this
-- setBackgroundColorWithThemecolortype :: SlidesThemeColorType.ThemeColorType -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
setBackgroundColorWithThemecolortype :: Unit
setBackgroundColorWithThemecolortype = unit
foreign import setBackgroundColorTransparentImpl :: SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
-- | Sets the background color of the text to transparent.
setBackgroundColorTransparent :: SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
setBackgroundColorTransparent p' = setBackgroundColorTransparentImpl p'
foreign import setBaselineOffsetImpl :: SlidesTextBaselineOffset.TextBaselineOffsetForeign -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
-- Some type is not directly accessible in the runtime.
-- TODO: Implement this
-- setBaselineOffset :: SlidesTextBaselineOffset.TextBaselineOffset -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
setBaselineOffset :: Unit
setBaselineOffset = unit
foreign import setBoldImpl :: Boolean -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
-- | Sets whether the text should be rendered as bold.
setBold :: Boolean -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
setBold bold p' = setBoldImpl bold p'
foreign import setFontFamilyImpl :: String -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
-- | Sets the font family of the text .
setFontFamily :: String -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
setFontFamily fontFamily p' = setFontFamilyImpl fontFamily p'
foreign import setFontFamilyAndWeightImpl :: String -> Int -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
-- | Sets the font family and weight of the text.
setFontFamilyAndWeight :: String -> Int -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
setFontFamilyAndWeight fontFamily fontWeight p' = setFontFamilyAndWeightImpl fontFamily fontWeight p'
foreign import setFontSizeImpl :: Number -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
-- | Sets the font size of the text, in points.
setFontSize :: Number -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
setFontSize fontSize p' = setFontSizeImpl fontSize p'
foreign import setForegroundColorWithColorImpl :: SlidesColor.Color -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
-- | Sets the foreground color of the text.
setForegroundColorWithColor :: SlidesColor.Color -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
setForegroundColorWithColor foregroundColor p' = setForegroundColorWithColorImpl foregroundColor p'
foreign import setForegroundColorWithIntegerIntegerIntegerImpl :: Int -> Int -> Int -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
-- | Sets the foreground color of the text to the given RGB values from 0 to 255.
setForegroundColorWithIntegerIntegerInteger :: Int -> Int -> Int -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
setForegroundColorWithIntegerIntegerInteger red green blue p' = setForegroundColorWithIntegerIntegerIntegerImpl red green blue p'
foreign import setForegroundColorWithStringImpl :: String -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
-- | Sets the foreground color of the text to the given hex color string.
setForegroundColorWithString :: String -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
setForegroundColorWithString hexColor p' = setForegroundColorWithStringImpl hexColor p'
foreign import setForegroundColorWithThemecolortypeImpl :: SlidesThemeColorType.ThemeColorTypeForeign -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
-- Some type is not directly accessible in the runtime.
-- TODO: Implement this
-- setForegroundColorWithThemecolortype :: SlidesThemeColorType.ThemeColorType -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
setForegroundColorWithThemecolortype :: Unit
setForegroundColorWithThemecolortype = unit
foreign import setItalicImpl :: Boolean -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
-- | Sets the whether the text is italicized.
setItalic :: Boolean -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
setItalic italic p' = setItalicImpl italic p'
foreign import setLinkSlideWithIntegerImpl :: Int -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
-- | Sets a Link to the given Slide using the zero-based index of the slide.
setLinkSlideWithInteger :: Int -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
setLinkSlideWithInteger slideIndex p' = setLinkSlideWithIntegerImpl slideIndex p'
foreign import setLinkSlideWithSlideImpl :: SlidesSlide.Slide -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
-- | Sets a Link to the given Slide, the link is set by the given slide ID.
setLinkSlideWithSlide :: SlidesSlide.Slide -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
setLinkSlideWithSlide slide p' = setLinkSlideWithSlideImpl slide p'
foreign import setLinkSlideWithSlidepositionImpl :: SlidesSlidePosition.SlidePositionForeign -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
-- Some type is not directly accessible in the runtime.
-- TODO: Implement this
-- setLinkSlideWithSlideposition :: SlidesSlidePosition.SlidePosition -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
setLinkSlideWithSlideposition :: Unit
setLinkSlideWithSlideposition = unit
foreign import setLinkUrlImpl :: String -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
-- | Sets a Link to the given non-empty URL string.
setLinkUrl :: String -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
setLinkUrl url p' = setLinkUrlImpl url p'
foreign import setSmallCapsImpl :: Boolean -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
-- | Sets whether the text is rendered in small capital letters.
setSmallCaps :: Boolean -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
setSmallCaps smallCaps p' = setSmallCapsImpl smallCaps p'
foreign import setStrikethroughImpl :: Boolean -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
-- | Sets whether the text is struck through.
setStrikethrough :: Boolean -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
setStrikethrough strikethrough p' = setStrikethroughImpl strikethrough p'
foreign import setUnderlineImpl :: Boolean -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
-- | Sets whether the text is underlined.
setUnderline :: Boolean -> SlidesTextStyle.TextStyle -> Effect SlidesTextStyle.TextStyle
setUnderline underline p' = setUnderlineImpl underline p'