SVGGradientElement.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. //
  3. http://www.w3.org/TR/SVG/pservers.html#InterfaceSVGGradientElement
  4. interface SVGGradientElement : SVGElement,
  5. SVGURIReference,
  6. SVGExternalResourcesRequired,
  7. SVGStylable,
  8. SVGUnitTypes {
  9. // Spread Method Types
  10. const unsigned short SVG_SPREADMETHOD_UNKNOWN = 0;
  11. const unsigned short SVG_SPREADMETHOD_PAD = 1;
  12. const unsigned short SVG_SPREADMETHOD_REFLECT = 2;
  13. const unsigned short SVG_SPREADMETHOD_REPEAT = 3;
  14. readonly attribute SVGAnimatedEnumeration gradientUnits;
  15. readonly attribute SVGAnimatedTransformList gradientTransform;
  16. readonly attribute SVGAnimatedEnumeration spreadMethod;
  17. */
  18. #import "SVGElement.h"
  19. #import "SVGRect.h"
  20. #import "SVGGradientStop.h"
  21. #import "SVGTransformable.h"
  22. #import "SVGPreserveAspectRatio.h"
  23. #import "SVGUnitTypes.h"
  24. typedef NS_ENUM(NSUInteger, SVGSpreadMethod) {
  25. SVGSpreadMethodUnkown = 0,
  26. SVGSpreadMethodPad = 1,
  27. SVGSpreadMethodReflect = 2,
  28. SVGSpreadMethodRepeat = 3
  29. };
  30. @class SVGGradientLayer;
  31. @interface SVGGradientElement : SVGElement <SVGTransformable> /* NB: does NOT implemente "SVGLayeredElement" because spec says that these specifically NEVER appear in the output */
  32. @property (readonly, strong) NSArray *stops; /* FIXME: not in SVG Spec */
  33. @property (readonly, strong) NSArray *locations; /* FIXME: not in SVG Spec */
  34. @property (readonly, strong) NSArray *colors; /* FIXME: not in SVG Spec */
  35. @property (readonly, assign) SVG_UNIT_TYPE gradientUnits;
  36. @property (readonly, assign) SVGSpreadMethod spreadMethod; /* FIXME: currently only support `pad`. other methods are not supported */
  37. -(void)addStop:(SVGGradientStop *)gradientStop; /* FIXME: not in SVG Spec */
  38. -(NSString*) getAttributeInheritedIfNil:(NSString*)attrName;
  39. -(SVGGradientLayer *)newGradientLayerForObjectRect:(CGRect)objectRect
  40. viewportRect:(SVGRect)viewportRect
  41. transform:(CGAffineTransform)transform;
  42. - (void)synthesizeProperties; // resolve any xlink:hrefs to other gradients
  43. @end