-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodel_effect.go
646 lines (551 loc) · 17.5 KB
/
model_effect.go
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
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
/*
* --------------------------------------------------------------------------------------------------------------------
* <copyright company="Aspose">
* Copyright (c) 2018 Aspose.Slides for Cloud
* </copyright>
* <summary>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
* </summary>
* --------------------------------------------------------------------------------------------------------------------
*/
package asposeslidescloud
import (
"encoding/json"
)
// Represents comment of slide
type IEffect interface {
// Effect type.
GetType() string
SetType(newValue string)
// Effect subtype.
GetSubtype() string
SetSubtype(newValue string)
// Preset class type.
GetPresetClassType() string
SetPresetClassType(newValue string)
// Preset class type.
GetAnimateTextType() string
SetAnimateTextType(newValue string)
// Shape index.
GetShapeIndex() int32
SetShapeIndex(newValue int32)
// Paragraph index.
GetParagraphIndex() int32
SetParagraphIndex(newValue int32)
// Effect trigger type.
GetTriggerType() string
SetTriggerType(newValue string)
// The percentage of duration accelerate behavior effect.
GetAccelerate() float64
SetAccelerate(newValue float64)
// True to automatically play the animation in reverse after playing it in the forward direction.
GetAutoReverse() *bool
SetAutoReverse(newValue *bool)
// The percentage of duration decelerate behavior effect.
GetDecelerate() float64
SetDecelerate(newValue float64)
// The duration of animation effect.
GetDuration() float64
SetDuration(newValue float64)
// The number of times the effect should repeat.
GetRepeatCount() float64
SetRepeatCount(newValue float64)
// The number of times the effect should repeat.
GetRepeatDuration() float64
SetRepeatDuration(newValue float64)
// The way for a effect to restart after complete.
GetRestart() string
SetRestart(newValue string)
// The percentage by which to speed up (or slow down) the timing.
GetSpeed() float64
SetSpeed(newValue float64)
// Delay time after trigger.
GetTriggerDelayTime() float64
SetTriggerDelayTime(newValue float64)
// Specifies if the effect will repeat until the end of slide.
GetRepeatUntilEndSlide() *bool
SetRepeatUntilEndSlide(newValue *bool)
// Specifies if the effect will repeat until the next click.
GetRepeatUntilNextClick() *bool
SetRepeatUntilNextClick(newValue *bool)
// This attribute specifies if the animation effect stops the previous sound.
GetStopPreviousSound() *bool
SetStopPreviousSound(newValue *bool)
// This attribute specifies if the effect will rewind when done playing.
GetRewind() *bool
SetRewind(newValue *bool)
// Defined an after animation color for effect.
GetAfterAnimationType() string
SetAfterAnimationType(newValue string)
// Defined an after animation color for effect. Applied when the AfterAnimationType property is set to Color.
GetAfterAnimationColor() string
SetAfterAnimationColor(newValue string)
}
type Effect struct {
// Effect type.
Type_ string `json:"Type,omitempty"`
// Effect subtype.
Subtype string `json:"Subtype,omitempty"`
// Preset class type.
PresetClassType string `json:"PresetClassType,omitempty"`
// Preset class type.
AnimateTextType string `json:"AnimateTextType,omitempty"`
// Shape index.
ShapeIndex int32 `json:"ShapeIndex"`
// Paragraph index.
ParagraphIndex int32 `json:"ParagraphIndex,omitempty"`
// Effect trigger type.
TriggerType string `json:"TriggerType,omitempty"`
// The percentage of duration accelerate behavior effect.
Accelerate float64 `json:"Accelerate,omitempty"`
// True to automatically play the animation in reverse after playing it in the forward direction.
AutoReverse *bool `json:"AutoReverse"`
// The percentage of duration decelerate behavior effect.
Decelerate float64 `json:"Decelerate,omitempty"`
// The duration of animation effect.
Duration float64 `json:"Duration,omitempty"`
// The number of times the effect should repeat.
RepeatCount float64 `json:"RepeatCount,omitempty"`
// The number of times the effect should repeat.
RepeatDuration float64 `json:"RepeatDuration,omitempty"`
// The way for a effect to restart after complete.
Restart string `json:"Restart,omitempty"`
// The percentage by which to speed up (or slow down) the timing.
Speed float64 `json:"Speed,omitempty"`
// Delay time after trigger.
TriggerDelayTime float64 `json:"TriggerDelayTime,omitempty"`
// Specifies if the effect will repeat until the end of slide.
RepeatUntilEndSlide *bool `json:"RepeatUntilEndSlide"`
// Specifies if the effect will repeat until the next click.
RepeatUntilNextClick *bool `json:"RepeatUntilNextClick"`
// This attribute specifies if the animation effect stops the previous sound.
StopPreviousSound *bool `json:"StopPreviousSound"`
// This attribute specifies if the effect will rewind when done playing.
Rewind *bool `json:"Rewind"`
// Defined an after animation color for effect.
AfterAnimationType string `json:"AfterAnimationType,omitempty"`
// Defined an after animation color for effect. Applied when the AfterAnimationType property is set to Color.
AfterAnimationColor string `json:"AfterAnimationColor,omitempty"`
}
func NewEffect() *Effect {
instance := new(Effect)
return instance
}
func (this *Effect) GetType() string {
return this.Type_
}
func (this *Effect) SetType(newValue string) {
this.Type_ = newValue
}
func (this *Effect) GetSubtype() string {
return this.Subtype
}
func (this *Effect) SetSubtype(newValue string) {
this.Subtype = newValue
}
func (this *Effect) GetPresetClassType() string {
return this.PresetClassType
}
func (this *Effect) SetPresetClassType(newValue string) {
this.PresetClassType = newValue
}
func (this *Effect) GetAnimateTextType() string {
return this.AnimateTextType
}
func (this *Effect) SetAnimateTextType(newValue string) {
this.AnimateTextType = newValue
}
func (this *Effect) GetShapeIndex() int32 {
return this.ShapeIndex
}
func (this *Effect) SetShapeIndex(newValue int32) {
this.ShapeIndex = newValue
}
func (this *Effect) GetParagraphIndex() int32 {
return this.ParagraphIndex
}
func (this *Effect) SetParagraphIndex(newValue int32) {
this.ParagraphIndex = newValue
}
func (this *Effect) GetTriggerType() string {
return this.TriggerType
}
func (this *Effect) SetTriggerType(newValue string) {
this.TriggerType = newValue
}
func (this *Effect) GetAccelerate() float64 {
return this.Accelerate
}
func (this *Effect) SetAccelerate(newValue float64) {
this.Accelerate = newValue
}
func (this *Effect) GetAutoReverse() *bool {
return this.AutoReverse
}
func (this *Effect) SetAutoReverse(newValue *bool) {
this.AutoReverse = newValue
}
func (this *Effect) GetDecelerate() float64 {
return this.Decelerate
}
func (this *Effect) SetDecelerate(newValue float64) {
this.Decelerate = newValue
}
func (this *Effect) GetDuration() float64 {
return this.Duration
}
func (this *Effect) SetDuration(newValue float64) {
this.Duration = newValue
}
func (this *Effect) GetRepeatCount() float64 {
return this.RepeatCount
}
func (this *Effect) SetRepeatCount(newValue float64) {
this.RepeatCount = newValue
}
func (this *Effect) GetRepeatDuration() float64 {
return this.RepeatDuration
}
func (this *Effect) SetRepeatDuration(newValue float64) {
this.RepeatDuration = newValue
}
func (this *Effect) GetRestart() string {
return this.Restart
}
func (this *Effect) SetRestart(newValue string) {
this.Restart = newValue
}
func (this *Effect) GetSpeed() float64 {
return this.Speed
}
func (this *Effect) SetSpeed(newValue float64) {
this.Speed = newValue
}
func (this *Effect) GetTriggerDelayTime() float64 {
return this.TriggerDelayTime
}
func (this *Effect) SetTriggerDelayTime(newValue float64) {
this.TriggerDelayTime = newValue
}
func (this *Effect) GetRepeatUntilEndSlide() *bool {
return this.RepeatUntilEndSlide
}
func (this *Effect) SetRepeatUntilEndSlide(newValue *bool) {
this.RepeatUntilEndSlide = newValue
}
func (this *Effect) GetRepeatUntilNextClick() *bool {
return this.RepeatUntilNextClick
}
func (this *Effect) SetRepeatUntilNextClick(newValue *bool) {
this.RepeatUntilNextClick = newValue
}
func (this *Effect) GetStopPreviousSound() *bool {
return this.StopPreviousSound
}
func (this *Effect) SetStopPreviousSound(newValue *bool) {
this.StopPreviousSound = newValue
}
func (this *Effect) GetRewind() *bool {
return this.Rewind
}
func (this *Effect) SetRewind(newValue *bool) {
this.Rewind = newValue
}
func (this *Effect) GetAfterAnimationType() string {
return this.AfterAnimationType
}
func (this *Effect) SetAfterAnimationType(newValue string) {
this.AfterAnimationType = newValue
}
func (this *Effect) GetAfterAnimationColor() string {
return this.AfterAnimationColor
}
func (this *Effect) SetAfterAnimationColor(newValue string) {
this.AfterAnimationColor = newValue
}
func (this *Effect) UnmarshalJSON(b []byte) error {
var objMap map[string]*json.RawMessage
err := json.Unmarshal(b, &objMap)
if err != nil {
return err
}
if valType, ok := GetMapValue(objMap, "type"); ok {
if valType != nil {
var valueForType string
err = json.Unmarshal(*valType, &valueForType)
if err != nil {
var valueForTypeInt int32
err = json.Unmarshal(*valType, &valueForTypeInt)
if err != nil {
return err
}
this.Type_ = string(valueForTypeInt)
} else {
this.Type_ = valueForType
}
}
}
if valSubtype, ok := GetMapValue(objMap, "subtype"); ok {
if valSubtype != nil {
var valueForSubtype string
err = json.Unmarshal(*valSubtype, &valueForSubtype)
if err != nil {
var valueForSubtypeInt int32
err = json.Unmarshal(*valSubtype, &valueForSubtypeInt)
if err != nil {
return err
}
this.Subtype = string(valueForSubtypeInt)
} else {
this.Subtype = valueForSubtype
}
}
}
if valPresetClassType, ok := GetMapValue(objMap, "presetClassType"); ok {
if valPresetClassType != nil {
var valueForPresetClassType string
err = json.Unmarshal(*valPresetClassType, &valueForPresetClassType)
if err != nil {
var valueForPresetClassTypeInt int32
err = json.Unmarshal(*valPresetClassType, &valueForPresetClassTypeInt)
if err != nil {
return err
}
this.PresetClassType = string(valueForPresetClassTypeInt)
} else {
this.PresetClassType = valueForPresetClassType
}
}
}
if valAnimateTextType, ok := GetMapValue(objMap, "animateTextType"); ok {
if valAnimateTextType != nil {
var valueForAnimateTextType string
err = json.Unmarshal(*valAnimateTextType, &valueForAnimateTextType)
if err != nil {
var valueForAnimateTextTypeInt int32
err = json.Unmarshal(*valAnimateTextType, &valueForAnimateTextTypeInt)
if err != nil {
return err
}
this.AnimateTextType = string(valueForAnimateTextTypeInt)
} else {
this.AnimateTextType = valueForAnimateTextType
}
}
}
if valShapeIndex, ok := GetMapValue(objMap, "shapeIndex"); ok {
if valShapeIndex != nil {
var valueForShapeIndex int32
err = json.Unmarshal(*valShapeIndex, &valueForShapeIndex)
if err != nil {
return err
}
this.ShapeIndex = valueForShapeIndex
}
}
if valParagraphIndex, ok := GetMapValue(objMap, "paragraphIndex"); ok {
if valParagraphIndex != nil {
var valueForParagraphIndex int32
err = json.Unmarshal(*valParagraphIndex, &valueForParagraphIndex)
if err != nil {
return err
}
this.ParagraphIndex = valueForParagraphIndex
}
}
if valTriggerType, ok := GetMapValue(objMap, "triggerType"); ok {
if valTriggerType != nil {
var valueForTriggerType string
err = json.Unmarshal(*valTriggerType, &valueForTriggerType)
if err != nil {
var valueForTriggerTypeInt int32
err = json.Unmarshal(*valTriggerType, &valueForTriggerTypeInt)
if err != nil {
return err
}
this.TriggerType = string(valueForTriggerTypeInt)
} else {
this.TriggerType = valueForTriggerType
}
}
}
if valAccelerate, ok := GetMapValue(objMap, "accelerate"); ok {
if valAccelerate != nil {
var valueForAccelerate float64
err = json.Unmarshal(*valAccelerate, &valueForAccelerate)
if err != nil {
return err
}
this.Accelerate = valueForAccelerate
}
}
if valAutoReverse, ok := GetMapValue(objMap, "autoReverse"); ok {
if valAutoReverse != nil {
var valueForAutoReverse *bool
err = json.Unmarshal(*valAutoReverse, &valueForAutoReverse)
if err != nil {
return err
}
this.AutoReverse = valueForAutoReverse
}
}
if valDecelerate, ok := GetMapValue(objMap, "decelerate"); ok {
if valDecelerate != nil {
var valueForDecelerate float64
err = json.Unmarshal(*valDecelerate, &valueForDecelerate)
if err != nil {
return err
}
this.Decelerate = valueForDecelerate
}
}
if valDuration, ok := GetMapValue(objMap, "duration"); ok {
if valDuration != nil {
var valueForDuration float64
err = json.Unmarshal(*valDuration, &valueForDuration)
if err != nil {
return err
}
this.Duration = valueForDuration
}
}
if valRepeatCount, ok := GetMapValue(objMap, "repeatCount"); ok {
if valRepeatCount != nil {
var valueForRepeatCount float64
err = json.Unmarshal(*valRepeatCount, &valueForRepeatCount)
if err != nil {
return err
}
this.RepeatCount = valueForRepeatCount
}
}
if valRepeatDuration, ok := GetMapValue(objMap, "repeatDuration"); ok {
if valRepeatDuration != nil {
var valueForRepeatDuration float64
err = json.Unmarshal(*valRepeatDuration, &valueForRepeatDuration)
if err != nil {
return err
}
this.RepeatDuration = valueForRepeatDuration
}
}
if valRestart, ok := GetMapValue(objMap, "restart"); ok {
if valRestart != nil {
var valueForRestart string
err = json.Unmarshal(*valRestart, &valueForRestart)
if err != nil {
var valueForRestartInt int32
err = json.Unmarshal(*valRestart, &valueForRestartInt)
if err != nil {
return err
}
this.Restart = string(valueForRestartInt)
} else {
this.Restart = valueForRestart
}
}
}
if valSpeed, ok := GetMapValue(objMap, "speed"); ok {
if valSpeed != nil {
var valueForSpeed float64
err = json.Unmarshal(*valSpeed, &valueForSpeed)
if err != nil {
return err
}
this.Speed = valueForSpeed
}
}
if valTriggerDelayTime, ok := GetMapValue(objMap, "triggerDelayTime"); ok {
if valTriggerDelayTime != nil {
var valueForTriggerDelayTime float64
err = json.Unmarshal(*valTriggerDelayTime, &valueForTriggerDelayTime)
if err != nil {
return err
}
this.TriggerDelayTime = valueForTriggerDelayTime
}
}
if valRepeatUntilEndSlide, ok := GetMapValue(objMap, "repeatUntilEndSlide"); ok {
if valRepeatUntilEndSlide != nil {
var valueForRepeatUntilEndSlide *bool
err = json.Unmarshal(*valRepeatUntilEndSlide, &valueForRepeatUntilEndSlide)
if err != nil {
return err
}
this.RepeatUntilEndSlide = valueForRepeatUntilEndSlide
}
}
if valRepeatUntilNextClick, ok := GetMapValue(objMap, "repeatUntilNextClick"); ok {
if valRepeatUntilNextClick != nil {
var valueForRepeatUntilNextClick *bool
err = json.Unmarshal(*valRepeatUntilNextClick, &valueForRepeatUntilNextClick)
if err != nil {
return err
}
this.RepeatUntilNextClick = valueForRepeatUntilNextClick
}
}
if valStopPreviousSound, ok := GetMapValue(objMap, "stopPreviousSound"); ok {
if valStopPreviousSound != nil {
var valueForStopPreviousSound *bool
err = json.Unmarshal(*valStopPreviousSound, &valueForStopPreviousSound)
if err != nil {
return err
}
this.StopPreviousSound = valueForStopPreviousSound
}
}
if valRewind, ok := GetMapValue(objMap, "rewind"); ok {
if valRewind != nil {
var valueForRewind *bool
err = json.Unmarshal(*valRewind, &valueForRewind)
if err != nil {
return err
}
this.Rewind = valueForRewind
}
}
if valAfterAnimationType, ok := GetMapValue(objMap, "afterAnimationType"); ok {
if valAfterAnimationType != nil {
var valueForAfterAnimationType string
err = json.Unmarshal(*valAfterAnimationType, &valueForAfterAnimationType)
if err != nil {
var valueForAfterAnimationTypeInt int32
err = json.Unmarshal(*valAfterAnimationType, &valueForAfterAnimationTypeInt)
if err != nil {
return err
}
this.AfterAnimationType = string(valueForAfterAnimationTypeInt)
} else {
this.AfterAnimationType = valueForAfterAnimationType
}
}
}
if valAfterAnimationColor, ok := GetMapValue(objMap, "afterAnimationColor"); ok {
if valAfterAnimationColor != nil {
var valueForAfterAnimationColor string
err = json.Unmarshal(*valAfterAnimationColor, &valueForAfterAnimationColor)
if err != nil {
return err
}
this.AfterAnimationColor = valueForAfterAnimationColor
}
}
return nil
}