Code

Warning cleanup
[inkscape.git] / src / dom / svg / svgtypes.h
1 #ifndef __SVGTYPES_H__
2 #define __SVGTYPES_H__
4 /**
5  * Phoebe DOM Implementation.
6  *
7  * This is a C++ approximation of the W3C DOM model, which follows
8  * fairly closely the specifications in the various .idl files, copies of
9  * which are provided for reference.  Most important is this one:
10  *
11  * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html
12  *
13  * Authors:
14  *   Bob Jamison
15  *
16  * Copyright (C) 2006 Bob Jamison
17  *
18  *  This library is free software; you can redistribute it and/or
19  *  modify it under the terms of the GNU Lesser General Public
20  *  License as published by the Free Software Foundation; either
21  *  version 2.1 of the License, or (at your option) any later version.
22  *
23  *  This library is distributed in the hope that it will be useful,
24  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
25  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
26  *  Lesser General Public License for more details.
27  *
28  *  You should have received a copy of the GNU Lesser General Public
29  *  License along with this library; if not, write to the Free Software
30  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
31  */
34 // For access to DOM2 core
35 #include "dom/dom.h"
37 // For access to DOM2 events
38 #include "dom/events.h"
40 // For access to those parts from DOM2 CSS OM used by SVG DOM.
41 #include "dom/css.h"
43 // For access to those parts from DOM2 Views OM used by SVG DOM.
44 #include "dom/views.h"
46 // For access to the SMIL OM used by SVG DOM.
47 #include "dom/smil.h"
50 #include <math.h>
54 namespace org {
55 namespace w3c {
56 namespace dom {
57 namespace svg {
62 //local definitions
63 typedef dom::DOMString DOMString;
64 typedef dom::DOMException DOMException;
65 typedef dom::Element Element;
66 typedef dom::Document Document;
67 typedef dom::NodeList NodeList;
70 class SVGElement;
71 class SVGUseElement;
72 class SVGAnimatedPreserveAspectRatio;
75 /*#########################################################################
76 ## SVGException
77 #########################################################################*/
79 /**
80  *
81  */
82 class SVGException
83 {
84 public:
85     // unsigned short   code;  //inherited
86 };
88     /**
89      * SVGExceptionCode
90      */
91     typedef enum
92         {
93         SVG_WRONG_TYPE_ERR           = 0,
94         SVG_INVALID_VALUE_ERR        = 1,
95         SVG_MATRIX_NOT_INVERTABLE    = 2
96         } SVGExceptionCode;
102 /*#########################################################################
103 ## SVGMatrix
104 #########################################################################*/
106 /**
107  *  In SVG, a Matrix is defined like this:
108  *
109  * | a  c  e |
110  * | b  d  f |
111  * | 0  0  1 |
112  *
113  */
114 class SVGMatrix
116 public:
119     /**
120      *
121      */
122     virtual double getA()
123         { return a; }
125     /**
126      *
127      */
128     virtual void setA(double val) throw (DOMException)
129         { a = val; }
131     /**
132      *
133      */
134     virtual double getB()
135         { return b; }
137     /**
138      *
139      */
140     virtual void setB(double val) throw (DOMException)
141         { b = val; }
143     /**
144      *
145      */
146     virtual double getC()
147         { return c; }
149     /**
150      *
151      */
152     virtual void setC(double val) throw (DOMException)
153         { c = val; }
155     /**
156      *
157      */
158     virtual double getD()
159         { return d; }
161     /**
162      *
163      */
164     virtual void setD(double val) throw (DOMException)
165         { d = val; }
166     /**
167      *
168      */
169     virtual double getE()
170         { return e; }
172     /**
173      *
174      */
175     virtual void setE(double val) throw (DOMException)
176         { e = val; }
177     /**
178      *
179      */
180     virtual double getF()
181         { return f; }
183     /**
184      *
185      */
186     virtual void setF(double val) throw (DOMException)
187         { f = val; }
190     /**
191      * Return the result of postmultiplying this matrix with another.
192      */
193     virtual SVGMatrix multiply(const SVGMatrix &other)
194         {
195         SVGMatrix result;
196         result.a = a * other.a  +  c * other.b;
197         result.b = b * other.a  +  d * other.b;
198         result.c = a * other.c  +  c * other.d;
199         result.d = b * other.c  +  d * other.d;
200         result.e = a * other.e  +  c * other.f  +  e;
201         result.f = b * other.e  +  d * other.f  +  f;
202         return result;
203         }
205     /**
206      *  Calculate the inverse of this matrix
207      *
208      */
209     virtual SVGMatrix inverse(  ) throw( SVGException )
210         {
211         /*###########################################
212         The determinant of a 3x3 matrix E
213            (let's use our own notation for a bit)
215             A  B  C
216             D  E  F
217             G  H  I
218         is
219             AEI - AFH - BDI + BFG + CDH - CEG
221         Since in our affine transforms, G and H==0 and I==1,
222         this reduces to:
223             AE - BD
224         In SVG's naming scheme, that is:  a * d - c * b .  SIMPLE!
226         In a similar method of attack, SVG's adjunct matrix is:
228            d  -c   cf-ed
229           -b   a   eb-af
230            0   0   ad-cb
232         To get the inverse matrix, we divide the adjunct matrix by
233         the determinant.  Notice that (ad-cb)/(ad-cb)==1.  Very cool.
234         So what we end up with is this:
236            a =  d/(ad-cb)  c = -c/(ad-cb)   e = (cf-ed)/(ad-cb)
237            b = -b/(ad-cb)  d =  a/(ad-cb)   f = (eb-af)/(ad-cb)
239         (Since this would be in all SVG-DOM implementations,
240          somebody needed to document this!  ^^ )
241         #############################################*/
243         SVGMatrix result;
244         double determinant = a * d  -  c * b;
245         if (determinant < 1.0e-18)//invertible?
246             {
247             result.identity();//cop out
248             return result;
249             }
251         double idet = 1.0 / determinant;
252         result.a =   d * idet;
253         result.b =  -b * idet;
254         result.c =  -c * idet;
255         result.d =   a * idet;
256         result.e =  (c*f - e*d) * idet;
257         result.f =  (e*b - a*f) * idet;
258         return result;
259         }
261     /**
262      * Equivalent to multiplying by:
263      *  | 1  0  x |
264      *  | 0  1  y |
265      *  | 0  0  1 |
266      *
267      */
268     virtual SVGMatrix translate(double x, double y )
269         {
270         SVGMatrix result;
271         result.a = a;
272         result.b = b;
273         result.c = c;
274         result.d = d;
275         result.e = a * x  +  c * y  +  e;
276         result.f = b * x  +  d * y  +  f;
277         return result;
278         }
280     /**
281      * Equivalent to multiplying by:
282      *  | scale  0      0 |
283      *  | 0      scale  0 |
284      *  | 0      0      1 |
285      *
286      */
287     virtual SVGMatrix scale(double scale)
288         {
289         SVGMatrix result;
290         result.a = a * scale;
291         result.b = b * scale;
292         result.c = c * scale;
293         result.d = d * scale;
294         result.e = e;
295         result.f = f;
296         return result;
297         }
299     /**
300      * Equivalent to multiplying by:
301      *  | scaleX  0       0 |
302      *  | 0       scaleY  0 |
303      *  | 0       0       1 |
304      *
305      */
306     virtual SVGMatrix scaleNonUniform(double scaleX,
307                                       double scaleY )
308         {
309         SVGMatrix result;
310         result.a = a * scaleX;
311         result.b = b * scaleX;
312         result.c = c * scaleY;
313         result.d = d * scaleY;
314         result.e = e;
315         result.f = f;
316         return result;
317         }
319     /**
320      * Equivalent to multiplying by:
321      *  | cos(a) -sin(a)   0 |
322      *  | sin(a)  cos(a)   0 |
323      *  | 0       0        1 |
324      *
325      */
326     virtual SVGMatrix rotate (double angle)
327         {
328         double sina  = sin(angle);
329         double msina = -sina;
330         double cosa  = cos(angle);
331         SVGMatrix result;
332         result.a = a * cosa   +  c * sina;
333         result.b = b * cosa   +  d + sina;
334         result.c = a * msina  +  c * cosa;
335         result.d = b * msina  +  d * cosa;
336         result.e = e;
337         result.f = f;
338         return result;
339         }
341     /**
342      * Equivalent to multiplying by:
343      *  | cos(a) -sin(a)   0 |
344      *  | sin(a)  cos(a)   0 |
345      *  | 0       0        1 |
346      *  In this case, angle 'a' is computed as the artangent
347      *  of the slope y/x .  It is negative if the slope is negative.
348      */
349     virtual SVGMatrix rotateFromVector(double x, double y)
350                                       throw( SVGException )
351         {
352         double angle = atan(y / x);
353         if (y < 0.0)
354             angle = -angle;
355         SVGMatrix result;
356         double sina  = sin(angle);
357         double msina = -sina;
358         double cosa  = cos(angle);
359         result.a = a * cosa   +  c * sina;
360         result.b = b * cosa   +  d + sina;
361         result.c = a * msina  +  c * cosa;
362         result.d = b * msina  +  d * cosa;
363         result.e = e;
364         result.f = f;
365         return result;
366         }
368     /**
369      * Equivalent to multiplying by:
370      *  | -1   0   0 |
371      *  | 0    1   0 |
372      *  | 0    0   1 |
373      *
374      */
375     virtual SVGMatrix flipX(  )
376         {
377         SVGMatrix result;
378         result.a = -a;
379         result.b = -b;
380         result.c =  c;
381         result.d =  d;
382         result.e =  e;
383         result.f =  f;
384         return result;
385         }
387     /**
388      * Equivalent to multiplying by:
389      *  | 1   0   0 |
390      *  | 0  -1   0 |
391      *  | 0   0   1 |
392      *
393      */
394     virtual SVGMatrix flipY( )
395         {
396         SVGMatrix result;
397         result.a =  a;
398         result.b =  b;
399         result.c = -c;
400         result.d = -d;
401         result.e =  e;
402         result.f =  f;
403         return result;
404         }
406     /**
407      *  | 1   tan(a)  0 |
408      *  | 0   1       0 |
409      *  | 0   0       1 |
410      *
411      */
412     virtual SVGMatrix skewX(double angle)
413         {
414         double tana = tan(angle);
415         SVGMatrix result;
416         result.a =  a;
417         result.b =  b;
418         result.c =  a * tana + c;
419         result.d =  b * tana + d;
420         result.e =  e;
421         result.f =  f;
422         return result;
423         }
425     /**
426      * Equivalent to multiplying by:
427      *  | 1       0   0 |
428      *  | tan(a)  1   0 |
429      *  | 0       0   1 |
430      *
431      */
432     virtual SVGMatrix skewY(double angle)
433         {
434         double tana = tan(angle);
435         SVGMatrix result;
436         result.a =  a + c * tana;
437         result.b =  b + d * tana;
438         result.c =  c;
439         result.d =  d;
440         result.e =  e;
441         result.f =  f;
442         return result;
443         }
447     //##################
448     //# Non-API methods
449     //##################
451     /**
452      *
453      */
454     SVGMatrix()
455         {
456         identity();
457         }
459     /**
460      *
461      */
462     SVGMatrix(double aArg, double bArg, double cArg,
463               double dArg, double eArg, double fArg )
464         {
465         a = aArg; b = bArg; c = cArg;
466         d = dArg; e = eArg; f = fArg;
467         }
469     /**
470      * Copy constructor
471      */
472     SVGMatrix(const SVGMatrix &other)
473         {
474         a = other.a;
475         b = other.b;
476         c = other.c;
477         d = other.d;
478         e = other.e;
479         f = other.f;
480         }
484     /**
485      *
486      */
487     virtual ~SVGMatrix() {}
489 protected:
491 friend class SVGTransform;
493     /*
494      * Set to the identify matrix
495      */
496    void identity()
497        {
498        a = 1.0;
499        b = 0.0;
500        c = 0.0;
501        d = 1.0;
502        e = 0.0;
503        f = 0.0;
504        }
506     double a, b, c, d, e, f;
508 };
511 /*#########################################################################
512 ## SVGTransform
513 #########################################################################*/
515 /**
516  *
517  */
518 class SVGTransform
520 public:
522     /**
523      * Transform Types
524      */
525     typedef enum
526         {
527         SVG_TRANSFORM_UNKNOWN   = 0,
528         SVG_TRANSFORM_MATRIX    = 1,
529         SVG_TRANSFORM_TRANSLATE = 2,
530         SVG_TRANSFORM_SCALE     = 3,
531         SVG_TRANSFORM_ROTATE    = 4,
532         SVG_TRANSFORM_SKEWX     = 5,
533         SVG_TRANSFORM_SKEWY     = 6,
534         } TransformType;
536     /**
537      *
538      */
539     virtual unsigned short getType()
540         { return type; }
543     /**
544      *
545      */
546     virtual SVGMatrix getMatrix()
547         {
548         return matrix;
549         }
551     /**
552      *
553      */
554     virtual double getAngle()
555         {
556         return angle;
557         }
560     /**
561      *
562      */
563     virtual void setMatrix(const SVGMatrix &matrixArg)
564         {
565         type = SVG_TRANSFORM_MATRIX;
566         matrix = matrixArg;
567         }
569     /**
570      *
571      */
572     virtual void setTranslate (double tx, double ty )
573         {
574         type = SVG_TRANSFORM_TRANSLATE;
575         matrix.setA(1.0);
576         matrix.setB(0.0);
577         matrix.setC(0.0);
578         matrix.setD(1.0);
579         matrix.setE(tx);
580         matrix.setF(ty);
581         }
583     /**
584      *
585      */
586     virtual void setScale (double sx, double sy )
587         {
588         type = SVG_TRANSFORM_SCALE;
589         matrix.setA(sx);
590         matrix.setB(0.0);
591         matrix.setC(0.0);
592         matrix.setD(sy);
593         matrix.setE(0.0);
594         matrix.setF(0.0);
595         }
597     /**
598      *
599      */
600     virtual void setRotate (double angleArg, double cx, double cy)
601         {
602         angle = angleArg;
603         setTranslate(cx, cy);
604         type = SVG_TRANSFORM_ROTATE;
605         matrix.rotate(angle);
606         }
608     /**
609      *
610      */
611     virtual void setSkewX (double angleArg)
612         {
613         angle = angleArg;
614         type = SVG_TRANSFORM_SKEWX;
615         matrix.identity();
616         matrix.skewX(angle);
617         }
619     /**
620      *
621      */
622     virtual void setSkewY (double angleArg)
623         {
624         angle = angleArg;
625         type = SVG_TRANSFORM_SKEWY;
626         matrix.identity();
627         matrix.skewY(angle);
628         }
631     //##################
632     //# Non-API methods
633     //##################
635     /**
636      *
637      */
638     SVGTransform()
639         {
640         type = SVG_TRANSFORM_UNKNOWN;
641         angle = 0.0;
642         }
644     /**
645      *
646      */
647     SVGTransform(const SVGTransform &other)
648         {
649         type   = other.type;
650         angle  = other.angle;
651         matrix = other.matrix;
652         }
654     /**
655      *
656      */
657     virtual ~SVGTransform()
658         {}
660 protected:
662     int type;
663     double angle;
665     SVGMatrix matrix;
666 };
673 /*#########################################################################
674 ## SVGTransformList
675 #########################################################################*/
677 /**
678  *
679  */
680 class SVGTransformList
682 public:
685     /**
686      *
687      */
688     virtual unsigned long getNumberOfItems()
689         { return items.size(); }
692     /**
693      *
694      */
695     virtual void clear( ) throw( DOMException )
696         { items.clear(); }
698     /**
699      *
700      */
701     virtual SVGTransform initialize (const SVGTransform &newItem)
702                          throw( DOMException, SVGException )
703         {
704         items.clear();
705         items.push_back(newItem);
706         return newItem;
707         }
709     /**
710      *
711      */
712     virtual SVGTransform getItem (unsigned long index )
713                     throw( DOMException )
714         {
715         if (index>=items.size())
716             {
717             SVGTransform transform;
718             return transform;
719             }
720         return items[index];
721         }
723     /**
724      *
725      */
726     virtual SVGTransform insertItemBefore (const SVGTransform &newItem,
727                                            unsigned long index )
728                                       throw( DOMException, SVGException )
729         {
730         if (index > items.size())
731             items.push_back(newItem);
732         else
733             {
734             std::vector<SVGTransform>::iterator iter = items.begin() + index;
735             items.insert(iter, newItem);
736             }
737         return newItem;
738         }
740     /**
741      *
742      */
743     virtual SVGTransform replaceItem (const SVGTransform &newItem,
744                                        unsigned long index )
745                                 throw( DOMException, SVGException )
746         {
747         if (index>=items.size())
748             {
749             SVGTransform transform;
750             return transform;
751             }
752         else
753             {
754             std::vector<SVGTransform>::iterator iter = items.begin() + index;
755             *iter = newItem;
756             }
757         return newItem;
758         }
760     /**
761      *
762      */
763     virtual SVGTransform removeItem (unsigned long index )
764                                      throw( DOMException )
765         {
766         if (index>=items.size())
767             {
768             SVGTransform transform;
769             return transform;
770             }
771         std::vector<SVGTransform>::iterator iter = items.begin() + index;
772         SVGTransform oldItem = *iter;
773         items.erase(iter);
774         return oldItem;
775         }
777     /**
778      *
779      */
780     virtual SVGTransform appendItem (const SVGTransform &newItem)
781                                   throw( DOMException, SVGException )
782         {
783         items.push_back(newItem);
784         return newItem;
785         }
787     /**
788      *
789      */
790     virtual SVGTransform createSVGTransformFromMatrix(const SVGMatrix &matrix)
791         {
792         SVGTransform transform;
793         transform.setMatrix(matrix);
794         return transform;
795         }
797     /**
798      *
799      */
800     virtual SVGTransform consolidate()
801         {
802         SVGMatrix matrix;
803         for (unsigned int i=0 ; i<items.size() ; i++)
804             matrix = matrix.multiply(items[i].getMatrix());
805         SVGTransform transform;
806         transform.setMatrix(matrix);
807         items.clear();
808         items.push_back(transform);
809         return transform;
810         }
814     //##################
815     //# Non-API methods
816     //##################
818     /**
819      *
820      */
821     SVGTransformList()
822         {}
824     /**
825      *
826      */
827     SVGTransformList(const SVGTransformList &other)
828         {
829         items = other.items;
830         }
832     /**
833      *
834      */
835     virtual ~SVGTransformList() {}
837 protected:
839     std::vector<SVGTransform> items;
841 };
848 /*#########################################################################
849 ## SVGAnimatedTransformList
850 #########################################################################*/
852 /**
853  *
854  */
855 class SVGAnimatedTransformList
857 public:
859     /**
860      *
861      */
862     virtual SVGTransformList getBaseVal()
863         { return baseVal; }
865     /**
866      *
867      */
868     virtual SVGTransformList getAnimVal()
869         { return animVal; }
873     //##################
874     //# Non-API methods
875     //##################
877     /**
878      *
879      */
880     SVGAnimatedTransformList()
881         {}
883     /**
884      *
885      */
886     SVGAnimatedTransformList(const SVGAnimatedTransformList &other)
887         {
888         baseVal = other.baseVal;
889         animVal = other.animVal;
890         }
892     /**
893      *
894      */
895     virtual ~SVGAnimatedTransformList() {}
897 protected:
899     SVGTransformList baseVal;
900     SVGTransformList animVal;
902 };
907 /*#########################################################################
908 ## SVGAnimatedBoolean
909 #########################################################################*/
911 /**
912  *
913  */
914 class SVGAnimatedBoolean
916 public:
918     /**
919      *
920      */
921     virtual bool getBaseVal()
922         {
923         return baseVal;
924         }
926     /**
927      *
928      */
929     virtual void setBaseVal(bool val) throw (DOMException)
930         {
931         baseVal = val;
932         }
934     /**
935      *
936      */
937     virtual bool getAnimVal()
938         {
939         return animVal;
940         }
943     //##################
944     //# Non-API methods
945     //##################
947     /**
948      *
949      */
950     SVGAnimatedBoolean()
951         {
952         baseVal = animVal = false;
953         }
955     /**
956      *
957      */
958     SVGAnimatedBoolean(const SVGAnimatedBoolean &other)
959         {
960         baseVal = other.baseVal;
961         animVal = other.animVal;
962         }
964     /**
965      *
966      */
967     virtual ~SVGAnimatedBoolean() {}
969 protected:
971     bool baseVal, animVal;
973 };
978 /*#########################################################################
979 ## SVGAnimatedString
980 #########################################################################*/
982 /**
983  *
984  */
985 class SVGAnimatedString
987 public:
989     /**
990      *
991      */
992     virtual DOMString getBaseVal()
993         {
994         return baseVal;
995         }
997     /**
998      *
999      */
1000     virtual void setBaseVal(const DOMString &val)
1001                             throw (DOMException)
1002         {
1003         baseVal = val;
1004         }
1006     /**
1007      *
1008      */
1009     virtual DOMString getAnimVal()
1010         {
1011         return animVal;
1012         }
1015     //##################
1016     //# Non-API methods
1017     //##################
1020     /**
1021      *
1022      */
1023     SVGAnimatedString()
1024         {
1025         baseVal = "";
1026         animVal = "";
1027         }
1029     /**
1030      *
1031      */
1032     SVGAnimatedString(const SVGAnimatedString &other)
1033         {
1034         baseVal = other.baseVal;
1035         animVal = other.animVal;
1036         }
1038     /**
1039      *
1040      */
1041     virtual ~SVGAnimatedString() {}
1043 protected:
1045     DOMString baseVal, animVal;
1047 };
1053 /*#########################################################################
1054 ## SVGStringList
1055 #########################################################################*/
1057 /**
1058  *
1059  */
1060 class SVGStringList
1062 public:
1065     /**
1066      *
1067      */
1068     virtual unsigned long getNumberOfItems()
1069         {
1070         return items.size();
1071         }
1073     /**
1074      *
1075      */
1076     virtual void clear () throw( DOMException )
1077        {
1078        items.clear();
1079        }
1081     /**
1082      *
1083      */
1084     virtual DOMString initialize ( const DOMString& newItem )
1085                     throw( DOMException, SVGException )
1086         {
1087         items.clear();
1088         items.push_back(newItem);
1089         return newItem;
1090         }
1092     /**
1093      *
1094      */
1095     virtual DOMString getItem ( unsigned long index )
1096                     throw( DOMException )
1097         {
1098         if (index >= items.size())
1099             return "";
1100         return items[index];
1101         }
1103     /**
1104      *
1105      */
1106     virtual DOMString insertItemBefore ( const DOMString& newItem,
1107                                  unsigned long index )
1108                                throw( DOMException, SVGException )
1109         {
1110         if (index>=items.size())
1111             {
1112             items.push_back(newItem);
1113             }
1114         else
1115             {
1116             std::vector<DOMString>::iterator iter = items.begin() + index;
1117             items.insert(iter, newItem);
1118             }
1119         return newItem;
1120         }
1122     /**
1123      *
1124      */
1125     virtual DOMString replaceItem ( const DOMString& newItem,
1126                                     unsigned long index )
1127                                 throw( DOMException, SVGException )
1128         {
1129         if (index>=items.size())
1130             return "";
1131         std::vector<DOMString>::iterator iter = items.begin() + index;
1132         *iter = newItem;
1133         return newItem;
1134         }
1136     /**
1137      *
1138      */
1139     virtual DOMString removeItem ( unsigned long index )
1140                     throw( DOMException )
1141         {
1142         if (index>=items.size())
1143             return "";
1144         std::vector<DOMString>::iterator iter = items.begin() + index;
1145         DOMString oldstr = *iter;
1146         items.erase(iter);
1147         return oldstr;
1148         }
1150     /**
1151      *
1152      */
1153     virtual DOMString appendItem ( const DOMString& newItem )
1154                     throw( DOMException, SVGException )
1155         {
1156         items.push_back(newItem);
1157         return newItem;
1158         }
1162     //##################
1163     //# Non-API methods
1164     //##################
1166     /**
1167      *
1168      */
1169     SVGStringList() {}
1171     /**
1172      *
1173      */
1174    SVGStringList(const SVGStringList &other)
1175        {
1176        items = other.items;
1177        }
1179     /**
1180      *
1181      */
1182     virtual ~SVGStringList() {}
1184 protected:
1186     std::vector<DOMString>items;
1188 };
1194 /*#########################################################################
1195 ## SVGAnimatedEnumeration
1196 #########################################################################*/
1198 /**
1199  *
1200  */
1201 class SVGAnimatedEnumeration
1203 public:
1205     /**
1206      *
1207      */
1208     virtual unsigned short getBaseVal()
1209         {
1210         return baseVal;
1211         }
1213     /**
1214      *
1215      */
1216     virtual void setBaseVal(unsigned short val)
1217                                      throw (DOMException)
1218         {
1219         baseVal = val;
1220         }
1222     /**
1223      *
1224      */
1225     virtual unsigned short getAnimVal()
1226         {
1227         return animVal;
1228         }
1232     //##################
1233     //# Non-API methods
1234     //##################
1237     /**
1238      *
1239      */
1240     SVGAnimatedEnumeration()
1241         {
1242         baseVal = animVal = 0;
1243         }
1245     /**
1246      *
1247      */
1248     SVGAnimatedEnumeration(const SVGAnimatedEnumeration &other)
1249         {
1250         baseVal = other.baseVal;
1251         animVal = other.animVal;
1252         }
1254     /**
1255      *
1256      */
1257     virtual ~SVGAnimatedEnumeration() {}
1259 protected:
1261     int baseVal, animVal;
1263 };
1269 /*#########################################################################
1270 ## SVGAnimatedInteger
1271 #########################################################################*/
1273 /**
1274  *
1275  */
1276 class SVGAnimatedInteger
1278 public:
1281     /**
1282      *
1283      */
1284     virtual long getBaseVal()
1285         {
1286         return baseVal;
1287         }
1289     /**
1290      *
1291      */
1292     virtual void setBaseVal(long val) throw (DOMException)
1293         {
1294         baseVal = val;
1295         }
1297     /**
1298      *
1299      */
1300     virtual long getAnimVal()
1301         {
1302         return animVal;
1303         }
1307     //##################
1308     //# Non-API methods
1309     //##################
1312     /**
1313      *
1314      */
1315     SVGAnimatedInteger()
1316         { baseVal = animVal = 0L;}
1319     /**
1320      *
1321      */
1322     SVGAnimatedInteger(long value)
1323         {
1324         baseVal = value;
1325         animVal = 0L;
1326         }
1328     /**
1329      *
1330      */
1331     SVGAnimatedInteger(long baseValArg, long animValArg)
1332         {
1333         baseVal = baseValArg;
1334         animVal = animValArg;
1335         }
1338     /**
1339      *
1340      */
1341     SVGAnimatedInteger(const SVGAnimatedInteger &other)
1342         {
1343         baseVal = other.baseVal;
1344         animVal = other.animVal;
1345         }
1347     /**
1348      *
1349      */
1350     virtual ~SVGAnimatedInteger() {}
1352 protected:
1354     long baseVal, animVal;
1356 };
1362 /*#########################################################################
1363 ## SVGNumber
1364 #########################################################################*/
1366 /**
1367  *
1368  */
1369 class SVGNumber
1371 public:
1374     /**
1375      *
1376      */
1377     virtual double getValue()
1378         {
1379         return value;
1380         }
1382     /**
1383      *
1384      */
1385     virtual void setValue(double val) throw (DOMException)
1386         {
1387         value = val;
1388         }
1391     //##################
1392     //# Non-API methods
1393     //##################
1395     /**
1396      *
1397      */
1398     SVGNumber()
1399         {
1400         value = 0.0;
1401         }
1403     /**
1404      *
1405      */
1406     SVGNumber(const SVGNumber &other)
1407         {
1408         value = other.value;
1409         }
1411     /**
1412      *
1413      */
1414     virtual ~SVGNumber() {}
1416 protected:
1418     double value;
1420 };
1426 /*#########################################################################
1427 ## SVGAnimatedNumber
1428 #########################################################################*/
1430 /**
1431  *
1432  */
1433 class SVGAnimatedNumber
1435 public:
1439     /**
1440      *
1441      */
1442     virtual double getBaseVal()
1443         {
1444         return baseVal;
1445         }
1447     /**
1448      *
1449      */
1450     virtual void setBaseVal(double val) throw (DOMException)
1451         {
1452         baseVal = val;
1453         }
1455     /**
1456      *
1457      */
1458     virtual double getAnimVal()
1459         {
1460         return animVal;
1461         }
1465     //##################
1466     //# Non-API methods
1467     //##################
1469     /**
1470      *
1471      */
1472     SVGAnimatedNumber()
1473         {
1474         baseVal = animVal = 0.0;
1475         }
1478     /**
1479      *
1480      */
1481     SVGAnimatedNumber(double val)
1482         {
1483         baseVal = val;
1484         animVal = 0.0;
1485         }
1488     /**
1489      *
1490      */
1491     SVGAnimatedNumber(double baseValArg, double animValArg)
1492         {
1493         baseVal = baseValArg;
1494         animVal = animValArg;
1495         }
1497     /**
1498      *
1499      */
1500     SVGAnimatedNumber(const SVGAnimatedNumber &other)
1501         {
1502         baseVal = other.baseVal;
1503         animVal = other.animVal;
1504         }
1506     /**
1507      *
1508      */
1509     virtual ~SVGAnimatedNumber() {}
1511 protected:
1513     double baseVal, animVal;
1515 };
1521 /*#########################################################################
1522 ## SVGNumberList
1523 #########################################################################*/
1525 /**
1526  *
1527  */
1528 class SVGNumberList
1530 public:
1532     /**
1533      *
1534      */
1535     virtual unsigned long getNumberOfItems()
1536         {
1537         return items.size();
1538         }
1541     /**
1542      *
1543      */
1544     virtual void clear() throw( DOMException )
1545         {
1546         items.clear();
1547         }
1549     /**
1550      *
1551      */
1552     virtual SVGNumber initialize (const SVGNumber &newItem)
1553                     throw( DOMException, SVGException )
1554         {
1555         items.clear();
1556         items.push_back(newItem);
1557         return newItem;
1558         }
1560     /**
1561      *
1562      */
1563     virtual SVGNumber getItem ( unsigned long index )
1564                                   throw( DOMException )
1565         {
1566         if (index>=items.size())
1567             {
1568             SVGNumber num;
1569             return num;
1570             }
1571         return items[index];
1572         }
1574     /**
1575      *
1576      */
1577     virtual SVGNumber insertItemBefore ( const SVGNumber &newItem,
1578                                          unsigned long index )
1579                                          throw( DOMException, SVGException )
1580         {
1581         if (index>=items.size())
1582             {
1583             items.push_back(newItem);
1584             }
1585         else
1586             {
1587             std::vector<SVGNumber>::iterator iter = items.begin() + index;
1588             items.insert(iter, newItem);
1589             }
1590         return newItem;
1591         }
1593     /**
1594      *
1595      */
1596     virtual SVGNumber replaceItem ( const SVGNumber &newItem,
1597                                     unsigned long index )
1598                                     throw( DOMException, SVGException )
1599         {
1600         if (index>=items.size())
1601             {
1602             SVGNumber num;
1603             return num;
1604             }
1605         std::vector<SVGNumber>::iterator iter = items.begin() + index;
1606         *iter = newItem;
1607         return newItem;
1608         }
1610     /**
1611      *
1612      */
1613     virtual SVGNumber removeItem ( unsigned long index )
1614                                   throw( DOMException )
1615         {
1616         if (index>=items.size())
1617             {
1618             SVGNumber num;
1619             return num;
1620             }
1621         std::vector<SVGNumber>::iterator iter = items.begin() + index;
1622         SVGNumber oldval = *iter;
1623         items.erase(iter);
1624         return oldval;
1625         }
1627     /**
1628      *
1629      */
1630     virtual SVGNumber appendItem ( const SVGNumber &newItem )
1631                                    throw( DOMException, SVGException )
1632         {
1633         items.push_back(newItem);
1634         return newItem;
1635         }
1638     //##################
1639     //# Non-API methods
1640     //##################
1642     /**
1643      *
1644      */
1645     SVGNumberList() {}
1647     /**
1648      *
1649      */
1650     SVGNumberList(const SVGNumberList &other)
1651         {
1652         items = other.items;
1653         }
1655     /**
1656      *
1657      */
1658     virtual ~SVGNumberList() {}
1660 protected:
1662     std::vector<SVGNumber>items;
1664 };
1670 /*#########################################################################
1671 ## SVGAnimatedNumberList
1672 #########################################################################*/
1674 /**
1675  *
1676  */
1677 class SVGAnimatedNumberList
1679 public:
1682     /**
1683      *
1684      */
1685     virtual SVGNumberList &getBaseVal()
1686         {
1687         return baseVal;
1688         }
1690     /**
1691      *
1692      */
1693     virtual SVGNumberList &getAnimVal()
1694         {
1695         return animVal;
1696         }
1700     //##################
1701     //# Non-API methods
1702     //##################
1704     /**
1705      *
1706      */
1707     SVGAnimatedNumberList() {}
1709     /**
1710      *
1711      */
1712     SVGAnimatedNumberList(const SVGAnimatedNumberList &other)
1713         {
1714         baseVal = other.baseVal;
1715         animVal = other.animVal;
1716         }
1718     /**
1719      *
1720      */
1721     virtual ~SVGAnimatedNumberList() {}
1723 protected:
1725     SVGNumberList baseVal;
1726     SVGNumberList animVal;
1728 };
1735 /*#########################################################################
1736 ## SVGLength
1737 #########################################################################*/
1739 /**
1740  *
1741  */
1742 class SVGLength
1744 public:
1746     /**
1747      * Length Unit Types
1748      */
1749     typedef enum
1750         {
1751         SVG_LENGTHTYPE_UNKNOWN    = 0,
1752         SVG_LENGTHTYPE_NUMBER     = 1,
1753         SVG_LENGTHTYPE_PERCENTAGE = 2,
1754         SVG_LENGTHTYPE_EMS        = 3,
1755         SVG_LENGTHTYPE_EXS        = 4,
1756         SVG_LENGTHTYPE_PX         = 5,
1757         SVG_LENGTHTYPE_CM         = 6,
1758         SVG_LENGTHTYPE_MM         = 7,
1759         SVG_LENGTHTYPE_IN         = 8,
1760         SVG_LENGTHTYPE_PT         = 9,
1761         SVG_LENGTHTYPE_PC         = 10
1762         } LengthUnitType;
1765     /**
1766      *
1767      */
1768     virtual unsigned short getUnitType( )
1769         {
1770         return unitType;
1771         }
1773     /**
1774      *
1775      */
1776     virtual double getValue( )
1777         {
1778         return value;
1779         }
1781     /**
1782      *
1783      */
1784     virtual void setValue( double val )  throw (DOMException)
1785         {
1786         value = val;
1787         }
1789     /**
1790      *
1791      */
1792     virtual double getValueInSpecifiedUnits( )
1793         {
1794         double result = 0.0;
1795         //fill this in
1796         return result;
1797         }
1799     /**
1800      *
1801      */
1802     virtual void setValueInSpecifiedUnits( double /*val*/ )
1803                                            throw (DOMException)
1804         {
1805         //fill this in
1806         }
1808     /**
1809      *
1810      */
1811     virtual DOMString getValueAsString( )
1812         {
1813         DOMString ret;
1814         char buf[32];
1815         snprintf(buf, 31, "%f", value);
1816         ret.append(buf);
1817         return ret;
1818         }
1820     /**
1821      *
1822      */
1823     virtual void setValueAsString( const DOMString& /*val*/ )
1824                                    throw (DOMException)
1825         {
1826         }
1829     /**
1830      *
1831      */
1832     virtual void newValueSpecifiedUnits ( unsigned short /*unitType*/, double /*val*/ )
1833         {
1834         }
1836     /**
1837      *
1838      */
1839     virtual void convertToSpecifiedUnits ( unsigned short /*unitType*/ )
1840         {
1841         }
1845     //##################
1846     //# Non-API methods
1847     //##################
1849     /**
1850      *
1851      */
1852     SVGLength()
1853         {
1854         unitType = SVG_LENGTHTYPE_UNKNOWN;
1855         value    = 0.0;
1856         }
1859     /**
1860      *
1861      */
1862     SVGLength(const SVGLength &other)
1863         {
1864         unitType  = other.unitType;
1865         value     = other.value;
1866         }
1868     /**
1869      *
1870      */
1871     virtual ~SVGLength() {}
1873 protected:
1875     int unitType;
1877     double value;
1879 };
1886 /*#########################################################################
1887 ## SVGAnimatedLength
1888 #########################################################################*/
1890 /**
1891  *
1892  */
1893 class SVGAnimatedLength
1895 public:
1897     /**
1898      *
1899      */
1900     virtual SVGLength &getBaseVal()
1901         {
1902         return baseVal;
1903         }
1905     /**
1906      *
1907      */
1908     virtual SVGLength &getAnimVal()
1909         {
1910         return animVal;
1911         }
1915     //##################
1916     //# Non-API methods
1917     //##################
1919     /**
1920      *
1921      */
1922     SVGAnimatedLength() {}
1924     /**
1925      *
1926      */
1927     SVGAnimatedLength(const SVGAnimatedLength &other)
1928         {
1929         baseVal = other.baseVal;
1930         animVal = other.animVal;
1931         }
1933     /**
1934      *
1935      */
1936     virtual ~SVGAnimatedLength() {}
1938 protected:
1940     SVGLength baseVal, animVal;
1942 };
1949 /*#########################################################################
1950 ## SVGLengthList
1951 #########################################################################*/
1953 /**
1954  *
1955  */
1956 class SVGLengthList
1958 public:
1960     /**
1961      *
1962      */
1963     virtual unsigned long getNumberOfItems()
1964         {
1965         return items.size();
1966         }
1969     /**
1970      *
1971      */
1972     virtual void clear (  ) throw( DOMException )
1973         {
1974         items.clear();
1975         }
1977     /**
1978      *
1979      */
1980     virtual SVGLength initialize (const SVGLength &newItem )
1981                     throw( DOMException, SVGException )
1982         {
1983         items.clear();
1984         items.push_back(newItem);
1985         return newItem;
1986         }
1988     /**
1989      *
1990      */
1991     virtual SVGLength getItem (unsigned long index)
1992                     throw( DOMException )
1993         {
1994         if (index>=items.size())
1995             {
1996             SVGLength ret;
1997             return ret;
1998             }
1999         return items[index];
2000         }
2002     /**
2003      *
2004      */
2005     virtual SVGLength insertItemBefore (const SVGLength &newItem,
2006                                          unsigned long index )
2007                                    throw( DOMException, SVGException )
2008         {
2009         if (index>=items.size())
2010             {
2011             items.push_back(newItem);
2012             }
2013         else
2014             {
2015             std::vector<SVGLength>::iterator iter = items.begin() + index;
2016             items.insert(iter, newItem);
2017             }
2018         return newItem;
2019         }
2021     /**
2022      *
2023      */
2024     virtual SVGLength replaceItem (const SVGLength &newItem,
2025                                     unsigned long index )
2026                                throw( DOMException, SVGException )
2027         {
2028         if (index>=items.size())
2029             {
2030             SVGLength ret;
2031             return ret;
2032             }
2033         std::vector<SVGLength>::iterator iter = items.begin() + index;
2034         *iter = newItem;
2035         return newItem;
2036         }
2038     /**
2039      *
2040      */
2041     virtual SVGLength removeItem (unsigned long index )
2042                     throw( DOMException )
2043         {
2044         if (index>=items.size())
2045             {
2046             SVGLength ret;
2047             return ret;
2048             }
2049         std::vector<SVGLength>::iterator iter = items.begin() + index;
2050         SVGLength oldval = *iter;
2051         items.erase(iter);
2052         return oldval;
2053         }
2055     /**
2056      *
2057      */
2058     virtual SVGLength appendItem (const SVGLength &newItem )
2059                     throw( DOMException, SVGException )
2060         {
2061         items.push_back(newItem);
2062         return newItem;
2063         }
2066     //##################
2067     //# Non-API methods
2068     //##################
2070     /**
2071      *
2072      */
2073     SVGLengthList() {}
2075     /**
2076      *
2077      */
2078     SVGLengthList(const SVGLengthList &other)
2079         {
2080         items = other.items;
2081         }
2083     /**
2084      *
2085      */
2086     virtual ~SVGLengthList() {}
2088 protected:
2090     std::vector<SVGLength>items;
2092 };
2099 /*#########################################################################
2100 ## SVGAnimatedLengthList
2101 #########################################################################*/
2103 /**
2104  *
2105  */
2106 class SVGAnimatedLengthList
2108 public:
2110     /**
2111      *
2112      */
2113     virtual SVGLengthList &getBaseVal()
2114         {
2115         return baseVal;
2116         }
2118     /**
2119      *
2120      */
2121     virtual SVGLengthList &getAnimVal()
2122         {
2123         return animVal;
2124         }
2128     //##################
2129     //# Non-API methods
2130     //##################
2132     /**
2133      *
2134      */
2135     SVGAnimatedLengthList() {}
2137     /**
2138      *
2139      */
2140    SVGAnimatedLengthList(const SVGAnimatedLengthList &other)
2141         {
2142         baseVal = other.baseVal;
2143         animVal = other.animVal;
2144         }
2146     /**
2147      *
2148      */
2149     virtual ~SVGAnimatedLengthList() {}
2151 protected:
2153     SVGLengthList baseVal, animVal;
2155 };
2162 /*#########################################################################
2163 ## SVGAngle
2164 #########################################################################*/
2166 /**
2167  *
2168  */
2169 class SVGAngle
2171 public:
2173     /**
2174      *  Angle Unit Types
2175      */
2176     typedef enum
2177         {
2178         SVG_ANGLETYPE_UNKNOWN     = 0,
2179         SVG_ANGLETYPE_UNSPECIFIED = 1,
2180         SVG_ANGLETYPE_DEG         = 2,
2181         SVG_ANGLETYPE_RAD         = 3,
2182         SVG_ANGLETYPE_GRAD        = 4
2183         } AngleUnitType;
2187     /**
2188      *
2189      */
2190     virtual unsigned short getUnitType()
2191         {
2192         return unitType;
2193         }
2195     /**
2196      *
2197      */
2198     virtual double getValue()
2199         {
2200         return value;
2201         }
2203     /**
2204      *
2205      */
2206     virtual void setValue(double val) throw (DOMException)
2207         {
2208         value = val;
2209         }
2211     /**
2212      *
2213      */
2214     virtual double getValueInSpecifiedUnits()
2215         {
2216         double result = 0.0;
2217         //convert here
2218         return result;
2219         }
2221     /**
2222      *
2223      */
2224     virtual void setValueInSpecifiedUnits(double /*val*/)
2225                                      throw (DOMException)
2226         {
2227         //do conversion
2228         }
2230     /**
2231      *
2232      */
2233     virtual DOMString getValueAsString()
2234         {
2235         DOMString result;
2236         char buf[32];
2237         snprintf(buf, 31, "%f", value);
2238         result.append(buf);
2239         return result;
2240         }
2242     /**
2243      *
2244      */
2245     virtual void setValueAsString(const DOMString &/*val*/)
2246                                   throw (DOMException)
2247         {
2248         //convert here
2249         }
2252     /**
2253      *
2254      */
2255     virtual void newValueSpecifiedUnits (unsigned short /*unitType*/,
2256                                          double /*valueInSpecifiedUnits*/ )
2257         {
2258         //convert here
2259         }
2261     /**
2262      *
2263      */
2264     virtual void convertToSpecifiedUnits (unsigned short /*unitType*/ )
2265         {
2266         //convert here
2267         }
2271     //##################
2272     //# Non-API methods
2273     //##################
2275     /**
2276      *
2277      */
2278     SVGAngle()
2279         {
2280         unitType = SVG_ANGLETYPE_UNKNOWN;
2281         value    = 0.0;
2282         }
2284     /**
2285      *
2286      */
2287     SVGAngle(const SVGAngle &other)
2288         {
2289         unitType = other.unitType;
2290         value    = other.value;
2291         }
2293     /**
2294      *
2295      */
2296     virtual ~SVGAngle() {}
2298 protected:
2300     int unitType;
2302     double value;
2304 };
2311 /*#########################################################################
2312 ## SVGAnimatedAngle
2313 #########################################################################*/
2315 /**
2316  *
2317  */
2318 class SVGAnimatedAngle
2320 public:
2322     /**
2323      *
2324      */
2325     virtual SVGAngle getBaseVal()
2326         {
2327         return baseVal;
2328         }
2330     /**
2331      *
2332      */
2333     virtual SVGAngle getAnimVal()
2334         {
2335         return animVal;
2336         }
2338     //##################
2339     //# Non-API methods
2340     //##################
2342     /**
2343      *
2344      */
2345     SVGAnimatedAngle() {}
2347     /**
2348      *
2349      */
2350     SVGAnimatedAngle(const SVGAngle &angle)
2351         { baseVal = angle; }
2353     /**
2354      *
2355      */
2356     SVGAnimatedAngle(const SVGAnimatedAngle &other)
2357         {
2358         baseVal = other.baseVal;
2359         animVal = other.animVal;
2360         }
2362     /**
2363      *
2364      */
2365     virtual ~SVGAnimatedAngle() {}
2367 protected:
2369     SVGAngle baseVal, animVal;
2371 };
2378 /*#########################################################################
2379 ## SVGICCColor
2380 #########################################################################*/
2382 /**
2383  *
2384  */
2385 class SVGICCColor
2387 public:
2389     /**
2390      *
2391      */
2392     virtual DOMString getColorProfile()
2393         {
2394         return colorProfile;
2395         }
2397     /**
2398      *
2399      */
2400     virtual void setColorProfile(const DOMString &val) throw (DOMException)
2401         {
2402         colorProfile = val;
2403         }
2405     /**
2406      *
2407      */
2408     virtual SVGNumberList &getColors()
2409         {
2410         return colors;
2411         }
2415     //##################
2416     //# Non-API methods
2417     //##################
2419     /**
2420      *
2421      */
2422     SVGICCColor() {}
2424     /**
2425      *
2426      */
2427     SVGICCColor(const SVGICCColor &other)
2428         {
2429         colorProfile = other.colorProfile;
2430         colors       = other.colors;
2431         }
2433     /**
2434      *
2435      */
2436     virtual ~SVGICCColor() {}
2438 protected:
2440     DOMString colorProfile;
2442     SVGNumberList colors;
2444 };
2447 /*#########################################################################
2448 ## SVGColor
2449 #########################################################################*/
2451 /**
2452  *
2453  */
2454 class SVGColor : virtual public css::CSSValue
2456 public:
2459     /**
2460      * Color Types
2461      */
2462     typedef enum
2463         {
2464         SVG_COLORTYPE_UNKNOWN           = 0,
2465         SVG_COLORTYPE_RGBCOLOR          = 1,
2466         SVG_COLORTYPE_RGBCOLOR_ICCCOLOR = 2,
2467         SVG_COLORTYPE_CURRENTCOLOR      = 3
2468         } ColorType;
2471     /**
2472      *
2473      */
2474     virtual unsigned short getColorType()
2475         {
2476         return colorType;
2477         }
2479     /**
2480      *
2481      */
2482     virtual css::RGBColor getRgbColor()
2483         {
2484         css::RGBColor col;
2485         return col;
2486         }
2488     /**
2489      *
2490      */
2491     virtual SVGICCColor getIccColor()
2492         {
2493         SVGICCColor col;
2494         return col;
2495         }
2498     /**
2499      *
2500      */
2501     virtual void setRGBColor (const DOMString& /*rgbColor*/ )
2502                               throw( SVGException )
2503         {
2504         }
2506     /**
2507      *
2508      */
2509     virtual void setRGBColorICCColor (const DOMString& /*rgbColor*/,
2510                                       const DOMString& /*iccColor*/ )
2511                                       throw( SVGException )
2512         {
2513         }
2515     /**
2516      *
2517      */
2518     virtual void setColor (unsigned short /*colorType*/,
2519                            const DOMString& /*rgbColor*/,
2520                            const DOMString& /*iccColor*/ )
2521                            throw( SVGException )
2522         {
2523         }
2527     //##################
2528     //# Non-API methods
2529     //##################
2531     /**
2532      *
2533      */
2534     SVGColor()
2535         {
2536         colorType = SVG_COLORTYPE_UNKNOWN;
2537         }
2539     /**
2540      *
2541      */
2542     SVGColor(const SVGColor &other) : css::CSSValue(other)
2543         {
2544         colorType = other.colorType;
2545         }
2547     /**
2548      *
2549      */
2550     virtual ~SVGColor() {}
2552 protected:
2554     int colorType;
2556 };
2567 /*#########################################################################
2568 ## SVGRect
2569 #########################################################################*/
2571 /**
2572  *
2573  */
2574 class SVGRect
2576 public:
2578     /**
2579      *
2580      */
2581     virtual double getX()
2582         {
2583         return x;
2584         }
2586     /**
2587      *
2588      */
2589     virtual void setX(double val) throw (DOMException)
2590         {
2591         x = val;
2592         }
2594     /**
2595      *
2596      */
2597     virtual double getY()
2598         {
2599         return y;
2600         }
2602     /**
2603      *
2604      */
2605     virtual void setY(double val) throw (DOMException)
2606         {
2607         y = val;
2608         }
2610     /**
2611      *
2612      */
2613     virtual double getWidth()
2614         {
2615         return width;
2616         }
2618     /**
2619      *
2620      */
2621     virtual void setWidth(double val) throw (DOMException)
2622         {
2623         width = val;
2624         }
2626     /**
2627      *
2628      */
2629     virtual double getHeight()
2630         {
2631         return height;
2632         }
2634     /**
2635      *
2636      */
2637     virtual void setHeight(double val) throw (DOMException)
2638         {
2639         height = val;
2640         }
2643     //##################
2644     //# Non-API methods
2645     //##################
2647     /**
2648      *
2649      */
2650     SVGRect()
2651         {
2652         x = y = width = height = 0.0;
2653         }
2655     /**
2656      *
2657      */
2658     SVGRect(const SVGRect &other)
2659         {
2660         x = other.x;
2661         y = other.y;
2662         width = other.width;
2663         height = other.height;
2664         }
2666     /**
2667      *
2668      */
2669     virtual ~SVGRect() {}
2671 protected:
2673     double x, y, width, height;
2675 };
2682 /*#########################################################################
2683 ## SVGAnimatedRect
2684 #########################################################################*/
2686 /**
2687  *
2688  */
2689 class SVGAnimatedRect
2691 public:
2693     /**
2694      *
2695      */
2696     virtual SVGRect &getBaseVal()
2697         {
2698         return baseVal;
2699         }
2701     /**
2702      *
2703      */
2704     virtual SVGRect &getAnimVal()
2705         {
2706         return animVal;
2707         }
2711     //##################
2712     //# Non-API methods
2713     //##################
2715     /**
2716      *
2717      */
2718     SVGAnimatedRect()
2719         {
2720         }
2722     /**
2723      *
2724      */
2725     SVGAnimatedRect(const SVGAnimatedRect &other)
2726         {
2727         baseVal = other.baseVal;
2728         animVal = other.animVal;
2729         }
2731     /**
2732      *
2733      */
2734     virtual ~SVGAnimatedRect() {}
2736 protected:
2738     SVGRect baseVal, animVal;
2740 };
2744 /*#########################################################################
2745 ## SVGPoint
2746 #########################################################################*/
2748 /**
2749  *
2750  */
2751 class SVGPoint
2753 public:
2757     /**
2758      *
2759      */
2760     virtual double getX()
2761         { return x; }
2763     /**
2764      *
2765      */
2766     virtual void setX(double val) throw (DOMException)
2767         { x = val; }
2769     /**
2770      *
2771      */
2772     virtual double getY()
2773         { return y; }
2775     /**
2776      *
2777      */
2778     virtual void setY(double val) throw (DOMException)
2779         { y = val; }
2781     /**
2782      *
2783      */
2784     virtual SVGPoint matrixTransform(const SVGMatrix &/*matrix*/)
2785         {
2786         SVGPoint point;
2787         return point;
2788         }
2792     //##################
2793     //# Non-API methods
2794     //##################
2796     /**
2797      *
2798      */
2799     SVGPoint()
2800         { x = y = 0; }
2802     /**
2803      *
2804      */
2805     SVGPoint(const SVGPoint &other)
2806         {
2807         x = other.x;
2808         y = other.y;
2809         }
2811     /**
2812      *
2813      */
2814     virtual ~SVGPoint() {}
2816 protected:
2818     double x, y;
2819 };
2826 /*#########################################################################
2827 ## SVGPointList
2828 #########################################################################*/
2830 /**
2831  *
2832  */
2833 class SVGPointList
2835 public:
2837     /**
2838      *
2839      */
2840     virtual unsigned long getNumberOfItems()
2841         { return items.size(); }
2843     /**
2844      *
2845      */
2846     virtual void clear() throw( DOMException )
2847         { items.clear(); }
2849     /**
2850      *
2851      */
2852     virtual SVGPoint initialize(const SVGPoint &newItem)
2853                              throw( DOMException, SVGException )
2854         {
2855         items.clear();
2856         items.push_back(newItem);
2857         return newItem;
2858         }
2860     /**
2861      *
2862      */
2863     virtual SVGPoint getItem(unsigned long index )
2864                              throw( DOMException )
2865         {
2866         if (index >= items.size())
2867             {
2868             SVGPoint point;
2869             return point;
2870             }
2871         return items[index];
2872         }
2874     /**
2875      *
2876      */
2877     virtual SVGPoint insertItemBefore(const SVGPoint &newItem,
2878                                       unsigned long index )
2879                                       throw( DOMException, SVGException )
2880         {
2881         if (index >= items.size())
2882             items.push_back(newItem);
2883         else
2884             {
2885             std::vector<SVGPoint>::iterator iter = items.begin() + index;
2886             items.insert(iter, newItem);
2887             }
2888         return newItem;
2889         }
2891     /**
2892      *
2893      */
2894     virtual SVGPoint replaceItem(const SVGPoint &newItem,
2895                                   unsigned long index )
2896                                   throw( DOMException, SVGException )
2897         {
2898         if (index >= items.size())
2899             {
2900             SVGPoint point;
2901             return point;
2902             }
2903         std::vector<SVGPoint>::iterator iter = items.begin() + index;
2904         *iter = newItem;
2905         return newItem;
2906         }
2908     /**
2909      *
2910      */
2911     virtual SVGPoint removeItem(unsigned long index )
2912                                   throw( DOMException )
2913         {
2914         if (index >= items.size())
2915             {
2916             SVGPoint point;
2917             return point;
2918             }
2919         std::vector<SVGPoint>::iterator iter = items.begin() + index;
2920         SVGPoint oldItem = *iter;
2921         items.erase(iter);
2922         return oldItem;
2923         }
2925     /**
2926      *
2927      */
2928     virtual SVGPoint appendItem(const SVGPoint &newItem)
2929                               throw( DOMException, SVGException )
2930         {
2931         items.push_back(newItem);
2932         return newItem;
2933         }
2936     //##################
2937     //# Non-API methods
2938     //##################
2940     /**
2941      *
2942      */
2943     SVGPointList() {}
2946     /**
2947      *
2948      */
2949     SVGPointList(const SVGPointList &other)
2950         {
2951         items = other.items;
2952         }
2955     /**
2956      *
2957      */
2958     virtual ~SVGPointList() {}
2960 protected:
2962     std::vector<SVGPoint> items;
2964 };
2969 /*#########################################################################
2970 ## SVGUnitTypes
2971 #########################################################################*/
2973 /**
2974  *
2975  */
2976 class SVGUnitTypes
2978 public:
2980     /**
2981      * Unit Types
2982      */
2983     typedef enum
2984         {
2985         SVG_UNIT_TYPE_UNKNOWN           = 0,
2986         SVG_UNIT_TYPE_USERSPACEONUSE    = 1,
2987         SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2
2988         } UnitType;
2992     //##################
2993     //# Non-API methods
2994     //##################
2996     /**
2997      *
2998      */
2999     SVGUnitTypes() {}
3001     /**
3002      *
3003      */
3004     virtual ~SVGUnitTypes() {}
3006 };
3013 /*#########################################################################
3014 ## SVGStylable
3015 #########################################################################*/
3017 /**
3018  *
3019  */
3020 class SVGStylable
3022 public:
3024     /**
3025      *
3026      */
3027     virtual SVGAnimatedString getClassName()
3028         {
3029         return className;
3030         }
3032     /**
3033      *
3034      */
3035     virtual css::CSSStyleDeclaration getStyle()
3036         {
3037         return style;
3038         }
3041     /**
3042      *
3043      */
3044     virtual css::CSSValue getPresentationAttribute (const DOMString& /*name*/ )
3045         {
3046         css::CSSValue val;
3047         //perform a lookup
3048         return val;
3049         }
3052     //##################
3053     //# Non-API methods
3054     //##################
3056     /**
3057      *
3058      */
3059     SVGStylable() {}
3061     /**
3062      *
3063      */
3064     SVGStylable(const SVGStylable &other)
3065         {
3066         className = other.className;
3067         style     = other.style;
3068         }
3070     /**
3071      *
3072      */
3073     virtual ~SVGStylable() {}
3075 protected:
3077     SVGAnimatedString className;
3078     css::CSSStyleDeclaration style;
3080 };
3083 /*#########################################################################
3084 ## SVGLocatable
3085 #########################################################################*/
3087 /**
3088  *
3089  */
3090 class SVGLocatable
3092 public:
3094     /**
3095      *
3096      */
3097     virtual SVGElement *getNearestViewportElement()
3098         {
3099         SVGElement *result = NULL;
3100         return result;
3101         }
3103     /**
3104      *
3105      */
3106     virtual SVGElement *getFarthestViewportElement()
3107         {
3108         SVGElement *result = NULL;
3109         return result;
3110         }
3112     /**
3113      *
3114      */
3115     virtual SVGRect getBBox (  )
3116         {
3117         return bbox;
3118         }
3120     /**
3121      *
3122      */
3123     virtual SVGMatrix getCTM (  )
3124         {
3125         return ctm;
3126         }
3128     /**
3129      *
3130      */
3131     virtual SVGMatrix getScreenCTM (  )
3132         {
3133         return screenCtm;
3134         }
3136     /**
3137      *
3138      */
3139     virtual SVGMatrix getTransformToElement (const SVGElement &/*element*/)
3140                     throw( SVGException )
3141         {
3142         SVGMatrix result;
3143         //do calculations
3144         return result;
3145         }
3149     //##################
3150     //# Non-API methods
3151     //##################
3153     /**
3154      *
3155      */
3156     SVGLocatable() {}
3158     /**
3159      *
3160      */
3161     SVGLocatable(const SVGLocatable &/*other*/)
3162         {
3163         }
3165     /**
3166      *
3167      */
3168     virtual ~SVGLocatable() {}
3170 protected:
3172     SVGRect bbox;
3173     SVGMatrix ctm;
3174     SVGMatrix screenCtm;
3176 };
3183 /*#########################################################################
3184 ## SVGTransformable
3185 #########################################################################*/
3187 /**
3188  *
3189  */
3190 class SVGTransformable : public SVGLocatable
3192 public:
3195     /**
3196      *
3197      */
3198     virtual SVGAnimatedTransformList &getTransform()
3199         {
3200         return transforms;
3201         }
3205     //##################
3206     //# Non-API methods
3207     //##################
3209     /**
3210      *
3211      */
3212     SVGTransformable() {}
3214     /**
3215      *
3216      */
3217     SVGTransformable(const SVGTransformable &other) : SVGLocatable(other)
3218         {
3219         transforms = other.transforms;
3220         }
3222     /**
3223      *
3224      */
3225     virtual ~SVGTransformable() {}
3227 protected:
3229     SVGAnimatedTransformList transforms;
3230 };
3237 /*#########################################################################
3238 ## SVGTests
3239 #########################################################################*/
3241 /**
3242  *
3243  */
3244 class SVGTests
3246 public:
3249     /**
3250      *
3251      */
3252     virtual SVGStringList &getRequiredFeatures()
3253         {
3254         return requiredFeatures;
3255         }
3257     /**
3258      *
3259      */
3260     virtual SVGStringList &getRequiredExtensions()
3261         {
3262         return requiredExtensions;
3263         }
3265     /**
3266      *
3267      */
3268     virtual SVGStringList &getSystemLanguage()
3269         {
3270         return systemLanguage;
3271         }
3274     /**
3275      *
3276      */
3277     virtual bool hasExtension (const DOMString& /*extension*/ )
3278         {
3279         return false;
3280         }
3284     //##################
3285     //# Non-API methods
3286     //##################
3288     /**
3289      *
3290      */
3291     SVGTests() {}
3293     /**
3294      *
3295      */
3296     SVGTests(const SVGTests &other)
3297         {
3298         requiredFeatures   = other.requiredFeatures;
3299         requiredExtensions = other.requiredExtensions;
3300         systemLanguage     = other.systemLanguage;
3301         }
3303     /**
3304      *
3305      */
3306     virtual ~SVGTests() {}
3308 protected:
3310     SVGStringList requiredFeatures;
3311     SVGStringList requiredExtensions;
3312     SVGStringList systemLanguage;
3314 };
3321 /*#########################################################################
3322 ## SVGLangSpace
3323 #########################################################################*/
3325 /**
3326  *
3327  */
3328 class SVGLangSpace
3330 public:
3333     /**
3334      *
3335      */
3336     virtual DOMString getXmllang()
3337         {
3338         return xmlLang;
3339         }
3341     /**
3342      *
3343      */
3344     virtual void setXmllang(const DOMString &val)
3345                                      throw (DOMException)
3346         {
3347         xmlLang = val;
3348         }
3350     /**
3351      *
3352      */
3353     virtual DOMString getXmlspace()
3354         {
3355         return xmlSpace;
3356         }
3358     /**
3359      *
3360      */
3361     virtual void setXmlspace(const DOMString &val)
3362                                      throw (DOMException)
3363         {
3364         xmlSpace = val;
3365         }
3369     //##################
3370     //# Non-API methods
3371     //##################
3373     /**
3374      *
3375      */
3376     SVGLangSpace() {}
3378     /**
3379      *
3380      */
3381     SVGLangSpace(const SVGLangSpace &other)
3382         {
3383         xmlLang  = other.xmlLang;
3384         xmlSpace = other.xmlSpace;
3385         }
3387     /**
3388      *
3389      */
3390     virtual ~SVGLangSpace() {}
3392 protected:
3394     DOMString xmlLang;
3395     DOMString xmlSpace;
3397 };
3404 /*#########################################################################
3405 ## SVGExternalResourcesRequired
3406 #########################################################################*/
3408 /**
3409  *
3410  */
3411 class SVGExternalResourcesRequired
3413 public:
3416     /**
3417      *
3418      */
3419     virtual SVGAnimatedBoolean getExternalResourcesRequired()
3420         { return required; }
3424     //##################
3425     //# Non-API methods
3426     //##################
3428     /**
3429      *
3430      */
3431     SVGExternalResourcesRequired()
3432         {  }
3435     /**
3436      *
3437      */
3438     SVGExternalResourcesRequired(const SVGExternalResourcesRequired &other)
3439         {
3440         required = other.required;
3441         }
3443     /**
3444      *
3445      */
3446     virtual ~SVGExternalResourcesRequired() {}
3448 protected:
3450     SVGAnimatedBoolean required;
3452 };
3459 /*#########################################################################
3460 ## SVGPreserveAspectRatio
3461 #########################################################################*/
3463 /**
3464  *
3465  */
3466 class SVGPreserveAspectRatio
3468 public:
3471     /**
3472      * Alignment Types
3473      */
3474     typedef enum
3475         {
3476         SVG_PRESERVEASPECTRATIO_UNKNOWN  = 0,
3477         SVG_PRESERVEASPECTRATIO_NONE     = 1,
3478         SVG_PRESERVEASPECTRATIO_XMINYMIN = 2,
3479         SVG_PRESERVEASPECTRATIO_XMIDYMIN = 3,
3480         SVG_PRESERVEASPECTRATIO_XMAXYMIN = 4,
3481         SVG_PRESERVEASPECTRATIO_XMINYMID = 5,
3482         SVG_PRESERVEASPECTRATIO_XMIDYMID = 6,
3483         SVG_PRESERVEASPECTRATIO_XMAXYMID = 7,
3484         SVG_PRESERVEASPECTRATIO_XMINYMAX = 8,
3485         SVG_PRESERVEASPECTRATIO_XMIDYMAX = 9,
3486         SVG_PRESERVEASPECTRATIO_XMAXYMAX = 10
3487         } AlignmentType;
3490     /**
3491      * Meet-or-slice Types
3492      */
3493     typedef enum
3494         {
3495         SVG_MEETORSLICE_UNKNOWN  = 0,
3496         SVG_MEETORSLICE_MEET     = 1,
3497         SVG_MEETORSLICE_SLICE    = 2
3498         } MeetOrSliceType;
3501     /**
3502      *
3503      */
3504     virtual unsigned short getAlign()
3505         { return align; }
3507     /**
3508      *
3509      */
3510     virtual void setAlign(unsigned short val) throw (DOMException)
3511         { align = val; }
3513     /**
3514      *
3515      */
3516     virtual unsigned short getMeetOrSlice()
3517         { return meetOrSlice; }
3519     /**
3520      *
3521      */
3522     virtual void setMeetOrSlice(unsigned short val) throw (DOMException)
3523         { meetOrSlice = val; }
3527     //##################
3528     //# Non-API methods
3529     //##################
3531     /**
3532      *
3533      */
3534     SVGPreserveAspectRatio()
3535         {
3536         align       = SVG_PRESERVEASPECTRATIO_UNKNOWN;
3537         meetOrSlice = SVG_MEETORSLICE_UNKNOWN;
3538         }
3540     /**
3541      *
3542      */
3543     SVGPreserveAspectRatio(const SVGPreserveAspectRatio &other)
3544         {
3545         align       = other.align;
3546         meetOrSlice = other.meetOrSlice;
3547         }
3549     /**
3550      *
3551      */
3552     virtual ~SVGPreserveAspectRatio() {}
3554 protected:
3556     unsigned short align;
3557     unsigned short meetOrSlice;
3559 };
3566 /*#########################################################################
3567 ## SVGAnimatedPreserveAspectRatio
3568 #########################################################################*/
3570 /**
3571  *
3572  */
3573 class SVGAnimatedPreserveAspectRatio
3575 public:
3578     /**
3579      *
3580      */
3581     virtual SVGPreserveAspectRatio getBaseVal()
3582         { return baseVal; }
3584     /**
3585      *
3586      */
3587     virtual SVGPreserveAspectRatio getAnimVal()
3588         { return animVal; }
3592     //##################
3593     //# Non-API methods
3594     //##################
3596     /**
3597      *
3598      */
3599     SVGAnimatedPreserveAspectRatio() {}
3601     /**
3602      *
3603      */
3604     SVGAnimatedPreserveAspectRatio(const SVGAnimatedPreserveAspectRatio &other)
3605         {
3606         baseVal = other.baseVal;
3607         baseVal = other.animVal;
3608         }
3610     /**
3611      *
3612      */
3613     virtual ~SVGAnimatedPreserveAspectRatio() {}
3615 protected:
3617     SVGPreserveAspectRatio baseVal;
3618     SVGPreserveAspectRatio animVal;
3620 };
3625 /*#########################################################################
3626 ## SVGFitToViewBox
3627 #########################################################################*/
3629 /**
3630  *
3631  */
3632 class SVGFitToViewBox
3634 public:
3636     /**
3637      *
3638      */
3639     virtual SVGAnimatedRect getViewBox()
3640         { return viewBox; }
3642     /**
3643      *
3644      */
3645     virtual SVGAnimatedPreserveAspectRatio getPreserveAspectRatio()
3646         { return preserveAspectRatio; }
3650     //##################
3651     //# Non-API methods
3652     //##################
3654     /**
3655      *
3656      */
3657     SVGFitToViewBox()
3658         {}
3660     /**
3661      *
3662      */
3664     SVGFitToViewBox(const SVGFitToViewBox &other)
3665         {
3666         viewBox = other.viewBox;
3667         preserveAspectRatio = other.preserveAspectRatio;
3668         }
3670     /**
3671      *
3672      */
3673     virtual ~SVGFitToViewBox() {}
3675 protected:
3677     SVGAnimatedRect viewBox;
3679     SVGAnimatedPreserveAspectRatio preserveAspectRatio;
3681 };
3684 /*#########################################################################
3685 ## SVGZoomAndPan
3686 #########################################################################*/
3688 /**
3689  *
3690  */
3691 class SVGZoomAndPan
3693 public:
3696     /**
3697      * Zoom and Pan Types
3698      */
3699     typedef enum
3700         {
3701         SVG_ZOOMANDPAN_UNKNOWN = 0,
3702         SVG_ZOOMANDPAN_DISABLE = 1,
3703         SVG_ZOOMANDPAN_MAGNIFY = 2
3704         } ZoomAndPanType;
3707     /**
3708      *
3709      */
3710     virtual unsigned short getZoomAndPan()
3711         { return zoomAndPan; }
3713     /**
3714      *
3715      */
3716     virtual void setZoomAndPan(unsigned short val) throw (DOMException)
3717         { zoomAndPan = val; }
3720     //##################
3721     //# Non-API methods
3722     //##################
3724     /**
3725      *
3726      */
3727     SVGZoomAndPan()
3728         { zoomAndPan = SVG_ZOOMANDPAN_UNKNOWN; }
3730     /**
3731      *
3732      */
3733     SVGZoomAndPan(const SVGZoomAndPan &other)
3734         { zoomAndPan = other.zoomAndPan; }
3736     /**
3737      *
3738      */
3739     virtual ~SVGZoomAndPan() {}
3741 protected:
3743     unsigned short zoomAndPan;
3745 };
3752 /*#########################################################################
3753 ## SVGViewSpec
3754 #########################################################################*/
3756 /**
3757  *
3758  */
3759 class SVGViewSpec : public SVGZoomAndPan,
3760                     public SVGFitToViewBox
3762 public:
3764     /**
3765      *
3766      */
3767     virtual SVGTransformList getTransform()
3768         { return transform; }
3770     /**
3771      *
3772      */
3773     virtual SVGElement *getViewTarget()
3774         { return viewTarget; }
3776     /**
3777      *
3778      */
3779     virtual DOMString getViewBoxString()
3780         {
3781         DOMString ret;
3782         return ret;
3783         }
3785     /**
3786      *
3787      */
3788     virtual DOMString getPreserveAspectRatioString()
3789         {
3790         DOMString ret;
3791         return ret;
3792         }
3794     /**
3795      *
3796      */
3797     virtual DOMString getTransformString()
3798         {
3799         DOMString ret;
3800         return ret;
3801         }
3803     /**
3804      *
3805      */
3806     virtual DOMString getViewTargetString()
3807         {
3808         DOMString ret;
3809         return ret;
3810         }
3814     //##################
3815     //# Non-API methods
3816     //##################
3818     /**
3819      *
3820      */
3821     SVGViewSpec()
3822         {
3823         viewTarget = NULL;
3824         }
3826     /**
3827      *
3828      */
3829     SVGViewSpec(const SVGViewSpec &other) : SVGZoomAndPan(other), SVGFitToViewBox(other)
3830         {
3831         viewTarget = other.viewTarget;
3832         transform  = other.transform;
3833         }
3835     /**
3836      *
3837      */
3838     virtual ~SVGViewSpec() {}
3840 protected:
3842     SVGElement *viewTarget;
3843     SVGTransformList transform;
3844 };
3851 /*#########################################################################
3852 ## SVGURIReference
3853 #########################################################################*/
3855 /**
3856  *
3857  */
3858 class SVGURIReference
3860 public:
3862     /**
3863      *
3864      */
3865     virtual SVGAnimatedString getHref()
3866         { return href; }
3870     //##################
3871     //# Non-API methods
3872     //##################
3874     /**
3875      *
3876      */
3877     SVGURIReference() {}
3879     /**
3880      *
3881      */
3882     SVGURIReference(const SVGURIReference &other)
3883         {
3884         href = other.href;
3885         }
3887     /**
3888      *
3889      */
3890     virtual ~SVGURIReference() {}
3892 protected:
3894     SVGAnimatedString href;
3896 };
3903 /*#########################################################################
3904 ## SVGCSSRule
3905 #########################################################################*/
3907 /**
3908  *
3909  */
3910 class SVGCSSRule : public css::CSSRule
3912 public:
3915     /**
3916      * Additional CSS RuleType to support ICC color specifications
3917      */
3918     typedef enum
3919         {
3920         COLOR_PROFILE_RULE = 7
3921         } ColorProfileRuleType;
3923     //##################
3924     //# Non-API methods
3925     //##################
3927     /**
3928      *
3929      */
3930     SVGCSSRule()
3931         { type = COLOR_PROFILE_RULE; }
3933     /**
3934      *
3935      */
3936     SVGCSSRule(const SVGCSSRule &other) : css::CSSRule(other)
3937         { type = COLOR_PROFILE_RULE; }
3939     /**
3940      *
3941      */
3942     virtual ~SVGCSSRule() {}
3944 };
3948 /*#########################################################################
3949 ## SVGRenderingIntent
3950 #########################################################################*/
3952 /**
3953  *
3954  */
3955 class SVGRenderingIntent
3957 public:
3959     /**
3960      * Rendering Intent Types
3961      */
3962     typedef enum
3963         {
3964         RENDERING_INTENT_UNKNOWN               = 0,
3965         RENDERING_INTENT_AUTO                  = 1,
3966         RENDERING_INTENT_PERCEPTUAL            = 2,
3967         RENDERING_INTENT_RELATIVE_COLORIMETRIC = 3,
3968         RENDERING_INTENT_SATURATION            = 4,
3969         RENDERING_INTENT_ABSOLUTE_COLORIMETRIC = 5
3970         } RenderingIntentType;
3974     //##################
3975     //# Non-API methods
3976     //##################
3978     /**
3979      *
3980      */
3981     SVGRenderingIntent()
3982         {
3983         renderingIntentType = RENDERING_INTENT_UNKNOWN;
3984         }
3986     /**
3987      *
3988      */
3989     SVGRenderingIntent(const SVGRenderingIntent &other)
3990         {
3991         renderingIntentType = other.renderingIntentType;
3992         }
3994     /**
3995      *
3996      */
3997     virtual ~SVGRenderingIntent() {}
3999 protected:
4001     unsigned short renderingIntentType;
4002 };
4010 /*#########################################################################
4011 ###########################################################################
4012 ## P A T H    S E G M E N T S
4013 ###########################################################################
4014 #########################################################################*/
4016 static char const *const pathSegLetters[] =
4018     "@", // PATHSEG_UNKNOWN,
4019     "z", // PATHSEG_CLOSEPATH
4020     "M", // PATHSEG_MOVETO_ABS
4021     "m", // PATHSEG_MOVETO_REL,
4022     "L", // PATHSEG_LINETO_ABS
4023     "l", // PATHSEG_LINETO_REL
4024     "C", // PATHSEG_CURVETO_CUBIC_ABS
4025     "c", // PATHSEG_CURVETO_CUBIC_REL
4026     "Q", // PATHSEG_CURVETO_QUADRATIC_ABS,
4027     "q", // PATHSEG_CURVETO_QUADRATIC_REL
4028     "A", // PATHSEG_ARC_ABS
4029     "a", // PATHSEG_ARC_REL,
4030     "H", // PATHSEG_LINETO_HORIZONTAL_ABS,
4031     "h", // PATHSEG_LINETO_HORIZONTAL_REL
4032     "V", // PATHSEG_LINETO_VERTICAL_ABS
4033     "v", // PATHSEG_LINETO_VERTICAL_REL
4034     "S", // PATHSEG_CURVETO_CUBIC_SMOOTH_ABS
4035     "s", // PATHSEG_CURVETO_CUBIC_SMOOTH_REL
4036     "T", // PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS
4037     "t"  // PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL
4038 };
4040 /*#########################################################################
4041 ## SVGPathSeg
4042 #########################################################################*/
4044 /**
4045  *
4046  */
4047 class SVGPathSeg
4049 public:
4053     /**
4054      *  Path Segment Types
4055      */
4056     typedef enum
4057         {
4058         PATHSEG_UNKNOWN                      = 0,
4059         PATHSEG_CLOSEPATH                    = 1,
4060         PATHSEG_MOVETO_ABS                   = 2,
4061         PATHSEG_MOVETO_REL                   = 3,
4062         PATHSEG_LINETO_ABS                   = 4,
4063         PATHSEG_LINETO_REL                   = 5,
4064         PATHSEG_CURVETO_CUBIC_ABS            = 6,
4065         PATHSEG_CURVETO_CUBIC_REL            = 7,
4066         PATHSEG_CURVETO_QUADRATIC_ABS        = 8,
4067         PATHSEG_CURVETO_QUADRATIC_REL        = 9,
4068         PATHSEG_ARC_ABS                      = 10,
4069         PATHSEG_ARC_REL                      = 11,
4070         PATHSEG_LINETO_HORIZONTAL_ABS        = 12,
4071         PATHSEG_LINETO_HORIZONTAL_REL        = 13,
4072         PATHSEG_LINETO_VERTICAL_ABS          = 14,
4073         PATHSEG_LINETO_VERTICAL_REL          = 15,
4074         PATHSEG_CURVETO_CUBIC_SMOOTH_ABS     = 16,
4075         PATHSEG_CURVETO_CUBIC_SMOOTH_REL     = 17,
4076         PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18,
4077         PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19
4078         } PathSegmentType;
4080     /**
4081      *
4082      */
4083     virtual unsigned short getPathSegType()
4084         { return type; }
4086     /**
4087      *
4088      */
4089     virtual DOMString getPathSegTypeAsLetter()
4090         {
4091         int typ = type;
4092         if (typ<0 || typ>PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL)
4093             typ = PATHSEG_UNKNOWN;
4094         char const *ch = pathSegLetters[typ];
4095         DOMString letter = ch;
4096         return letter;
4097         }
4101     //##################
4102     //# Non-API methods
4103     //##################
4105     /**
4106      *
4107      */
4108     SVGPathSeg()
4109         { type = PATHSEG_UNKNOWN; }
4111     /**
4112      *
4113      */
4114     SVGPathSeg(const SVGPathSeg &other)
4115         {
4116         type = other.type;
4117         }
4119     /**
4120      *
4121      */
4122     virtual ~SVGPathSeg() {}
4124 protected:
4126     int type;
4128 };
4135 /*#########################################################################
4136 ## SVGPathSegClosePath
4137 #########################################################################*/
4139 /**
4140  *
4141  */
4142 class SVGPathSegClosePath : public SVGPathSeg
4144 public:
4146     //##################
4147     //# Non-API methods
4148     //##################
4150     /**
4151      *
4152      */
4153     SVGPathSegClosePath()
4154         {
4155         type = PATHSEG_CLOSEPATH;
4156         }
4158     /**
4159      *
4160      */
4161     SVGPathSegClosePath(const SVGPathSegClosePath &other) : SVGPathSeg(other)
4162         {
4163         type = PATHSEG_CLOSEPATH;
4164         }
4166     /**
4167      *
4168      */
4169     virtual ~SVGPathSegClosePath() {}
4171 };
4176 /*#########################################################################
4177 ## SVGPathSegMovetoAbs
4178 #########################################################################*/
4180 /**
4181  *
4182  */
4183 class SVGPathSegMovetoAbs : public SVGPathSeg
4185 public:
4187     /**
4188      *
4189      */
4190     virtual double getX()
4191         { return x; }
4193     /**
4194      *
4195      */
4196     virtual void setX(double val) throw (DOMException)
4197         { x = val; }
4199     /**
4200      *
4201      */
4202     virtual double getY()
4203         { return y; }
4205     /**
4206      *
4207      */
4208     virtual void setY(double val) throw (DOMException)
4209         { y = val; }
4211     //##################
4212     //# Non-API methods
4213     //##################
4215     /**
4216      *
4217      */
4218     SVGPathSegMovetoAbs()
4219         {
4220         type = PATHSEG_MOVETO_ABS;
4221         x = y = 0.0;
4222         }
4224     /**
4225      *
4226      */
4227     SVGPathSegMovetoAbs(double xArg, double yArg)
4228         {
4229         type = PATHSEG_MOVETO_ABS;
4230         x = xArg; y = yArg;
4231         }
4233     /**
4234      *
4235      */
4236     SVGPathSegMovetoAbs(const SVGPathSegMovetoAbs &other) : SVGPathSeg(other)
4237         {
4238         type = PATHSEG_MOVETO_ABS;
4239         x = other.x; y = other.y;
4240         }
4242     /**
4243      *
4244      */
4245     virtual ~SVGPathSegMovetoAbs() {}
4247 protected:
4249     double x,y;
4251 };
4258 /*#########################################################################
4259 ## SVGPathSegMovetoRel
4260 #########################################################################*/
4262 /**
4263  *
4264  */
4265 class SVGPathSegMovetoRel : public SVGPathSeg
4267 public:
4269     /**
4270      *
4271      */
4272     virtual double getX()
4273         { return x; }
4275     /**
4276      *
4277      */
4278     virtual void setX(double val) throw (DOMException)
4279         { x = val; }
4281     /**
4282      *
4283      */
4284     virtual double getY()
4285         { return y; }
4287     /**
4288      *
4289      */
4290     virtual void setY(double val) throw (DOMException)
4291         { y = val; }
4293     //##################
4294     //# Non-API methods
4295     //##################
4297     /**
4298      *
4299      */
4300     SVGPathSegMovetoRel()
4301         {
4302         type = PATHSEG_MOVETO_REL;
4303         x = y = 0.0;
4304         }
4307     /**
4308      *
4309      */
4310     SVGPathSegMovetoRel(double xArg, double yArg)
4311         {
4312         type = PATHSEG_MOVETO_REL;
4313         x = xArg; y = yArg;
4314         }
4316     /**
4317      *
4318      */
4319     SVGPathSegMovetoRel(const SVGPathSegMovetoRel &other) : SVGPathSeg(other)
4320         {
4321         type = PATHSEG_MOVETO_REL;
4322         x = other.x; y = other.y;
4323         }
4325     /**
4326      *
4327      */
4328     virtual ~SVGPathSegMovetoRel() {}
4330 protected:
4332     double x,y;
4333 };
4340 /*#########################################################################
4341 ## SVGPathSegLinetoAbs
4342 #########################################################################*/
4344 /**
4345  *
4346  */
4347 class SVGPathSegLinetoAbs : public SVGPathSeg
4349 public:
4351     /**
4352      *
4353      */
4354     virtual double getX()
4355         { return x; }
4357     /**
4358      *
4359      */
4360     virtual void setX(double val) throw (DOMException)
4361         { x = val; }
4363     /**
4364      *
4365      */
4366     virtual double getY()
4367         { return y; }
4369     /**
4370      *
4371      */
4372     virtual void setY(double val) throw (DOMException)
4373         { y = val; }
4375     //##################
4376     //# Non-API methods
4377     //##################
4379     /**
4380      *
4381      */
4382     SVGPathSegLinetoAbs()
4383         {
4384         type = PATHSEG_LINETO_ABS;
4385         x = y = 0.0;
4386         }
4389     /**
4390      *
4391      */
4392     SVGPathSegLinetoAbs(double xArg, double yArg)
4393         {
4394         type = PATHSEG_LINETO_ABS;
4395         x = xArg; y = yArg;
4396         }
4398     /**
4399      *
4400      */
4401     SVGPathSegLinetoAbs(const SVGPathSegLinetoAbs &other) : SVGPathSeg(other)
4402         {
4403         type = PATHSEG_LINETO_ABS;
4404         x = other.x; y = other.y;
4405         }
4407     /**
4408      *
4409      */
4410     virtual ~SVGPathSegLinetoAbs() {}
4412 protected:
4414     double x,y;
4415 };
4422 /*#########################################################################
4423 ## SVGPathSegLinetoRel
4424 #########################################################################*/
4426 /**
4427  *
4428  */
4429 class SVGPathSegLinetoRel : public SVGPathSeg
4431 public:
4433     /**
4434      *
4435      */
4436     virtual double getX()
4437         { return x; }
4439     /**
4440      *
4441      */
4442     virtual void setX(double val) throw (DOMException)
4443         { x = val; }
4445     /**
4446      *
4447      */
4448     virtual double getY()
4449         { return y; }
4451     /**
4452      *
4453      */
4454     virtual void setY(double val) throw (DOMException)
4455         { y = val; }
4457     //##################
4458     //# Non-API methods
4459     //##################
4461     /**
4462      *
4463      */
4464     SVGPathSegLinetoRel()
4465         {
4466         type = PATHSEG_LINETO_REL;
4467         x = y = 0.0;
4468         }
4471     /**
4472      *
4473      */
4474     SVGPathSegLinetoRel(double xArg, double yArg)
4475         {
4476         type = PATHSEG_LINETO_REL;
4477         x = xArg; y = yArg;
4478         }
4480     /**
4481      *
4482      */
4483     SVGPathSegLinetoRel(const SVGPathSegLinetoRel &other) : SVGPathSeg(other)
4484         {
4485         type = PATHSEG_LINETO_REL;
4486         x = other.x; y = other.y;
4487         }
4489     /**
4490      *
4491      */
4492     virtual ~SVGPathSegLinetoRel() {}
4494 protected:
4496     double x,y;
4497 };
4504 /*#########################################################################
4505 ## SVGPathSegCurvetoCubicAbs
4506 #########################################################################*/
4508 /**
4509  *
4510  */
4511 class SVGPathSegCurvetoCubicAbs : public SVGPathSeg
4513 public:
4515     /**
4516      *
4517      */
4518     virtual double getX()
4519         { return x; }
4521     /**
4522      *
4523      */
4524     virtual void setX(double val) throw (DOMException)
4525         { x = val; }
4527     /**
4528      *
4529      */
4530     virtual double getY()
4531         { return y; }
4533     /**
4534      *
4535      */
4536     virtual void setY(double val) throw (DOMException)
4537         { y = val; }
4539     /**
4540      *
4541      */
4542     virtual double getX1()
4543         { return x1; }
4545     /**
4546      *
4547      */
4548     virtual void setX1(double val) throw (DOMException)
4549         { x1 = val; }
4551     /**
4552      *
4553      */
4554     virtual double getY1()
4555         { return y1; }
4557     /**
4558      *
4559      */
4560     virtual void setY1(double val) throw (DOMException)
4561         { y1 = val; }
4564     /**
4565      *
4566      */
4567     virtual double getX2()
4568         { return x2; }
4570     /**
4571      *
4572      */
4573     virtual void setX2(double val) throw (DOMException)
4574         { x2 = val; }
4576     /**
4577      *
4578      */
4579     virtual double getY2()
4580         { return y2; }
4582     /**
4583      *
4584      */
4585     virtual void setY2(double val) throw (DOMException)
4586         { y2 = val; }
4589     //##################
4590     //# Non-API methods
4591     //##################
4594     /**
4595      *
4596      */
4597     SVGPathSegCurvetoCubicAbs()
4598         {
4599         type = PATHSEG_CURVETO_CUBIC_ABS;
4600         x = y = x1 = y1 = x2 = y2 = 0.0;
4601         }
4603     /**
4604      *
4605      */
4606     SVGPathSegCurvetoCubicAbs(double xArg,  double yArg,
4607                               double x1Arg, double y1Arg,
4608                               double x2Arg, double y2Arg)
4609         {
4610         type = PATHSEG_CURVETO_CUBIC_ABS;
4611         x  = xArg;   y  = yArg;
4612         x1 = x1Arg;  y1 = y1Arg;
4613         x2 = x2Arg;  y2 = y2Arg;
4614         }
4616     /**
4617      *
4618      */
4619     SVGPathSegCurvetoCubicAbs(const SVGPathSegCurvetoCubicAbs &other)
4620                      : SVGPathSeg(other)
4621         {
4622         type = PATHSEG_CURVETO_CUBIC_ABS;
4623         x  = other.x;  y  = other.y;
4624         x1 = other.x1; y1 = other.y1;
4625         x2 = other.x2; y2 = other.y2;
4626         }
4628     /**
4629      *
4630      */
4631     virtual ~SVGPathSegCurvetoCubicAbs() {}
4633 protected:
4635     double x, y, x1, y1, x2, y2;
4637 };
4644 /*#########################################################################
4645 ## SVGPathSegCurvetoCubicRel
4646 #########################################################################*/
4648 /**
4649  *
4650  */
4651 class SVGPathSegCurvetoCubicRel : public SVGPathSeg
4653 public:
4655     /**
4656      *
4657      */
4658     virtual double getX()
4659         { return x; }
4661     /**
4662      *
4663      */
4664     virtual void setX(double val) throw (DOMException)
4665         { x = val; }
4667     /**
4668      *
4669      */
4670     virtual double getY()
4671         { return y; }
4673     /**
4674      *
4675      */
4676     virtual void setY(double val) throw (DOMException)
4677         { y = val; }
4679     /**
4680      *
4681      */
4682     virtual double getX1()
4683         { return x1; }
4685     /**
4686      *
4687      */
4688     virtual void setX1(double val) throw (DOMException)
4689         { x1 = val; }
4691     /**
4692      *
4693      */
4694     virtual double getY1()
4695         { return y1; }
4697     /**
4698      *
4699      */
4700     virtual void setY1(double val) throw (DOMException)
4701         { y1 = val; }
4704     /**
4705      *
4706      */
4707     virtual double getX2()
4708         { return x2; }
4710     /**
4711      *
4712      */
4713     virtual void setX2(double val) throw (DOMException)
4714         { x2 = val; }
4716     /**
4717      *
4718      */
4719     virtual double getY2()
4720         { return y2; }
4722     /**
4723      *
4724      */
4725     virtual void setY2(double val) throw (DOMException)
4726         { y2 = val; }
4729     //##################
4730     //# Non-API methods
4731     //##################
4734     /**
4735      *
4736      */
4737     SVGPathSegCurvetoCubicRel()
4738         {
4739         type = PATHSEG_CURVETO_CUBIC_REL;
4740         x = y = x1 = y1 = x2 = y2 = 0.0;
4741         }
4744     /**
4745      *
4746      */
4747     SVGPathSegCurvetoCubicRel(double xArg,  double yArg,
4748                               double x1Arg, double y1Arg,
4749                               double x2Arg, double y2Arg)
4750         {
4751         type = PATHSEG_CURVETO_CUBIC_REL;
4752         x  = xArg;   y  = yArg;
4753         x1 = x1Arg;  y1 = y1Arg;
4754         x2 = x2Arg;  y2 = y2Arg;
4755         }
4757     /**
4758      *
4759      */
4760     SVGPathSegCurvetoCubicRel(const SVGPathSegCurvetoCubicRel &other)
4761                      : SVGPathSeg(other)
4762         {
4763         type = PATHSEG_CURVETO_CUBIC_REL;
4764         x  = other.x;  y  = other.y;
4765         x1 = other.x1; y1 = other.y1;
4766         x2 = other.x2; y2 = other.y2;
4767         }
4769     /**
4770      *
4771      */
4772     virtual ~SVGPathSegCurvetoCubicRel() {}
4774 protected:
4776     double x, y, x1, y1, x2, y2;
4778 };
4785 /*#########################################################################
4786 ## SVGPathSegCurvetoQuadraticAbs
4787 #########################################################################*/
4789 /**
4790  *
4791  */
4792 class SVGPathSegCurvetoQuadraticAbs : public SVGPathSeg
4794 public:
4796     /**
4797      *
4798      */
4799     virtual double getX()
4800         { return x; }
4802     /**
4803      *
4804      */
4805     virtual void setX(double val) throw (DOMException)
4806         { x = val; }
4808     /**
4809      *
4810      */
4811     virtual double getY()
4812         { return y; }
4814     /**
4815      *
4816      */
4817     virtual void setY(double val) throw (DOMException)
4818         { y = val; }
4820     /**
4821      *
4822      */
4823     virtual double getX1()
4824         { return x1; }
4826     /**
4827      *
4828      */
4829     virtual void setX1(double val) throw (DOMException)
4830         { x1 = val; }
4832     /**
4833      *
4834      */
4835     virtual double getY1()
4836         { return y1; }
4838     /**
4839      *
4840      */
4841     virtual void setY1(double val) throw (DOMException)
4842         { y1 = val; }
4845     //##################
4846     //# Non-API methods
4847     //##################
4850     /**
4851      *
4852      */
4853     SVGPathSegCurvetoQuadraticAbs()
4854         {
4855         type = PATHSEG_CURVETO_QUADRATIC_ABS;
4856         x = y = x1 = y1 = 0.0;
4857         }
4859     /**
4860      *
4861      */
4862     SVGPathSegCurvetoQuadraticAbs(double xArg,  double yArg,
4863                               double x1Arg, double y1Arg)
4864         {
4865         type = PATHSEG_CURVETO_QUADRATIC_ABS;
4866         x  = xArg;   y  = yArg;
4867         x1 = x1Arg;  y1 = y1Arg;
4868         }
4870     /**
4871      *
4872      */
4873     SVGPathSegCurvetoQuadraticAbs(const SVGPathSegCurvetoQuadraticAbs &other)
4874                      : SVGPathSeg(other)
4875         {
4876         type = PATHSEG_CURVETO_QUADRATIC_ABS;
4877         x  = other.x;  y  = other.y;
4878         x1 = other.x1; y1 = other.y1;
4879         }
4881     /**
4882      *
4883      */
4884     virtual ~SVGPathSegCurvetoQuadraticAbs() {}
4886 protected:
4888     double x, y, x1, y1;
4890 };
4897 /*#########################################################################
4898 ## SVGPathSegCurvetoQuadraticRel
4899 #########################################################################*/
4901 /**
4902  *
4903  */
4904 class SVGPathSegCurvetoQuadraticRel : public SVGPathSeg
4906 public:
4908     /**
4909      *
4910      */
4911     virtual double getX()
4912         { return x; }
4914     /**
4915      *
4916      */
4917     virtual void setX(double val) throw (DOMException)
4918         { x = val; }
4920     /**
4921      *
4922      */
4923     virtual double getY()
4924         { return y; }
4926     /**
4927      *
4928      */
4929     virtual void setY(double val) throw (DOMException)
4930         { y = val; }
4932     /**
4933      *
4934      */
4935     virtual double getX1()
4936         { return x1; }
4938     /**
4939      *
4940      */
4941     virtual void setX1(double val) throw (DOMException)
4942         { x1 = val; }
4944     /**
4945      *
4946      */
4947     virtual double getY1()
4948         { return y1; }
4950     /**
4951      *
4952      */
4953     virtual void setY1(double val) throw (DOMException)
4954         { y1 = val; }
4957     //##################
4958     //# Non-API methods
4959     //##################
4962     /**
4963      *
4964      */
4965     SVGPathSegCurvetoQuadraticRel()
4966         {
4967         type = PATHSEG_CURVETO_QUADRATIC_REL;
4968         x = y = x1 = y1 = 0.0;
4969         }
4972     /**
4973      *
4974      */
4975     SVGPathSegCurvetoQuadraticRel(double xArg,  double yArg,
4976                                   double x1Arg, double y1Arg)
4977         {
4978         type = PATHSEG_CURVETO_QUADRATIC_REL;
4979         x  = xArg;   y  = yArg;
4980         x1 = x1Arg;  y1 = y1Arg;
4981         }
4983     /**
4984      *
4985      */
4986     SVGPathSegCurvetoQuadraticRel(const SVGPathSegCurvetoQuadraticRel &other)
4987                      : SVGPathSeg(other)
4988         {
4989         type = PATHSEG_CURVETO_QUADRATIC_REL;
4990         x  = other.x;  y  = other.y;
4991         x1 = other.x1; y1 = other.y1;
4992         }
4994     /**
4995      *
4996      */
4997     virtual ~SVGPathSegCurvetoQuadraticRel() {}
4999 protected:
5001     double x, y, x1, y1;
5003 };
5010 /*#########################################################################
5011 ## SVGPathSegArcAbs
5012 #########################################################################*/
5014 /**
5015  *
5016  */
5017 class SVGPathSegArcAbs : public SVGPathSeg
5019 public:
5021     /**
5022      *
5023      */
5024     virtual double getX()
5025         { return x; }
5027     /**
5028      *
5029      */
5030     virtual void setX(double val) throw (DOMException)
5031         { x = val; }
5033     /**
5034      *
5035      */
5036     virtual double getY()
5037         { return y; }
5039     /**
5040      *
5041      */
5042     virtual void setY(double val) throw (DOMException)
5043         { y = val; }
5045     /**
5046      *
5047      */
5048     virtual double getR1()
5049         { return r1; }
5051     /**
5052      *
5053      */
5054     virtual void setR1(double val) throw (DOMException)
5055         { r1 = val; }
5057     /**
5058      *
5059      */
5060     virtual double getR2()
5061         { return r2; }
5063     /**
5064      *
5065      */
5066     virtual void setR2(double val) throw (DOMException)
5067         { r2 = val; }
5069     /**
5070      *
5071      */
5072     virtual double getAngle()
5073         { return angle; }
5075     /**
5076      *
5077      */
5078     virtual void setAngle(double val) throw (DOMException)
5079         { angle = val; }
5081     /**
5082      *
5083      */
5084     virtual bool getLargeArcFlag()
5085         { return largeArcFlag; }
5087     /**
5088      *
5089      */
5090     virtual void setLargeArcFlag(bool val) throw (DOMException)
5091         { largeArcFlag = val; }
5093     /**
5094      *
5095      */
5096     virtual bool getSweepFlag()
5097         { return sweepFlag; }
5099     /**
5100      *
5101      */
5102     virtual void setSweepFlag(bool val) throw (DOMException)
5103         { sweepFlag = val; }
5105     //##################
5106     //# Non-API methods
5107     //##################
5110     /**
5111      *
5112      */
5113     SVGPathSegArcAbs()
5114         {
5115         type = PATHSEG_ARC_ABS;
5116         x = y = r1 = r2 = angle = 0.0;
5117         largeArcFlag = sweepFlag = false;
5118         }
5120     /**
5121      *
5122      */
5123     SVGPathSegArcAbs(double xArg,  double yArg,
5124                      double r1Arg, double r2Arg,
5125                      double angleArg,
5126                      bool largeArcFlagArg,
5127                      bool sweepFlagArg )
5129         {
5130         type = PATHSEG_ARC_ABS;
5131         x  = xArg;   y  = yArg;
5132         r1 = r1Arg;  r2 = r2Arg;
5133         angle        = angleArg;
5134         largeArcFlag = largeArcFlagArg;
5135         sweepFlag    = sweepFlagArg;
5136         }
5138     /**
5139      *
5140      */
5141     SVGPathSegArcAbs(const SVGPathSegArcAbs &other)
5142                      : SVGPathSeg(other)
5143         {
5144         type = PATHSEG_ARC_ABS;
5145         x  = other.x;  y  = other.y;
5146         r1 = other.r1; r2 = other.r2;
5147         angle        = other.angle;
5148         largeArcFlag = other.largeArcFlag;
5149         sweepFlag    = other.sweepFlag;
5150         }
5152     /**
5153      *
5154      */
5155     virtual ~SVGPathSegArcAbs() {}
5157 protected:
5159     double x, y, r1, r2, angle;
5160     bool largeArcFlag;
5161     bool sweepFlag;
5163 };
5167 /*#########################################################################
5168 ## SVGPathSegArcRel
5169 #########################################################################*/
5171 /**
5172  *
5173  */
5174 class SVGPathSegArcRel : public SVGPathSeg
5176 public:
5178     /**
5179      *
5180      */
5181     virtual double getX()
5182         { return x; }
5184     /**
5185      *
5186      */
5187     virtual void setX(double val) throw (DOMException)
5188         { x = val; }
5190     /**
5191      *
5192      */
5193     virtual double getY()
5194         { return y; }
5196     /**
5197      *
5198      */
5199     virtual void setY(double val) throw (DOMException)
5200         { y = val; }
5202     /**
5203      *
5204      */
5205     virtual double getR1()
5206         { return r1; }
5208     /**
5209      *
5210      */
5211     virtual void setR1(double val) throw (DOMException)
5212         { r1 = val; }
5214     /**
5215      *
5216      */
5217     virtual double getR2()
5218         { return r2; }
5220     /**
5221      *
5222      */
5223     virtual void setR2(double val) throw (DOMException)
5224         { r2 = val; }
5226     /**
5227      *
5228      */
5229     virtual double getAngle()
5230         { return angle; }
5232     /**
5233      *
5234      */
5235     virtual void setAngle(double val) throw (DOMException)
5236         { angle = val; }
5238     /**
5239      *
5240      */
5241     virtual bool getLargeArcFlag()
5242         { return largeArcFlag; }
5244     /**
5245      *
5246      */
5247     virtual void setLargeArcFlag(bool val) throw (DOMException)
5248         { largeArcFlag = val; }
5250     /**
5251      *
5252      */
5253     virtual bool getSweepFlag()
5254         { return sweepFlag; }
5256     /**
5257      *
5258      */
5259     virtual void setSweepFlag(bool val) throw (DOMException)
5260         { sweepFlag = val; }
5262     //##################
5263     //# Non-API methods
5264     //##################
5267     /**
5268      *
5269      */
5270     SVGPathSegArcRel()
5271         {
5272         type = PATHSEG_ARC_REL;
5273         x = y = r1 = r2 = angle = 0.0;
5274         largeArcFlag = sweepFlag = false;
5275         }
5278     /**
5279      *
5280      */
5281     SVGPathSegArcRel(double xArg, double yArg,
5282                      double r1Arg, double r2Arg,
5283                      double angleArg,
5284                      bool largeArcFlagArg,
5285                      bool sweepFlagArg )
5287         {
5288         type = PATHSEG_ARC_REL;
5289         x  = xArg;   y  = yArg;
5290         r1 = r1Arg;  r2 = r2Arg;
5291         angle        = angleArg;
5292         largeArcFlag = largeArcFlagArg;
5293         sweepFlag    = sweepFlagArg;
5294         }
5296     /**
5297      *
5298      */
5299     SVGPathSegArcRel(const SVGPathSegArcRel &other)
5300                      : SVGPathSeg(other)
5301         {
5302         type = PATHSEG_ARC_REL;
5303         x  = other.x;  y  = other.y;
5304         r1 = other.r1; r2 = other.r2;
5305         angle        = other.angle;
5306         largeArcFlag = other.largeArcFlag;
5307         sweepFlag    = other.sweepFlag;
5308         }
5310     /**
5311      *
5312      */
5313     virtual ~SVGPathSegArcRel() {}
5315 protected:
5317     double x, y, r1, r2, angle;
5318     bool largeArcFlag;
5319     bool sweepFlag;
5321 };
5328 /*#########################################################################
5329 ## SVGPathSegLinetoHorizontalAbs
5330 #########################################################################*/
5332 /**
5333  *
5334  */
5335 class SVGPathSegLinetoHorizontalAbs : public SVGPathSeg
5337 public:
5339     /**
5340      *
5341      */
5342     virtual double getX()
5343         { return x; }
5345     /**
5346      *
5347      */
5348     virtual void setX(double val) throw (DOMException)
5349         { x = val; }
5351     //##################
5352     //# Non-API methods
5353     //##################
5355     /**
5356      *
5357      */
5358     SVGPathSegLinetoHorizontalAbs()
5359         {
5360         type = PATHSEG_LINETO_HORIZONTAL_ABS;
5361         x = 0.0;
5362         }
5365     /**
5366      *
5367      */
5368     SVGPathSegLinetoHorizontalAbs(double xArg)
5369         {
5370         type = PATHSEG_LINETO_HORIZONTAL_ABS;
5371         x = xArg;
5372         }
5374     /**
5375      *
5376      */
5377     SVGPathSegLinetoHorizontalAbs(const SVGPathSegLinetoHorizontalAbs &other)
5378                      : SVGPathSeg(other)
5379         {
5380         type = PATHSEG_LINETO_HORIZONTAL_ABS;
5381         x = other.x;
5382         }
5384     /**
5385      *
5386      */
5387     virtual ~SVGPathSegLinetoHorizontalAbs() {}
5389 protected:
5391     double x;
5393 };
5400 /*#########################################################################
5401 ## SVGPathSegLinetoHorizontalRel
5402 #########################################################################*/
5404 /**
5405  *
5406  */
5407 class SVGPathSegLinetoHorizontalRel : public SVGPathSeg
5409 public:
5411     /**
5412      *
5413      */
5414     virtual double getX()
5415         { return x; }
5417     /**
5418      *
5419      */
5420     virtual void setX(double val) throw (DOMException)
5421         { x = val; }
5423     //##################
5424     //# Non-API methods
5425     //##################
5427     /**
5428      *
5429      */
5430     SVGPathSegLinetoHorizontalRel()
5431         {
5432         type = PATHSEG_LINETO_HORIZONTAL_REL;
5433         x = 0.0;
5434         }
5437     /**
5438      *
5439      */
5440     SVGPathSegLinetoHorizontalRel(double xArg)
5441         {
5442         type = PATHSEG_LINETO_HORIZONTAL_REL;
5443         x = xArg;
5444         }
5446     /**
5447      *
5448      */
5449     SVGPathSegLinetoHorizontalRel(const SVGPathSegLinetoHorizontalRel &other)
5450                      : SVGPathSeg(other)
5451         {
5452         type = PATHSEG_LINETO_HORIZONTAL_REL;
5453         x = other.x;
5454         }
5456     /**
5457      *
5458      */
5459     virtual ~SVGPathSegLinetoHorizontalRel() {}
5461 protected:
5463     double x;
5465 };
5469 /*#########################################################################
5470 ## SVGPathSegLinetoVerticalAbs
5471 #########################################################################*/
5473 /**
5474  *
5475  */
5476 class SVGPathSegLinetoVerticalAbs : public SVGPathSeg
5478 public:
5480     /**
5481      *
5482      */
5483     virtual double getY()
5484         { return y; }
5486     /**
5487      *
5488      */
5489     virtual void setY(double val) throw (DOMException)
5490         { y = val; }
5492     //##################
5493     //# Non-API methods
5494     //##################
5496     /**
5497      *
5498      */
5499     SVGPathSegLinetoVerticalAbs()
5500         {
5501         type = PATHSEG_LINETO_VERTICAL_ABS;
5502         y = 0.0;
5503         }
5506     /**
5507      *
5508      */
5509     SVGPathSegLinetoVerticalAbs(double yArg)
5510         {
5511         type = PATHSEG_LINETO_VERTICAL_ABS;
5512         y = yArg;
5513         }
5515     /**
5516      *
5517      */
5518     SVGPathSegLinetoVerticalAbs(const SVGPathSegLinetoVerticalAbs &other)
5519                      : SVGPathSeg(other)
5520         {
5521         type = PATHSEG_LINETO_VERTICAL_ABS;
5522         y = other.y;
5523         }
5525     /**
5526      *
5527      */
5528     virtual ~SVGPathSegLinetoVerticalAbs() {}
5530 protected:
5532     double y;
5534 };
5538 /*#########################################################################
5539 ## SVGPathSegLinetoVerticalRel
5540 #########################################################################*/
5542 /**
5543  *
5544  */
5545 class SVGPathSegLinetoVerticalRel : public SVGPathSeg
5547 public:
5549     /**
5550      *
5551      */
5552     virtual double getY()
5553         { return y; }
5555     /**
5556      *
5557      */
5558     virtual void setY(double val) throw (DOMException)
5559         { y = val; }
5561     //##################
5562     //# Non-API methods
5563     //##################
5565     /**
5566      *
5567      */
5568     SVGPathSegLinetoVerticalRel()
5569         {
5570         type = PATHSEG_LINETO_VERTICAL_REL;
5571         y = 0.0;
5572         }
5575     /**
5576      *
5577      */
5578     SVGPathSegLinetoVerticalRel(double yArg)
5579         {
5580         type = PATHSEG_LINETO_VERTICAL_REL;
5581         y = yArg;
5582         }
5584     /**
5585      *
5586      */
5587     SVGPathSegLinetoVerticalRel(const SVGPathSegLinetoVerticalRel &other)
5588                      : SVGPathSeg(other)
5589         {
5590         type = PATHSEG_LINETO_VERTICAL_REL;
5591         y = other.y;
5592         }
5594     /**
5595      *
5596      */
5597     virtual ~SVGPathSegLinetoVerticalRel() {}
5599 protected:
5601     double y;
5603 };
5610 /*#########################################################################
5611 ## SVGPathSegCurvetoCubicSmoothAbs
5612 #########################################################################*/
5614 /**
5615  *
5616  */
5617 class SVGPathSegCurvetoCubicSmoothAbs : public SVGPathSeg
5619 public:
5621     /**
5622      *
5623      */
5624     virtual double getX()
5625         { return x; }
5627     /**
5628      *
5629      */
5630     virtual void setX(double val) throw (DOMException)
5631         { x = val; }
5633     /**
5634      *
5635      */
5636     virtual double getY()
5637         { return y; }
5639     /**
5640      *
5641      */
5642     virtual void setY(double val) throw (DOMException)
5643         { y = val; }
5645     /**
5646      *
5647      */
5648     virtual double getX2()
5649         { return x2; }
5651     /**
5652      *
5653      */
5654     virtual void setX2(double val) throw (DOMException)
5655         { x2 = val; }
5657     /**
5658      *
5659      */
5660     virtual double getY2()
5661         { return y2; }
5663     /**
5664      *
5665      */
5666     virtual void setY2(double val) throw (DOMException)
5667         { y2 = val; }
5670     //##################
5671     //# Non-API methods
5672     //##################
5674     /**
5675      *
5676      */
5677     SVGPathSegCurvetoCubicSmoothAbs()
5678         {
5679         type = PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;
5680         x = y = x2 = y2 = 0.0;
5681         }
5684     /**
5685      *
5686      */
5687     SVGPathSegCurvetoCubicSmoothAbs(double xArg,   double yArg,
5688                                     double x2Arg, double y2Arg)
5689         {
5690         type = PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;
5691         x  = xArg;    y  = yArg;
5692         x2 = x2Arg;   y2 = y2Arg;
5693         }
5695     /**
5696      *
5697      */
5698     SVGPathSegCurvetoCubicSmoothAbs(const SVGPathSegCurvetoCubicSmoothAbs &other)
5699                      : SVGPathSeg(other)
5700         {
5701         type = PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;
5702         x  = other.x;  y  = other.y;
5703         x2 = other.x2; y2 = other.y2;
5704         }
5706     /**
5707      *
5708      */
5709     virtual ~SVGPathSegCurvetoCubicSmoothAbs() {}
5711 protected:
5713     double x, y, x2, y2;
5715 };
5719 /*#########################################################################
5720 ## SVGPathSegCurvetoCubicSmoothRel
5721 #########################################################################*/
5723 /**
5724  *
5725  */
5726 class SVGPathSegCurvetoCubicSmoothRel : public SVGPathSeg
5728 public:
5730     /**
5731      *
5732      */
5733     virtual double getX()
5734         { return x; }
5736     /**
5737      *
5738      */
5739     virtual void setX(double val) throw (DOMException)
5740         { x = val; }
5742     /**
5743      *
5744      */
5745     virtual double getY()
5746         { return y; }
5748     /**
5749      *
5750      */
5751     virtual void setY(double val) throw (DOMException)
5752         { y = val; }
5754     /**
5755      *
5756      */
5757     virtual double getX2()
5758         { return x2; }
5760     /**
5761      *
5762      */
5763     virtual void setX2(double val) throw (DOMException)
5764         { x2 = val; }
5766     /**
5767      *
5768      */
5769     virtual double getY2()
5770         { return y2; }
5772     /**
5773      *
5774      */
5775     virtual void setY2(double val) throw (DOMException)
5776         { y2 = val; }
5779     //##################
5780     //# Non-API methods
5781     //##################
5783     /**
5784      *
5785      */
5786     SVGPathSegCurvetoCubicSmoothRel()
5787         {
5788         type = PATHSEG_CURVETO_CUBIC_SMOOTH_REL;
5789         x = y = x2 = y2 = 0.0;
5790         }
5793     /**
5794      *
5795      */
5796     SVGPathSegCurvetoCubicSmoothRel(double xArg,   double yArg,
5797                                     double x2Arg, double y2Arg)
5798         {
5799         type = PATHSEG_CURVETO_CUBIC_SMOOTH_REL;
5800         x  = xArg;    y  = yArg;
5801         x2 = x2Arg;   y2 = y2Arg;
5802         }
5804     /**
5805      *
5806      */
5807     SVGPathSegCurvetoCubicSmoothRel(const SVGPathSegCurvetoCubicSmoothRel &other)
5808                      : SVGPathSeg(other)
5809         {
5810         type = PATHSEG_CURVETO_CUBIC_SMOOTH_REL;
5811         x  = other.x;  y  = other.y;
5812         x2 = other.x2; y2 = other.y2;
5813         }
5815     /**
5816      *
5817      */
5818     virtual ~SVGPathSegCurvetoCubicSmoothRel() {}
5820 protected:
5822     double x, y, x2, y2;
5824 };
5831 /*#########################################################################
5832 ## SVGPathSegCurvetoQuadraticSmoothAbs
5833 #########################################################################*/
5835 /**
5836  *
5837  */
5838 class SVGPathSegCurvetoQuadraticSmoothAbs : public SVGPathSeg
5840 public:
5842     /**
5843      *
5844      */
5845     virtual double getX()
5846         { return x; }
5848     /**
5849      *
5850      */
5851     virtual void setX(double val) throw (DOMException)
5852         { x = val; }
5854     /**
5855      *
5856      */
5857     virtual double getY()
5858         { return y; }
5860     /**
5861      *
5862      */
5863     virtual void setY(double val) throw (DOMException)
5864         { y = val; }
5868     //##################
5869     //# Non-API methods
5870     //##################
5872     /**
5873      *
5874      */
5875     SVGPathSegCurvetoQuadraticSmoothAbs()
5876         {
5877         type = PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;
5878         x = y = 0.0;
5879         }
5882     /**
5883      *
5884      */
5885     SVGPathSegCurvetoQuadraticSmoothAbs(double xArg, double yArg)
5886         {
5887         type = PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;
5888         x = xArg;     y = yArg;
5889         }
5891     /**
5892      *
5893      */
5894     SVGPathSegCurvetoQuadraticSmoothAbs(const SVGPathSegCurvetoQuadraticSmoothAbs &other)
5895                      : SVGPathSeg(other)
5896         {
5897         type = PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;
5898         x = y = 0.0;
5899         }
5901     /**
5902      *
5903      */
5904     virtual ~SVGPathSegCurvetoQuadraticSmoothAbs() {}
5906 protected:
5908     double x, y;
5910 };
5917 /*#########################################################################
5918 ## SVGPathSegCurvetoQuadraticSmoothRel
5919 #########################################################################*/
5921 /**
5922  *
5923  */
5924 class SVGPathSegCurvetoQuadraticSmoothRel : public SVGPathSeg
5926 public:
5928     /**
5929      *
5930      */
5931     virtual double getX()
5932         { return x; }
5934     /**
5935      *
5936      */
5937     virtual void setX(double val) throw (DOMException)
5938         { x = val; }
5940     /**
5941      *
5942      */
5943     virtual double getY()
5944         { return y; }
5946     /**
5947      *
5948      */
5949     virtual void setY(double val) throw (DOMException)
5950         { y = val; }
5954     //##################
5955     //# Non-API methods
5956     //##################
5958     /**
5959      *
5960      */
5961     SVGPathSegCurvetoQuadraticSmoothRel()
5962         {
5963         type = PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;
5964         x = y = 0.0;
5965         }
5968     /**
5969      *
5970      */
5971     SVGPathSegCurvetoQuadraticSmoothRel(double xArg, double yArg)
5972         {
5973         type = PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;
5974         x = xArg;     y = yArg;
5975         }
5977     /**
5978      *
5979      */
5980     SVGPathSegCurvetoQuadraticSmoothRel(const SVGPathSegCurvetoQuadraticSmoothRel &other)
5981                      : SVGPathSeg(other)
5982         {
5983         type = PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;
5984         x = y = 0.0;
5985         }
5987     /**
5988      *
5989      */
5990     virtual ~SVGPathSegCurvetoQuadraticSmoothRel() {}
5992 protected:
5994     double x, y;
5996 };
6003 /*#########################################################################
6004 ## SVGPathSegList
6005 #########################################################################*/
6007 /**
6008  *
6009  */
6010 class SVGPathSegList
6012 public:
6014     /**
6015      *
6016      */
6017     virtual unsigned long getNumberOfItems()
6018         { return items.size(); }
6021     /**
6022      *
6023      */
6024     virtual void clear () throw( DOMException )
6025         { items.clear(); }
6027     /**
6028      *
6029      */
6030     virtual SVGPathSeg initialize (const SVGPathSeg &newItem)
6031                     throw( DOMException, SVGException )
6032         {
6033         items.clear();
6034         items.push_back(newItem);
6035         return newItem;
6036         }
6038     /**
6039      *
6040      */
6041     virtual SVGPathSeg getItem (unsigned long index)
6042                     throw( DOMException )
6043         {
6044         if (index >= items.size())
6045             {
6046             SVGPathSeg seg;
6047             return seg;
6048             }
6049         return items[index];
6050         }
6052     /**
6053      *
6054      */
6055     virtual SVGPathSeg insertItemBefore(const SVGPathSeg &newItem,
6056                                         unsigned long index )
6057                           throw( DOMException, SVGException )
6058         {
6059         if (index >= items.size())
6060             items.push_back(newItem);
6061         else
6062             {
6063             std::vector<SVGPathSeg>::iterator iter = items.begin() + index;
6064             items.insert(iter, newItem);
6065             }
6066         return newItem;
6067         }
6069     /**
6070      *
6071      */
6072     virtual SVGPathSeg replaceItem(const SVGPathSeg &newItem,
6073                                    unsigned long index )
6074                               throw( DOMException, SVGException )
6075         {
6076         if (index >= items.size())
6077             {
6078             SVGPathSeg seg;
6079             return seg;
6080             }
6081         std::vector<SVGPathSeg>::iterator iter = items.begin() + index;
6082         *iter = newItem;
6083         return newItem;
6084         }
6086     /**
6087      *
6088      */
6089     virtual SVGPathSeg removeItem (unsigned long index)
6090                                   throw (DOMException)
6091         {
6092         if (index >= items.size())
6093             {
6094             SVGPathSeg seg;
6095             return seg;
6096             }
6097         std::vector<SVGPathSeg>::iterator iter = items.begin() + index;
6098         SVGPathSeg olditem = *iter;
6099         items.erase(iter);
6100         return olditem;
6101         }
6103     /**
6104      *
6105      */
6106     virtual SVGPathSeg appendItem (const SVGPathSeg &newItem)
6107                     throw( DOMException, SVGException )
6108         {
6109         items.push_back(newItem);
6110         return newItem;
6111         }
6115     //##################
6116     //# Non-API methods
6117     //##################
6119     /**
6120      *
6121      */
6122     SVGPathSegList() {}
6125     /**
6126      *
6127      */
6128     SVGPathSegList(const SVGPathSegList &other)
6129         {
6130         items = other.items;
6131         }
6134     /**
6135      *
6136      */
6137     virtual ~SVGPathSegList() {}
6139 protected:
6141     std::vector<SVGPathSeg> items;
6143 };
6150 /*#########################################################################
6151 ## SVGAnimatedPathData
6152 #########################################################################*/
6154 /**
6155  *
6156  */
6157 class SVGAnimatedPathData
6159 public:
6161     /**
6162      *
6163      */
6164     virtual SVGPathSegList getPathSegList()
6165         {
6166         SVGPathSegList list;
6167         return list;
6168         }
6170     /**
6171      *
6172      */
6173     virtual SVGPathSegList getNormalizedPathSegList()
6174         {
6175         SVGPathSegList list;
6176         return list;
6177         }
6179     /**
6180      *
6181      */
6182     virtual SVGPathSegList getAnimatedPathSegList()
6183         {
6184         SVGPathSegList list;
6185         return list;
6186         }
6188     /**
6189      *
6190      */
6191     virtual SVGPathSegList getAnimatedNormalizedPathSegList()
6192         {
6193         SVGPathSegList list;
6194         return list;
6195         }
6199     //##################
6200     //# Non-API methods
6201     //##################
6203     /**
6204      *
6205      */
6206    SVGAnimatedPathData()
6207         {}
6209     /**
6210      *
6211      */
6212    SVGAnimatedPathData(const SVGAnimatedPathData &/*other*/)
6213         {
6214         }
6216     /**
6217      *
6218      */
6219     virtual ~SVGAnimatedPathData() {}
6221 };
6228 /*#########################################################################
6229 ## SVGAnimatedPoints
6230 #########################################################################*/
6232 /**
6233  *
6234  */
6235 class SVGAnimatedPoints
6237 public:
6239     /**
6240      *
6241      */
6242     virtual SVGPointList getPoints()
6243         { return points; }
6245     /**
6246      *
6247      */
6248     virtual SVGPointList getAnimatedPoints()
6249         { return animatedPoints; }
6253     //##################
6254     //# Non-API methods
6255     //##################
6257     /**
6258      *
6259      */
6260     SVGAnimatedPoints() {}
6262     /**
6263      *
6264      */
6265     SVGAnimatedPoints(const SVGAnimatedPoints &other)
6266         {
6267         points         = other.points;
6268         animatedPoints = other.animatedPoints;
6269         }
6271     /**
6272      *
6273      */
6274     virtual ~SVGAnimatedPoints() {}
6276 protected:
6278     SVGPointList points;
6279     SVGPointList animatedPoints;
6281 };
6287 /*#########################################################################
6288 ## SVGPaint
6289 #########################################################################*/
6291 /**
6292  *
6293  */
6294 class SVGPaint : public SVGColor
6296 public:
6299     /**
6300      * Paint Types
6301      */
6302     typedef enum
6303         {
6304         SVG_PAINTTYPE_UNKNOWN               = 0,
6305         SVG_PAINTTYPE_RGBCOLOR              = 1,
6306         SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR     = 2,
6307         SVG_PAINTTYPE_NONE                  = 101,
6308         SVG_PAINTTYPE_CURRENTCOLOR          = 102,
6309         SVG_PAINTTYPE_URI_NONE              = 103,
6310         SVG_PAINTTYPE_URI_CURRENTCOLOR      = 104,
6311         SVG_PAINTTYPE_URI_RGBCOLOR          = 105,
6312         SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR = 106,
6313         SVG_PAINTTYPE_URI                   = 107
6314         } PaintType;
6317     /**
6318      *
6319      */
6320     virtual unsigned short getPaintType()
6321         { return paintType; }
6323     /**
6324      *
6325      */
6326     virtual DOMString getUri()
6327         { return uri; }
6329     /**
6330      *
6331      */
6332     virtual void setUri (const DOMString& uriArg )
6333         { uri = uriArg; }
6335     /**
6336      *
6337      */
6338     virtual void setPaint (unsigned short paintTypeArg,
6339                            const DOMString& uriArg,
6340                            const DOMString& /*rgbColor*/,
6341                            const DOMString& /*iccColor*/ )
6342                            throw( SVGException )
6343         {
6344         paintType = paintTypeArg;
6345         uri       = uriArg;
6346         //do something with rgbColor
6347         //do something with iccColor;
6348         }
6352     //##################
6353     //# Non-API methods
6354     //##################
6356     /**
6357      *
6358      */
6359     SVGPaint()
6360         {
6361         uri       = "";
6362         paintType = SVG_PAINTTYPE_UNKNOWN;
6363         }
6365     /**
6366      *
6367      */
6368     SVGPaint(const SVGPaint &other) : css::CSSValue(other), SVGColor(other)
6369         {
6370         uri       = "";
6371         paintType = SVG_PAINTTYPE_UNKNOWN;
6372         }
6374     /**
6375      *
6376      */
6377     virtual ~SVGPaint() {}
6379 protected:
6381     unsigned int paintType;
6382     DOMString uri;
6384 };
6389 /*#########################################################################
6390 ## SVGColorProfileRule
6391 #########################################################################*/
6393 /**
6394  *
6395  */
6396 class SVGColorProfileRule : public SVGCSSRule,
6397                             public SVGRenderingIntent
6400 public:
6401    /**
6402      *
6403      */
6404     virtual DOMString getSrc()
6405         { return src; }
6407     /**
6408      *
6409      */
6410     virtual void setSrc(const DOMString &val) throw (DOMException)
6411         { src = val; }
6413     /**
6414      *
6415      */
6416     virtual DOMString getName()
6417         { return name; }
6419     /**
6420      *
6421      */
6422     virtual void setName(const DOMString &val) throw (DOMException)
6423         { name = val; }
6425     /**
6426      *
6427      */
6428     virtual unsigned short getRenderingIntent()
6429         { return renderingIntent; }
6431     /**
6432      *
6433      */
6434     virtual void setRenderingIntent(unsigned short val) throw (DOMException)
6435         { renderingIntent = val; }
6438     //##################
6439     //# Non-API methods
6440     //##################
6442     /**
6443      *
6444      */
6445     SVGColorProfileRule() {}
6447     /**
6448      *
6449      */
6450     SVGColorProfileRule(const SVGColorProfileRule &other)
6451                : SVGCSSRule(other), SVGRenderingIntent(other)
6452         {
6453         renderingIntent = other.renderingIntent;
6454         src             = other.src;
6455         name            = other.name;
6456         }
6458     /**
6459      *
6460      */
6461     virtual ~SVGColorProfileRule() {}
6463 protected:
6465     unsigned short renderingIntent;
6466     DOMString src;
6467     DOMString name;
6469 };
6473 /*#########################################################################
6474 ## SVGFilterPrimitiveStandardAttributes
6475 #########################################################################*/
6477 /**
6478  *
6479  */
6480 class SVGFilterPrimitiveStandardAttributes : public SVGStylable
6482 public:
6486     /**
6487      *
6488      */
6489     virtual SVGAnimatedLength getX()
6490         { return x; }
6492     /**
6493      *
6494      */
6495     virtual SVGAnimatedLength getY()
6496         { return y; }
6498     /**
6499      *
6500      */
6501     virtual SVGAnimatedLength getWidth()
6502         { return width; }
6504     /**
6505      *
6506      */
6507     virtual SVGAnimatedLength getHeight()
6508         { return height; }
6510     /**
6511      *
6512      */
6513     virtual SVGAnimatedString getResult()
6514         { return result; }
6518     //##################
6519     //# Non-API methods
6520     //##################
6523     /**
6524      *
6525      */
6526     SVGFilterPrimitiveStandardAttributes()
6527         {}
6529     /**
6530      *
6531      */
6532     SVGFilterPrimitiveStandardAttributes(const SVGFilterPrimitiveStandardAttributes &other)
6533                                  : SVGStylable(other)
6534         {
6535         x      = other.x;
6536         y      = other.y;
6537         width  = other.width;
6538         height = other.height;
6539         result = other.result;
6540         }
6542     /**
6543      *
6544      */
6545     virtual ~SVGFilterPrimitiveStandardAttributes() {}
6547 protected:
6549     SVGAnimatedLength x;
6550     SVGAnimatedLength y;
6551     SVGAnimatedLength width;
6552     SVGAnimatedLength height;
6553     SVGAnimatedString result;
6555 };
6567 /*#########################################################################
6568 ## SVGEvent
6569 #########################################################################*/
6571 /**
6572  *
6573  */
6574 class SVGEvent : events::Event
6576 public:
6578     //##################
6579     //# Non-API methods
6580     //##################
6582     /**
6583      *
6584      */
6585     SVGEvent() {}
6587     /**
6588      *
6589      */
6590     SVGEvent(const SVGEvent &other) : events::Event(other)
6591         {}
6593     /**
6594      *
6595      */
6596     virtual ~SVGEvent() {}
6598 };
6603 /*#########################################################################
6604 ## SVGZoomEvent
6605 #########################################################################*/
6607 /**
6608  *
6609  */
6610 class SVGZoomEvent : events::UIEvent
6612 public:
6614     /**
6615      *
6616      */
6617     virtual SVGRect getZoomRectScreen()
6618         { return zoomRectScreen; }
6620     /**
6621      *
6622      */
6623     virtual double getPreviousScale()
6624         { return previousScale; }
6626     /**
6627      *
6628      */
6629     virtual SVGPoint getPreviousTranslate()
6630         { return previousTranslate; }
6632     /**
6633      *
6634      */
6635     virtual double getNewScale()
6636         { return newScale; }
6638    /**
6639      *
6640      */
6641     virtual SVGPoint getNewTranslate()
6642         { return newTranslate; }
6646     //##################
6647     //# Non-API methods
6648     //##################
6650     /**
6651      *
6652      */
6653     SVGZoomEvent()
6654         {}
6656     /**
6657      *
6658      */
6659     SVGZoomEvent(const SVGZoomEvent &other) : events::Event(other),
6660                                               events::UIEvent(other)
6661         {
6662         zoomRectScreen    = other.zoomRectScreen;
6663         previousScale     = other.previousScale;
6664         previousTranslate = other.previousTranslate;
6665         newScale          = other.newScale;
6666         newTranslate      = other.newTranslate;
6667         }
6669     /**
6670      *
6671      */
6672     virtual ~SVGZoomEvent() {}
6674 protected:
6676     SVGRect  zoomRectScreen;
6677     double   previousScale;
6678     SVGPoint previousTranslate;
6679     double   newScale;
6680     SVGPoint newTranslate;
6682 };
6686 /*#########################################################################
6687 ## SVGElementInstance
6688 #########################################################################*/
6690 /**
6691  *
6692  */
6693 class SVGElementInstance : public events::EventTarget
6695 public:
6697     /**
6698      *
6699      */
6700     virtual SVGElement *getCorrespondingElement()
6701         { return correspondingElement; }
6703     /**
6704      *
6705      */
6706     virtual SVGUseElement *getCorrespondingUseElement()
6707         { return correspondingUseElement; }
6709     /**
6710      *
6711      */
6712     virtual SVGElementInstance getParentNode()
6713         {
6714         SVGElementInstance ret;
6715         return ret;
6716         }
6718     /**
6719      *  Since we are using stack types and this is a circular definition,
6720      *  we will instead implement this as a global function below:
6721      *   SVGElementInstanceList getChildNodes(const SVGElementInstance instance);
6722      */
6723     //virtual SVGElementInstanceList getChildNodes();
6725     /**
6726      *
6727      */
6728     virtual SVGElementInstance getFirstChild()
6729         {
6730         SVGElementInstance ret;
6731         return ret;
6732         }
6734     /**
6735      *
6736      */
6737     virtual SVGElementInstance getLastChild()
6738         {
6739         SVGElementInstance ret;
6740         return ret;
6741         }
6743     /**
6744      *
6745      */
6746     virtual SVGElementInstance getPreviousSibling()
6747         {
6748         SVGElementInstance ret;
6749         return ret;
6750         }
6752     /**
6753      *
6754      */
6755     virtual SVGElementInstance getNextSibling()
6756         {
6757         SVGElementInstance ret;
6758         return ret;
6759         }
6762     //##################
6763     //# Non-API methods
6764     //##################
6766     /**
6767      *
6768      */
6769     SVGElementInstance() {}
6771     /**
6772      *
6773      */
6774     SVGElementInstance(const SVGElementInstance &other)
6775                         : events::EventTarget(other)
6776         {
6777         }
6779     /**
6780      *
6781      */
6782     virtual ~SVGElementInstance() {}
6784 protected:
6786     SVGElement    *correspondingElement;
6787     SVGUseElement *correspondingUseElement;
6789 };
6796 /*#########################################################################
6797 ## SVGElementInstanceList
6798 #########################################################################*/
6800 /**
6801  *
6802  */
6803 class SVGElementInstanceList
6805 public:
6808     /**
6809      *
6810      */
6811     virtual unsigned long getLength()
6812         { return items.size(); }
6814     /**
6815      *
6816      */
6817     virtual SVGElementInstance item (unsigned long index )
6818         {
6819         if (index >= items.size())
6820             {
6821             SVGElementInstance ret;
6822             return ret;
6823             }
6824         return items[index];
6825         }
6827     /**
6828      *  This static method replaces the circular definition of:
6829      *        SVGElementInstanceList SVGElementInstance::getChildNodes()
6830      *
6831      */
6832     static SVGElementInstanceList getChildNodes(const SVGElementInstance &/*instance*/)
6833         {
6834         SVGElementInstanceList list;
6835         return list;
6836         }
6839     //##################
6840     //# Non-API methods
6841     //##################
6843     /**
6844      *
6845      */
6846     SVGElementInstanceList() {}
6848     /**
6849      *
6850      */
6851     SVGElementInstanceList(const SVGElementInstanceList &other)
6852         {
6853         items = other.items;
6854         }
6856     /**
6857      *
6858      */
6859     virtual ~SVGElementInstanceList() {}
6861 protected:
6863     std::vector<SVGElementInstance> items;
6866 };
6880 }  //namespace svg
6881 }  //namespace dom
6882 }  //namespace w3c
6883 }  //namespace org
6885 #endif /* __SVGTYPES_H__ */
6886 /*#########################################################################
6887 ## E N D    O F    F I L E
6888 #########################################################################*/