Code

9b3d1caf6192c139ddc610ede5863d0154e0726d
[inkscape.git] / src / dom / 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-2008 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  *  
32  * =======================================================================
33  * NOTES
34  * 
35  * This API follows:
36  * http://www.w3.org/TR/SVG11/svgdom.html
37  * 
38  * This file contains the definitions of the non-Node SVG classes.  DOM Nodes
39  * for SVG are defined in svg.h.
40  *          
41  */
44 // For access to DOM2 core
45 #include "dom/dom.h"
47 // For access to DOM2 events
48 #include "dom/events.h"
50 // For access to those parts from DOM2 CSS OM used by SVG DOM.
51 #include "dom/css.h"
53 // For access to those parts from DOM2 Views OM used by SVG DOM.
54 #include "dom/views.h"
56 // For access to the SMIL OM used by SVG DOM.
57 #include "dom/smil.h"
60 #include <math.h>
64 namespace org {
65 namespace w3c {
66 namespace dom {
67 namespace svg {
72 //local definitions
73 typedef dom::DOMString DOMString;
74 typedef dom::DOMException DOMException;
75 typedef dom::Element Element;
76 typedef dom::Document Document;
77 typedef dom::NodeList NodeList;
80 class SVGElement;
81 typedef Ptr<SVGElement> SVGElementPtr;
82 class SVGUseElement;
83 typedef Ptr<SVGUseElement> SVGUseElementPtr;
84 class SVGAnimatedPreserveAspectRatio;
87 /*#########################################################################
88 ## SVGException
89 #########################################################################*/
91 /**
92  *
93  */
94 class SVGException
95 {
96 public:
97     // unsigned short   code;  //inherited
98 };
100     /**
101      * SVGExceptionCode
102      */
103     typedef enum
104         {
105         SVG_WRONG_TYPE_ERR           = 0,
106         SVG_INVALID_VALUE_ERR        = 1,
107         SVG_MATRIX_NOT_INVERTABLE    = 2
108         } SVGExceptionCode;
114 /*#########################################################################
115 ## SVGMatrix
116 #########################################################################*/
118 /**
119  *  In SVG, a Matrix is defined like this:
120  *
121  * | a  c  e |
122  * | b  d  f |
123  * | 0  0  1 |
124  *
125  */
126 class SVGMatrix
128 public:
131     /**
132      *
133      */
134     virtual double getA()
135         { return a; }
137     /**
138      *
139      */
140     virtual void setA(double val) throw (DOMException)
141         { a = val; }
143     /**
144      *
145      */
146     virtual double getB()
147         { return b; }
149     /**
150      *
151      */
152     virtual void setB(double val) throw (DOMException)
153         { b = val; }
155     /**
156      *
157      */
158     virtual double getC()
159         { return c; }
161     /**
162      *
163      */
164     virtual void setC(double val) throw (DOMException)
165         { c = val; }
167     /**
168      *
169      */
170     virtual double getD()
171         { return d; }
173     /**
174      *
175      */
176     virtual void setD(double val) throw (DOMException)
177         { d = val; }
178     /**
179      *
180      */
181     virtual double getE()
182         { return e; }
184     /**
185      *
186      */
187     virtual void setE(double val) throw (DOMException)
188         { e = val; }
189     /**
190      *
191      */
192     virtual double getF()
193         { return f; }
195     /**
196      *
197      */
198     virtual void setF(double val) throw (DOMException)
199         { f = val; }
202     /**
203      * Return the result of postmultiplying this matrix with another.
204      */
205     virtual SVGMatrix multiply(const SVGMatrix &other)
206         {
207         SVGMatrix result;
208         result.a = a * other.a  +  c * other.b;
209         result.b = b * other.a  +  d * other.b;
210         result.c = a * other.c  +  c * other.d;
211         result.d = b * other.c  +  d * other.d;
212         result.e = a * other.e  +  c * other.f  +  e;
213         result.f = b * other.e  +  d * other.f  +  f;
214         return result;
215         }
217     /**
218      *  Calculate the inverse of this matrix
219      *
220      */
221     virtual SVGMatrix inverse(  ) throw( SVGException )
222         {
223         /*###########################################
224         The determinant of a 3x3 matrix E
225            (let's use our own notation for a bit)
227             A  B  C
228             D  E  F
229             G  H  I
230         is
231             AEI - AFH - BDI + BFG + CDH - CEG
233         Since in our affine transforms, G and H==0 and I==1,
234         this reduces to:
235             AE - BD
236         In SVG's naming scheme, that is:  a * d - c * b .  SIMPLE!
238         In a similar method of attack, SVG's adjunct matrix is:
240            d  -c   cf-ed
241           -b   a   eb-af
242            0   0   ad-cb
244         To get the inverse matrix, we divide the adjunct matrix by
245         the determinant.  Notice that (ad-cb)/(ad-cb)==1.  Very cool.
246         So what we end up with is this:
248            a =  d/(ad-cb)  c = -c/(ad-cb)   e = (cf-ed)/(ad-cb)
249            b = -b/(ad-cb)  d =  a/(ad-cb)   f = (eb-af)/(ad-cb)
251         (Since this would be in all SVG-DOM implementations,
252          somebody needed to document this!  ^^ )
253         #############################################*/
255         SVGMatrix result;
256         double determinant = a * d  -  c * b;
257         if (determinant < 1.0e-18)//invertible?
258             {
259             result.identity();//cop out
260             return result;
261             }
263         double idet = 1.0 / determinant;
264         result.a =   d * idet;
265         result.b =  -b * idet;
266         result.c =  -c * idet;
267         result.d =   a * idet;
268         result.e =  (c*f - e*d) * idet;
269         result.f =  (e*b - a*f) * idet;
270         return result;
271         }
273     /**
274      * Equivalent to multiplying by:
275      *  | 1  0  x |
276      *  | 0  1  y |
277      *  | 0  0  1 |
278      *
279      */
280     virtual SVGMatrix translate(double x, double y )
281         {
282         SVGMatrix result;
283         result.a = a;
284         result.b = b;
285         result.c = c;
286         result.d = d;
287         result.e = a * x  +  c * y  +  e;
288         result.f = b * x  +  d * y  +  f;
289         return result;
290         }
292     /**
293      * Equivalent to multiplying by:
294      *  | scale  0      0 |
295      *  | 0      scale  0 |
296      *  | 0      0      1 |
297      *
298      */
299     virtual SVGMatrix scale(double scale)
300         {
301         SVGMatrix result;
302         result.a = a * scale;
303         result.b = b * scale;
304         result.c = c * scale;
305         result.d = d * scale;
306         result.e = e;
307         result.f = f;
308         return result;
309         }
311     /**
312      * Equivalent to multiplying by:
313      *  | scaleX  0       0 |
314      *  | 0       scaleY  0 |
315      *  | 0       0       1 |
316      *
317      */
318     virtual SVGMatrix scaleNonUniform(double scaleX,
319                                       double scaleY )
320         {
321         SVGMatrix result;
322         result.a = a * scaleX;
323         result.b = b * scaleX;
324         result.c = c * scaleY;
325         result.d = d * scaleY;
326         result.e = e;
327         result.f = f;
328         return result;
329         }
331     /**
332      * Equivalent to multiplying by:
333      *  | cos(a) -sin(a)   0 |
334      *  | sin(a)  cos(a)   0 |
335      *  | 0       0        1 |
336      *
337      */
338     virtual SVGMatrix rotate (double angle)
339         {
340         double sina  = sin(angle);
341         double msina = -sina;
342         double cosa  = cos(angle);
343         SVGMatrix result;
344         result.a = a * cosa   +  c * sina;
345         result.b = b * cosa   +  d + sina;
346         result.c = a * msina  +  c * cosa;
347         result.d = b * msina  +  d * cosa;
348         result.e = e;
349         result.f = f;
350         return result;
351         }
353     /**
354      * Equivalent to multiplying by:
355      *  | cos(a) -sin(a)   0 |
356      *  | sin(a)  cos(a)   0 |
357      *  | 0       0        1 |
358      *  In this case, angle 'a' is computed as the artangent
359      *  of the slope y/x .  It is negative if the slope is negative.
360      */
361     virtual SVGMatrix rotateFromVector(double x, double y)
362                                       throw( SVGException )
363         {
364         double angle = atan(y / x);
365         if (y < 0.0)
366             angle = -angle;
367         SVGMatrix result;
368         double sina  = sin(angle);
369         double msina = -sina;
370         double cosa  = cos(angle);
371         result.a = a * cosa   +  c * sina;
372         result.b = b * cosa   +  d + sina;
373         result.c = a * msina  +  c * cosa;
374         result.d = b * msina  +  d * cosa;
375         result.e = e;
376         result.f = f;
377         return result;
378         }
380     /**
381      * Equivalent to multiplying by:
382      *  | -1   0   0 |
383      *  | 0    1   0 |
384      *  | 0    0   1 |
385      *
386      */
387     virtual SVGMatrix flipX(  )
388         {
389         SVGMatrix result;
390         result.a = -a;
391         result.b = -b;
392         result.c =  c;
393         result.d =  d;
394         result.e =  e;
395         result.f =  f;
396         return result;
397         }
399     /**
400      * Equivalent to multiplying by:
401      *  | 1   0   0 |
402      *  | 0  -1   0 |
403      *  | 0   0   1 |
404      *
405      */
406     virtual SVGMatrix flipY( )
407         {
408         SVGMatrix result;
409         result.a =  a;
410         result.b =  b;
411         result.c = -c;
412         result.d = -d;
413         result.e =  e;
414         result.f =  f;
415         return result;
416         }
418     /**
419      *  | 1   tan(a)  0 |
420      *  | 0   1       0 |
421      *  | 0   0       1 |
422      *
423      */
424     virtual SVGMatrix skewX(double angle)
425         {
426         double tana = tan(angle);
427         SVGMatrix result;
428         result.a =  a;
429         result.b =  b;
430         result.c =  a * tana + c;
431         result.d =  b * tana + d;
432         result.e =  e;
433         result.f =  f;
434         return result;
435         }
437     /**
438      * Equivalent to multiplying by:
439      *  | 1       0   0 |
440      *  | tan(a)  1   0 |
441      *  | 0       0   1 |
442      *
443      */
444     virtual SVGMatrix skewY(double angle)
445         {
446         double tana = tan(angle);
447         SVGMatrix result;
448         result.a =  a + c * tana;
449         result.b =  b + d * tana;
450         result.c =  c;
451         result.d =  d;
452         result.e =  e;
453         result.f =  f;
454         return result;
455         }
459     //##################
460     //# Non-API methods
461     //##################
463     /**
464      *
465      */
466     SVGMatrix()
467         {
468         identity();
469         }
471     /**
472      *
473      */
474     SVGMatrix(double aArg, double bArg, double cArg,
475               double dArg, double eArg, double fArg )
476         {
477         a = aArg; b = bArg; c = cArg;
478         d = dArg; e = eArg; f = fArg;
479         }
481     /**
482      * Copy constructor
483      */
484     SVGMatrix(const SVGMatrix &other)
485         {
486         a = other.a;
487         b = other.b;
488         c = other.c;
489         d = other.d;
490         e = other.e;
491         f = other.f;
492         }
496     /**
497      *
498      */
499     virtual ~SVGMatrix() {}
501 protected:
503 friend class SVGTransform;
505     /*
506      * Set to the identify matrix
507      */
508    void identity()
509        {
510        a = 1.0;
511        b = 0.0;
512        c = 0.0;
513        d = 1.0;
514        e = 0.0;
515        f = 0.0;
516        }
518     double a, b, c, d, e, f;
520 };
523 /*#########################################################################
524 ## SVGTransform
525 #########################################################################*/
527 /**
528  *
529  */
530 class SVGTransform
532 public:
534     /**
535      * Transform Types
536      */
537     typedef enum
538         {
539         SVG_TRANSFORM_UNKNOWN   = 0,
540         SVG_TRANSFORM_MATRIX    = 1,
541         SVG_TRANSFORM_TRANSLATE = 2,
542         SVG_TRANSFORM_SCALE     = 3,
543         SVG_TRANSFORM_ROTATE    = 4,
544         SVG_TRANSFORM_SKEWX     = 5,
545         SVG_TRANSFORM_SKEWY     = 6,
546         } TransformType;
548     /**
549      *
550      */
551     virtual unsigned short getType()
552         { return type; }
555     /**
556      *
557      */
558     virtual SVGMatrix getMatrix()
559         {
560         return matrix;
561         }
563     /**
564      *
565      */
566     virtual double getAngle()
567         {
568         return angle;
569         }
572     /**
573      *
574      */
575     virtual void setMatrix(const SVGMatrix &matrixArg)
576         {
577         type = SVG_TRANSFORM_MATRIX;
578         matrix = matrixArg;
579         }
581     /**
582      *
583      */
584     virtual void setTranslate (double tx, double ty )
585         {
586         type = SVG_TRANSFORM_TRANSLATE;
587         matrix.setA(1.0);
588         matrix.setB(0.0);
589         matrix.setC(0.0);
590         matrix.setD(1.0);
591         matrix.setE(tx);
592         matrix.setF(ty);
593         }
595     /**
596      *
597      */
598     virtual void setScale (double sx, double sy )
599         {
600         type = SVG_TRANSFORM_SCALE;
601         matrix.setA(sx);
602         matrix.setB(0.0);
603         matrix.setC(0.0);
604         matrix.setD(sy);
605         matrix.setE(0.0);
606         matrix.setF(0.0);
607         }
609     /**
610      *
611      */
612     virtual void setRotate (double angleArg, double cx, double cy)
613         {
614         angle = angleArg;
615         setTranslate(cx, cy);
616         type = SVG_TRANSFORM_ROTATE;
617         matrix.rotate(angle);
618         }
620     /**
621      *
622      */
623     virtual void setSkewX (double angleArg)
624         {
625         angle = angleArg;
626         type = SVG_TRANSFORM_SKEWX;
627         matrix.identity();
628         matrix.skewX(angle);
629         }
631     /**
632      *
633      */
634     virtual void setSkewY (double angleArg)
635         {
636         angle = angleArg;
637         type = SVG_TRANSFORM_SKEWY;
638         matrix.identity();
639         matrix.skewY(angle);
640         }
643     //##################
644     //# Non-API methods
645     //##################
647     /**
648      *
649      */
650     SVGTransform()
651         {
652         type = SVG_TRANSFORM_UNKNOWN;
653         angle = 0.0;
654         }
656     /**
657      *
658      */
659     SVGTransform(const SVGTransform &other)
660         {
661         type   = other.type;
662         angle  = other.angle;
663         matrix = other.matrix;
664         }
666     /**
667      *
668      */
669     virtual ~SVGTransform()
670         {}
672 protected:
674     int type;
675     double angle;
677     SVGMatrix matrix;
678 };
685 /*#########################################################################
686 ## SVGTransformList
687 #########################################################################*/
689 /**
690  *
691  */
692 class SVGTransformList
694 public:
697     /**
698      *
699      */
700     virtual unsigned long getNumberOfItems()
701         { return items.size(); }
704     /**
705      *
706      */
707     virtual void clear( ) throw( DOMException )
708         { items.clear(); }
710     /**
711      *
712      */
713     virtual SVGTransform initialize (const SVGTransform &newItem)
714                          throw( DOMException, SVGException )
715         {
716         items.clear();
717         items.push_back(newItem);
718         return newItem;
719         }
721     /**
722      *
723      */
724     virtual SVGTransform getItem (unsigned long index )
725                     throw( DOMException )
726         {
727         if (index>=items.size())
728             {
729             SVGTransform transform;
730             return transform;
731             }
732         return items[index];
733         }
735     /**
736      *
737      */
738     virtual SVGTransform insertItemBefore (const SVGTransform &newItem,
739                                            unsigned long index )
740                                       throw( DOMException, SVGException )
741         {
742         if (index > items.size())
743             items.push_back(newItem);
744         else
745             {
746             std::vector<SVGTransform>::iterator iter = items.begin() + index;
747             items.insert(iter, newItem);
748             }
749         return newItem;
750         }
752     /**
753      *
754      */
755     virtual SVGTransform replaceItem (const SVGTransform &newItem,
756                                        unsigned long index )
757                                 throw( DOMException, SVGException )
758         {
759         if (index>=items.size())
760             {
761             SVGTransform transform;
762             return transform;
763             }
764         else
765             {
766             std::vector<SVGTransform>::iterator iter = items.begin() + index;
767             *iter = newItem;
768             }
769         return newItem;
770         }
772     /**
773      *
774      */
775     virtual SVGTransform removeItem (unsigned long index )
776                                      throw( DOMException )
777         {
778         if (index>=items.size())
779             {
780             SVGTransform transform;
781             return transform;
782             }
783         std::vector<SVGTransform>::iterator iter = items.begin() + index;
784         SVGTransform oldItem = *iter;
785         items.erase(iter);
786         return oldItem;
787         }
789     /**
790      *
791      */
792     virtual SVGTransform appendItem (const SVGTransform &newItem)
793                                   throw( DOMException, SVGException )
794         {
795         items.push_back(newItem);
796         return newItem;
797         }
799     /**
800      *
801      */
802     virtual SVGTransform createSVGTransformFromMatrix(const SVGMatrix &matrix)
803         {
804         SVGTransform transform;
805         transform.setMatrix(matrix);
806         return transform;
807         }
809     /**
810      *
811      */
812     virtual SVGTransform consolidate()
813         {
814         SVGMatrix matrix;
815         for (unsigned int i=0 ; i<items.size() ; i++)
816             matrix = matrix.multiply(items[i].getMatrix());
817         SVGTransform transform;
818         transform.setMatrix(matrix);
819         items.clear();
820         items.push_back(transform);
821         return transform;
822         }
826     //##################
827     //# Non-API methods
828     //##################
830     /**
831      *
832      */
833     SVGTransformList()
834         {}
836     /**
837      *
838      */
839     SVGTransformList(const SVGTransformList &other)
840         {
841         items = other.items;
842         }
844     /**
845      *
846      */
847     virtual ~SVGTransformList() {}
849 protected:
851     std::vector<SVGTransform> items;
853 };
860 /*#########################################################################
861 ## SVGAnimatedTransformList
862 #########################################################################*/
864 /**
865  *
866  */
867 class SVGAnimatedTransformList
869 public:
871     /**
872      *
873      */
874     virtual SVGTransformList getBaseVal()
875         { return baseVal; }
877     /**
878      *
879      */
880     virtual SVGTransformList getAnimVal()
881         { return animVal; }
885     //##################
886     //# Non-API methods
887     //##################
889     /**
890      *
891      */
892     SVGAnimatedTransformList()
893         {}
895     /**
896      *
897      */
898     SVGAnimatedTransformList(const SVGAnimatedTransformList &other)
899         {
900         baseVal = other.baseVal;
901         animVal = other.animVal;
902         }
904     /**
905      *
906      */
907     virtual ~SVGAnimatedTransformList() {}
909 protected:
911     SVGTransformList baseVal;
912     SVGTransformList animVal;
914 };
919 /*#########################################################################
920 ## SVGAnimatedBoolean
921 #########################################################################*/
923 /**
924  *
925  */
926 class SVGAnimatedBoolean
928 public:
930     /**
931      *
932      */
933     virtual bool getBaseVal()
934         {
935         return baseVal;
936         }
938     /**
939      *
940      */
941     virtual void setBaseVal(bool val) throw (DOMException)
942         {
943         baseVal = val;
944         }
946     /**
947      *
948      */
949     virtual bool getAnimVal()
950         {
951         return animVal;
952         }
955     //##################
956     //# Non-API methods
957     //##################
959     /**
960      *
961      */
962     SVGAnimatedBoolean()
963         {
964         baseVal = animVal = false;
965         }
967     /**
968      *
969      */
970     SVGAnimatedBoolean(const SVGAnimatedBoolean &other)
971         {
972         baseVal = other.baseVal;
973         animVal = other.animVal;
974         }
976     /**
977      *
978      */
979     virtual ~SVGAnimatedBoolean() {}
981 protected:
983     bool baseVal, animVal;
985 };
990 /*#########################################################################
991 ## SVGAnimatedString
992 #########################################################################*/
994 /**
995  *
996  */
997 class SVGAnimatedString
999 public:
1001     /**
1002      *
1003      */
1004     virtual DOMString getBaseVal()
1005         {
1006         return baseVal;
1007         }
1009     /**
1010      *
1011      */
1012     virtual void setBaseVal(const DOMString &val)
1013                             throw (DOMException)
1014         {
1015         baseVal = val;
1016         }
1018     /**
1019      *
1020      */
1021     virtual DOMString getAnimVal()
1022         {
1023         return animVal;
1024         }
1027     //##################
1028     //# Non-API methods
1029     //##################
1032     /**
1033      *
1034      */
1035     SVGAnimatedString()
1036         {
1037         baseVal = "";
1038         animVal = "";
1039         }
1041     /**
1042      *
1043      */
1044     SVGAnimatedString(const SVGAnimatedString &other)
1045         {
1046         baseVal = other.baseVal;
1047         animVal = other.animVal;
1048         }
1050     /**
1051      *
1052      */
1053     virtual ~SVGAnimatedString() {}
1055 protected:
1057     DOMString baseVal, animVal;
1059 };
1065 /*#########################################################################
1066 ## SVGStringList
1067 #########################################################################*/
1069 /**
1070  *
1071  */
1072 class SVGStringList
1074 public:
1077     /**
1078      *
1079      */
1080     virtual unsigned long getNumberOfItems()
1081         {
1082         return items.size();
1083         }
1085     /**
1086      *
1087      */
1088     virtual void clear () throw( DOMException )
1089        {
1090        items.clear();
1091        }
1093     /**
1094      *
1095      */
1096     virtual DOMString initialize ( const DOMString& newItem )
1097                     throw( DOMException, SVGException )
1098         {
1099         items.clear();
1100         items.push_back(newItem);
1101         return newItem;
1102         }
1104     /**
1105      *
1106      */
1107     virtual DOMString getItem ( unsigned long index )
1108                     throw( DOMException )
1109         {
1110         if (index >= items.size())
1111             return "";
1112         return items[index];
1113         }
1115     /**
1116      *
1117      */
1118     virtual DOMString insertItemBefore ( const DOMString& newItem,
1119                                  unsigned long index )
1120                                throw( DOMException, SVGException )
1121         {
1122         if (index>=items.size())
1123             {
1124             items.push_back(newItem);
1125             }
1126         else
1127             {
1128             std::vector<DOMString>::iterator iter = items.begin() + index;
1129             items.insert(iter, newItem);
1130             }
1131         return newItem;
1132         }
1134     /**
1135      *
1136      */
1137     virtual DOMString replaceItem ( const DOMString& newItem,
1138                                     unsigned long index )
1139                                 throw( DOMException, SVGException )
1140         {
1141         if (index>=items.size())
1142             return "";
1143         std::vector<DOMString>::iterator iter = items.begin() + index;
1144         *iter = newItem;
1145         return newItem;
1146         }
1148     /**
1149      *
1150      */
1151     virtual DOMString removeItem ( unsigned long index )
1152                     throw( DOMException )
1153         {
1154         if (index>=items.size())
1155             return "";
1156         std::vector<DOMString>::iterator iter = items.begin() + index;
1157         DOMString oldstr = *iter;
1158         items.erase(iter);
1159         return oldstr;
1160         }
1162     /**
1163      *
1164      */
1165     virtual DOMString appendItem ( const DOMString& newItem )
1166                     throw( DOMException, SVGException )
1167         {
1168         items.push_back(newItem);
1169         return newItem;
1170         }
1174     //##################
1175     //# Non-API methods
1176     //##################
1178     /**
1179      *
1180      */
1181     SVGStringList() {}
1183     /**
1184      *
1185      */
1186    SVGStringList(const SVGStringList &other)
1187        {
1188        items = other.items;
1189        }
1191     /**
1192      *
1193      */
1194     virtual ~SVGStringList() {}
1196 protected:
1198     std::vector<DOMString>items;
1200 };
1206 /*#########################################################################
1207 ## SVGAnimatedEnumeration
1208 #########################################################################*/
1210 /**
1211  *
1212  */
1213 class SVGAnimatedEnumeration
1215 public:
1217     /**
1218      *
1219      */
1220     virtual unsigned short getBaseVal()
1221         {
1222         return baseVal;
1223         }
1225     /**
1226      *
1227      */
1228     virtual void setBaseVal(unsigned short val)
1229                                      throw (DOMException)
1230         {
1231         baseVal = val;
1232         }
1234     /**
1235      *
1236      */
1237     virtual unsigned short getAnimVal()
1238         {
1239         return animVal;
1240         }
1244     //##################
1245     //# Non-API methods
1246     //##################
1249     /**
1250      *
1251      */
1252     SVGAnimatedEnumeration()
1253         {
1254         baseVal = animVal = 0;
1255         }
1257     /**
1258      *
1259      */
1260     SVGAnimatedEnumeration(const SVGAnimatedEnumeration &other)
1261         {
1262         baseVal = other.baseVal;
1263         animVal = other.animVal;
1264         }
1266     /**
1267      *
1268      */
1269     virtual ~SVGAnimatedEnumeration() {}
1271 protected:
1273     int baseVal, animVal;
1275 };
1281 /*#########################################################################
1282 ## SVGAnimatedInteger
1283 #########################################################################*/
1285 /**
1286  *
1287  */
1288 class SVGAnimatedInteger
1290 public:
1293     /**
1294      *
1295      */
1296     virtual long getBaseVal()
1297         {
1298         return baseVal;
1299         }
1301     /**
1302      *
1303      */
1304     virtual void setBaseVal(long val) throw (DOMException)
1305         {
1306         baseVal = val;
1307         }
1309     /**
1310      *
1311      */
1312     virtual long getAnimVal()
1313         {
1314         return animVal;
1315         }
1319     //##################
1320     //# Non-API methods
1321     //##################
1324     /**
1325      *
1326      */
1327     SVGAnimatedInteger()
1328         { baseVal = animVal = 0L;}
1331     /**
1332      *
1333      */
1334     SVGAnimatedInteger(long value)
1335         {
1336         baseVal = value;
1337         animVal = 0L;
1338         }
1340     /**
1341      *
1342      */
1343     SVGAnimatedInteger(long baseValArg, long animValArg)
1344         {
1345         baseVal = baseValArg;
1346         animVal = animValArg;
1347         }
1350     /**
1351      *
1352      */
1353     SVGAnimatedInteger(const SVGAnimatedInteger &other)
1354         {
1355         baseVal = other.baseVal;
1356         animVal = other.animVal;
1357         }
1359     /**
1360      *
1361      */
1362     virtual ~SVGAnimatedInteger() {}
1364 protected:
1366     long baseVal, animVal;
1368 };
1374 /*#########################################################################
1375 ## SVGNumber
1376 #########################################################################*/
1378 /**
1379  *
1380  */
1381 class SVGNumber
1383 public:
1386     /**
1387      *
1388      */
1389     virtual double getValue()
1390         {
1391         return value;
1392         }
1394     /**
1395      *
1396      */
1397     virtual void setValue(double val) throw (DOMException)
1398         {
1399         value = val;
1400         }
1403     //##################
1404     //# Non-API methods
1405     //##################
1407     /**
1408      *
1409      */
1410     SVGNumber()
1411         {
1412         value = 0.0;
1413         }
1415     /**
1416      *
1417      */
1418     SVGNumber(const SVGNumber &other)
1419         {
1420         value = other.value;
1421         }
1423     /**
1424      *
1425      */
1426     virtual ~SVGNumber() {}
1428 protected:
1430     double value;
1432 };
1438 /*#########################################################################
1439 ## SVGAnimatedNumber
1440 #########################################################################*/
1442 /**
1443  *
1444  */
1445 class SVGAnimatedNumber
1447 public:
1451     /**
1452      *
1453      */
1454     virtual double getBaseVal()
1455         {
1456         return baseVal;
1457         }
1459     /**
1460      *
1461      */
1462     virtual void setBaseVal(double val) throw (DOMException)
1463         {
1464         baseVal = val;
1465         }
1467     /**
1468      *
1469      */
1470     virtual double getAnimVal()
1471         {
1472         return animVal;
1473         }
1477     //##################
1478     //# Non-API methods
1479     //##################
1481     /**
1482      *
1483      */
1484     SVGAnimatedNumber()
1485         {
1486         baseVal = animVal = 0.0;
1487         }
1490     /**
1491      *
1492      */
1493     SVGAnimatedNumber(double val)
1494         {
1495         baseVal = val;
1496         animVal = 0.0;
1497         }
1500     /**
1501      *
1502      */
1503     SVGAnimatedNumber(double baseValArg, double animValArg)
1504         {
1505         baseVal = baseValArg;
1506         animVal = animValArg;
1507         }
1509     /**
1510      *
1511      */
1512     SVGAnimatedNumber(const SVGAnimatedNumber &other)
1513         {
1514         baseVal = other.baseVal;
1515         animVal = other.animVal;
1516         }
1518     /**
1519      *
1520      */
1521     virtual ~SVGAnimatedNumber() {}
1523 protected:
1525     double baseVal, animVal;
1527 };
1533 /*#########################################################################
1534 ## SVGNumberList
1535 #########################################################################*/
1537 /**
1538  *
1539  */
1540 class SVGNumberList
1542 public:
1544     /**
1545      *
1546      */
1547     virtual unsigned long getNumberOfItems()
1548         {
1549         return items.size();
1550         }
1553     /**
1554      *
1555      */
1556     virtual void clear() throw( DOMException )
1557         {
1558         items.clear();
1559         }
1561     /**
1562      *
1563      */
1564     virtual SVGNumber initialize (const SVGNumber &newItem)
1565                     throw( DOMException, SVGException )
1566         {
1567         items.clear();
1568         items.push_back(newItem);
1569         return newItem;
1570         }
1572     /**
1573      *
1574      */
1575     virtual SVGNumber getItem ( unsigned long index )
1576                                   throw( DOMException )
1577         {
1578         if (index>=items.size())
1579             {
1580             SVGNumber num;
1581             return num;
1582             }
1583         return items[index];
1584         }
1586     /**
1587      *
1588      */
1589     virtual SVGNumber insertItemBefore ( const SVGNumber &newItem,
1590                                          unsigned long index )
1591                                          throw( DOMException, SVGException )
1592         {
1593         if (index>=items.size())
1594             {
1595             items.push_back(newItem);
1596             }
1597         else
1598             {
1599             std::vector<SVGNumber>::iterator iter = items.begin() + index;
1600             items.insert(iter, newItem);
1601             }
1602         return newItem;
1603         }
1605     /**
1606      *
1607      */
1608     virtual SVGNumber replaceItem ( const SVGNumber &newItem,
1609                                     unsigned long index )
1610                                     throw( DOMException, SVGException )
1611         {
1612         if (index>=items.size())
1613             {
1614             SVGNumber num;
1615             return num;
1616             }
1617         std::vector<SVGNumber>::iterator iter = items.begin() + index;
1618         *iter = newItem;
1619         return newItem;
1620         }
1622     /**
1623      *
1624      */
1625     virtual SVGNumber removeItem ( unsigned long index )
1626                                   throw( DOMException )
1627         {
1628         if (index>=items.size())
1629             {
1630             SVGNumber num;
1631             return num;
1632             }
1633         std::vector<SVGNumber>::iterator iter = items.begin() + index;
1634         SVGNumber oldval = *iter;
1635         items.erase(iter);
1636         return oldval;
1637         }
1639     /**
1640      *
1641      */
1642     virtual SVGNumber appendItem ( const SVGNumber &newItem )
1643                                    throw( DOMException, SVGException )
1644         {
1645         items.push_back(newItem);
1646         return newItem;
1647         }
1650     //##################
1651     //# Non-API methods
1652     //##################
1654     /**
1655      *
1656      */
1657     SVGNumberList() {}
1659     /**
1660      *
1661      */
1662     SVGNumberList(const SVGNumberList &other)
1663         {
1664         items = other.items;
1665         }
1667     /**
1668      *
1669      */
1670     virtual ~SVGNumberList() {}
1672 protected:
1674     std::vector<SVGNumber>items;
1676 };
1682 /*#########################################################################
1683 ## SVGAnimatedNumberList
1684 #########################################################################*/
1686 /**
1687  *
1688  */
1689 class SVGAnimatedNumberList
1691 public:
1694     /**
1695      *
1696      */
1697     virtual SVGNumberList &getBaseVal()
1698         {
1699         return baseVal;
1700         }
1702     /**
1703      *
1704      */
1705     virtual SVGNumberList &getAnimVal()
1706         {
1707         return animVal;
1708         }
1712     //##################
1713     //# Non-API methods
1714     //##################
1716     /**
1717      *
1718      */
1719     SVGAnimatedNumberList() {}
1721     /**
1722      *
1723      */
1724     SVGAnimatedNumberList(const SVGAnimatedNumberList &other)
1725         {
1726         baseVal = other.baseVal;
1727         animVal = other.animVal;
1728         }
1730     /**
1731      *
1732      */
1733     virtual ~SVGAnimatedNumberList() {}
1735 protected:
1737     SVGNumberList baseVal;
1738     SVGNumberList animVal;
1740 };
1747 /*#########################################################################
1748 ## SVGLength
1749 #########################################################################*/
1751 /**
1752  *
1753  */
1754 class SVGLength
1756 public:
1758     /**
1759      * Length Unit Types
1760      */
1761     typedef enum
1762         {
1763         SVG_LENGTHTYPE_UNKNOWN    = 0,
1764         SVG_LENGTHTYPE_NUMBER     = 1,
1765         SVG_LENGTHTYPE_PERCENTAGE = 2,
1766         SVG_LENGTHTYPE_EMS        = 3,
1767         SVG_LENGTHTYPE_EXS        = 4,
1768         SVG_LENGTHTYPE_PX         = 5,
1769         SVG_LENGTHTYPE_CM         = 6,
1770         SVG_LENGTHTYPE_MM         = 7,
1771         SVG_LENGTHTYPE_IN         = 8,
1772         SVG_LENGTHTYPE_PT         = 9,
1773         SVG_LENGTHTYPE_PC         = 10
1774         } LengthUnitType;
1777     /**
1778      *
1779      */
1780     virtual unsigned short getUnitType( )
1781         {
1782         return unitType;
1783         }
1785     /**
1786      *
1787      */
1788     virtual double getValue( )
1789         {
1790         return value;
1791         }
1793     /**
1794      *
1795      */
1796     virtual void setValue( double val )  throw (DOMException)
1797         {
1798         value = val;
1799         }
1801     /**
1802      *
1803      */
1804     virtual double getValueInSpecifiedUnits( )
1805         {
1806         double result = 0.0;
1807         //fill this in
1808         return result;
1809         }
1811     /**
1812      *
1813      */
1814     virtual void setValueInSpecifiedUnits( double /*val*/ )
1815                                            throw (DOMException)
1816         {
1817         //fill this in
1818         }
1820     /**
1821      *
1822      */
1823     virtual DOMString getValueAsString( )
1824         {
1825         DOMString ret;
1826         char buf[32];
1827         snprintf(buf, 31, "%f", value);
1828         ret.append(buf);
1829         return ret;
1830         }
1832     /**
1833      *
1834      */
1835     virtual void setValueAsString( const DOMString& /*val*/ )
1836                                    throw (DOMException)
1837         {
1838         }
1841     /**
1842      *
1843      */
1844     virtual void newValueSpecifiedUnits ( unsigned short /*unitType*/, double /*val*/ )
1845         {
1846         }
1848     /**
1849      *
1850      */
1851     virtual void convertToSpecifiedUnits ( unsigned short /*unitType*/ )
1852         {
1853         }
1857     //##################
1858     //# Non-API methods
1859     //##################
1861     /**
1862      *
1863      */
1864     SVGLength()
1865         {
1866         unitType = SVG_LENGTHTYPE_UNKNOWN;
1867         value    = 0.0;
1868         }
1871     /**
1872      *
1873      */
1874     SVGLength(const SVGLength &other)
1875         {
1876         unitType  = other.unitType;
1877         value     = other.value;
1878         }
1880     /**
1881      *
1882      */
1883     virtual ~SVGLength() {}
1885 protected:
1887     int unitType;
1889     double value;
1891 };
1898 /*#########################################################################
1899 ## SVGAnimatedLength
1900 #########################################################################*/
1902 /**
1903  *
1904  */
1905 class SVGAnimatedLength
1907 public:
1909     /**
1910      *
1911      */
1912     virtual SVGLength &getBaseVal()
1913         {
1914         return baseVal;
1915         }
1917     /**
1918      *
1919      */
1920     virtual SVGLength &getAnimVal()
1921         {
1922         return animVal;
1923         }
1927     //##################
1928     //# Non-API methods
1929     //##################
1931     /**
1932      *
1933      */
1934     SVGAnimatedLength() {}
1936     /**
1937      *
1938      */
1939     SVGAnimatedLength(const SVGAnimatedLength &other)
1940         {
1941         baseVal = other.baseVal;
1942         animVal = other.animVal;
1943         }
1945     /**
1946      *
1947      */
1948     virtual ~SVGAnimatedLength() {}
1950 protected:
1952     SVGLength baseVal, animVal;
1954 };
1961 /*#########################################################################
1962 ## SVGLengthList
1963 #########################################################################*/
1965 /**
1966  *
1967  */
1968 class SVGLengthList
1970 public:
1972     /**
1973      *
1974      */
1975     virtual unsigned long getNumberOfItems()
1976         {
1977         return items.size();
1978         }
1981     /**
1982      *
1983      */
1984     virtual void clear (  ) throw( DOMException )
1985         {
1986         items.clear();
1987         }
1989     /**
1990      *
1991      */
1992     virtual SVGLength initialize (const SVGLength &newItem )
1993                     throw( DOMException, SVGException )
1994         {
1995         items.clear();
1996         items.push_back(newItem);
1997         return newItem;
1998         }
2000     /**
2001      *
2002      */
2003     virtual SVGLength getItem (unsigned long index)
2004                     throw( DOMException )
2005         {
2006         if (index>=items.size())
2007             {
2008             SVGLength ret;
2009             return ret;
2010             }
2011         return items[index];
2012         }
2014     /**
2015      *
2016      */
2017     virtual SVGLength insertItemBefore (const SVGLength &newItem,
2018                                          unsigned long index )
2019                                    throw( DOMException, SVGException )
2020         {
2021         if (index>=items.size())
2022             {
2023             items.push_back(newItem);
2024             }
2025         else
2026             {
2027             std::vector<SVGLength>::iterator iter = items.begin() + index;
2028             items.insert(iter, newItem);
2029             }
2030         return newItem;
2031         }
2033     /**
2034      *
2035      */
2036     virtual SVGLength replaceItem (const SVGLength &newItem,
2037                                     unsigned long index )
2038                                throw( DOMException, SVGException )
2039         {
2040         if (index>=items.size())
2041             {
2042             SVGLength ret;
2043             return ret;
2044             }
2045         std::vector<SVGLength>::iterator iter = items.begin() + index;
2046         *iter = newItem;
2047         return newItem;
2048         }
2050     /**
2051      *
2052      */
2053     virtual SVGLength removeItem (unsigned long index )
2054                     throw( DOMException )
2055         {
2056         if (index>=items.size())
2057             {
2058             SVGLength ret;
2059             return ret;
2060             }
2061         std::vector<SVGLength>::iterator iter = items.begin() + index;
2062         SVGLength oldval = *iter;
2063         items.erase(iter);
2064         return oldval;
2065         }
2067     /**
2068      *
2069      */
2070     virtual SVGLength appendItem (const SVGLength &newItem )
2071                     throw( DOMException, SVGException )
2072         {
2073         items.push_back(newItem);
2074         return newItem;
2075         }
2078     //##################
2079     //# Non-API methods
2080     //##################
2082     /**
2083      *
2084      */
2085     SVGLengthList() {}
2087     /**
2088      *
2089      */
2090     SVGLengthList(const SVGLengthList &other)
2091         {
2092         items = other.items;
2093         }
2095     /**
2096      *
2097      */
2098     virtual ~SVGLengthList() {}
2100 protected:
2102     std::vector<SVGLength>items;
2104 };
2111 /*#########################################################################
2112 ## SVGAnimatedLengthList
2113 #########################################################################*/
2115 /**
2116  *
2117  */
2118 class SVGAnimatedLengthList
2120 public:
2122     /**
2123      *
2124      */
2125     virtual SVGLengthList &getBaseVal()
2126         {
2127         return baseVal;
2128         }
2130     /**
2131      *
2132      */
2133     virtual SVGLengthList &getAnimVal()
2134         {
2135         return animVal;
2136         }
2140     //##################
2141     //# Non-API methods
2142     //##################
2144     /**
2145      *
2146      */
2147     SVGAnimatedLengthList() {}
2149     /**
2150      *
2151      */
2152    SVGAnimatedLengthList(const SVGAnimatedLengthList &other)
2153         {
2154         baseVal = other.baseVal;
2155         animVal = other.animVal;
2156         }
2158     /**
2159      *
2160      */
2161     virtual ~SVGAnimatedLengthList() {}
2163 protected:
2165     SVGLengthList baseVal, animVal;
2167 };
2174 /*#########################################################################
2175 ## SVGAngle
2176 #########################################################################*/
2178 /**
2179  *
2180  */
2181 class SVGAngle
2183 public:
2185     /**
2186      *  Angle Unit Types
2187      */
2188     typedef enum
2189         {
2190         SVG_ANGLETYPE_UNKNOWN     = 0,
2191         SVG_ANGLETYPE_UNSPECIFIED = 1,
2192         SVG_ANGLETYPE_DEG         = 2,
2193         SVG_ANGLETYPE_RAD         = 3,
2194         SVG_ANGLETYPE_GRAD        = 4
2195         } AngleUnitType;
2199     /**
2200      *
2201      */
2202     virtual unsigned short getUnitType()
2203         {
2204         return unitType;
2205         }
2207     /**
2208      *
2209      */
2210     virtual double getValue()
2211         {
2212         return value;
2213         }
2215     /**
2216      *
2217      */
2218     virtual void setValue(double val) throw (DOMException)
2219         {
2220         value = val;
2221         }
2223     /**
2224      *
2225      */
2226     virtual double getValueInSpecifiedUnits()
2227         {
2228         double result = 0.0;
2229         //convert here
2230         return result;
2231         }
2233     /**
2234      *
2235      */
2236     virtual void setValueInSpecifiedUnits(double /*val*/)
2237                                      throw (DOMException)
2238         {
2239         //do conversion
2240         }
2242     /**
2243      *
2244      */
2245     virtual DOMString getValueAsString()
2246         {
2247         DOMString result;
2248         char buf[32];
2249         snprintf(buf, 31, "%f", value);
2250         result.append(buf);
2251         return result;
2252         }
2254     /**
2255      *
2256      */
2257     virtual void setValueAsString(const DOMString &/*val*/)
2258                                   throw (DOMException)
2259         {
2260         //convert here
2261         }
2264     /**
2265      *
2266      */
2267     virtual void newValueSpecifiedUnits (unsigned short /*unitType*/,
2268                                          double /*valueInSpecifiedUnits*/ )
2269         {
2270         //convert here
2271         }
2273     /**
2274      *
2275      */
2276     virtual void convertToSpecifiedUnits (unsigned short /*unitType*/ )
2277         {
2278         //convert here
2279         }
2283     //##################
2284     //# Non-API methods
2285     //##################
2287     /**
2288      *
2289      */
2290     SVGAngle()
2291         {
2292         unitType = SVG_ANGLETYPE_UNKNOWN;
2293         value    = 0.0;
2294         }
2296     /**
2297      *
2298      */
2299     SVGAngle(const SVGAngle &other)
2300         {
2301         unitType = other.unitType;
2302         value    = other.value;
2303         }
2305     /**
2306      *
2307      */
2308     virtual ~SVGAngle() {}
2310 protected:
2312     int unitType;
2314     double value;
2316 };
2323 /*#########################################################################
2324 ## SVGAnimatedAngle
2325 #########################################################################*/
2327 /**
2328  *
2329  */
2330 class SVGAnimatedAngle
2332 public:
2334     /**
2335      *
2336      */
2337     virtual SVGAngle getBaseVal()
2338         {
2339         return baseVal;
2340         }
2342     /**
2343      *
2344      */
2345     virtual SVGAngle getAnimVal()
2346         {
2347         return animVal;
2348         }
2350     //##################
2351     //# Non-API methods
2352     //##################
2354     /**
2355      *
2356      */
2357     SVGAnimatedAngle() {}
2359     /**
2360      *
2361      */
2362     SVGAnimatedAngle(const SVGAngle &angle)
2363         { baseVal = angle; }
2365     /**
2366      *
2367      */
2368     SVGAnimatedAngle(const SVGAnimatedAngle &other)
2369         {
2370         baseVal = other.baseVal;
2371         animVal = other.animVal;
2372         }
2374     /**
2375      *
2376      */
2377     virtual ~SVGAnimatedAngle() {}
2379 protected:
2381     SVGAngle baseVal, animVal;
2383 };
2390 /*#########################################################################
2391 ## SVGICCColor
2392 #########################################################################*/
2394 /**
2395  *
2396  */
2397 class SVGICCColor
2399 public:
2401     /**
2402      *
2403      */
2404     virtual DOMString getColorProfile()
2405         {
2406         return colorProfile;
2407         }
2409     /**
2410      *
2411      */
2412     virtual void setColorProfile(const DOMString &val) throw (DOMException)
2413         {
2414         colorProfile = val;
2415         }
2417     /**
2418      *
2419      */
2420     virtual SVGNumberList &getColors()
2421         {
2422         return colors;
2423         }
2427     //##################
2428     //# Non-API methods
2429     //##################
2431     /**
2432      *
2433      */
2434     SVGICCColor() {}
2436     /**
2437      *
2438      */
2439     SVGICCColor(const SVGICCColor &other)
2440         {
2441         colorProfile = other.colorProfile;
2442         colors       = other.colors;
2443         }
2445     /**
2446      *
2447      */
2448     virtual ~SVGICCColor() {}
2450 protected:
2452     DOMString colorProfile;
2454     SVGNumberList colors;
2456 };
2459 /*#########################################################################
2460 ## SVGColor
2461 #########################################################################*/
2463 /**
2464  *
2465  */
2466 class SVGColor : virtual public css::CSSValue
2468 public:
2471     /**
2472      * Color Types
2473      */
2474     typedef enum
2475         {
2476         SVG_COLORTYPE_UNKNOWN           = 0,
2477         SVG_COLORTYPE_RGBCOLOR          = 1,
2478         SVG_COLORTYPE_RGBCOLOR_ICCCOLOR = 2,
2479         SVG_COLORTYPE_CURRENTCOLOR      = 3
2480         } ColorType;
2483     /**
2484      *
2485      */
2486     virtual unsigned short getColorType()
2487         {
2488         return colorType;
2489         }
2491     /**
2492      *
2493      */
2494     virtual css::RGBColor getRgbColor()
2495         {
2496         css::RGBColor col;
2497         return col;
2498         }
2500     /**
2501      *
2502      */
2503     virtual SVGICCColor getIccColor()
2504         {
2505         SVGICCColor col;
2506         return col;
2507         }
2510     /**
2511      *
2512      */
2513     virtual void setRGBColor (const DOMString& /*rgbColor*/ )
2514                               throw( SVGException )
2515         {
2516         }
2518     /**
2519      *
2520      */
2521     virtual void setRGBColorICCColor (const DOMString& /*rgbColor*/,
2522                                       const DOMString& /*iccColor*/ )
2523                                       throw( SVGException )
2524         {
2525         }
2527     /**
2528      *
2529      */
2530     virtual void setColor (unsigned short /*colorType*/,
2531                            const DOMString& /*rgbColor*/,
2532                            const DOMString& /*iccColor*/ )
2533                            throw( SVGException )
2534         {
2535         }
2539     //##################
2540     //# Non-API methods
2541     //##################
2543     /**
2544      *
2545      */
2546     SVGColor()
2547         {
2548         colorType = SVG_COLORTYPE_UNKNOWN;
2549         }
2551     /**
2552      *
2553      */
2554     SVGColor(const SVGColor &other) : css::CSSValue(other)
2555         {
2556         colorType = other.colorType;
2557         }
2559     /**
2560      *
2561      */
2562     virtual ~SVGColor() {}
2564 protected:
2566     int colorType;
2568 };
2579 /*#########################################################################
2580 ## SVGRect
2581 #########################################################################*/
2583 /**
2584  *
2585  */
2586 class SVGRect
2588 public:
2590     /**
2591      *
2592      */
2593     virtual double getX()
2594         {
2595         return x;
2596         }
2598     /**
2599      *
2600      */
2601     virtual void setX(double val) throw (DOMException)
2602         {
2603         x = val;
2604         }
2606     /**
2607      *
2608      */
2609     virtual double getY()
2610         {
2611         return y;
2612         }
2614     /**
2615      *
2616      */
2617     virtual void setY(double val) throw (DOMException)
2618         {
2619         y = val;
2620         }
2622     /**
2623      *
2624      */
2625     virtual double getWidth()
2626         {
2627         return width;
2628         }
2630     /**
2631      *
2632      */
2633     virtual void setWidth(double val) throw (DOMException)
2634         {
2635         width = val;
2636         }
2638     /**
2639      *
2640      */
2641     virtual double getHeight()
2642         {
2643         return height;
2644         }
2646     /**
2647      *
2648      */
2649     virtual void setHeight(double val) throw (DOMException)
2650         {
2651         height = val;
2652         }
2655     //##################
2656     //# Non-API methods
2657     //##################
2659     /**
2660      *
2661      */
2662     SVGRect()
2663         {
2664         x = y = width = height = 0.0;
2665         }
2667     /**
2668      *
2669      */
2670     SVGRect(const SVGRect &other)
2671         {
2672         x = other.x;
2673         y = other.y;
2674         width = other.width;
2675         height = other.height;
2676         }
2678     /**
2679      *
2680      */
2681     virtual ~SVGRect() {}
2683 protected:
2685     double x, y, width, height;
2687 };
2694 /*#########################################################################
2695 ## SVGAnimatedRect
2696 #########################################################################*/
2698 /**
2699  *
2700  */
2701 class SVGAnimatedRect
2703 public:
2705     /**
2706      *
2707      */
2708     virtual SVGRect &getBaseVal()
2709         {
2710         return baseVal;
2711         }
2713     /**
2714      *
2715      */
2716     virtual SVGRect &getAnimVal()
2717         {
2718         return animVal;
2719         }
2723     //##################
2724     //# Non-API methods
2725     //##################
2727     /**
2728      *
2729      */
2730     SVGAnimatedRect()
2731         {
2732         }
2734     /**
2735      *
2736      */
2737     SVGAnimatedRect(const SVGAnimatedRect &other)
2738         {
2739         baseVal = other.baseVal;
2740         animVal = other.animVal;
2741         }
2743     /**
2744      *
2745      */
2746     virtual ~SVGAnimatedRect() {}
2748 protected:
2750     SVGRect baseVal, animVal;
2752 };
2756 /*#########################################################################
2757 ## SVGPoint
2758 #########################################################################*/
2760 /**
2761  *
2762  */
2763 class SVGPoint
2765 public:
2769     /**
2770      *
2771      */
2772     virtual double getX()
2773         { return x; }
2775     /**
2776      *
2777      */
2778     virtual void setX(double val) throw (DOMException)
2779         { x = val; }
2781     /**
2782      *
2783      */
2784     virtual double getY()
2785         { return y; }
2787     /**
2788      *
2789      */
2790     virtual void setY(double val) throw (DOMException)
2791         { y = val; }
2793     /**
2794      *
2795      */
2796     virtual SVGPoint matrixTransform(const SVGMatrix &/*matrix*/)
2797         {
2798         SVGPoint point;
2799         return point;
2800         }
2804     //##################
2805     //# Non-API methods
2806     //##################
2808     /**
2809      *
2810      */
2811     SVGPoint()
2812         { x = y = 0; }
2814     /**
2815      *
2816      */
2817     SVGPoint(const SVGPoint &other)
2818         {
2819         x = other.x;
2820         y = other.y;
2821         }
2823     /**
2824      *
2825      */
2826     virtual ~SVGPoint() {}
2828 protected:
2830     double x, y;
2831 };
2838 /*#########################################################################
2839 ## SVGPointList
2840 #########################################################################*/
2842 /**
2843  *
2844  */
2845 class SVGPointList
2847 public:
2849     /**
2850      *
2851      */
2852     virtual unsigned long getNumberOfItems()
2853         { return items.size(); }
2855     /**
2856      *
2857      */
2858     virtual void clear() throw( DOMException )
2859         { items.clear(); }
2861     /**
2862      *
2863      */
2864     virtual SVGPoint initialize(const SVGPoint &newItem)
2865                              throw( DOMException, SVGException )
2866         {
2867         items.clear();
2868         items.push_back(newItem);
2869         return newItem;
2870         }
2872     /**
2873      *
2874      */
2875     virtual SVGPoint getItem(unsigned long index )
2876                              throw( DOMException )
2877         {
2878         if (index >= items.size())
2879             {
2880             SVGPoint point;
2881             return point;
2882             }
2883         return items[index];
2884         }
2886     /**
2887      *
2888      */
2889     virtual SVGPoint insertItemBefore(const SVGPoint &newItem,
2890                                       unsigned long index )
2891                                       throw( DOMException, SVGException )
2892         {
2893         if (index >= items.size())
2894             items.push_back(newItem);
2895         else
2896             {
2897             std::vector<SVGPoint>::iterator iter = items.begin() + index;
2898             items.insert(iter, newItem);
2899             }
2900         return newItem;
2901         }
2903     /**
2904      *
2905      */
2906     virtual SVGPoint replaceItem(const SVGPoint &newItem,
2907                                   unsigned long index )
2908                                   throw( DOMException, SVGException )
2909         {
2910         if (index >= items.size())
2911             {
2912             SVGPoint point;
2913             return point;
2914             }
2915         std::vector<SVGPoint>::iterator iter = items.begin() + index;
2916         *iter = newItem;
2917         return newItem;
2918         }
2920     /**
2921      *
2922      */
2923     virtual SVGPoint removeItem(unsigned long index )
2924                                   throw( DOMException )
2925         {
2926         if (index >= items.size())
2927             {
2928             SVGPoint point;
2929             return point;
2930             }
2931         std::vector<SVGPoint>::iterator iter = items.begin() + index;
2932         SVGPoint oldItem = *iter;
2933         items.erase(iter);
2934         return oldItem;
2935         }
2937     /**
2938      *
2939      */
2940     virtual SVGPoint appendItem(const SVGPoint &newItem)
2941                               throw( DOMException, SVGException )
2942         {
2943         items.push_back(newItem);
2944         return newItem;
2945         }
2948     //##################
2949     //# Non-API methods
2950     //##################
2952     /**
2953      *
2954      */
2955     SVGPointList() {}
2958     /**
2959      *
2960      */
2961     SVGPointList(const SVGPointList &other)
2962         {
2963         items = other.items;
2964         }
2967     /**
2968      *
2969      */
2970     virtual ~SVGPointList() {}
2972 protected:
2974     std::vector<SVGPoint> items;
2976 };
2981 /*#########################################################################
2982 ## SVGUnitTypes
2983 #########################################################################*/
2985 /**
2986  *
2987  */
2988 class SVGUnitTypes
2990 public:
2992     /**
2993      * Unit Types
2994      */
2995     typedef enum
2996         {
2997         SVG_UNIT_TYPE_UNKNOWN           = 0,
2998         SVG_UNIT_TYPE_USERSPACEONUSE    = 1,
2999         SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2
3000         } UnitType;
3004     //##################
3005     //# Non-API methods
3006     //##################
3008     /**
3009      *
3010      */
3011     SVGUnitTypes() {}
3013     /**
3014      *
3015      */
3016     virtual ~SVGUnitTypes() {}
3018 };
3025 /*#########################################################################
3026 ## SVGStylable
3027 #########################################################################*/
3029 /**
3030  *
3031  */
3032 class SVGStylable
3034 public:
3036     /**
3037      *
3038      */
3039     virtual SVGAnimatedString getClassName()
3040         {
3041         return className;
3042         }
3044     /**
3045      *
3046      */
3047     virtual css::CSSStyleDeclaration getStyle()
3048         {
3049         return style;
3050         }
3053     /**
3054      *
3055      */
3056     virtual css::CSSValue getPresentationAttribute (const DOMString& /*name*/ )
3057         {
3058         css::CSSValue val;
3059         //perform a lookup
3060         return val;
3061         }
3064     //##################
3065     //# Non-API methods
3066     //##################
3068     /**
3069      *
3070      */
3071     SVGStylable() {}
3073     /**
3074      *
3075      */
3076     SVGStylable(const SVGStylable &other)
3077         {
3078         className = other.className;
3079         style     = other.style;
3080         }
3082     /**
3083      *
3084      */
3085     virtual ~SVGStylable() {}
3087 protected:
3089     SVGAnimatedString className;
3090     css::CSSStyleDeclaration style;
3092 };
3095 /*#########################################################################
3096 ## SVGLocatable
3097 #########################################################################*/
3099 /**
3100  *
3101  */
3102 class SVGLocatable
3104 public:
3106     /**
3107      *
3108      */
3109     virtual SVGElementPtr getNearestViewportElement()
3110         {
3111         SVGElementPtr result;
3112         return result;
3113         }
3115     /**
3116      *
3117      */
3118     virtual SVGElementPtr getFarthestViewportElement()
3119         {
3120         SVGElementPtr result;
3121         return result;
3122         }
3124     /**
3125      *
3126      */
3127     virtual SVGRect getBBox (  )
3128         {
3129         return bbox;
3130         }
3132     /**
3133      *
3134      */
3135     virtual SVGMatrix getCTM (  )
3136         {
3137         return ctm;
3138         }
3140     /**
3141      *
3142      */
3143     virtual SVGMatrix getScreenCTM (  )
3144         {
3145         return screenCtm;
3146         }
3148     /**
3149      *
3150      */
3151     virtual SVGMatrix getTransformToElement (const SVGElement &/*element*/)
3152                     throw( SVGException )
3153         {
3154         SVGMatrix result;
3155         //do calculations
3156         return result;
3157         }
3161     //##################
3162     //# Non-API methods
3163     //##################
3165     /**
3166      *
3167      */
3168     SVGLocatable() {}
3170     /**
3171      *
3172      */
3173     SVGLocatable(const SVGLocatable &/*other*/)
3174         {
3175         }
3177     /**
3178      *
3179      */
3180     virtual ~SVGLocatable() {}
3182 protected:
3184     SVGRect bbox;
3185     SVGMatrix ctm;
3186     SVGMatrix screenCtm;
3188 };
3195 /*#########################################################################
3196 ## SVGTransformable
3197 #########################################################################*/
3199 /**
3200  *
3201  */
3202 class SVGTransformable : public SVGLocatable
3204 public:
3207     /**
3208      *
3209      */
3210     virtual SVGAnimatedTransformList &getTransform()
3211         {
3212         return transforms;
3213         }
3217     //##################
3218     //# Non-API methods
3219     //##################
3221     /**
3222      *
3223      */
3224     SVGTransformable() {}
3226     /**
3227      *
3228      */
3229     SVGTransformable(const SVGTransformable &other) : SVGLocatable(other)
3230         {
3231         transforms = other.transforms;
3232         }
3234     /**
3235      *
3236      */
3237     virtual ~SVGTransformable() {}
3239 protected:
3241     SVGAnimatedTransformList transforms;
3242 };
3249 /*#########################################################################
3250 ## SVGTests
3251 #########################################################################*/
3253 /**
3254  *
3255  */
3256 class SVGTests
3258 public:
3261     /**
3262      *
3263      */
3264     virtual SVGStringList &getRequiredFeatures()
3265         {
3266         return requiredFeatures;
3267         }
3269     /**
3270      *
3271      */
3272     virtual SVGStringList &getRequiredExtensions()
3273         {
3274         return requiredExtensions;
3275         }
3277     /**
3278      *
3279      */
3280     virtual SVGStringList &getSystemLanguage()
3281         {
3282         return systemLanguage;
3283         }
3286     /**
3287      *
3288      */
3289     virtual bool hasExtension (const DOMString& /*extension*/ )
3290         {
3291         return false;
3292         }
3296     //##################
3297     //# Non-API methods
3298     //##################
3300     /**
3301      *
3302      */
3303     SVGTests() {}
3305     /**
3306      *
3307      */
3308     SVGTests(const SVGTests &other)
3309         {
3310         requiredFeatures   = other.requiredFeatures;
3311         requiredExtensions = other.requiredExtensions;
3312         systemLanguage     = other.systemLanguage;
3313         }
3315     /**
3316      *
3317      */
3318     virtual ~SVGTests() {}
3320 protected:
3322     SVGStringList requiredFeatures;
3323     SVGStringList requiredExtensions;
3324     SVGStringList systemLanguage;
3326 };
3333 /*#########################################################################
3334 ## SVGLangSpace
3335 #########################################################################*/
3337 /**
3338  *
3339  */
3340 class SVGLangSpace
3342 public:
3345     /**
3346      *
3347      */
3348     virtual DOMString getXmllang()
3349         {
3350         return xmlLang;
3351         }
3353     /**
3354      *
3355      */
3356     virtual void setXmllang(const DOMString &val)
3357                                      throw (DOMException)
3358         {
3359         xmlLang = val;
3360         }
3362     /**
3363      *
3364      */
3365     virtual DOMString getXmlspace()
3366         {
3367         return xmlSpace;
3368         }
3370     /**
3371      *
3372      */
3373     virtual void setXmlspace(const DOMString &val)
3374                                      throw (DOMException)
3375         {
3376         xmlSpace = val;
3377         }
3381     //##################
3382     //# Non-API methods
3383     //##################
3385     /**
3386      *
3387      */
3388     SVGLangSpace() {}
3390     /**
3391      *
3392      */
3393     SVGLangSpace(const SVGLangSpace &other)
3394         {
3395         xmlLang  = other.xmlLang;
3396         xmlSpace = other.xmlSpace;
3397         }
3399     /**
3400      *
3401      */
3402     virtual ~SVGLangSpace() {}
3404 protected:
3406     DOMString xmlLang;
3407     DOMString xmlSpace;
3409 };
3416 /*#########################################################################
3417 ## SVGExternalResourcesRequired
3418 #########################################################################*/
3420 /**
3421  *
3422  */
3423 class SVGExternalResourcesRequired
3425 public:
3428     /**
3429      *
3430      */
3431     virtual SVGAnimatedBoolean getExternalResourcesRequired()
3432         { return required; }
3436     //##################
3437     //# Non-API methods
3438     //##################
3440     /**
3441      *
3442      */
3443     SVGExternalResourcesRequired()
3444         {  }
3447     /**
3448      *
3449      */
3450     SVGExternalResourcesRequired(const SVGExternalResourcesRequired &other)
3451         {
3452         required = other.required;
3453         }
3455     /**
3456      *
3457      */
3458     virtual ~SVGExternalResourcesRequired() {}
3460 protected:
3462     SVGAnimatedBoolean required;
3464 };
3471 /*#########################################################################
3472 ## SVGPreserveAspectRatio
3473 #########################################################################*/
3475 /**
3476  *
3477  */
3478 class SVGPreserveAspectRatio
3480 public:
3483     /**
3484      * Alignment Types
3485      */
3486     typedef enum
3487         {
3488         SVG_PRESERVEASPECTRATIO_UNKNOWN  = 0,
3489         SVG_PRESERVEASPECTRATIO_NONE     = 1,
3490         SVG_PRESERVEASPECTRATIO_XMINYMIN = 2,
3491         SVG_PRESERVEASPECTRATIO_XMIDYMIN = 3,
3492         SVG_PRESERVEASPECTRATIO_XMAXYMIN = 4,
3493         SVG_PRESERVEASPECTRATIO_XMINYMID = 5,
3494         SVG_PRESERVEASPECTRATIO_XMIDYMID = 6,
3495         SVG_PRESERVEASPECTRATIO_XMAXYMID = 7,
3496         SVG_PRESERVEASPECTRATIO_XMINYMAX = 8,
3497         SVG_PRESERVEASPECTRATIO_XMIDYMAX = 9,
3498         SVG_PRESERVEASPECTRATIO_XMAXYMAX = 10
3499         } AlignmentType;
3502     /**
3503      * Meet-or-slice Types
3504      */
3505     typedef enum
3506         {
3507         SVG_MEETORSLICE_UNKNOWN  = 0,
3508         SVG_MEETORSLICE_MEET     = 1,
3509         SVG_MEETORSLICE_SLICE    = 2
3510         } MeetOrSliceType;
3513     /**
3514      *
3515      */
3516     virtual unsigned short getAlign()
3517         { return align; }
3519     /**
3520      *
3521      */
3522     virtual void setAlign(unsigned short val) throw (DOMException)
3523         { align = val; }
3525     /**
3526      *
3527      */
3528     virtual unsigned short getMeetOrSlice()
3529         { return meetOrSlice; }
3531     /**
3532      *
3533      */
3534     virtual void setMeetOrSlice(unsigned short val) throw (DOMException)
3535         { meetOrSlice = val; }
3539     //##################
3540     //# Non-API methods
3541     //##################
3543     /**
3544      *
3545      */
3546     SVGPreserveAspectRatio()
3547         {
3548         align       = SVG_PRESERVEASPECTRATIO_UNKNOWN;
3549         meetOrSlice = SVG_MEETORSLICE_UNKNOWN;
3550         }
3552     /**
3553      *
3554      */
3555     SVGPreserveAspectRatio(const SVGPreserveAspectRatio &other)
3556         {
3557         align       = other.align;
3558         meetOrSlice = other.meetOrSlice;
3559         }
3561     /**
3562      *
3563      */
3564     virtual ~SVGPreserveAspectRatio() {}
3566 protected:
3568     unsigned short align;
3569     unsigned short meetOrSlice;
3571 };
3578 /*#########################################################################
3579 ## SVGAnimatedPreserveAspectRatio
3580 #########################################################################*/
3582 /**
3583  *
3584  */
3585 class SVGAnimatedPreserveAspectRatio
3587 public:
3590     /**
3591      *
3592      */
3593     virtual SVGPreserveAspectRatio getBaseVal()
3594         { return baseVal; }
3596     /**
3597      *
3598      */
3599     virtual SVGPreserveAspectRatio getAnimVal()
3600         { return animVal; }
3604     //##################
3605     //# Non-API methods
3606     //##################
3608     /**
3609      *
3610      */
3611     SVGAnimatedPreserveAspectRatio() {}
3613     /**
3614      *
3615      */
3616     SVGAnimatedPreserveAspectRatio(const SVGAnimatedPreserveAspectRatio &other)
3617         {
3618         baseVal = other.baseVal;
3619         baseVal = other.animVal;
3620         }
3622     /**
3623      *
3624      */
3625     virtual ~SVGAnimatedPreserveAspectRatio() {}
3627 protected:
3629     SVGPreserveAspectRatio baseVal;
3630     SVGPreserveAspectRatio animVal;
3632 };
3637 /*#########################################################################
3638 ## SVGFitToViewBox
3639 #########################################################################*/
3641 /**
3642  *
3643  */
3644 class SVGFitToViewBox
3646 public:
3648     /**
3649      *
3650      */
3651     virtual SVGAnimatedRect getViewBox()
3652         { return viewBox; }
3654     /**
3655      *
3656      */
3657     virtual SVGAnimatedPreserveAspectRatio getPreserveAspectRatio()
3658         { return preserveAspectRatio; }
3662     //##################
3663     //# Non-API methods
3664     //##################
3666     /**
3667      *
3668      */
3669     SVGFitToViewBox()
3670         {}
3672     /**
3673      *
3674      */
3676     SVGFitToViewBox(const SVGFitToViewBox &other)
3677         {
3678         viewBox = other.viewBox;
3679         preserveAspectRatio = other.preserveAspectRatio;
3680         }
3682     /**
3683      *
3684      */
3685     virtual ~SVGFitToViewBox() {}
3687 protected:
3689     SVGAnimatedRect viewBox;
3691     SVGAnimatedPreserveAspectRatio preserveAspectRatio;
3693 };
3696 /*#########################################################################
3697 ## SVGZoomAndPan
3698 #########################################################################*/
3700 /**
3701  *
3702  */
3703 class SVGZoomAndPan
3705 public:
3708     /**
3709      * Zoom and Pan Types
3710      */
3711     typedef enum
3712         {
3713         SVG_ZOOMANDPAN_UNKNOWN = 0,
3714         SVG_ZOOMANDPAN_DISABLE = 1,
3715         SVG_ZOOMANDPAN_MAGNIFY = 2
3716         } ZoomAndPanType;
3719     /**
3720      *
3721      */
3722     virtual unsigned short getZoomAndPan()
3723         { return zoomAndPan; }
3725     /**
3726      *
3727      */
3728     virtual void setZoomAndPan(unsigned short val) throw (DOMException)
3729         { zoomAndPan = val; }
3732     //##################
3733     //# Non-API methods
3734     //##################
3736     /**
3737      *
3738      */
3739     SVGZoomAndPan()
3740         { zoomAndPan = SVG_ZOOMANDPAN_UNKNOWN; }
3742     /**
3743      *
3744      */
3745     SVGZoomAndPan(const SVGZoomAndPan &other)
3746         { zoomAndPan = other.zoomAndPan; }
3748     /**
3749      *
3750      */
3751     virtual ~SVGZoomAndPan() {}
3753 protected:
3755     unsigned short zoomAndPan;
3757 };
3764 /*#########################################################################
3765 ## SVGViewSpec
3766 #########################################################################*/
3768 /**
3769  *
3770  */
3771 class SVGViewSpec : public SVGZoomAndPan,
3772                     public SVGFitToViewBox
3774 public:
3776     /**
3777      *
3778      */
3779     virtual SVGTransformList getTransform()
3780         { return transform; }
3782     /**
3783      *
3784      */
3785     virtual SVGElementPtr getViewTarget()
3786         { return viewTarget; }
3788     /**
3789      *
3790      */
3791     virtual DOMString getViewBoxString()
3792         {
3793         DOMString ret;
3794         return ret;
3795         }
3797     /**
3798      *
3799      */
3800     virtual DOMString getPreserveAspectRatioString()
3801         {
3802         DOMString ret;
3803         return ret;
3804         }
3806     /**
3807      *
3808      */
3809     virtual DOMString getTransformString()
3810         {
3811         DOMString ret;
3812         return ret;
3813         }
3815     /**
3816      *
3817      */
3818     virtual DOMString getViewTargetString()
3819         {
3820         DOMString ret;
3821         return ret;
3822         }
3826     //##################
3827     //# Non-API methods
3828     //##################
3830     /**
3831      *
3832      */
3833     SVGViewSpec()
3834         {
3835         viewTarget = NULL;
3836         }
3838     /**
3839      *
3840      */
3841     SVGViewSpec(const SVGViewSpec &other) : SVGZoomAndPan(other), SVGFitToViewBox(other)
3842         {
3843         viewTarget = other.viewTarget;
3844         transform  = other.transform;
3845         }
3847     /**
3848      *
3849      */
3850     virtual ~SVGViewSpec() {}
3852 protected:
3854     SVGElementPtr viewTarget;
3855     SVGTransformList transform;
3856 };
3863 /*#########################################################################
3864 ## SVGURIReference
3865 #########################################################################*/
3867 /**
3868  *
3869  */
3870 class SVGURIReference
3872 public:
3874     /**
3875      *
3876      */
3877     virtual SVGAnimatedString getHref()
3878         { return href; }
3882     //##################
3883     //# Non-API methods
3884     //##################
3886     /**
3887      *
3888      */
3889     SVGURIReference() {}
3891     /**
3892      *
3893      */
3894     SVGURIReference(const SVGURIReference &other)
3895         {
3896         href = other.href;
3897         }
3899     /**
3900      *
3901      */
3902     virtual ~SVGURIReference() {}
3904 protected:
3906     SVGAnimatedString href;
3908 };
3915 /*#########################################################################
3916 ## SVGCSSRule
3917 #########################################################################*/
3919 /**
3920  *
3921  */
3922 class SVGCSSRule : public css::CSSRule
3924 public:
3927     /**
3928      * Additional CSS RuleType to support ICC color specifications
3929      */
3930     typedef enum
3931         {
3932         COLOR_PROFILE_RULE = 7
3933         } ColorProfileRuleType;
3935     //##################
3936     //# Non-API methods
3937     //##################
3939     /**
3940      *
3941      */
3942     SVGCSSRule()
3943         { type = COLOR_PROFILE_RULE; }
3945     /**
3946      *
3947      */
3948     SVGCSSRule(const SVGCSSRule &other) : css::CSSRule(other)
3949         { type = COLOR_PROFILE_RULE; }
3951     /**
3952      *
3953      */
3954     virtual ~SVGCSSRule() {}
3956 };
3960 /*#########################################################################
3961 ## SVGRenderingIntent
3962 #########################################################################*/
3964 /**
3965  *
3966  */
3967 class SVGRenderingIntent
3969 public:
3971     /**
3972      * Rendering Intent Types
3973      */
3974     typedef enum
3975         {
3976         RENDERING_INTENT_UNKNOWN               = 0,
3977         RENDERING_INTENT_AUTO                  = 1,
3978         RENDERING_INTENT_PERCEPTUAL            = 2,
3979         RENDERING_INTENT_RELATIVE_COLORIMETRIC = 3,
3980         RENDERING_INTENT_SATURATION            = 4,
3981         RENDERING_INTENT_ABSOLUTE_COLORIMETRIC = 5
3982         } RenderingIntentType;
3986     //##################
3987     //# Non-API methods
3988     //##################
3990     /**
3991      *
3992      */
3993     SVGRenderingIntent()
3994         {
3995         renderingIntentType = RENDERING_INTENT_UNKNOWN;
3996         }
3998     /**
3999      *
4000      */
4001     SVGRenderingIntent(const SVGRenderingIntent &other)
4002         {
4003         renderingIntentType = other.renderingIntentType;
4004         }
4006     /**
4007      *
4008      */
4009     virtual ~SVGRenderingIntent() {}
4011 protected:
4013     unsigned short renderingIntentType;
4014 };
4022 /*#########################################################################
4023 ###########################################################################
4024 ## P A T H    S E G M E N T S
4025 ###########################################################################
4026 #########################################################################*/
4028 static char const *const pathSegLetters[] =
4030     "@", // PATHSEG_UNKNOWN,
4031     "z", // PATHSEG_CLOSEPATH
4032     "M", // PATHSEG_MOVETO_ABS
4033     "m", // PATHSEG_MOVETO_REL,
4034     "L", // PATHSEG_LINETO_ABS
4035     "l", // PATHSEG_LINETO_REL
4036     "C", // PATHSEG_CURVETO_CUBIC_ABS
4037     "c", // PATHSEG_CURVETO_CUBIC_REL
4038     "Q", // PATHSEG_CURVETO_QUADRATIC_ABS,
4039     "q", // PATHSEG_CURVETO_QUADRATIC_REL
4040     "A", // PATHSEG_ARC_ABS
4041     "a", // PATHSEG_ARC_REL,
4042     "H", // PATHSEG_LINETO_HORIZONTAL_ABS,
4043     "h", // PATHSEG_LINETO_HORIZONTAL_REL
4044     "V", // PATHSEG_LINETO_VERTICAL_ABS
4045     "v", // PATHSEG_LINETO_VERTICAL_REL
4046     "S", // PATHSEG_CURVETO_CUBIC_SMOOTH_ABS
4047     "s", // PATHSEG_CURVETO_CUBIC_SMOOTH_REL
4048     "T", // PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS
4049     "t"  // PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL
4050 };
4052 /*#########################################################################
4053 ## SVGPathSeg
4054 #########################################################################*/
4056 /**
4057  *
4058  */
4059 class SVGPathSeg
4061 public:
4065     /**
4066      *  Path Segment Types
4067      */
4068     typedef enum
4069         {
4070         PATHSEG_UNKNOWN                      = 0,
4071         PATHSEG_CLOSEPATH                    = 1,
4072         PATHSEG_MOVETO_ABS                   = 2,
4073         PATHSEG_MOVETO_REL                   = 3,
4074         PATHSEG_LINETO_ABS                   = 4,
4075         PATHSEG_LINETO_REL                   = 5,
4076         PATHSEG_CURVETO_CUBIC_ABS            = 6,
4077         PATHSEG_CURVETO_CUBIC_REL            = 7,
4078         PATHSEG_CURVETO_QUADRATIC_ABS        = 8,
4079         PATHSEG_CURVETO_QUADRATIC_REL        = 9,
4080         PATHSEG_ARC_ABS                      = 10,
4081         PATHSEG_ARC_REL                      = 11,
4082         PATHSEG_LINETO_HORIZONTAL_ABS        = 12,
4083         PATHSEG_LINETO_HORIZONTAL_REL        = 13,
4084         PATHSEG_LINETO_VERTICAL_ABS          = 14,
4085         PATHSEG_LINETO_VERTICAL_REL          = 15,
4086         PATHSEG_CURVETO_CUBIC_SMOOTH_ABS     = 16,
4087         PATHSEG_CURVETO_CUBIC_SMOOTH_REL     = 17,
4088         PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18,
4089         PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19
4090         } PathSegmentType;
4092     /**
4093      *
4094      */
4095     virtual unsigned short getPathSegType()
4096         { return type; }
4098     /**
4099      *
4100      */
4101     virtual DOMString getPathSegTypeAsLetter()
4102         {
4103         int typ = type;
4104         if (typ<0 || typ>PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL)
4105             typ = PATHSEG_UNKNOWN;
4106         char const *ch = pathSegLetters[typ];
4107         DOMString letter = ch;
4108         return letter;
4109         }
4113     //##################
4114     //# Non-API methods
4115     //##################
4117     /**
4118      *
4119      */
4120     SVGPathSeg()
4121         { type = PATHSEG_UNKNOWN; }
4123     /**
4124      *
4125      */
4126     SVGPathSeg(const SVGPathSeg &other)
4127         {
4128         type = other.type;
4129         }
4131     /**
4132      *
4133      */
4134     virtual ~SVGPathSeg() {}
4136 protected:
4138     int type;
4140 };
4147 /*#########################################################################
4148 ## SVGPathSegClosePath
4149 #########################################################################*/
4151 /**
4152  *
4153  */
4154 class SVGPathSegClosePath : public SVGPathSeg
4156 public:
4158     //##################
4159     //# Non-API methods
4160     //##################
4162     /**
4163      *
4164      */
4165     SVGPathSegClosePath()
4166         {
4167         type = PATHSEG_CLOSEPATH;
4168         }
4170     /**
4171      *
4172      */
4173     SVGPathSegClosePath(const SVGPathSegClosePath &other) : SVGPathSeg(other)
4174         {
4175         type = PATHSEG_CLOSEPATH;
4176         }
4178     /**
4179      *
4180      */
4181     virtual ~SVGPathSegClosePath() {}
4183 };
4188 /*#########################################################################
4189 ## SVGPathSegMovetoAbs
4190 #########################################################################*/
4192 /**
4193  *
4194  */
4195 class SVGPathSegMovetoAbs : public SVGPathSeg
4197 public:
4199     /**
4200      *
4201      */
4202     virtual double getX()
4203         { return x; }
4205     /**
4206      *
4207      */
4208     virtual void setX(double val) throw (DOMException)
4209         { x = val; }
4211     /**
4212      *
4213      */
4214     virtual double getY()
4215         { return y; }
4217     /**
4218      *
4219      */
4220     virtual void setY(double val) throw (DOMException)
4221         { y = val; }
4223     //##################
4224     //# Non-API methods
4225     //##################
4227     /**
4228      *
4229      */
4230     SVGPathSegMovetoAbs()
4231         {
4232         type = PATHSEG_MOVETO_ABS;
4233         x = y = 0.0;
4234         }
4236     /**
4237      *
4238      */
4239     SVGPathSegMovetoAbs(double xArg, double yArg)
4240         {
4241         type = PATHSEG_MOVETO_ABS;
4242         x = xArg; y = yArg;
4243         }
4245     /**
4246      *
4247      */
4248     SVGPathSegMovetoAbs(const SVGPathSegMovetoAbs &other) : SVGPathSeg(other)
4249         {
4250         type = PATHSEG_MOVETO_ABS;
4251         x = other.x; y = other.y;
4252         }
4254     /**
4255      *
4256      */
4257     virtual ~SVGPathSegMovetoAbs() {}
4259 protected:
4261     double x,y;
4263 };
4270 /*#########################################################################
4271 ## SVGPathSegMovetoRel
4272 #########################################################################*/
4274 /**
4275  *
4276  */
4277 class SVGPathSegMovetoRel : public SVGPathSeg
4279 public:
4281     /**
4282      *
4283      */
4284     virtual double getX()
4285         { return x; }
4287     /**
4288      *
4289      */
4290     virtual void setX(double val) throw (DOMException)
4291         { x = val; }
4293     /**
4294      *
4295      */
4296     virtual double getY()
4297         { return y; }
4299     /**
4300      *
4301      */
4302     virtual void setY(double val) throw (DOMException)
4303         { y = val; }
4305     //##################
4306     //# Non-API methods
4307     //##################
4309     /**
4310      *
4311      */
4312     SVGPathSegMovetoRel()
4313         {
4314         type = PATHSEG_MOVETO_REL;
4315         x = y = 0.0;
4316         }
4319     /**
4320      *
4321      */
4322     SVGPathSegMovetoRel(double xArg, double yArg)
4323         {
4324         type = PATHSEG_MOVETO_REL;
4325         x = xArg; y = yArg;
4326         }
4328     /**
4329      *
4330      */
4331     SVGPathSegMovetoRel(const SVGPathSegMovetoRel &other) : SVGPathSeg(other)
4332         {
4333         type = PATHSEG_MOVETO_REL;
4334         x = other.x; y = other.y;
4335         }
4337     /**
4338      *
4339      */
4340     virtual ~SVGPathSegMovetoRel() {}
4342 protected:
4344     double x,y;
4345 };
4352 /*#########################################################################
4353 ## SVGPathSegLinetoAbs
4354 #########################################################################*/
4356 /**
4357  *
4358  */
4359 class SVGPathSegLinetoAbs : public SVGPathSeg
4361 public:
4363     /**
4364      *
4365      */
4366     virtual double getX()
4367         { return x; }
4369     /**
4370      *
4371      */
4372     virtual void setX(double val) throw (DOMException)
4373         { x = val; }
4375     /**
4376      *
4377      */
4378     virtual double getY()
4379         { return y; }
4381     /**
4382      *
4383      */
4384     virtual void setY(double val) throw (DOMException)
4385         { y = val; }
4387     //##################
4388     //# Non-API methods
4389     //##################
4391     /**
4392      *
4393      */
4394     SVGPathSegLinetoAbs()
4395         {
4396         type = PATHSEG_LINETO_ABS;
4397         x = y = 0.0;
4398         }
4401     /**
4402      *
4403      */
4404     SVGPathSegLinetoAbs(double xArg, double yArg)
4405         {
4406         type = PATHSEG_LINETO_ABS;
4407         x = xArg; y = yArg;
4408         }
4410     /**
4411      *
4412      */
4413     SVGPathSegLinetoAbs(const SVGPathSegLinetoAbs &other) : SVGPathSeg(other)
4414         {
4415         type = PATHSEG_LINETO_ABS;
4416         x = other.x; y = other.y;
4417         }
4419     /**
4420      *
4421      */
4422     virtual ~SVGPathSegLinetoAbs() {}
4424 protected:
4426     double x,y;
4427 };
4434 /*#########################################################################
4435 ## SVGPathSegLinetoRel
4436 #########################################################################*/
4438 /**
4439  *
4440  */
4441 class SVGPathSegLinetoRel : public SVGPathSeg
4443 public:
4445     /**
4446      *
4447      */
4448     virtual double getX()
4449         { return x; }
4451     /**
4452      *
4453      */
4454     virtual void setX(double val) throw (DOMException)
4455         { x = val; }
4457     /**
4458      *
4459      */
4460     virtual double getY()
4461         { return y; }
4463     /**
4464      *
4465      */
4466     virtual void setY(double val) throw (DOMException)
4467         { y = val; }
4469     //##################
4470     //# Non-API methods
4471     //##################
4473     /**
4474      *
4475      */
4476     SVGPathSegLinetoRel()
4477         {
4478         type = PATHSEG_LINETO_REL;
4479         x = y = 0.0;
4480         }
4483     /**
4484      *
4485      */
4486     SVGPathSegLinetoRel(double xArg, double yArg)
4487         {
4488         type = PATHSEG_LINETO_REL;
4489         x = xArg; y = yArg;
4490         }
4492     /**
4493      *
4494      */
4495     SVGPathSegLinetoRel(const SVGPathSegLinetoRel &other) : SVGPathSeg(other)
4496         {
4497         type = PATHSEG_LINETO_REL;
4498         x = other.x; y = other.y;
4499         }
4501     /**
4502      *
4503      */
4504     virtual ~SVGPathSegLinetoRel() {}
4506 protected:
4508     double x,y;
4509 };
4516 /*#########################################################################
4517 ## SVGPathSegCurvetoCubicAbs
4518 #########################################################################*/
4520 /**
4521  *
4522  */
4523 class SVGPathSegCurvetoCubicAbs : public SVGPathSeg
4525 public:
4527     /**
4528      *
4529      */
4530     virtual double getX()
4531         { return x; }
4533     /**
4534      *
4535      */
4536     virtual void setX(double val) throw (DOMException)
4537         { x = val; }
4539     /**
4540      *
4541      */
4542     virtual double getY()
4543         { return y; }
4545     /**
4546      *
4547      */
4548     virtual void setY(double val) throw (DOMException)
4549         { y = val; }
4551     /**
4552      *
4553      */
4554     virtual double getX1()
4555         { return x1; }
4557     /**
4558      *
4559      */
4560     virtual void setX1(double val) throw (DOMException)
4561         { x1 = val; }
4563     /**
4564      *
4565      */
4566     virtual double getY1()
4567         { return y1; }
4569     /**
4570      *
4571      */
4572     virtual void setY1(double val) throw (DOMException)
4573         { y1 = val; }
4576     /**
4577      *
4578      */
4579     virtual double getX2()
4580         { return x2; }
4582     /**
4583      *
4584      */
4585     virtual void setX2(double val) throw (DOMException)
4586         { x2 = val; }
4588     /**
4589      *
4590      */
4591     virtual double getY2()
4592         { return y2; }
4594     /**
4595      *
4596      */
4597     virtual void setY2(double val) throw (DOMException)
4598         { y2 = val; }
4601     //##################
4602     //# Non-API methods
4603     //##################
4606     /**
4607      *
4608      */
4609     SVGPathSegCurvetoCubicAbs()
4610         {
4611         type = PATHSEG_CURVETO_CUBIC_ABS;
4612         x = y = x1 = y1 = x2 = y2 = 0.0;
4613         }
4615     /**
4616      *
4617      */
4618     SVGPathSegCurvetoCubicAbs(double xArg,  double yArg,
4619                               double x1Arg, double y1Arg,
4620                               double x2Arg, double y2Arg)
4621         {
4622         type = PATHSEG_CURVETO_CUBIC_ABS;
4623         x  = xArg;   y  = yArg;
4624         x1 = x1Arg;  y1 = y1Arg;
4625         x2 = x2Arg;  y2 = y2Arg;
4626         }
4628     /**
4629      *
4630      */
4631     SVGPathSegCurvetoCubicAbs(const SVGPathSegCurvetoCubicAbs &other)
4632                      : SVGPathSeg(other)
4633         {
4634         type = PATHSEG_CURVETO_CUBIC_ABS;
4635         x  = other.x;  y  = other.y;
4636         x1 = other.x1; y1 = other.y1;
4637         x2 = other.x2; y2 = other.y2;
4638         }
4640     /**
4641      *
4642      */
4643     virtual ~SVGPathSegCurvetoCubicAbs() {}
4645 protected:
4647     double x, y, x1, y1, x2, y2;
4649 };
4656 /*#########################################################################
4657 ## SVGPathSegCurvetoCubicRel
4658 #########################################################################*/
4660 /**
4661  *
4662  */
4663 class SVGPathSegCurvetoCubicRel : public SVGPathSeg
4665 public:
4667     /**
4668      *
4669      */
4670     virtual double getX()
4671         { return x; }
4673     /**
4674      *
4675      */
4676     virtual void setX(double val) throw (DOMException)
4677         { x = val; }
4679     /**
4680      *
4681      */
4682     virtual double getY()
4683         { return y; }
4685     /**
4686      *
4687      */
4688     virtual void setY(double val) throw (DOMException)
4689         { y = val; }
4691     /**
4692      *
4693      */
4694     virtual double getX1()
4695         { return x1; }
4697     /**
4698      *
4699      */
4700     virtual void setX1(double val) throw (DOMException)
4701         { x1 = val; }
4703     /**
4704      *
4705      */
4706     virtual double getY1()
4707         { return y1; }
4709     /**
4710      *
4711      */
4712     virtual void setY1(double val) throw (DOMException)
4713         { y1 = val; }
4716     /**
4717      *
4718      */
4719     virtual double getX2()
4720         { return x2; }
4722     /**
4723      *
4724      */
4725     virtual void setX2(double val) throw (DOMException)
4726         { x2 = val; }
4728     /**
4729      *
4730      */
4731     virtual double getY2()
4732         { return y2; }
4734     /**
4735      *
4736      */
4737     virtual void setY2(double val) throw (DOMException)
4738         { y2 = val; }
4741     //##################
4742     //# Non-API methods
4743     //##################
4746     /**
4747      *
4748      */
4749     SVGPathSegCurvetoCubicRel()
4750         {
4751         type = PATHSEG_CURVETO_CUBIC_REL;
4752         x = y = x1 = y1 = x2 = y2 = 0.0;
4753         }
4756     /**
4757      *
4758      */
4759     SVGPathSegCurvetoCubicRel(double xArg,  double yArg,
4760                               double x1Arg, double y1Arg,
4761                               double x2Arg, double y2Arg)
4762         {
4763         type = PATHSEG_CURVETO_CUBIC_REL;
4764         x  = xArg;   y  = yArg;
4765         x1 = x1Arg;  y1 = y1Arg;
4766         x2 = x2Arg;  y2 = y2Arg;
4767         }
4769     /**
4770      *
4771      */
4772     SVGPathSegCurvetoCubicRel(const SVGPathSegCurvetoCubicRel &other)
4773                      : SVGPathSeg(other)
4774         {
4775         type = PATHSEG_CURVETO_CUBIC_REL;
4776         x  = other.x;  y  = other.y;
4777         x1 = other.x1; y1 = other.y1;
4778         x2 = other.x2; y2 = other.y2;
4779         }
4781     /**
4782      *
4783      */
4784     virtual ~SVGPathSegCurvetoCubicRel() {}
4786 protected:
4788     double x, y, x1, y1, x2, y2;
4790 };
4797 /*#########################################################################
4798 ## SVGPathSegCurvetoQuadraticAbs
4799 #########################################################################*/
4801 /**
4802  *
4803  */
4804 class SVGPathSegCurvetoQuadraticAbs : public SVGPathSeg
4806 public:
4808     /**
4809      *
4810      */
4811     virtual double getX()
4812         { return x; }
4814     /**
4815      *
4816      */
4817     virtual void setX(double val) throw (DOMException)
4818         { x = val; }
4820     /**
4821      *
4822      */
4823     virtual double getY()
4824         { return y; }
4826     /**
4827      *
4828      */
4829     virtual void setY(double val) throw (DOMException)
4830         { y = val; }
4832     /**
4833      *
4834      */
4835     virtual double getX1()
4836         { return x1; }
4838     /**
4839      *
4840      */
4841     virtual void setX1(double val) throw (DOMException)
4842         { x1 = val; }
4844     /**
4845      *
4846      */
4847     virtual double getY1()
4848         { return y1; }
4850     /**
4851      *
4852      */
4853     virtual void setY1(double val) throw (DOMException)
4854         { y1 = val; }
4857     //##################
4858     //# Non-API methods
4859     //##################
4862     /**
4863      *
4864      */
4865     SVGPathSegCurvetoQuadraticAbs()
4866         {
4867         type = PATHSEG_CURVETO_QUADRATIC_ABS;
4868         x = y = x1 = y1 = 0.0;
4869         }
4871     /**
4872      *
4873      */
4874     SVGPathSegCurvetoQuadraticAbs(double xArg,  double yArg,
4875                               double x1Arg, double y1Arg)
4876         {
4877         type = PATHSEG_CURVETO_QUADRATIC_ABS;
4878         x  = xArg;   y  = yArg;
4879         x1 = x1Arg;  y1 = y1Arg;
4880         }
4882     /**
4883      *
4884      */
4885     SVGPathSegCurvetoQuadraticAbs(const SVGPathSegCurvetoQuadraticAbs &other)
4886                      : SVGPathSeg(other)
4887         {
4888         type = PATHSEG_CURVETO_QUADRATIC_ABS;
4889         x  = other.x;  y  = other.y;
4890         x1 = other.x1; y1 = other.y1;
4891         }
4893     /**
4894      *
4895      */
4896     virtual ~SVGPathSegCurvetoQuadraticAbs() {}
4898 protected:
4900     double x, y, x1, y1;
4902 };
4909 /*#########################################################################
4910 ## SVGPathSegCurvetoQuadraticRel
4911 #########################################################################*/
4913 /**
4914  *
4915  */
4916 class SVGPathSegCurvetoQuadraticRel : public SVGPathSeg
4918 public:
4920     /**
4921      *
4922      */
4923     virtual double getX()
4924         { return x; }
4926     /**
4927      *
4928      */
4929     virtual void setX(double val) throw (DOMException)
4930         { x = val; }
4932     /**
4933      *
4934      */
4935     virtual double getY()
4936         { return y; }
4938     /**
4939      *
4940      */
4941     virtual void setY(double val) throw (DOMException)
4942         { y = val; }
4944     /**
4945      *
4946      */
4947     virtual double getX1()
4948         { return x1; }
4950     /**
4951      *
4952      */
4953     virtual void setX1(double val) throw (DOMException)
4954         { x1 = val; }
4956     /**
4957      *
4958      */
4959     virtual double getY1()
4960         { return y1; }
4962     /**
4963      *
4964      */
4965     virtual void setY1(double val) throw (DOMException)
4966         { y1 = val; }
4969     //##################
4970     //# Non-API methods
4971     //##################
4974     /**
4975      *
4976      */
4977     SVGPathSegCurvetoQuadraticRel()
4978         {
4979         type = PATHSEG_CURVETO_QUADRATIC_REL;
4980         x = y = x1 = y1 = 0.0;
4981         }
4984     /**
4985      *
4986      */
4987     SVGPathSegCurvetoQuadraticRel(double xArg,  double yArg,
4988                                   double x1Arg, double y1Arg)
4989         {
4990         type = PATHSEG_CURVETO_QUADRATIC_REL;
4991         x  = xArg;   y  = yArg;
4992         x1 = x1Arg;  y1 = y1Arg;
4993         }
4995     /**
4996      *
4997      */
4998     SVGPathSegCurvetoQuadraticRel(const SVGPathSegCurvetoQuadraticRel &other)
4999                      : SVGPathSeg(other)
5000         {
5001         type = PATHSEG_CURVETO_QUADRATIC_REL;
5002         x  = other.x;  y  = other.y;
5003         x1 = other.x1; y1 = other.y1;
5004         }
5006     /**
5007      *
5008      */
5009     virtual ~SVGPathSegCurvetoQuadraticRel() {}
5011 protected:
5013     double x, y, x1, y1;
5015 };
5022 /*#########################################################################
5023 ## SVGPathSegArcAbs
5024 #########################################################################*/
5026 /**
5027  *
5028  */
5029 class SVGPathSegArcAbs : public SVGPathSeg
5031 public:
5033     /**
5034      *
5035      */
5036     virtual double getX()
5037         { return x; }
5039     /**
5040      *
5041      */
5042     virtual void setX(double val) throw (DOMException)
5043         { x = val; }
5045     /**
5046      *
5047      */
5048     virtual double getY()
5049         { return y; }
5051     /**
5052      *
5053      */
5054     virtual void setY(double val) throw (DOMException)
5055         { y = val; }
5057     /**
5058      *
5059      */
5060     virtual double getR1()
5061         { return r1; }
5063     /**
5064      *
5065      */
5066     virtual void setR1(double val) throw (DOMException)
5067         { r1 = val; }
5069     /**
5070      *
5071      */
5072     virtual double getR2()
5073         { return r2; }
5075     /**
5076      *
5077      */
5078     virtual void setR2(double val) throw (DOMException)
5079         { r2 = val; }
5081     /**
5082      *
5083      */
5084     virtual double getAngle()
5085         { return angle; }
5087     /**
5088      *
5089      */
5090     virtual void setAngle(double val) throw (DOMException)
5091         { angle = val; }
5093     /**
5094      *
5095      */
5096     virtual bool getLargeArcFlag()
5097         { return largeArcFlag; }
5099     /**
5100      *
5101      */
5102     virtual void setLargeArcFlag(bool val) throw (DOMException)
5103         { largeArcFlag = val; }
5105     /**
5106      *
5107      */
5108     virtual bool getSweepFlag()
5109         { return sweepFlag; }
5111     /**
5112      *
5113      */
5114     virtual void setSweepFlag(bool val) throw (DOMException)
5115         { sweepFlag = val; }
5117     //##################
5118     //# Non-API methods
5119     //##################
5122     /**
5123      *
5124      */
5125     SVGPathSegArcAbs()
5126         {
5127         type = PATHSEG_ARC_ABS;
5128         x = y = r1 = r2 = angle = 0.0;
5129         largeArcFlag = sweepFlag = false;
5130         }
5132     /**
5133      *
5134      */
5135     SVGPathSegArcAbs(double xArg,  double yArg,
5136                      double r1Arg, double r2Arg,
5137                      double angleArg,
5138                      bool largeArcFlagArg,
5139                      bool sweepFlagArg )
5141         {
5142         type = PATHSEG_ARC_ABS;
5143         x  = xArg;   y  = yArg;
5144         r1 = r1Arg;  r2 = r2Arg;
5145         angle        = angleArg;
5146         largeArcFlag = largeArcFlagArg;
5147         sweepFlag    = sweepFlagArg;
5148         }
5150     /**
5151      *
5152      */
5153     SVGPathSegArcAbs(const SVGPathSegArcAbs &other)
5154                      : SVGPathSeg(other)
5155         {
5156         type = PATHSEG_ARC_ABS;
5157         x  = other.x;  y  = other.y;
5158         r1 = other.r1; r2 = other.r2;
5159         angle        = other.angle;
5160         largeArcFlag = other.largeArcFlag;
5161         sweepFlag    = other.sweepFlag;
5162         }
5164     /**
5165      *
5166      */
5167     virtual ~SVGPathSegArcAbs() {}
5169 protected:
5171     double x, y, r1, r2, angle;
5172     bool largeArcFlag;
5173     bool sweepFlag;
5175 };
5179 /*#########################################################################
5180 ## SVGPathSegArcRel
5181 #########################################################################*/
5183 /**
5184  *
5185  */
5186 class SVGPathSegArcRel : public SVGPathSeg
5188 public:
5190     /**
5191      *
5192      */
5193     virtual double getX()
5194         { return x; }
5196     /**
5197      *
5198      */
5199     virtual void setX(double val) throw (DOMException)
5200         { x = val; }
5202     /**
5203      *
5204      */
5205     virtual double getY()
5206         { return y; }
5208     /**
5209      *
5210      */
5211     virtual void setY(double val) throw (DOMException)
5212         { y = val; }
5214     /**
5215      *
5216      */
5217     virtual double getR1()
5218         { return r1; }
5220     /**
5221      *
5222      */
5223     virtual void setR1(double val) throw (DOMException)
5224         { r1 = val; }
5226     /**
5227      *
5228      */
5229     virtual double getR2()
5230         { return r2; }
5232     /**
5233      *
5234      */
5235     virtual void setR2(double val) throw (DOMException)
5236         { r2 = val; }
5238     /**
5239      *
5240      */
5241     virtual double getAngle()
5242         { return angle; }
5244     /**
5245      *
5246      */
5247     virtual void setAngle(double val) throw (DOMException)
5248         { angle = val; }
5250     /**
5251      *
5252      */
5253     virtual bool getLargeArcFlag()
5254         { return largeArcFlag; }
5256     /**
5257      *
5258      */
5259     virtual void setLargeArcFlag(bool val) throw (DOMException)
5260         { largeArcFlag = val; }
5262     /**
5263      *
5264      */
5265     virtual bool getSweepFlag()
5266         { return sweepFlag; }
5268     /**
5269      *
5270      */
5271     virtual void setSweepFlag(bool val) throw (DOMException)
5272         { sweepFlag = val; }
5274     //##################
5275     //# Non-API methods
5276     //##################
5279     /**
5280      *
5281      */
5282     SVGPathSegArcRel()
5283         {
5284         type = PATHSEG_ARC_REL;
5285         x = y = r1 = r2 = angle = 0.0;
5286         largeArcFlag = sweepFlag = false;
5287         }
5290     /**
5291      *
5292      */
5293     SVGPathSegArcRel(double xArg, double yArg,
5294                      double r1Arg, double r2Arg,
5295                      double angleArg,
5296                      bool largeArcFlagArg,
5297                      bool sweepFlagArg )
5299         {
5300         type = PATHSEG_ARC_REL;
5301         x  = xArg;   y  = yArg;
5302         r1 = r1Arg;  r2 = r2Arg;
5303         angle        = angleArg;
5304         largeArcFlag = largeArcFlagArg;
5305         sweepFlag    = sweepFlagArg;
5306         }
5308     /**
5309      *
5310      */
5311     SVGPathSegArcRel(const SVGPathSegArcRel &other)
5312                      : SVGPathSeg(other)
5313         {
5314         type = PATHSEG_ARC_REL;
5315         x  = other.x;  y  = other.y;
5316         r1 = other.r1; r2 = other.r2;
5317         angle        = other.angle;
5318         largeArcFlag = other.largeArcFlag;
5319         sweepFlag    = other.sweepFlag;
5320         }
5322     /**
5323      *
5324      */
5325     virtual ~SVGPathSegArcRel() {}
5327 protected:
5329     double x, y, r1, r2, angle;
5330     bool largeArcFlag;
5331     bool sweepFlag;
5333 };
5340 /*#########################################################################
5341 ## SVGPathSegLinetoHorizontalAbs
5342 #########################################################################*/
5344 /**
5345  *
5346  */
5347 class SVGPathSegLinetoHorizontalAbs : public SVGPathSeg
5349 public:
5351     /**
5352      *
5353      */
5354     virtual double getX()
5355         { return x; }
5357     /**
5358      *
5359      */
5360     virtual void setX(double val) throw (DOMException)
5361         { x = val; }
5363     //##################
5364     //# Non-API methods
5365     //##################
5367     /**
5368      *
5369      */
5370     SVGPathSegLinetoHorizontalAbs()
5371         {
5372         type = PATHSEG_LINETO_HORIZONTAL_ABS;
5373         x = 0.0;
5374         }
5377     /**
5378      *
5379      */
5380     SVGPathSegLinetoHorizontalAbs(double xArg)
5381         {
5382         type = PATHSEG_LINETO_HORIZONTAL_ABS;
5383         x = xArg;
5384         }
5386     /**
5387      *
5388      */
5389     SVGPathSegLinetoHorizontalAbs(const SVGPathSegLinetoHorizontalAbs &other)
5390                      : SVGPathSeg(other)
5391         {
5392         type = PATHSEG_LINETO_HORIZONTAL_ABS;
5393         x = other.x;
5394         }
5396     /**
5397      *
5398      */
5399     virtual ~SVGPathSegLinetoHorizontalAbs() {}
5401 protected:
5403     double x;
5405 };
5412 /*#########################################################################
5413 ## SVGPathSegLinetoHorizontalRel
5414 #########################################################################*/
5416 /**
5417  *
5418  */
5419 class SVGPathSegLinetoHorizontalRel : public SVGPathSeg
5421 public:
5423     /**
5424      *
5425      */
5426     virtual double getX()
5427         { return x; }
5429     /**
5430      *
5431      */
5432     virtual void setX(double val) throw (DOMException)
5433         { x = val; }
5435     //##################
5436     //# Non-API methods
5437     //##################
5439     /**
5440      *
5441      */
5442     SVGPathSegLinetoHorizontalRel()
5443         {
5444         type = PATHSEG_LINETO_HORIZONTAL_REL;
5445         x = 0.0;
5446         }
5449     /**
5450      *
5451      */
5452     SVGPathSegLinetoHorizontalRel(double xArg)
5453         {
5454         type = PATHSEG_LINETO_HORIZONTAL_REL;
5455         x = xArg;
5456         }
5458     /**
5459      *
5460      */
5461     SVGPathSegLinetoHorizontalRel(const SVGPathSegLinetoHorizontalRel &other)
5462                      : SVGPathSeg(other)
5463         {
5464         type = PATHSEG_LINETO_HORIZONTAL_REL;
5465         x = other.x;
5466         }
5468     /**
5469      *
5470      */
5471     virtual ~SVGPathSegLinetoHorizontalRel() {}
5473 protected:
5475     double x;
5477 };
5481 /*#########################################################################
5482 ## SVGPathSegLinetoVerticalAbs
5483 #########################################################################*/
5485 /**
5486  *
5487  */
5488 class SVGPathSegLinetoVerticalAbs : public SVGPathSeg
5490 public:
5492     /**
5493      *
5494      */
5495     virtual double getY()
5496         { return y; }
5498     /**
5499      *
5500      */
5501     virtual void setY(double val) throw (DOMException)
5502         { y = val; }
5504     //##################
5505     //# Non-API methods
5506     //##################
5508     /**
5509      *
5510      */
5511     SVGPathSegLinetoVerticalAbs()
5512         {
5513         type = PATHSEG_LINETO_VERTICAL_ABS;
5514         y = 0.0;
5515         }
5518     /**
5519      *
5520      */
5521     SVGPathSegLinetoVerticalAbs(double yArg)
5522         {
5523         type = PATHSEG_LINETO_VERTICAL_ABS;
5524         y = yArg;
5525         }
5527     /**
5528      *
5529      */
5530     SVGPathSegLinetoVerticalAbs(const SVGPathSegLinetoVerticalAbs &other)
5531                      : SVGPathSeg(other)
5532         {
5533         type = PATHSEG_LINETO_VERTICAL_ABS;
5534         y = other.y;
5535         }
5537     /**
5538      *
5539      */
5540     virtual ~SVGPathSegLinetoVerticalAbs() {}
5542 protected:
5544     double y;
5546 };
5550 /*#########################################################################
5551 ## SVGPathSegLinetoVerticalRel
5552 #########################################################################*/
5554 /**
5555  *
5556  */
5557 class SVGPathSegLinetoVerticalRel : public SVGPathSeg
5559 public:
5561     /**
5562      *
5563      */
5564     virtual double getY()
5565         { return y; }
5567     /**
5568      *
5569      */
5570     virtual void setY(double val) throw (DOMException)
5571         { y = val; }
5573     //##################
5574     //# Non-API methods
5575     //##################
5577     /**
5578      *
5579      */
5580     SVGPathSegLinetoVerticalRel()
5581         {
5582         type = PATHSEG_LINETO_VERTICAL_REL;
5583         y = 0.0;
5584         }
5587     /**
5588      *
5589      */
5590     SVGPathSegLinetoVerticalRel(double yArg)
5591         {
5592         type = PATHSEG_LINETO_VERTICAL_REL;
5593         y = yArg;
5594         }
5596     /**
5597      *
5598      */
5599     SVGPathSegLinetoVerticalRel(const SVGPathSegLinetoVerticalRel &other)
5600                      : SVGPathSeg(other)
5601         {
5602         type = PATHSEG_LINETO_VERTICAL_REL;
5603         y = other.y;
5604         }
5606     /**
5607      *
5608      */
5609     virtual ~SVGPathSegLinetoVerticalRel() {}
5611 protected:
5613     double y;
5615 };
5622 /*#########################################################################
5623 ## SVGPathSegCurvetoCubicSmoothAbs
5624 #########################################################################*/
5626 /**
5627  *
5628  */
5629 class SVGPathSegCurvetoCubicSmoothAbs : public SVGPathSeg
5631 public:
5633     /**
5634      *
5635      */
5636     virtual double getX()
5637         { return x; }
5639     /**
5640      *
5641      */
5642     virtual void setX(double val) throw (DOMException)
5643         { x = val; }
5645     /**
5646      *
5647      */
5648     virtual double getY()
5649         { return y; }
5651     /**
5652      *
5653      */
5654     virtual void setY(double val) throw (DOMException)
5655         { y = val; }
5657     /**
5658      *
5659      */
5660     virtual double getX2()
5661         { return x2; }
5663     /**
5664      *
5665      */
5666     virtual void setX2(double val) throw (DOMException)
5667         { x2 = val; }
5669     /**
5670      *
5671      */
5672     virtual double getY2()
5673         { return y2; }
5675     /**
5676      *
5677      */
5678     virtual void setY2(double val) throw (DOMException)
5679         { y2 = val; }
5682     //##################
5683     //# Non-API methods
5684     //##################
5686     /**
5687      *
5688      */
5689     SVGPathSegCurvetoCubicSmoothAbs()
5690         {
5691         type = PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;
5692         x = y = x2 = y2 = 0.0;
5693         }
5696     /**
5697      *
5698      */
5699     SVGPathSegCurvetoCubicSmoothAbs(double xArg,   double yArg,
5700                                     double x2Arg, double y2Arg)
5701         {
5702         type = PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;
5703         x  = xArg;    y  = yArg;
5704         x2 = x2Arg;   y2 = y2Arg;
5705         }
5707     /**
5708      *
5709      */
5710     SVGPathSegCurvetoCubicSmoothAbs(const SVGPathSegCurvetoCubicSmoothAbs &other)
5711                      : SVGPathSeg(other)
5712         {
5713         type = PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;
5714         x  = other.x;  y  = other.y;
5715         x2 = other.x2; y2 = other.y2;
5716         }
5718     /**
5719      *
5720      */
5721     virtual ~SVGPathSegCurvetoCubicSmoothAbs() {}
5723 protected:
5725     double x, y, x2, y2;
5727 };
5731 /*#########################################################################
5732 ## SVGPathSegCurvetoCubicSmoothRel
5733 #########################################################################*/
5735 /**
5736  *
5737  */
5738 class SVGPathSegCurvetoCubicSmoothRel : public SVGPathSeg
5740 public:
5742     /**
5743      *
5744      */
5745     virtual double getX()
5746         { return x; }
5748     /**
5749      *
5750      */
5751     virtual void setX(double val) throw (DOMException)
5752         { x = val; }
5754     /**
5755      *
5756      */
5757     virtual double getY()
5758         { return y; }
5760     /**
5761      *
5762      */
5763     virtual void setY(double val) throw (DOMException)
5764         { y = val; }
5766     /**
5767      *
5768      */
5769     virtual double getX2()
5770         { return x2; }
5772     /**
5773      *
5774      */
5775     virtual void setX2(double val) throw (DOMException)
5776         { x2 = val; }
5778     /**
5779      *
5780      */
5781     virtual double getY2()
5782         { return y2; }
5784     /**
5785      *
5786      */
5787     virtual void setY2(double val) throw (DOMException)
5788         { y2 = val; }
5791     //##################
5792     //# Non-API methods
5793     //##################
5795     /**
5796      *
5797      */
5798     SVGPathSegCurvetoCubicSmoothRel()
5799         {
5800         type = PATHSEG_CURVETO_CUBIC_SMOOTH_REL;
5801         x = y = x2 = y2 = 0.0;
5802         }
5805     /**
5806      *
5807      */
5808     SVGPathSegCurvetoCubicSmoothRel(double xArg,   double yArg,
5809                                     double x2Arg, double y2Arg)
5810         {
5811         type = PATHSEG_CURVETO_CUBIC_SMOOTH_REL;
5812         x  = xArg;    y  = yArg;
5813         x2 = x2Arg;   y2 = y2Arg;
5814         }
5816     /**
5817      *
5818      */
5819     SVGPathSegCurvetoCubicSmoothRel(const SVGPathSegCurvetoCubicSmoothRel &other)
5820                      : SVGPathSeg(other)
5821         {
5822         type = PATHSEG_CURVETO_CUBIC_SMOOTH_REL;
5823         x  = other.x;  y  = other.y;
5824         x2 = other.x2; y2 = other.y2;
5825         }
5827     /**
5828      *
5829      */
5830     virtual ~SVGPathSegCurvetoCubicSmoothRel() {}
5832 protected:
5834     double x, y, x2, y2;
5836 };
5843 /*#########################################################################
5844 ## SVGPathSegCurvetoQuadraticSmoothAbs
5845 #########################################################################*/
5847 /**
5848  *
5849  */
5850 class SVGPathSegCurvetoQuadraticSmoothAbs : public SVGPathSeg
5852 public:
5854     /**
5855      *
5856      */
5857     virtual double getX()
5858         { return x; }
5860     /**
5861      *
5862      */
5863     virtual void setX(double val) throw (DOMException)
5864         { x = val; }
5866     /**
5867      *
5868      */
5869     virtual double getY()
5870         { return y; }
5872     /**
5873      *
5874      */
5875     virtual void setY(double val) throw (DOMException)
5876         { y = val; }
5880     //##################
5881     //# Non-API methods
5882     //##################
5884     /**
5885      *
5886      */
5887     SVGPathSegCurvetoQuadraticSmoothAbs()
5888         {
5889         type = PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;
5890         x = y = 0.0;
5891         }
5894     /**
5895      *
5896      */
5897     SVGPathSegCurvetoQuadraticSmoothAbs(double xArg, double yArg)
5898         {
5899         type = PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;
5900         x = xArg;     y = yArg;
5901         }
5903     /**
5904      *
5905      */
5906     SVGPathSegCurvetoQuadraticSmoothAbs(const SVGPathSegCurvetoQuadraticSmoothAbs &other)
5907                      : SVGPathSeg(other)
5908         {
5909         type = PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;
5910         x = y = 0.0;
5911         }
5913     /**
5914      *
5915      */
5916     virtual ~SVGPathSegCurvetoQuadraticSmoothAbs() {}
5918 protected:
5920     double x, y;
5922 };
5929 /*#########################################################################
5930 ## SVGPathSegCurvetoQuadraticSmoothRel
5931 #########################################################################*/
5933 /**
5934  *
5935  */
5936 class SVGPathSegCurvetoQuadraticSmoothRel : public SVGPathSeg
5938 public:
5940     /**
5941      *
5942      */
5943     virtual double getX()
5944         { return x; }
5946     /**
5947      *
5948      */
5949     virtual void setX(double val) throw (DOMException)
5950         { x = val; }
5952     /**
5953      *
5954      */
5955     virtual double getY()
5956         { return y; }
5958     /**
5959      *
5960      */
5961     virtual void setY(double val) throw (DOMException)
5962         { y = val; }
5966     //##################
5967     //# Non-API methods
5968     //##################
5970     /**
5971      *
5972      */
5973     SVGPathSegCurvetoQuadraticSmoothRel()
5974         {
5975         type = PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;
5976         x = y = 0.0;
5977         }
5980     /**
5981      *
5982      */
5983     SVGPathSegCurvetoQuadraticSmoothRel(double xArg, double yArg)
5984         {
5985         type = PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;
5986         x = xArg;     y = yArg;
5987         }
5989     /**
5990      *
5991      */
5992     SVGPathSegCurvetoQuadraticSmoothRel(const SVGPathSegCurvetoQuadraticSmoothRel &other)
5993                      : SVGPathSeg(other)
5994         {
5995         type = PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;
5996         x = y = 0.0;
5997         }
5999     /**
6000      *
6001      */
6002     virtual ~SVGPathSegCurvetoQuadraticSmoothRel() {}
6004 protected:
6006     double x, y;
6008 };
6015 /*#########################################################################
6016 ## SVGPathSegList
6017 #########################################################################*/
6019 /**
6020  *
6021  */
6022 class SVGPathSegList
6024 public:
6026     /**
6027      *
6028      */
6029     virtual unsigned long getNumberOfItems()
6030         { return items.size(); }
6033     /**
6034      *
6035      */
6036     virtual void clear () throw( DOMException )
6037         { items.clear(); }
6039     /**
6040      *
6041      */
6042     virtual SVGPathSeg initialize (const SVGPathSeg &newItem)
6043                     throw( DOMException, SVGException )
6044         {
6045         items.clear();
6046         items.push_back(newItem);
6047         return newItem;
6048         }
6050     /**
6051      *
6052      */
6053     virtual SVGPathSeg getItem (unsigned long index)
6054                     throw( DOMException )
6055         {
6056         if (index >= items.size())
6057             {
6058             SVGPathSeg seg;
6059             return seg;
6060             }
6061         return items[index];
6062         }
6064     /**
6065      *
6066      */
6067     virtual SVGPathSeg insertItemBefore(const SVGPathSeg &newItem,
6068                                         unsigned long index )
6069                           throw( DOMException, SVGException )
6070         {
6071         if (index >= items.size())
6072             items.push_back(newItem);
6073         else
6074             {
6075             std::vector<SVGPathSeg>::iterator iter = items.begin() + index;
6076             items.insert(iter, newItem);
6077             }
6078         return newItem;
6079         }
6081     /**
6082      *
6083      */
6084     virtual SVGPathSeg replaceItem(const SVGPathSeg &newItem,
6085                                    unsigned long index )
6086                               throw( DOMException, SVGException )
6087         {
6088         if (index >= items.size())
6089             {
6090             SVGPathSeg seg;
6091             return seg;
6092             }
6093         std::vector<SVGPathSeg>::iterator iter = items.begin() + index;
6094         *iter = newItem;
6095         return newItem;
6096         }
6098     /**
6099      *
6100      */
6101     virtual SVGPathSeg removeItem (unsigned long index)
6102                                   throw (DOMException)
6103         {
6104         if (index >= items.size())
6105             {
6106             SVGPathSeg seg;
6107             return seg;
6108             }
6109         std::vector<SVGPathSeg>::iterator iter = items.begin() + index;
6110         SVGPathSeg olditem = *iter;
6111         items.erase(iter);
6112         return olditem;
6113         }
6115     /**
6116      *
6117      */
6118     virtual SVGPathSeg appendItem (const SVGPathSeg &newItem)
6119                     throw( DOMException, SVGException )
6120         {
6121         items.push_back(newItem);
6122         return newItem;
6123         }
6127     //##################
6128     //# Non-API methods
6129     //##################
6131     /**
6132      *
6133      */
6134     SVGPathSegList() {}
6137     /**
6138      *
6139      */
6140     SVGPathSegList(const SVGPathSegList &other)
6141         {
6142         items = other.items;
6143         }
6146     /**
6147      *
6148      */
6149     virtual ~SVGPathSegList() {}
6151 protected:
6153     std::vector<SVGPathSeg> items;
6155 };
6162 /*#########################################################################
6163 ## SVGAnimatedPathData
6164 #########################################################################*/
6166 /**
6167  *
6168  */
6169 class SVGAnimatedPathData
6171 public:
6173     /**
6174      *
6175      */
6176     virtual SVGPathSegList getPathSegList()
6177         {
6178         SVGPathSegList list;
6179         return list;
6180         }
6182     /**
6183      *
6184      */
6185     virtual SVGPathSegList getNormalizedPathSegList()
6186         {
6187         SVGPathSegList list;
6188         return list;
6189         }
6191     /**
6192      *
6193      */
6194     virtual SVGPathSegList getAnimatedPathSegList()
6195         {
6196         SVGPathSegList list;
6197         return list;
6198         }
6200     /**
6201      *
6202      */
6203     virtual SVGPathSegList getAnimatedNormalizedPathSegList()
6204         {
6205         SVGPathSegList list;
6206         return list;
6207         }
6211     //##################
6212     //# Non-API methods
6213     //##################
6215     /**
6216      *
6217      */
6218    SVGAnimatedPathData()
6219         {}
6221     /**
6222      *
6223      */
6224    SVGAnimatedPathData(const SVGAnimatedPathData &/*other*/)
6225         {
6226         }
6228     /**
6229      *
6230      */
6231     virtual ~SVGAnimatedPathData() {}
6233 };
6240 /*#########################################################################
6241 ## SVGAnimatedPoints
6242 #########################################################################*/
6244 /**
6245  *
6246  */
6247 class SVGAnimatedPoints
6249 public:
6251     /**
6252      *
6253      */
6254     virtual SVGPointList getPoints()
6255         { return points; }
6257     /**
6258      *
6259      */
6260     virtual SVGPointList getAnimatedPoints()
6261         { return animatedPoints; }
6265     //##################
6266     //# Non-API methods
6267     //##################
6269     /**
6270      *
6271      */
6272     SVGAnimatedPoints() {}
6274     /**
6275      *
6276      */
6277     SVGAnimatedPoints(const SVGAnimatedPoints &other)
6278         {
6279         points         = other.points;
6280         animatedPoints = other.animatedPoints;
6281         }
6283     /**
6284      *
6285      */
6286     virtual ~SVGAnimatedPoints() {}
6288 protected:
6290     SVGPointList points;
6291     SVGPointList animatedPoints;
6293 };
6299 /*#########################################################################
6300 ## SVGPaint
6301 #########################################################################*/
6303 /**
6304  *
6305  */
6306 class SVGPaint : public SVGColor
6308 public:
6311     /**
6312      * Paint Types
6313      */
6314     typedef enum
6315         {
6316         SVG_PAINTTYPE_UNKNOWN               = 0,
6317         SVG_PAINTTYPE_RGBCOLOR              = 1,
6318         SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR     = 2,
6319         SVG_PAINTTYPE_NONE                  = 101,
6320         SVG_PAINTTYPE_CURRENTCOLOR          = 102,
6321         SVG_PAINTTYPE_URI_NONE              = 103,
6322         SVG_PAINTTYPE_URI_CURRENTCOLOR      = 104,
6323         SVG_PAINTTYPE_URI_RGBCOLOR          = 105,
6324         SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR = 106,
6325         SVG_PAINTTYPE_URI                   = 107
6326         } PaintType;
6329     /**
6330      *
6331      */
6332     virtual unsigned short getPaintType()
6333         { return paintType; }
6335     /**
6336      *
6337      */
6338     virtual DOMString getUri()
6339         { return uri; }
6341     /**
6342      *
6343      */
6344     virtual void setUri (const DOMString& uriArg )
6345         { uri = uriArg; }
6347     /**
6348      *
6349      */
6350     virtual void setPaint (unsigned short paintTypeArg,
6351                            const DOMString& uriArg,
6352                            const DOMString& /*rgbColor*/,
6353                            const DOMString& /*iccColor*/ )
6354                            throw( SVGException )
6355         {
6356         paintType = paintTypeArg;
6357         uri       = uriArg;
6358         //do something with rgbColor
6359         //do something with iccColor;
6360         }
6364     //##################
6365     //# Non-API methods
6366     //##################
6368     /**
6369      *
6370      */
6371     SVGPaint()
6372         {
6373         uri       = "";
6374         paintType = SVG_PAINTTYPE_UNKNOWN;
6375         }
6377     /**
6378      *
6379      */
6380     SVGPaint(const SVGPaint &other) : css::CSSValue(other), SVGColor(other)
6381         {
6382         uri       = "";
6383         paintType = SVG_PAINTTYPE_UNKNOWN;
6384         }
6386     /**
6387      *
6388      */
6389     virtual ~SVGPaint() {}
6391 protected:
6393     unsigned int paintType;
6394     DOMString uri;
6396 };
6401 /*#########################################################################
6402 ## SVGColorProfileRule
6403 #########################################################################*/
6405 /**
6406  *
6407  */
6408 class SVGColorProfileRule : public SVGCSSRule,
6409                             public SVGRenderingIntent
6412 public:
6413    /**
6414      *
6415      */
6416     virtual DOMString getSrc()
6417         { return src; }
6419     /**
6420      *
6421      */
6422     virtual void setSrc(const DOMString &val) throw (DOMException)
6423         { src = val; }
6425     /**
6426      *
6427      */
6428     virtual DOMString getName()
6429         { return name; }
6431     /**
6432      *
6433      */
6434     virtual void setName(const DOMString &val) throw (DOMException)
6435         { name = val; }
6437     /**
6438      *
6439      */
6440     virtual unsigned short getRenderingIntent()
6441         { return renderingIntent; }
6443     /**
6444      *
6445      */
6446     virtual void setRenderingIntent(unsigned short val) throw (DOMException)
6447         { renderingIntent = val; }
6450     //##################
6451     //# Non-API methods
6452     //##################
6454     /**
6455      *
6456      */
6457     SVGColorProfileRule() {}
6459     /**
6460      *
6461      */
6462     SVGColorProfileRule(const SVGColorProfileRule &other)
6463                : SVGCSSRule(other), SVGRenderingIntent(other)
6464         {
6465         renderingIntent = other.renderingIntent;
6466         src             = other.src;
6467         name            = other.name;
6468         }
6470     /**
6471      *
6472      */
6473     virtual ~SVGColorProfileRule() {}
6475 protected:
6477     unsigned short renderingIntent;
6478     DOMString src;
6479     DOMString name;
6481 };
6485 /*#########################################################################
6486 ## SVGFilterPrimitiveStandardAttributes
6487 #########################################################################*/
6489 /**
6490  *
6491  */
6492 class SVGFilterPrimitiveStandardAttributes : public SVGStylable
6494 public:
6498     /**
6499      *
6500      */
6501     virtual SVGAnimatedLength getX()
6502         { return x; }
6504     /**
6505      *
6506      */
6507     virtual SVGAnimatedLength getY()
6508         { return y; }
6510     /**
6511      *
6512      */
6513     virtual SVGAnimatedLength getWidth()
6514         { return width; }
6516     /**
6517      *
6518      */
6519     virtual SVGAnimatedLength getHeight()
6520         { return height; }
6522     /**
6523      *
6524      */
6525     virtual SVGAnimatedString getResult()
6526         { return result; }
6530     //##################
6531     //# Non-API methods
6532     //##################
6535     /**
6536      *
6537      */
6538     SVGFilterPrimitiveStandardAttributes()
6539         {}
6541     /**
6542      *
6543      */
6544     SVGFilterPrimitiveStandardAttributes(const SVGFilterPrimitiveStandardAttributes &other)
6545                                  : SVGStylable(other)
6546         {
6547         x      = other.x;
6548         y      = other.y;
6549         width  = other.width;
6550         height = other.height;
6551         result = other.result;
6552         }
6554     /**
6555      *
6556      */
6557     virtual ~SVGFilterPrimitiveStandardAttributes() {}
6559 protected:
6561     SVGAnimatedLength x;
6562     SVGAnimatedLength y;
6563     SVGAnimatedLength width;
6564     SVGAnimatedLength height;
6565     SVGAnimatedString result;
6567 };
6579 /*#########################################################################
6580 ## SVGEvent
6581 #########################################################################*/
6583 /**
6584  *
6585  */
6586 class SVGEvent : events::Event
6588 public:
6590     //##################
6591     //# Non-API methods
6592     //##################
6594     /**
6595      *
6596      */
6597     SVGEvent() {}
6599     /**
6600      *
6601      */
6602     SVGEvent(const SVGEvent &other) : events::Event(other)
6603         {}
6605     /**
6606      *
6607      */
6608     virtual ~SVGEvent() {}
6610 };
6615 /*#########################################################################
6616 ## SVGZoomEvent
6617 #########################################################################*/
6619 /**
6620  *
6621  */
6622 class SVGZoomEvent : events::UIEvent
6624 public:
6626     /**
6627      *
6628      */
6629     virtual SVGRect getZoomRectScreen()
6630         { return zoomRectScreen; }
6632     /**
6633      *
6634      */
6635     virtual double getPreviousScale()
6636         { return previousScale; }
6638     /**
6639      *
6640      */
6641     virtual SVGPoint getPreviousTranslate()
6642         { return previousTranslate; }
6644     /**
6645      *
6646      */
6647     virtual double getNewScale()
6648         { return newScale; }
6650    /**
6651      *
6652      */
6653     virtual SVGPoint getNewTranslate()
6654         { return newTranslate; }
6658     //##################
6659     //# Non-API methods
6660     //##################
6662     /**
6663      *
6664      */
6665     SVGZoomEvent()
6666         {}
6668     /**
6669      *
6670      */
6671     SVGZoomEvent(const SVGZoomEvent &other) : events::Event(other),
6672                                               events::UIEvent(other)
6673         {
6674         zoomRectScreen    = other.zoomRectScreen;
6675         previousScale     = other.previousScale;
6676         previousTranslate = other.previousTranslate;
6677         newScale          = other.newScale;
6678         newTranslate      = other.newTranslate;
6679         }
6681     /**
6682      *
6683      */
6684     virtual ~SVGZoomEvent() {}
6686 protected:
6688     SVGRect  zoomRectScreen;
6689     double   previousScale;
6690     SVGPoint previousTranslate;
6691     double   newScale;
6692     SVGPoint newTranslate;
6694 };
6698 /*#########################################################################
6699 ## SVGElementInstance
6700 #########################################################################*/
6702 /**
6703  *
6704  */
6705 class SVGElementInstance : public events::EventTarget
6707 public:
6709     /**
6710      *
6711      */
6712     virtual SVGElementPtr getCorrespondingElement()
6713         { return correspondingElement; }
6715     /**
6716      *
6717      */
6718     virtual SVGUseElementPtr getCorrespondingUseElement()
6719         { return correspondingUseElement; }
6721     /**
6722      *
6723      */
6724     virtual SVGElementInstance getParentNode()
6725         {
6726         SVGElementInstance ret;
6727         return ret;
6728         }
6730     /**
6731      *  Since we are using stack types and this is a circular definition,
6732      *  we will instead implement this as a global function below:
6733      *   SVGElementInstanceList getChildNodes(const SVGElementInstance instance);
6734      */
6735     //virtual SVGElementInstanceList getChildNodes();
6737     /**
6738      *
6739      */
6740     virtual SVGElementInstance getFirstChild()
6741         {
6742         SVGElementInstance ret;
6743         return ret;
6744         }
6746     /**
6747      *
6748      */
6749     virtual SVGElementInstance getLastChild()
6750         {
6751         SVGElementInstance ret;
6752         return ret;
6753         }
6755     /**
6756      *
6757      */
6758     virtual SVGElementInstance getPreviousSibling()
6759         {
6760         SVGElementInstance ret;
6761         return ret;
6762         }
6764     /**
6765      *
6766      */
6767     virtual SVGElementInstance getNextSibling()
6768         {
6769         SVGElementInstance ret;
6770         return ret;
6771         }
6774     //##################
6775     //# Non-API methods
6776     //##################
6778     /**
6779      *
6780      */
6781     SVGElementInstance() {}
6783     /**
6784      *
6785      */
6786     SVGElementInstance(const SVGElementInstance &other)
6787                         : events::EventTarget(other)
6788         {
6789         }
6791     /**
6792      *
6793      */
6794     virtual ~SVGElementInstance() {}
6796 protected:
6798     SVGElementPtr      correspondingElement;
6799     SVGUseElementPtr   correspondingUseElement;
6801 };
6808 /*#########################################################################
6809 ## SVGElementInstanceList
6810 #########################################################################*/
6812 /**
6813  *
6814  */
6815 class SVGElementInstanceList
6817 public:
6820     /**
6821      *
6822      */
6823     virtual unsigned long getLength()
6824         { return items.size(); }
6826     /**
6827      *
6828      */
6829     virtual SVGElementInstance item (unsigned long index )
6830         {
6831         if (index >= items.size())
6832             {
6833             SVGElementInstance ret;
6834             return ret;
6835             }
6836         return items[index];
6837         }
6839     /**
6840      *  This static method replaces the circular definition of:
6841      *        SVGElementInstanceList SVGElementInstance::getChildNodes()
6842      *
6843      */
6844     static SVGElementInstanceList getChildNodes(const SVGElementInstance &/*instance*/)
6845         {
6846         SVGElementInstanceList list;
6847         return list;
6848         }
6851     //##################
6852     //# Non-API methods
6853     //##################
6855     /**
6856      *
6857      */
6858     SVGElementInstanceList() {}
6860     /**
6861      *
6862      */
6863     SVGElementInstanceList(const SVGElementInstanceList &other)
6864         {
6865         items = other.items;
6866         }
6868     /**
6869      *
6870      */
6871     virtual ~SVGElementInstanceList() {}
6873 protected:
6875     std::vector<SVGElementInstance> items;
6878 };
6892 }  //namespace svg
6893 }  //namespace dom
6894 }  //namespace w3c
6895 }  //namespace org
6897 #endif /* __SVGTYPES_H__ */
6898 /*#########################################################################
6899 ## E N D    O F    F I L E
6900 #########################################################################*/