1 /**
2  * Copyright (c) 2015-present, Horcrux.
3  * All rights reserved.
4  *
5  * This source code is licensed under the MIT-style license found in the
6  * LICENSE file in the root directory of this source tree.
7  */
8 
9 #import "RNSVGUIKit.h"
10 
11 #import "RNSVGContainer.h"
12 #import "RNSVGPainter.h"
13 #import "RNSVGVBMOS.h"
14 
15 #ifdef RCT_NEW_ARCH_ENABLED
16 #import <React/RCTViewComponentView.h>
17 #endif // RCT_NEW_ARCH_ENABLED
18 
19 @class RNSVGNode;
20 
21 @interface RNSVGSvgView :
22 #ifdef RCT_NEW_ARCH_ENABLED
23     RCTViewComponentView <RNSVGContainer>
24 #else
25     RNSVGView <RNSVGContainer>
26 #endif // RCT_NEW_ARCH_ENABLED
27 
28 @property (nonatomic, strong) RNSVGLength *bbWidth;
29 @property (nonatomic, strong) RNSVGLength *bbHeight;
30 @property (nonatomic, assign) CGFloat minX;
31 @property (nonatomic, assign) CGFloat minY;
32 @property (nonatomic, assign) CGFloat vbWidth;
33 @property (nonatomic, assign) CGFloat vbHeight;
34 @property (nonatomic, strong) NSString *align;
35 @property (nonatomic, assign) RNSVGVBMOS meetOrSlice;
36 @property (nonatomic, assign) BOOL responsible;
37 @property (nonatomic, assign) BOOL active;
38 @property (nonatomic, assign) CGRect boundingBox;
39 @property (nonatomic, assign) CGAffineTransform initialCTM;
40 @property (nonatomic, assign) CGAffineTransform invInitialCTM;
41 @property (nonatomic, assign) CGAffineTransform viewBoxTransform;
42 
43 /**
44  * define <ClipPath></ClipPath> content as clipPath template.
45  */
46 - (void)defineClipPath:(__kindof RNSVGNode *)clipPath clipPathName:(NSString *)clipPathName;
47 
48 - (RNSVGNode *)getDefinedClipPath:(NSString *)clipPathName;
49 
50 - (void)defineTemplate:(__kindof RNSVGNode *)definedTemplate templateName:(NSString *)templateName;
51 
52 - (RNSVGNode *)getDefinedTemplate:(NSString *)templateName;
53 
54 - (void)definePainter:(RNSVGPainter *)painter painterName:(NSString *)painterName;
55 
56 - (RNSVGPainter *)getDefinedPainter:(NSString *)painterName;
57 
58 - (void)defineMarker:(RNSVGNode *)marker markerName:(NSString *)markerName;
59 
60 - (RNSVGNode *)getDefinedMarker:(NSString *)markerName;
61 
62 - (void)defineMask:(RNSVGNode *)mask maskName:(NSString *)maskName;
63 
64 - (RNSVGNode *)getDefinedMask:(NSString *)maskName;
65 
66 - (NSString *)getDataURL;
67 
68 - (NSString *)getDataURLwithBounds:(CGRect)bounds;
69 
70 - (CGRect)getContextBounds;
71 
72 - (void)drawRect:(CGRect)rect;
73 
74 - (void)drawToContext:(CGContextRef)context withRect:(CGRect)rect;
75 
76 - (CGAffineTransform)getViewBoxTransform;
77 
78 @end
79