CSSPrimitiveValue.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /**
  2. http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/css.html#CSS-CSSPrimitiveValue
  3. interface CSSPrimitiveValue : CSSValue {
  4. // UnitTypes
  5. const unsigned short CSS_UNKNOWN = 0;
  6. const unsigned short CSS_NUMBER = 1;
  7. const unsigned short CSS_PERCENTAGE = 2;
  8. const unsigned short CSS_EMS = 3;
  9. const unsigned short CSS_EXS = 4;
  10. const unsigned short CSS_PX = 5;
  11. const unsigned short CSS_CM = 6;
  12. const unsigned short CSS_MM = 7;
  13. const unsigned short CSS_IN = 8;
  14. const unsigned short CSS_PT = 9;
  15. const unsigned short CSS_PC = 10;
  16. const unsigned short CSS_DEG = 11;
  17. const unsigned short CSS_RAD = 12;
  18. const unsigned short CSS_GRAD = 13;
  19. const unsigned short CSS_MS = 14;
  20. const unsigned short CSS_S = 15;
  21. const unsigned short CSS_HZ = 16;
  22. const unsigned short CSS_KHZ = 17;
  23. const unsigned short CSS_DIMENSION = 18;
  24. const unsigned short CSS_STRING = 19;
  25. const unsigned short CSS_URI = 20;
  26. const unsigned short CSS_IDENT = 21;
  27. const unsigned short CSS_ATTR = 22;
  28. const unsigned short CSS_COUNTER = 23;
  29. const unsigned short CSS_RECT = 24;
  30. const unsigned short CSS_RGBCOLOR = 25;
  31. readonly attribute unsigned short primitiveType;
  32. void setFloatValue(in unsigned short unitType,
  33. in float floatValue)
  34. raises(DOMException);
  35. float getFloatValue(in unsigned short unitType)
  36. raises(DOMException);
  37. void setStringValue(in unsigned short stringType,
  38. in DOMString stringValue)
  39. raises(DOMException);
  40. DOMString getStringValue()
  41. raises(DOMException);
  42. Counter getCounterValue()
  43. raises(DOMException);
  44. Rect getRectValue()
  45. raises(DOMException);
  46. RGBColor getRGBColorValue()
  47. raises(DOMException);
  48. */
  49. #import "CSSValue.h"
  50. typedef enum CSSPrimitiveType
  51. {
  52. CSS_UNKNOWN = 0,
  53. CSS_NUMBER = 1,
  54. CSS_PERCENTAGE = 2,
  55. CSS_EMS = 3,
  56. CSS_EXS = 4,
  57. CSS_PX = 5,
  58. CSS_CM = 6,
  59. CSS_MM = 7,
  60. CSS_IN = 8,
  61. CSS_PT = 9,
  62. CSS_PC = 10,
  63. CSS_DEG = 11,
  64. CSS_RAD = 12,
  65. CSS_GRAD = 13,
  66. CSS_MS = 14,
  67. CSS_S = 15,
  68. CSS_HZ = 16,
  69. CSS_KHZ = 17,
  70. CSS_DIMENSION = 18,
  71. CSS_STRING = 19,
  72. CSS_URI = 20,
  73. CSS_IDENT = 21,
  74. CSS_ATTR = 22,
  75. CSS_COUNTER = 23,
  76. CSS_RECT = 24,
  77. CSS_RGBCOLOR = 25
  78. } CSSPrimitiveType;
  79. @interface CSSPrimitiveValue : CSSValue
  80. @property(nonatomic) CSSPrimitiveType primitiveType;
  81. -(void) setFloatValue:(CSSPrimitiveType) unitType floatValue:(float) floatValue;
  82. -(float) getFloatValue:(CSSPrimitiveType) unitType;
  83. -(void) setStringValue:(CSSPrimitiveType) stringType stringValue:(NSString*) stringValue;
  84. -(NSString*) getStringValue;
  85. -(/* FIXME: have to add this type: Counter*/ void) getCounterValue;
  86. -(/* FIXME: have to add this type: Rect*/ void) getRectValue;
  87. -(/* FIXME: have to add this type: RGBColor*/ void) getRGBColorValue;
  88. @end