Code

Translations. French translation minor update.
[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 <cstdio>
61 #include <math.h>
65 namespace org {
66 namespace w3c {
67 namespace dom {
68 namespace svg {
73 //local definitions
74 typedef dom::DOMString DOMString;
75 typedef dom::DOMException DOMException;
76 typedef dom::Element Element;
77 typedef dom::Document Document;
78 typedef dom::NodeList NodeList;
81 class SVGElement;
82 typedef Ptr<SVGElement> SVGElementPtr;
83 class SVGUseElement;
84 typedef Ptr<SVGUseElement> SVGUseElementPtr;
85 class SVGAnimatedPreserveAspectRatio;
88 /*#########################################################################
89 ## SVGException
90 #########################################################################*/
92 /**
93  *
94  */
95 class SVGException
96 {
97 public:
98     // unsigned short   code;  //inherited
99 };
101     /**
102      * SVGExceptionCode
103      */
104     typedef enum
105         {
106         SVG_WRONG_TYPE_ERR           = 0,
107         SVG_INVALID_VALUE_ERR        = 1,
108         SVG_MATRIX_NOT_INVERTABLE    = 2
109         } SVGExceptionCode;
115 /*#########################################################################
116 ## SVGMatrix
117 #########################################################################*/
119 /**
120  *  In SVG, a Matrix is defined like this:
121  *
122  * | a  c  e |
123  * | b  d  f |
124  * | 0  0  1 |
125  *
126  */
127 class SVGMatrix
129 public:
132     /**
133      *
134      */
135     virtual double getA()
136         { return a; }
138     /**
139      *
140      */
141     virtual void setA(double val) throw (DOMException)
142         { a = val; }
144     /**
145      *
146      */
147     virtual double getB()
148         { return b; }
150     /**
151      *
152      */
153     virtual void setB(double val) throw (DOMException)
154         { b = val; }
156     /**
157      *
158      */
159     virtual double getC()
160         { return c; }
162     /**
163      *
164      */
165     virtual void setC(double val) throw (DOMException)
166         { c = val; }
168     /**
169      *
170      */
171     virtual double getD()
172         { return d; }
174     /**
175      *
176      */
177     virtual void setD(double val) throw (DOMException)
178         { d = val; }
179     /**
180      *
181      */
182     virtual double getE()
183         { return e; }
185     /**
186      *
187      */
188     virtual void setE(double val) throw (DOMException)
189         { e = val; }
190     /**
191      *
192      */
193     virtual double getF()
194         { return f; }
196     /**
197      *
198      */
199     virtual void setF(double val) throw (DOMException)
200         { f = val; }
203     /**
204      * Return the result of postmultiplying this matrix with another.
205      */
206     virtual SVGMatrix multiply(const SVGMatrix &other)
207         {
208         SVGMatrix result;
209         result.a = a * other.a  +  c * other.b;
210         result.b = b * other.a  +  d * other.b;
211         result.c = a * other.c  +  c * other.d;
212         result.d = b * other.c  +  d * other.d;
213         result.e = a * other.e  +  c * other.f  +  e;
214         result.f = b * other.e  +  d * other.f  +  f;
215         return result;
216         }
218     /**
219      *  Calculate the inverse of this matrix
220      *
221      */
222     virtual SVGMatrix inverse(  ) throw( SVGException )
223         {
224         /*###########################################
225         The determinant of a 3x3 matrix E
226            (let's use our own notation for a bit)
228             A  B  C
229             D  E  F
230             G  H  I
231         is
232             AEI - AFH - BDI + BFG + CDH - CEG
234         Since in our affine transforms, G and H==0 and I==1,
235         this reduces to:
236             AE - BD
237         In SVG's naming scheme, that is:  a * d - c * b .  SIMPLE!
239         In a similar method of attack, SVG's adjunct matrix is:
241            d  -c   cf-ed
242           -b   a   eb-af
243            0   0   ad-cb
245         To get the inverse matrix, we divide the adjunct matrix by
246         the determinant.  Notice that (ad-cb)/(ad-cb)==1.  Very cool.
247         So what we end up with is this:
249            a =  d/(ad-cb)  c = -c/(ad-cb)   e = (cf-ed)/(ad-cb)
250            b = -b/(ad-cb)  d =  a/(ad-cb)   f = (eb-af)/(ad-cb)
252         (Since this would be in all SVG-DOM implementations,
253          somebody needed to document this!  ^^ )
254         #############################################*/
256         SVGMatrix result;
257         double determinant = a * d  -  c * b;
258         if (determinant < 1.0e-18)//invertible?
259             {
260             result.identity();//cop out
261             return result;
262             }
264         double idet = 1.0 / determinant;
265         result.a =   d * idet;
266         result.b =  -b * idet;
267         result.c =  -c * idet;
268         result.d =   a * idet;
269         result.e =  (c*f - e*d) * idet;
270         result.f =  (e*b - a*f) * idet;
271         return result;
272         }
274     /**
275      * Equivalent to multiplying by:
276      *  | 1  0  x |
277      *  | 0  1  y |
278      *  | 0  0  1 |
279      *
280      */
281     virtual SVGMatrix translate(double x, double y )
282         {
283         SVGMatrix result;
284         result.a = a;
285         result.b = b;
286         result.c = c;
287         result.d = d;
288         result.e = a * x  +  c * y  +  e;
289         result.f = b * x  +  d * y  +  f;
290         return result;
291         }
293     /**
294      * Equivalent to multiplying by:
295      *  | scale  0      0 |
296      *  | 0      scale  0 |
297      *  | 0      0      1 |
298      *
299      */
300     virtual SVGMatrix scale(double scale)
301         {
302         SVGMatrix result;
303         result.a = a * scale;
304         result.b = b * scale;
305         result.c = c * scale;
306         result.d = d * scale;
307         result.e = e;
308         result.f = f;
309         return result;
310         }
312     /**
313      * Equivalent to multiplying by:
314      *  | scaleX  0       0 |
315      *  | 0       scaleY  0 |
316      *  | 0       0       1 |
317      *
318      */
319     virtual SVGMatrix scaleNonUniform(double scaleX,
320                                       double scaleY )
321         {
322         SVGMatrix result;
323         result.a = a * scaleX;
324         result.b = b * scaleX;
325         result.c = c * scaleY;
326         result.d = d * scaleY;
327         result.e = e;
328         result.f = f;
329         return result;
330         }
332     /**
333      * Equivalent to multiplying by:
334      *  | cos(a) -sin(a)   0 |
335      *  | sin(a)  cos(a)   0 |
336      *  | 0       0        1 |
337      *
338      */
339     virtual SVGMatrix rotate (double angle)
340         {
341         double sina  = sin(angle);
342         double msina = -sina;
343         double cosa  = cos(angle);
344         SVGMatrix result;
345         result.a = a * cosa   +  c * sina;
346         result.b = b * cosa   +  d + sina;
347         result.c = a * msina  +  c * cosa;
348         result.d = b * msina  +  d * cosa;
349         result.e = e;
350         result.f = f;
351         return result;
352         }
354     /**
355      * Equivalent to multiplying by:
356      *  | cos(a) -sin(a)   0 |
357      *  | sin(a)  cos(a)   0 |
358      *  | 0       0        1 |
359      *  In this case, angle 'a' is computed as the artangent
360      *  of the slope y/x .  It is negative if the slope is negative.
361      */
362     virtual SVGMatrix rotateFromVector(double x, double y)
363                                       throw( SVGException )
364         {
365         double angle = atan(y / x);
366         if (y < 0.0)
367             angle = -angle;
368         SVGMatrix result;
369         double sina  = sin(angle);
370         double msina = -sina;
371         double cosa  = cos(angle);
372         result.a = a * cosa   +  c * sina;
373         result.b = b * cosa   +  d + sina;
374         result.c = a * msina  +  c * cosa;
375         result.d = b * msina  +  d * cosa;
376         result.e = e;
377         result.f = f;
378         return result;
379         }
381     /**
382      * Equivalent to multiplying by:
383      *  | -1   0   0 |
384      *  | 0    1   0 |
385      *  | 0    0   1 |
386      *
387      */
388     virtual SVGMatrix flipX(  )
389         {
390         SVGMatrix result;
391         result.a = -a;
392         result.b = -b;
393         result.c =  c;
394         result.d =  d;
395         result.e =  e;
396         result.f =  f;
397         return result;
398         }
400     /**
401      * Equivalent to multiplying by:
402      *  | 1   0   0 |
403      *  | 0  -1   0 |
404      *  | 0   0   1 |
405      *
406      */
407     virtual SVGMatrix flipY( )
408         {
409         SVGMatrix result;
410         result.a =  a;
411         result.b =  b;
412         result.c = -c;
413         result.d = -d;
414         result.e =  e;
415         result.f =  f;
416         return result;
417         }
419     /**
420      *  | 1   tan(a)  0 |
421      *  | 0   1       0 |
422      *  | 0   0       1 |
423      *
424      */
425     virtual SVGMatrix skewX(double angle)
426         {
427         double tana = tan(angle);
428         SVGMatrix result;
429         result.a =  a;
430         result.b =  b;
431         result.c =  a * tana + c;
432         result.d =  b * tana + d;
433         result.e =  e;
434         result.f =  f;
435         return result;
436         }
438     /**
439      * Equivalent to multiplying by:
440      *  | 1       0   0 |
441      *  | tan(a)  1   0 |
442      *  | 0       0   1 |
443      *
444      */
445     virtual SVGMatrix skewY(double angle)
446         {
447         double tana = tan(angle);
448         SVGMatrix result;
449         result.a =  a + c * tana;
450         result.b =  b + d * tana;
451         result.c =  c;
452         result.d =  d;
453         result.e =  e;
454         result.f =  f;
455         return result;
456         }
460     //##################
461     //# Non-API methods
462     //##################
464     /**
465      *
466      */
467     SVGMatrix()
468         {
469         identity();
470         }
472     /**
473      *
474      */
475     SVGMatrix(double aArg, double bArg, double cArg,
476               double dArg, double eArg, double fArg )
477         {
478         a = aArg; b = bArg; c = cArg;
479         d = dArg; e = eArg; f = fArg;
480         }
482     /**
483      * Copy constructor
484      */
485     SVGMatrix(const SVGMatrix &other)
486         {
487         a = other.a;
488         b = other.b;
489         c = other.c;
490         d = other.d;
491         e = other.e;
492         f = other.f;
493         }
497     /**
498      *
499      */
500     virtual ~SVGMatrix() {}
502 protected:
504 friend class SVGTransform;
506     /*
507      * Set to the identify matrix
508      */
509    void identity()
510        {
511        a = 1.0;
512        b = 0.0;
513        c = 0.0;
514        d = 1.0;
515        e = 0.0;
516        f = 0.0;
517        }
519     double a, b, c, d, e, f;
521 };
524 /*#########################################################################
525 ## SVGTransform
526 #########################################################################*/
528 /**
529  *
530  */
531 class SVGTransform
533 public:
535     /**
536      * Transform Types
537      */
538     typedef enum
539         {
540         SVG_TRANSFORM_UNKNOWN   = 0,
541         SVG_TRANSFORM_MATRIX    = 1,
542         SVG_TRANSFORM_TRANSLATE = 2,
543         SVG_TRANSFORM_SCALE     = 3,
544         SVG_TRANSFORM_ROTATE    = 4,
545         SVG_TRANSFORM_SKEWX     = 5,
546         SVG_TRANSFORM_SKEWY     = 6,
547         } TransformType;
549     /**
550      *
551      */
552     virtual unsigned short getType()
553         { return type; }
556     /**
557      *
558      */
559     virtual SVGMatrix getMatrix()
560         {
561         return matrix;
562         }
564     /**
565      *
566      */
567     virtual double getAngle()
568         {
569         return angle;
570         }
573     /**
574      *
575      */
576     virtual void setMatrix(const SVGMatrix &matrixArg)
577         {
578         type = SVG_TRANSFORM_MATRIX;
579         matrix = matrixArg;
580         }
582     /**
583      *
584      */
585     virtual void setTranslate (double tx, double ty )
586         {
587         type = SVG_TRANSFORM_TRANSLATE;
588         matrix.setA(1.0);
589         matrix.setB(0.0);
590         matrix.setC(0.0);
591         matrix.setD(1.0);
592         matrix.setE(tx);
593         matrix.setF(ty);
594         }
596     /**
597      *
598      */
599     virtual void setScale (double sx, double sy )
600         {
601         type = SVG_TRANSFORM_SCALE;
602         matrix.setA(sx);
603         matrix.setB(0.0);
604         matrix.setC(0.0);
605         matrix.setD(sy);
606         matrix.setE(0.0);
607         matrix.setF(0.0);
608         }
610     /**
611      *
612      */
613     virtual void setRotate (double angleArg, double cx, double cy)
614         {
615         angle = angleArg;
616         setTranslate(cx, cy);
617         type = SVG_TRANSFORM_ROTATE;
618         matrix.rotate(angle);
619         }
621     /**
622      *
623      */
624     virtual void setSkewX (double angleArg)
625         {
626         angle = angleArg;
627         type = SVG_TRANSFORM_SKEWX;
628         matrix.identity();
629         matrix.skewX(angle);
630         }
632     /**
633      *
634      */
635     virtual void setSkewY (double angleArg)
636         {
637         angle = angleArg;
638         type = SVG_TRANSFORM_SKEWY;
639         matrix.identity();
640         matrix.skewY(angle);
641         }
644     //##################
645     //# Non-API methods
646     //##################
648     /**
649      *
650      */
651     SVGTransform()
652         {
653         type = SVG_TRANSFORM_UNKNOWN;
654         angle = 0.0;
655         }
657     /**
658      *
659      */
660     SVGTransform(const SVGTransform &other)
661         {
662         type   = other.type;
663         angle  = other.angle;
664         matrix = other.matrix;
665         }
667     /**
668      *
669      */
670     virtual ~SVGTransform()
671         {}
673 protected:
675     int type;
676     double angle;
678     SVGMatrix matrix;
679 };
686 /*#########################################################################
687 ## SVGTransformList
688 #########################################################################*/
690 /**
691  *
692  */
693 class SVGTransformList
695 public:
698     /**
699      *
700      */
701     virtual unsigned long getNumberOfItems()
702         { return items.size(); }
705     /**
706      *
707      */
708     virtual void clear( ) throw( DOMException )
709         { items.clear(); }
711     /**
712      *
713      */
714     virtual SVGTransform initialize (const SVGTransform &newItem)
715                          throw( DOMException, SVGException )
716         {
717         items.clear();
718         items.push_back(newItem);
719         return newItem;
720         }
722     /**
723      *
724      */
725     virtual SVGTransform getItem (unsigned long index )
726                     throw( DOMException )
727         {
728         if (index>=items.size())
729             {
730             SVGTransform transform;
731             return transform;
732             }
733         return items[index];
734         }
736     /**
737      *
738      */
739     virtual SVGTransform insertItemBefore (const SVGTransform &newItem,
740                                            unsigned long index )
741                                       throw( DOMException, SVGException )
742         {
743         if (index > items.size())
744             items.push_back(newItem);
745         else
746             {
747             std::vector<SVGTransform>::iterator iter = items.begin() + index;
748             items.insert(iter, newItem);
749             }
750         return newItem;
751         }
753     /**
754      *
755      */
756     virtual SVGTransform replaceItem (const SVGTransform &newItem,
757                                        unsigned long index )
758                                 throw( DOMException, SVGException )
759         {
760         if (index>=items.size())
761             {
762             SVGTransform transform;
763             return transform;
764             }
765         else
766             {
767             std::vector<SVGTransform>::iterator iter = items.begin() + index;
768             *iter = newItem;
769             }
770         return newItem;
771         }
773     /**
774      *
775      */
776     virtual SVGTransform removeItem (unsigned long index )
777                                      throw( DOMException )
778         {
779         if (index>=items.size())
780             {
781             SVGTransform transform;
782             return transform;
783             }
784         std::vector<SVGTransform>::iterator iter = items.begin() + index;
785         SVGTransform oldItem = *iter;
786         items.erase(iter);
787         return oldItem;
788         }
790     /**
791      *
792      */
793     virtual SVGTransform appendItem (const SVGTransform &newItem)
794                                   throw( DOMException, SVGException )
795         {
796         items.push_back(newItem);
797         return newItem;
798         }
800     /**
801      *
802      */
803     virtual SVGTransform createSVGTransformFromMatrix(const SVGMatrix &matrix)
804         {
805         SVGTransform transform;
806         transform.setMatrix(matrix);
807         return transform;
808         }
810     /**
811      *
812      */
813     virtual SVGTransform consolidate()
814         {
815         SVGMatrix matrix;
816         for (unsigned int i=0 ; i<items.size() ; i++)
817             matrix = matrix.multiply(items[i].getMatrix());
818         SVGTransform transform;
819         transform.setMatrix(matrix);
820         items.clear();
821         items.push_back(transform);
822         return transform;
823         }
827     //##################
828     //# Non-API methods
829     //##################
831     /**
832      *
833      */
834     SVGTransformList()
835         {}
837     /**
838      *
839      */
840     SVGTransformList(const SVGTransformList &other)
841         {
842         items = other.items;
843         }
845     /**
846      *
847      */
848     virtual ~SVGTransformList() {}
850 protected:
852     std::vector<SVGTransform> items;
854 };
861 /*#########################################################################
862 ## SVGAnimatedTransformList
863 #########################################################################*/
865 /**
866  *
867  */
868 class SVGAnimatedTransformList
870 public:
872     /**
873      *
874      */
875     virtual SVGTransformList getBaseVal()
876         { return baseVal; }
878     /**
879      *
880      */
881     virtual SVGTransformList getAnimVal()
882         { return animVal; }
886     //##################
887     //# Non-API methods
888     //##################
890     /**
891      *
892      */
893     SVGAnimatedTransformList()
894         {}
896     /**
897      *
898      */
899     SVGAnimatedTransformList(const SVGAnimatedTransformList &other)
900         {
901         baseVal = other.baseVal;
902         animVal = other.animVal;
903         }
905     /**
906      *
907      */
908     virtual ~SVGAnimatedTransformList() {}
910 protected:
912     SVGTransformList baseVal;
913     SVGTransformList animVal;
915 };
920 /*#########################################################################
921 ## SVGAnimatedBoolean
922 #########################################################################*/
924 /**
925  *
926  */
927 class SVGAnimatedBoolean
929 public:
931     /**
932      *
933      */
934     virtual bool getBaseVal()
935         {
936         return baseVal;
937         }
939     /**
940      *
941      */
942     virtual void setBaseVal(bool val) throw (DOMException)
943         {
944         baseVal = val;
945         }
947     /**
948      *
949      */
950     virtual bool getAnimVal()
951         {
952         return animVal;
953         }
956     //##################
957     //# Non-API methods
958     //##################
960     /**
961      *
962      */
963     SVGAnimatedBoolean()
964         {
965         baseVal = animVal = false;
966         }
968     /**
969      *
970      */
971     SVGAnimatedBoolean(const SVGAnimatedBoolean &other)
972         {
973         baseVal = other.baseVal;
974         animVal = other.animVal;
975         }
977     /**
978      *
979      */
980     virtual ~SVGAnimatedBoolean() {}
982 protected:
984     bool baseVal, animVal;
986 };
991 /*#########################################################################
992 ## SVGAnimatedString
993 #########################################################################*/
995 /**
996  *
997  */
998 class SVGAnimatedString
1000 public:
1002     /**
1003      *
1004      */
1005     virtual DOMString getBaseVal()
1006         {
1007         return baseVal;
1008         }
1010     /**
1011      *
1012      */
1013     virtual void setBaseVal(const DOMString &val)
1014                             throw (DOMException)
1015         {
1016         baseVal = val;
1017         }
1019     /**
1020      *
1021      */
1022     virtual DOMString getAnimVal()
1023         {
1024         return animVal;
1025         }
1028     //##################
1029     //# Non-API methods
1030     //##################
1033     /**
1034      *
1035      */
1036     SVGAnimatedString()
1037         {
1038         baseVal = "";
1039         animVal = "";
1040         }
1042     /**
1043      *
1044      */
1045     SVGAnimatedString(const SVGAnimatedString &other)
1046         {
1047         baseVal = other.baseVal;
1048         animVal = other.animVal;
1049         }
1051     /**
1052      *
1053      */
1054     virtual ~SVGAnimatedString() {}
1056 protected:
1058     DOMString baseVal, animVal;
1060 };
1066 /*#########################################################################
1067 ## SVGStringList
1068 #########################################################################*/
1070 /**
1071  *
1072  */
1073 class SVGStringList
1075 public:
1078     /**
1079      *
1080      */
1081     virtual unsigned long getNumberOfItems()
1082         {
1083         return items.size();
1084         }
1086     /**
1087      *
1088      */
1089     virtual void clear () throw( DOMException )
1090        {
1091        items.clear();
1092        }
1094     /**
1095      *
1096      */
1097     virtual DOMString initialize ( const DOMString& newItem )
1098                     throw( DOMException, SVGException )
1099         {
1100         items.clear();
1101         items.push_back(newItem);
1102         return newItem;
1103         }
1105     /**
1106      *
1107      */
1108     virtual DOMString getItem ( unsigned long index )
1109                     throw( DOMException )
1110         {
1111         if (index >= items.size())
1112             return "";
1113         return items[index];
1114         }
1116     /**
1117      *
1118      */
1119     virtual DOMString insertItemBefore ( const DOMString& newItem,
1120                                  unsigned long index )
1121                                throw( DOMException, SVGException )
1122         {
1123         if (index>=items.size())
1124             {
1125             items.push_back(newItem);
1126             }
1127         else
1128             {
1129             std::vector<DOMString>::iterator iter = items.begin() + index;
1130             items.insert(iter, newItem);
1131             }
1132         return newItem;
1133         }
1135     /**
1136      *
1137      */
1138     virtual DOMString replaceItem ( const DOMString& newItem,
1139                                     unsigned long index )
1140                                 throw( DOMException, SVGException )
1141         {
1142         if (index>=items.size())
1143             return "";
1144         std::vector<DOMString>::iterator iter = items.begin() + index;
1145         *iter = newItem;
1146         return newItem;
1147         }
1149     /**
1150      *
1151      */
1152     virtual DOMString removeItem ( unsigned long index )
1153                     throw( DOMException )
1154         {
1155         if (index>=items.size())
1156             return "";
1157         std::vector<DOMString>::iterator iter = items.begin() + index;
1158         DOMString oldstr = *iter;
1159         items.erase(iter);
1160         return oldstr;
1161         }
1163     /**
1164      *
1165      */
1166     virtual DOMString appendItem ( const DOMString& newItem )
1167                     throw( DOMException, SVGException )
1168         {
1169         items.push_back(newItem);
1170         return newItem;
1171         }
1175     //##################
1176     //# Non-API methods
1177     //##################
1179     /**
1180      *
1181      */
1182     SVGStringList() {}
1184     /**
1185      *
1186      */
1187    SVGStringList(const SVGStringList &other)
1188        {
1189        items = other.items;
1190        }
1192     /**
1193      *
1194      */
1195     virtual ~SVGStringList() {}
1197 protected:
1199     std::vector<DOMString>items;
1201 };
1207 /*#########################################################################
1208 ## SVGAnimatedEnumeration
1209 #########################################################################*/
1211 /**
1212  *
1213  */
1214 class SVGAnimatedEnumeration
1216 public:
1218     /**
1219      *
1220      */
1221     virtual unsigned short getBaseVal()
1222         {
1223         return baseVal;
1224         }
1226     /**
1227      *
1228      */
1229     virtual void setBaseVal(unsigned short val)
1230                                      throw (DOMException)
1231         {
1232         baseVal = val;
1233         }
1235     /**
1236      *
1237      */
1238     virtual unsigned short getAnimVal()
1239         {
1240         return animVal;
1241         }
1245     //##################
1246     //# Non-API methods
1247     //##################
1250     /**
1251      *
1252      */
1253     SVGAnimatedEnumeration()
1254         {
1255         baseVal = animVal = 0;
1256         }
1258     /**
1259      *
1260      */
1261     SVGAnimatedEnumeration(const SVGAnimatedEnumeration &other)
1262         {
1263         baseVal = other.baseVal;
1264         animVal = other.animVal;
1265         }
1267     /**
1268      *
1269      */
1270     virtual ~SVGAnimatedEnumeration() {}
1272 protected:
1274     int baseVal, animVal;
1276 };
1282 /*#########################################################################
1283 ## SVGAnimatedInteger
1284 #########################################################################*/
1286 /**
1287  *
1288  */
1289 class SVGAnimatedInteger
1291 public:
1294     /**
1295      *
1296      */
1297     virtual long getBaseVal()
1298         {
1299         return baseVal;
1300         }
1302     /**
1303      *
1304      */
1305     virtual void setBaseVal(long val) throw (DOMException)
1306         {
1307         baseVal = val;
1308         }
1310     /**
1311      *
1312      */
1313     virtual long getAnimVal()
1314         {
1315         return animVal;
1316         }
1320     //##################
1321     //# Non-API methods
1322     //##################
1325     /**
1326      *
1327      */
1328     SVGAnimatedInteger()
1329         { baseVal = animVal = 0L;}
1332     /**
1333      *
1334      */
1335     SVGAnimatedInteger(long value)
1336         {
1337         baseVal = value;
1338         animVal = 0L;
1339         }
1341     /**
1342      *
1343      */
1344     SVGAnimatedInteger(long baseValArg, long animValArg)
1345         {
1346         baseVal = baseValArg;
1347         animVal = animValArg;
1348         }
1351     /**
1352      *
1353      */
1354     SVGAnimatedInteger(const SVGAnimatedInteger &other)
1355         {
1356         baseVal = other.baseVal;
1357         animVal = other.animVal;
1358         }
1360     /**
1361      *
1362      */
1363     virtual ~SVGAnimatedInteger() {}
1365 protected:
1367     long baseVal, animVal;
1369 };
1375 /*#########################################################################
1376 ## SVGNumber
1377 #########################################################################*/
1379 /**
1380  *
1381  */
1382 class SVGNumber
1384 public:
1387     /**
1388      *
1389      */
1390     virtual double getValue()
1391         {
1392         return value;
1393         }
1395     /**
1396      *
1397      */
1398     virtual void setValue(double val) throw (DOMException)
1399         {
1400         value = val;
1401         }
1404     //##################
1405     //# Non-API methods
1406     //##################
1408     /**
1409      *
1410      */
1411     SVGNumber()
1412         {
1413         value = 0.0;
1414         }
1416     /**
1417      *
1418      */
1419     SVGNumber(const SVGNumber &other)
1420         {
1421         value = other.value;
1422         }
1424     /**
1425      *
1426      */
1427     virtual ~SVGNumber() {}
1429 protected:
1431     double value;
1433 };
1439 /*#########################################################################
1440 ## SVGAnimatedNumber
1441 #########################################################################*/
1443 /**
1444  *
1445  */
1446 class SVGAnimatedNumber
1448 public:
1452     /**
1453      *
1454      */
1455     virtual double getBaseVal()
1456         {
1457         return baseVal;
1458         }
1460     /**
1461      *
1462      */
1463     virtual void setBaseVal(double val) throw (DOMException)
1464         {
1465         baseVal = val;
1466         }
1468     /**
1469      *
1470      */
1471     virtual double getAnimVal()
1472         {
1473         return animVal;
1474         }
1478     //##################
1479     //# Non-API methods
1480     //##################
1482     /**
1483      *
1484      */
1485     SVGAnimatedNumber()
1486         {
1487         baseVal = animVal = 0.0;
1488         }
1491     /**
1492      *
1493      */
1494     SVGAnimatedNumber(double val)
1495         {
1496         baseVal = val;
1497         animVal = 0.0;
1498         }
1501     /**
1502      *
1503      */
1504     SVGAnimatedNumber(double baseValArg, double animValArg)
1505         {
1506         baseVal = baseValArg;
1507         animVal = animValArg;
1508         }
1510     /**
1511      *
1512      */
1513     SVGAnimatedNumber(const SVGAnimatedNumber &other)
1514         {
1515         baseVal = other.baseVal;
1516         animVal = other.animVal;
1517         }
1519     /**
1520      *
1521      */
1522     virtual ~SVGAnimatedNumber() {}
1524 protected:
1526     double baseVal, animVal;
1528 };
1534 /*#########################################################################
1535 ## SVGNumberList
1536 #########################################################################*/
1538 /**
1539  *
1540  */
1541 class SVGNumberList
1543 public:
1545     /**
1546      *
1547      */
1548     virtual unsigned long getNumberOfItems()
1549         {
1550         return items.size();
1551         }
1554     /**
1555      *
1556      */
1557     virtual void clear() throw( DOMException )
1558         {
1559         items.clear();
1560         }
1562     /**
1563      *
1564      */
1565     virtual SVGNumber initialize (const SVGNumber &newItem)
1566                     throw( DOMException, SVGException )
1567         {
1568         items.clear();
1569         items.push_back(newItem);
1570         return newItem;
1571         }
1573     /**
1574      *
1575      */
1576     virtual SVGNumber getItem ( unsigned long index )
1577                                   throw( DOMException )
1578         {
1579         if (index>=items.size())
1580             {
1581             SVGNumber num;
1582             return num;
1583             }
1584         return items[index];
1585         }
1587     /**
1588      *
1589      */
1590     virtual SVGNumber insertItemBefore ( const SVGNumber &newItem,
1591                                          unsigned long index )
1592                                          throw( DOMException, SVGException )
1593         {
1594         if (index>=items.size())
1595             {
1596             items.push_back(newItem);
1597             }
1598         else
1599             {
1600             std::vector<SVGNumber>::iterator iter = items.begin() + index;
1601             items.insert(iter, newItem);
1602             }
1603         return newItem;
1604         }
1606     /**
1607      *
1608      */
1609     virtual SVGNumber replaceItem ( const SVGNumber &newItem,
1610                                     unsigned long index )
1611                                     throw( DOMException, SVGException )
1612         {
1613         if (index>=items.size())
1614             {
1615             SVGNumber num;
1616             return num;
1617             }
1618         std::vector<SVGNumber>::iterator iter = items.begin() + index;
1619         *iter = newItem;
1620         return newItem;
1621         }
1623     /**
1624      *
1625      */
1626     virtual SVGNumber removeItem ( unsigned long index )
1627                                   throw( DOMException )
1628         {
1629         if (index>=items.size())
1630             {
1631             SVGNumber num;
1632             return num;
1633             }
1634         std::vector<SVGNumber>::iterator iter = items.begin() + index;
1635         SVGNumber oldval = *iter;
1636         items.erase(iter);
1637         return oldval;
1638         }
1640     /**
1641      *
1642      */
1643     virtual SVGNumber appendItem ( const SVGNumber &newItem )
1644                                    throw( DOMException, SVGException )
1645         {
1646         items.push_back(newItem);
1647         return newItem;
1648         }
1651     //##################
1652     //# Non-API methods
1653     //##################
1655     /**
1656      *
1657      */
1658     SVGNumberList() {}
1660     /**
1661      *
1662      */
1663     SVGNumberList(const SVGNumberList &other)
1664         {
1665         items = other.items;
1666         }
1668     /**
1669      *
1670      */
1671     virtual ~SVGNumberList() {}
1673 protected:
1675     std::vector<SVGNumber>items;
1677 };
1683 /*#########################################################################
1684 ## SVGAnimatedNumberList
1685 #########################################################################*/
1687 /**
1688  *
1689  */
1690 class SVGAnimatedNumberList
1692 public:
1695     /**
1696      *
1697      */
1698     virtual SVGNumberList &getBaseVal()
1699         {
1700         return baseVal;
1701         }
1703     /**
1704      *
1705      */
1706     virtual SVGNumberList &getAnimVal()
1707         {
1708         return animVal;
1709         }
1713     //##################
1714     //# Non-API methods
1715     //##################
1717     /**
1718      *
1719      */
1720     SVGAnimatedNumberList() {}
1722     /**
1723      *
1724      */
1725     SVGAnimatedNumberList(const SVGAnimatedNumberList &other)
1726         {
1727         baseVal = other.baseVal;
1728         animVal = other.animVal;
1729         }
1731     /**
1732      *
1733      */
1734     virtual ~SVGAnimatedNumberList() {}
1736 protected:
1738     SVGNumberList baseVal;
1739     SVGNumberList animVal;
1741 };
1748 /*#########################################################################
1749 ## SVGLength
1750 #########################################################################*/
1752 /**
1753  *
1754  */
1755 class SVGLength
1757 public:
1759     /**
1760      * Length Unit Types
1761      */
1762     typedef enum
1763         {
1764         SVG_LENGTHTYPE_UNKNOWN    = 0,
1765         SVG_LENGTHTYPE_NUMBER     = 1,
1766         SVG_LENGTHTYPE_PERCENTAGE = 2,
1767         SVG_LENGTHTYPE_EMS        = 3,
1768         SVG_LENGTHTYPE_EXS        = 4,
1769         SVG_LENGTHTYPE_PX         = 5,
1770         SVG_LENGTHTYPE_CM         = 6,
1771         SVG_LENGTHTYPE_MM         = 7,
1772         SVG_LENGTHTYPE_IN         = 8,
1773         SVG_LENGTHTYPE_PT         = 9,
1774         SVG_LENGTHTYPE_PC         = 10
1775         } LengthUnitType;
1778     /**
1779      *
1780      */
1781     virtual unsigned short getUnitType( )
1782         {
1783         return unitType;
1784         }
1786     /**
1787      *
1788      */
1789     virtual double getValue( )
1790         {
1791         return value;
1792         }
1794     /**
1795      *
1796      */
1797     virtual void setValue( double val )  throw (DOMException)
1798         {
1799         value = val;
1800         }
1802     /**
1803      *
1804      */
1805     virtual double getValueInSpecifiedUnits( )
1806         {
1807         double result = 0.0;
1808         //fill this in
1809         return result;
1810         }
1812     /**
1813      *
1814      */
1815     virtual void setValueInSpecifiedUnits( double /*val*/ )
1816                                            throw (DOMException)
1817         {
1818         //fill this in
1819         }
1821     /**
1822      *
1823      */
1824     virtual DOMString getValueAsString( )
1825         {
1826         DOMString ret;
1827         char buf[32];
1828         snprintf(buf, 31, "%f", value);
1829         ret.append(buf);
1830         return ret;
1831         }
1833     /**
1834      *
1835      */
1836     virtual void setValueAsString( const DOMString& /*val*/ )
1837                                    throw (DOMException)
1838         {
1839         }
1842     /**
1843      *
1844      */
1845     virtual void newValueSpecifiedUnits ( unsigned short /*unitType*/, double /*val*/ )
1846         {
1847         }
1849     /**
1850      *
1851      */
1852     virtual void convertToSpecifiedUnits ( unsigned short /*unitType*/ )
1853         {
1854         }
1858     //##################
1859     //# Non-API methods
1860     //##################
1862     /**
1863      *
1864      */
1865     SVGLength()
1866         {
1867         unitType = SVG_LENGTHTYPE_UNKNOWN;
1868         value    = 0.0;
1869         }
1872     /**
1873      *
1874      */
1875     SVGLength(const SVGLength &other)
1876         {
1877         unitType  = other.unitType;
1878         value     = other.value;
1879         }
1881     /**
1882      *
1883      */
1884     virtual ~SVGLength() {}
1886 protected:
1888     int unitType;
1890     double value;
1892 };
1899 /*#########################################################################
1900 ## SVGAnimatedLength
1901 #########################################################################*/
1903 /**
1904  *
1905  */
1906 class SVGAnimatedLength
1908 public:
1910     /**
1911      *
1912      */
1913     virtual SVGLength &getBaseVal()
1914         {
1915         return baseVal;
1916         }
1918     /**
1919      *
1920      */
1921     virtual SVGLength &getAnimVal()
1922         {
1923         return animVal;
1924         }
1928     //##################
1929     //# Non-API methods
1930     //##################
1932     /**
1933      *
1934      */
1935     SVGAnimatedLength() {}
1937     /**
1938      *
1939      */
1940     SVGAnimatedLength(const SVGAnimatedLength &other)
1941         {
1942         baseVal = other.baseVal;
1943         animVal = other.animVal;
1944         }
1946     /**
1947      *
1948      */
1949     virtual ~SVGAnimatedLength() {}
1951 protected:
1953     SVGLength baseVal, animVal;
1955 };
1962 /*#########################################################################
1963 ## SVGLengthList
1964 #########################################################################*/
1966 /**
1967  *
1968  */
1969 class SVGLengthList
1971 public:
1973     /**
1974      *
1975      */
1976     virtual unsigned long getNumberOfItems()
1977         {
1978         return items.size();
1979         }
1982     /**
1983      *
1984      */
1985     virtual void clear (  ) throw( DOMException )
1986         {
1987         items.clear();
1988         }
1990     /**
1991      *
1992      */
1993     virtual SVGLength initialize (const SVGLength &newItem )
1994                     throw( DOMException, SVGException )
1995         {
1996         items.clear();
1997         items.push_back(newItem);
1998         return newItem;
1999         }
2001     /**
2002      *
2003      */
2004     virtual SVGLength getItem (unsigned long index)
2005                     throw( DOMException )
2006         {
2007         if (index>=items.size())
2008             {
2009             SVGLength ret;
2010             return ret;
2011             }
2012         return items[index];
2013         }
2015     /**
2016      *
2017      */
2018     virtual SVGLength insertItemBefore (const SVGLength &newItem,
2019                                          unsigned long index )
2020                                    throw( DOMException, SVGException )
2021         {
2022         if (index>=items.size())
2023             {
2024             items.push_back(newItem);
2025             }
2026         else
2027             {
2028             std::vector<SVGLength>::iterator iter = items.begin() + index;
2029             items.insert(iter, newItem);
2030             }
2031         return newItem;
2032         }
2034     /**
2035      *
2036      */
2037     virtual SVGLength replaceItem (const SVGLength &newItem,
2038                                     unsigned long index )
2039                                throw( DOMException, SVGException )
2040         {
2041         if (index>=items.size())
2042             {
2043             SVGLength ret;
2044             return ret;
2045             }
2046         std::vector<SVGLength>::iterator iter = items.begin() + index;
2047         *iter = newItem;
2048         return newItem;
2049         }
2051     /**
2052      *
2053      */
2054     virtual SVGLength removeItem (unsigned long index )
2055                     throw( DOMException )
2056         {
2057         if (index>=items.size())
2058             {
2059             SVGLength ret;
2060             return ret;
2061             }
2062         std::vector<SVGLength>::iterator iter = items.begin() + index;
2063         SVGLength oldval = *iter;
2064         items.erase(iter);
2065         return oldval;
2066         }
2068     /**
2069      *
2070      */
2071     virtual SVGLength appendItem (const SVGLength &newItem )
2072                     throw( DOMException, SVGException )
2073         {
2074         items.push_back(newItem);
2075         return newItem;
2076         }
2079     //##################
2080     //# Non-API methods
2081     //##################
2083     /**
2084      *
2085      */
2086     SVGLengthList() {}
2088     /**
2089      *
2090      */
2091     SVGLengthList(const SVGLengthList &other)
2092         {
2093         items = other.items;
2094         }
2096     /**
2097      *
2098      */
2099     virtual ~SVGLengthList() {}
2101 protected:
2103     std::vector<SVGLength>items;
2105 };
2112 /*#########################################################################
2113 ## SVGAnimatedLengthList
2114 #########################################################################*/
2116 /**
2117  *
2118  */
2119 class SVGAnimatedLengthList
2121 public:
2123     /**
2124      *
2125      */
2126     virtual SVGLengthList &getBaseVal()
2127         {
2128         return baseVal;
2129         }
2131     /**
2132      *
2133      */
2134     virtual SVGLengthList &getAnimVal()
2135         {
2136         return animVal;
2137         }
2141     //##################
2142     //# Non-API methods
2143     //##################
2145     /**
2146      *
2147      */
2148     SVGAnimatedLengthList() {}
2150     /**
2151      *
2152      */
2153    SVGAnimatedLengthList(const SVGAnimatedLengthList &other)
2154         {
2155         baseVal = other.baseVal;
2156         animVal = other.animVal;
2157         }
2159     /**
2160      *
2161      */
2162     virtual ~SVGAnimatedLengthList() {}
2164 protected:
2166     SVGLengthList baseVal, animVal;
2168 };
2175 /*#########################################################################
2176 ## SVGAngle
2177 #########################################################################*/
2179 /**
2180  *
2181  */
2182 class SVGAngle
2184 public:
2186     /**
2187      *  Angle Unit Types
2188      */
2189     typedef enum
2190         {
2191         SVG_ANGLETYPE_UNKNOWN     = 0,
2192         SVG_ANGLETYPE_UNSPECIFIED = 1,
2193         SVG_ANGLETYPE_DEG         = 2,
2194         SVG_ANGLETYPE_RAD         = 3,
2195         SVG_ANGLETYPE_GRAD        = 4
2196         } AngleUnitType;
2200     /**
2201      *
2202      */
2203     virtual unsigned short getUnitType()
2204         {
2205         return unitType;
2206         }
2208     /**
2209      *
2210      */
2211     virtual double getValue()
2212         {
2213         return value;
2214         }
2216     /**
2217      *
2218      */
2219     virtual void setValue(double val) throw (DOMException)
2220         {
2221         value = val;
2222         }
2224     /**
2225      *
2226      */
2227     virtual double getValueInSpecifiedUnits()
2228         {
2229         double result = 0.0;
2230         //convert here
2231         return result;
2232         }
2234     /**
2235      *
2236      */
2237     virtual void setValueInSpecifiedUnits(double /*val*/)
2238                                      throw (DOMException)
2239         {
2240         //do conversion
2241         }
2243     /**
2244      *
2245      */
2246     virtual DOMString getValueAsString()
2247         {
2248         DOMString result;
2249         char buf[32];
2250         snprintf(buf, 31, "%f", value);
2251         result.append(buf);
2252         return result;
2253         }
2255     /**
2256      *
2257      */
2258     virtual void setValueAsString(const DOMString &/*val*/)
2259                                   throw (DOMException)
2260         {
2261         //convert here
2262         }
2265     /**
2266      *
2267      */
2268     virtual void newValueSpecifiedUnits (unsigned short /*unitType*/,
2269                                          double /*valueInSpecifiedUnits*/ )
2270         {
2271         //convert here
2272         }
2274     /**
2275      *
2276      */
2277     virtual void convertToSpecifiedUnits (unsigned short /*unitType*/ )
2278         {
2279         //convert here
2280         }
2284     //##################
2285     //# Non-API methods
2286     //##################
2288     /**
2289      *
2290      */
2291     SVGAngle()
2292         {
2293         unitType = SVG_ANGLETYPE_UNKNOWN;
2294         value    = 0.0;
2295         }
2297     /**
2298      *
2299      */
2300     SVGAngle(const SVGAngle &other)
2301         {
2302         unitType = other.unitType;
2303         value    = other.value;
2304         }
2306     /**
2307      *
2308      */
2309     virtual ~SVGAngle() {}
2311 protected:
2313     int unitType;
2315     double value;
2317 };
2324 /*#########################################################################
2325 ## SVGAnimatedAngle
2326 #########################################################################*/
2328 /**
2329  *
2330  */
2331 class SVGAnimatedAngle
2333 public:
2335     /**
2336      *
2337      */
2338     virtual SVGAngle getBaseVal()
2339         {
2340         return baseVal;
2341         }
2343     /**
2344      *
2345      */
2346     virtual SVGAngle getAnimVal()
2347         {
2348         return animVal;
2349         }
2351     //##################
2352     //# Non-API methods
2353     //##################
2355     /**
2356      *
2357      */
2358     SVGAnimatedAngle() {}
2360     /**
2361      *
2362      */
2363     SVGAnimatedAngle(const SVGAngle &angle)
2364         { baseVal = angle; }
2366     /**
2367      *
2368      */
2369     SVGAnimatedAngle(const SVGAnimatedAngle &other)
2370         {
2371         baseVal = other.baseVal;
2372         animVal = other.animVal;
2373         }
2375     /**
2376      *
2377      */
2378     virtual ~SVGAnimatedAngle() {}
2380 protected:
2382     SVGAngle baseVal, animVal;
2384 };
2391 /*#########################################################################
2392 ## SVGICCColor
2393 #########################################################################*/
2395 /**
2396  *
2397  */
2398 class SVGICCColor
2400 public:
2402     /**
2403      *
2404      */
2405     virtual DOMString getColorProfile()
2406         {
2407         return colorProfile;
2408         }
2410     /**
2411      *
2412      */
2413     virtual void setColorProfile(const DOMString &val) throw (DOMException)
2414         {
2415         colorProfile = val;
2416         }
2418     /**
2419      *
2420      */
2421     virtual SVGNumberList &getColors()
2422         {
2423         return colors;
2424         }
2428     //##################
2429     //# Non-API methods
2430     //##################
2432     /**
2433      *
2434      */
2435     SVGICCColor() {}
2437     /**
2438      *
2439      */
2440     SVGICCColor(const SVGICCColor &other)
2441         {
2442         colorProfile = other.colorProfile;
2443         colors       = other.colors;
2444         }
2446     /**
2447      *
2448      */
2449     virtual ~SVGICCColor() {}
2451 protected:
2453     DOMString colorProfile;
2455     SVGNumberList colors;
2457 };
2460 /*#########################################################################
2461 ## SVGColor
2462 #########################################################################*/
2464 /**
2465  *
2466  */
2467 class SVGColor : virtual public css::CSSValue
2469 public:
2472     /**
2473      * Color Types
2474      */
2475     typedef enum
2476         {
2477         SVG_COLORTYPE_UNKNOWN           = 0,
2478         SVG_COLORTYPE_RGBCOLOR          = 1,
2479         SVG_COLORTYPE_RGBCOLOR_ICCCOLOR = 2,
2480         SVG_COLORTYPE_CURRENTCOLOR      = 3
2481         } ColorType;
2484     /**
2485      *
2486      */
2487     virtual unsigned short getColorType()
2488         {
2489         return colorType;
2490         }
2492     /**
2493      *
2494      */
2495     virtual css::RGBColor getRgbColor()
2496         {
2497         css::RGBColor col;
2498         return col;
2499         }
2501     /**
2502      *
2503      */
2504     virtual SVGICCColor getIccColor()
2505         {
2506         SVGICCColor col;
2507         return col;
2508         }
2511     /**
2512      *
2513      */
2514     virtual void setRGBColor (const DOMString& /*rgbColor*/ )
2515                               throw( SVGException )
2516         {
2517         }
2519     /**
2520      *
2521      */
2522     virtual void setRGBColorICCColor (const DOMString& /*rgbColor*/,
2523                                       const DOMString& /*iccColor*/ )
2524                                       throw( SVGException )
2525         {
2526         }
2528     /**
2529      *
2530      */
2531     virtual void setColor (unsigned short /*colorType*/,
2532                            const DOMString& /*rgbColor*/,
2533                            const DOMString& /*iccColor*/ )
2534                            throw( SVGException )
2535         {
2536         }
2540     //##################
2541     //# Non-API methods
2542     //##################
2544     /**
2545      *
2546      */
2547     SVGColor()
2548         {
2549         colorType = SVG_COLORTYPE_UNKNOWN;
2550         }
2552     /**
2553      *
2554      */
2555     SVGColor(const SVGColor &other) : css::CSSValue(other)
2556         {
2557         colorType = other.colorType;
2558         }
2560     /**
2561      *
2562      */
2563     virtual ~SVGColor() {}
2565 protected:
2567     int colorType;
2569 };
2580 /*#########################################################################
2581 ## SVGRect
2582 #########################################################################*/
2584 /**
2585  *
2586  */
2587 class SVGRect
2589 public:
2591     /**
2592      *
2593      */
2594     virtual double getX()
2595         {
2596         return x;
2597         }
2599     /**
2600      *
2601      */
2602     virtual void setX(double val) throw (DOMException)
2603         {
2604         x = val;
2605         }
2607     /**
2608      *
2609      */
2610     virtual double getY()
2611         {
2612         return y;
2613         }
2615     /**
2616      *
2617      */
2618     virtual void setY(double val) throw (DOMException)
2619         {
2620         y = val;
2621         }
2623     /**
2624      *
2625      */
2626     virtual double getWidth()
2627         {
2628         return width;
2629         }
2631     /**
2632      *
2633      */
2634     virtual void setWidth(double val) throw (DOMException)
2635         {
2636         width = val;
2637         }
2639     /**
2640      *
2641      */
2642     virtual double getHeight()
2643         {
2644         return height;
2645         }
2647     /**
2648      *
2649      */
2650     virtual void setHeight(double val) throw (DOMException)
2651         {
2652         height = val;
2653         }
2656     //##################
2657     //# Non-API methods
2658     //##################
2660     /**
2661      *
2662      */
2663     SVGRect()
2664         {
2665         x = y = width = height = 0.0;
2666         }
2668     /**
2669      *
2670      */
2671     SVGRect(const SVGRect &other)
2672         {
2673         x = other.x;
2674         y = other.y;
2675         width = other.width;
2676         height = other.height;
2677         }
2679     /**
2680      *
2681      */
2682     virtual ~SVGRect() {}
2684 protected:
2686     double x, y, width, height;
2688 };
2695 /*#########################################################################
2696 ## SVGAnimatedRect
2697 #########################################################################*/
2699 /**
2700  *
2701  */
2702 class SVGAnimatedRect
2704 public:
2706     /**
2707      *
2708      */
2709     virtual SVGRect &getBaseVal()
2710         {
2711         return baseVal;
2712         }
2714     /**
2715      *
2716      */
2717     virtual SVGRect &getAnimVal()
2718         {
2719         return animVal;
2720         }
2724     //##################
2725     //# Non-API methods
2726     //##################
2728     /**
2729      *
2730      */
2731     SVGAnimatedRect()
2732         {
2733         }
2735     /**
2736      *
2737      */
2738     SVGAnimatedRect(const SVGAnimatedRect &other)
2739         {
2740         baseVal = other.baseVal;
2741         animVal = other.animVal;
2742         }
2744     /**
2745      *
2746      */
2747     virtual ~SVGAnimatedRect() {}
2749 protected:
2751     SVGRect baseVal, animVal;
2753 };
2757 /*#########################################################################
2758 ## SVGPoint
2759 #########################################################################*/
2761 /**
2762  *
2763  */
2764 class SVGPoint
2766 public:
2770     /**
2771      *
2772      */
2773     virtual double getX()
2774         { return x; }
2776     /**
2777      *
2778      */
2779     virtual void setX(double val) throw (DOMException)
2780         { x = val; }
2782     /**
2783      *
2784      */
2785     virtual double getY()
2786         { return y; }
2788     /**
2789      *
2790      */
2791     virtual void setY(double val) throw (DOMException)
2792         { y = val; }
2794     /**
2795      *
2796      */
2797     virtual SVGPoint matrixTransform(const SVGMatrix &/*matrix*/)
2798         {
2799         SVGPoint point;
2800         return point;
2801         }
2805     //##################
2806     //# Non-API methods
2807     //##################
2809     /**
2810      *
2811      */
2812     SVGPoint()
2813         { x = y = 0; }
2815     /**
2816      *
2817      */
2818     SVGPoint(const SVGPoint &other)
2819         {
2820         x = other.x;
2821         y = other.y;
2822         }
2824     /**
2825      *
2826      */
2827     virtual ~SVGPoint() {}
2829 protected:
2831     double x, y;
2832 };
2839 /*#########################################################################
2840 ## SVGPointList
2841 #########################################################################*/
2843 /**
2844  *
2845  */
2846 class SVGPointList
2848 public:
2850     /**
2851      *
2852      */
2853     virtual unsigned long getNumberOfItems()
2854         { return items.size(); }
2856     /**
2857      *
2858      */
2859     virtual void clear() throw( DOMException )
2860         { items.clear(); }
2862     /**
2863      *
2864      */
2865     virtual SVGPoint initialize(const SVGPoint &newItem)
2866                              throw( DOMException, SVGException )
2867         {
2868         items.clear();
2869         items.push_back(newItem);
2870         return newItem;
2871         }
2873     /**
2874      *
2875      */
2876     virtual SVGPoint getItem(unsigned long index )
2877                              throw( DOMException )
2878         {
2879         if (index >= items.size())
2880             {
2881             SVGPoint point;
2882             return point;
2883             }
2884         return items[index];
2885         }
2887     /**
2888      *
2889      */
2890     virtual SVGPoint insertItemBefore(const SVGPoint &newItem,
2891                                       unsigned long index )
2892                                       throw( DOMException, SVGException )
2893         {
2894         if (index >= items.size())
2895             items.push_back(newItem);
2896         else
2897             {
2898             std::vector<SVGPoint>::iterator iter = items.begin() + index;
2899             items.insert(iter, newItem);
2900             }
2901         return newItem;
2902         }
2904     /**
2905      *
2906      */
2907     virtual SVGPoint replaceItem(const SVGPoint &newItem,
2908                                   unsigned long index )
2909                                   throw( DOMException, SVGException )
2910         {
2911         if (index >= items.size())
2912             {
2913             SVGPoint point;
2914             return point;
2915             }
2916         std::vector<SVGPoint>::iterator iter = items.begin() + index;
2917         *iter = newItem;
2918         return newItem;
2919         }
2921     /**
2922      *
2923      */
2924     virtual SVGPoint removeItem(unsigned long index )
2925                                   throw( DOMException )
2926         {
2927         if (index >= items.size())
2928             {
2929             SVGPoint point;
2930             return point;
2931             }
2932         std::vector<SVGPoint>::iterator iter = items.begin() + index;
2933         SVGPoint oldItem = *iter;
2934         items.erase(iter);
2935         return oldItem;
2936         }
2938     /**
2939      *
2940      */
2941     virtual SVGPoint appendItem(const SVGPoint &newItem)
2942                               throw( DOMException, SVGException )
2943         {
2944         items.push_back(newItem);
2945         return newItem;
2946         }
2949     //##################
2950     //# Non-API methods
2951     //##################
2953     /**
2954      *
2955      */
2956     SVGPointList() {}
2959     /**
2960      *
2961      */
2962     SVGPointList(const SVGPointList &other)
2963         {
2964         items = other.items;
2965         }
2968     /**
2969      *
2970      */
2971     virtual ~SVGPointList() {}
2973 protected:
2975     std::vector<SVGPoint> items;
2977 };
2982 /*#########################################################################
2983 ## SVGUnitTypes
2984 #########################################################################*/
2986 /**
2987  *
2988  */
2989 class SVGUnitTypes
2991 public:
2993     /**
2994      * Unit Types
2995      */
2996     typedef enum
2997         {
2998         SVG_UNIT_TYPE_UNKNOWN           = 0,
2999         SVG_UNIT_TYPE_USERSPACEONUSE    = 1,
3000         SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2
3001         } UnitType;
3005     //##################
3006     //# Non-API methods
3007     //##################
3009     /**
3010      *
3011      */
3012     SVGUnitTypes() {}
3014     /**
3015      *
3016      */
3017     virtual ~SVGUnitTypes() {}
3019 };
3026 /*#########################################################################
3027 ## SVGStylable
3028 #########################################################################*/
3030 /**
3031  *
3032  */
3033 class SVGStylable
3035 public:
3037     /**
3038      *
3039      */
3040     virtual SVGAnimatedString getClassName()
3041         {
3042         return className;
3043         }
3045     /**
3046      *
3047      */
3048     virtual css::CSSStyleDeclaration getStyle()
3049         {
3050         return style;
3051         }
3054     /**
3055      *
3056      */
3057     virtual css::CSSValue getPresentationAttribute (const DOMString& /*name*/ )
3058         {
3059         css::CSSValue val;
3060         //perform a lookup
3061         return val;
3062         }
3065     //##################
3066     //# Non-API methods
3067     //##################
3069     /**
3070      *
3071      */
3072     SVGStylable() {}
3074     /**
3075      *
3076      */
3077     SVGStylable(const SVGStylable &other)
3078         {
3079         className = other.className;
3080         style     = other.style;
3081         }
3083     /**
3084      *
3085      */
3086     virtual ~SVGStylable() {}
3088 protected:
3090     SVGAnimatedString className;
3091     css::CSSStyleDeclaration style;
3093 };
3096 /*#########################################################################
3097 ## SVGLocatable
3098 #########################################################################*/
3100 /**
3101  *
3102  */
3103 class SVGLocatable
3105 public:
3107     /**
3108      *
3109      */
3110     virtual SVGElementPtr getNearestViewportElement()
3111         {
3112         SVGElementPtr result;
3113         return result;
3114         }
3116     /**
3117      *
3118      */
3119     virtual SVGElementPtr getFarthestViewportElement()
3120         {
3121         SVGElementPtr result;
3122         return result;
3123         }
3125     /**
3126      *
3127      */
3128     virtual SVGRect getBBox (  )
3129         {
3130         return bbox;
3131         }
3133     /**
3134      *
3135      */
3136     virtual SVGMatrix getCTM (  )
3137         {
3138         return ctm;
3139         }
3141     /**
3142      *
3143      */
3144     virtual SVGMatrix getScreenCTM (  )
3145         {
3146         return screenCtm;
3147         }
3149     /**
3150      *
3151      */
3152     virtual SVGMatrix getTransformToElement (const SVGElement &/*element*/)
3153                     throw( SVGException )
3154         {
3155         SVGMatrix result;
3156         //do calculations
3157         return result;
3158         }
3162     //##################
3163     //# Non-API methods
3164     //##################
3166     /**
3167      *
3168      */
3169     SVGLocatable() {}
3171     /**
3172      *
3173      */
3174     SVGLocatable(const SVGLocatable &/*other*/)
3175         {
3176         }
3178     /**
3179      *
3180      */
3181     virtual ~SVGLocatable() {}
3183 protected:
3185     SVGRect bbox;
3186     SVGMatrix ctm;
3187     SVGMatrix screenCtm;
3189 };
3196 /*#########################################################################
3197 ## SVGTransformable
3198 #########################################################################*/
3200 /**
3201  *
3202  */
3203 class SVGTransformable : public SVGLocatable
3205 public:
3208     /**
3209      *
3210      */
3211     virtual SVGAnimatedTransformList &getTransform()
3212         {
3213         return transforms;
3214         }
3218     //##################
3219     //# Non-API methods
3220     //##################
3222     /**
3223      *
3224      */
3225     SVGTransformable() {}
3227     /**
3228      *
3229      */
3230     SVGTransformable(const SVGTransformable &other) : SVGLocatable(other)
3231         {
3232         transforms = other.transforms;
3233         }
3235     /**
3236      *
3237      */
3238     virtual ~SVGTransformable() {}
3240 protected:
3242     SVGAnimatedTransformList transforms;
3243 };
3250 /*#########################################################################
3251 ## SVGTests
3252 #########################################################################*/
3254 /**
3255  *
3256  */
3257 class SVGTests
3259 public:
3262     /**
3263      *
3264      */
3265     virtual SVGStringList &getRequiredFeatures()
3266         {
3267         return requiredFeatures;
3268         }
3270     /**
3271      *
3272      */
3273     virtual SVGStringList &getRequiredExtensions()
3274         {
3275         return requiredExtensions;
3276         }
3278     /**
3279      *
3280      */
3281     virtual SVGStringList &getSystemLanguage()
3282         {
3283         return systemLanguage;
3284         }
3287     /**
3288      *
3289      */
3290     virtual bool hasExtension (const DOMString& /*extension*/ )
3291         {
3292         return false;
3293         }
3297     //##################
3298     //# Non-API methods
3299     //##################
3301     /**
3302      *
3303      */
3304     SVGTests() {}
3306     /**
3307      *
3308      */
3309     SVGTests(const SVGTests &other)
3310         {
3311         requiredFeatures   = other.requiredFeatures;
3312         requiredExtensions = other.requiredExtensions;
3313         systemLanguage     = other.systemLanguage;
3314         }
3316     /**
3317      *
3318      */
3319     virtual ~SVGTests() {}
3321 protected:
3323     SVGStringList requiredFeatures;
3324     SVGStringList requiredExtensions;
3325     SVGStringList systemLanguage;
3327 };
3334 /*#########################################################################
3335 ## SVGLangSpace
3336 #########################################################################*/
3338 /**
3339  *
3340  */
3341 class SVGLangSpace
3343 public:
3346     /**
3347      *
3348      */
3349     virtual DOMString getXmllang()
3350         {
3351         return xmlLang;
3352         }
3354     /**
3355      *
3356      */
3357     virtual void setXmllang(const DOMString &val)
3358                                      throw (DOMException)
3359         {
3360         xmlLang = val;
3361         }
3363     /**
3364      *
3365      */
3366     virtual DOMString getXmlspace()
3367         {
3368         return xmlSpace;
3369         }
3371     /**
3372      *
3373      */
3374     virtual void setXmlspace(const DOMString &val)
3375                                      throw (DOMException)
3376         {
3377         xmlSpace = val;
3378         }
3382     //##################
3383     //# Non-API methods
3384     //##################
3386     /**
3387      *
3388      */
3389     SVGLangSpace() {}
3391     /**
3392      *
3393      */
3394     SVGLangSpace(const SVGLangSpace &other)
3395         {
3396         xmlLang  = other.xmlLang;
3397         xmlSpace = other.xmlSpace;
3398         }
3400     /**
3401      *
3402      */
3403     virtual ~SVGLangSpace() {}
3405 protected:
3407     DOMString xmlLang;
3408     DOMString xmlSpace;
3410 };
3417 /*#########################################################################
3418 ## SVGExternalResourcesRequired
3419 #########################################################################*/
3421 /**
3422  *
3423  */
3424 class SVGExternalResourcesRequired
3426 public:
3429     /**
3430      *
3431      */
3432     virtual SVGAnimatedBoolean getExternalResourcesRequired()
3433         { return required; }
3437     //##################
3438     //# Non-API methods
3439     //##################
3441     /**
3442      *
3443      */
3444     SVGExternalResourcesRequired()
3445         {  }
3448     /**
3449      *
3450      */
3451     SVGExternalResourcesRequired(const SVGExternalResourcesRequired &other)
3452         {
3453         required = other.required;
3454         }
3456     /**
3457      *
3458      */
3459     virtual ~SVGExternalResourcesRequired() {}
3461 protected:
3463     SVGAnimatedBoolean required;
3465 };
3472 /*#########################################################################
3473 ## SVGPreserveAspectRatio
3474 #########################################################################*/
3476 /**
3477  *
3478  */
3479 class SVGPreserveAspectRatio
3481 public:
3484     /**
3485      * Alignment Types
3486      */
3487     typedef enum
3488         {
3489         SVG_PRESERVEASPECTRATIO_UNKNOWN  = 0,
3490         SVG_PRESERVEASPECTRATIO_NONE     = 1,
3491         SVG_PRESERVEASPECTRATIO_XMINYMIN = 2,
3492         SVG_PRESERVEASPECTRATIO_XMIDYMIN = 3,
3493         SVG_PRESERVEASPECTRATIO_XMAXYMIN = 4,
3494         SVG_PRESERVEASPECTRATIO_XMINYMID = 5,
3495         SVG_PRESERVEASPECTRATIO_XMIDYMID = 6,
3496         SVG_PRESERVEASPECTRATIO_XMAXYMID = 7,
3497         SVG_PRESERVEASPECTRATIO_XMINYMAX = 8,
3498         SVG_PRESERVEASPECTRATIO_XMIDYMAX = 9,
3499         SVG_PRESERVEASPECTRATIO_XMAXYMAX = 10
3500         } AlignmentType;
3503     /**
3504      * Meet-or-slice Types
3505      */
3506     typedef enum
3507         {
3508         SVG_MEETORSLICE_UNKNOWN  = 0,
3509         SVG_MEETORSLICE_MEET     = 1,
3510         SVG_MEETORSLICE_SLICE    = 2
3511         } MeetOrSliceType;
3514     /**
3515      *
3516      */
3517     virtual unsigned short getAlign()
3518         { return align; }
3520     /**
3521      *
3522      */
3523     virtual void setAlign(unsigned short val) throw (DOMException)
3524         { align = val; }
3526     /**
3527      *
3528      */
3529     virtual unsigned short getMeetOrSlice()
3530         { return meetOrSlice; }
3532     /**
3533      *
3534      */
3535     virtual void setMeetOrSlice(unsigned short val) throw (DOMException)
3536         { meetOrSlice = val; }
3540     //##################
3541     //# Non-API methods
3542     //##################
3544     /**
3545      *
3546      */
3547     SVGPreserveAspectRatio()
3548         {
3549         align       = SVG_PRESERVEASPECTRATIO_UNKNOWN;
3550         meetOrSlice = SVG_MEETORSLICE_UNKNOWN;
3551         }
3553     /**
3554      *
3555      */
3556     SVGPreserveAspectRatio(const SVGPreserveAspectRatio &other)
3557         {
3558         align       = other.align;
3559         meetOrSlice = other.meetOrSlice;
3560         }
3562     /**
3563      *
3564      */
3565     virtual ~SVGPreserveAspectRatio() {}
3567 protected:
3569     unsigned short align;
3570     unsigned short meetOrSlice;
3572 };
3579 /*#########################################################################
3580 ## SVGAnimatedPreserveAspectRatio
3581 #########################################################################*/
3583 /**
3584  *
3585  */
3586 class SVGAnimatedPreserveAspectRatio
3588 public:
3591     /**
3592      *
3593      */
3594     virtual SVGPreserveAspectRatio getBaseVal()
3595         { return baseVal; }
3597     /**
3598      *
3599      */
3600     virtual SVGPreserveAspectRatio getAnimVal()
3601         { return animVal; }
3605     //##################
3606     //# Non-API methods
3607     //##################
3609     /**
3610      *
3611      */
3612     SVGAnimatedPreserveAspectRatio() {}
3614     /**
3615      *
3616      */
3617     SVGAnimatedPreserveAspectRatio(const SVGAnimatedPreserveAspectRatio &other)
3618         {
3619         baseVal = other.baseVal;
3620         baseVal = other.animVal;
3621         }
3623     /**
3624      *
3625      */
3626     virtual ~SVGAnimatedPreserveAspectRatio() {}
3628 protected:
3630     SVGPreserveAspectRatio baseVal;
3631     SVGPreserveAspectRatio animVal;
3633 };
3638 /*#########################################################################
3639 ## SVGFitToViewBox
3640 #########################################################################*/
3642 /**
3643  *
3644  */
3645 class SVGFitToViewBox
3647 public:
3649     /**
3650      *
3651      */
3652     virtual SVGAnimatedRect getViewBox()
3653         { return viewBox; }
3655     /**
3656      *
3657      */
3658     virtual SVGAnimatedPreserveAspectRatio getPreserveAspectRatio()
3659         { return preserveAspectRatio; }
3663     //##################
3664     //# Non-API methods
3665     //##################
3667     /**
3668      *
3669      */
3670     SVGFitToViewBox()
3671         {}
3673     /**
3674      *
3675      */
3677     SVGFitToViewBox(const SVGFitToViewBox &other)
3678         {
3679         viewBox = other.viewBox;
3680         preserveAspectRatio = other.preserveAspectRatio;
3681         }
3683     /**
3684      *
3685      */
3686     virtual ~SVGFitToViewBox() {}
3688 protected:
3690     SVGAnimatedRect viewBox;
3692     SVGAnimatedPreserveAspectRatio preserveAspectRatio;
3694 };
3697 /*#########################################################################
3698 ## SVGZoomAndPan
3699 #########################################################################*/
3701 /**
3702  *
3703  */
3704 class SVGZoomAndPan
3706 public:
3709     /**
3710      * Zoom and Pan Types
3711      */
3712     typedef enum
3713         {
3714         SVG_ZOOMANDPAN_UNKNOWN = 0,
3715         SVG_ZOOMANDPAN_DISABLE = 1,
3716         SVG_ZOOMANDPAN_MAGNIFY = 2
3717         } ZoomAndPanType;
3720     /**
3721      *
3722      */
3723     virtual unsigned short getZoomAndPan()
3724         { return zoomAndPan; }
3726     /**
3727      *
3728      */
3729     virtual void setZoomAndPan(unsigned short val) throw (DOMException)
3730         { zoomAndPan = val; }
3733     //##################
3734     //# Non-API methods
3735     //##################
3737     /**
3738      *
3739      */
3740     SVGZoomAndPan()
3741         { zoomAndPan = SVG_ZOOMANDPAN_UNKNOWN; }
3743     /**
3744      *
3745      */
3746     SVGZoomAndPan(const SVGZoomAndPan &other)
3747         { zoomAndPan = other.zoomAndPan; }
3749     /**
3750      *
3751      */
3752     virtual ~SVGZoomAndPan() {}
3754 protected:
3756     unsigned short zoomAndPan;
3758 };
3765 /*#########################################################################
3766 ## SVGViewSpec
3767 #########################################################################*/
3769 /**
3770  *
3771  */
3772 class SVGViewSpec : public SVGZoomAndPan,
3773                     public SVGFitToViewBox
3775 public:
3777     /**
3778      *
3779      */
3780     virtual SVGTransformList getTransform()
3781         { return transform; }
3783     /**
3784      *
3785      */
3786     virtual SVGElementPtr getViewTarget()
3787         { return viewTarget; }
3789     /**
3790      *
3791      */
3792     virtual DOMString getViewBoxString()
3793         {
3794         DOMString ret;
3795         return ret;
3796         }
3798     /**
3799      *
3800      */
3801     virtual DOMString getPreserveAspectRatioString()
3802         {
3803         DOMString ret;
3804         return ret;
3805         }
3807     /**
3808      *
3809      */
3810     virtual DOMString getTransformString()
3811         {
3812         DOMString ret;
3813         return ret;
3814         }
3816     /**
3817      *
3818      */
3819     virtual DOMString getViewTargetString()
3820         {
3821         DOMString ret;
3822         return ret;
3823         }
3827     //##################
3828     //# Non-API methods
3829     //##################
3831     /**
3832      *
3833      */
3834     SVGViewSpec()
3835         {
3836         viewTarget = NULL;
3837         }
3839     /**
3840      *
3841      */
3842     SVGViewSpec(const SVGViewSpec &other) : SVGZoomAndPan(other), SVGFitToViewBox(other)
3843         {
3844         viewTarget = other.viewTarget;
3845         transform  = other.transform;
3846         }
3848     /**
3849      *
3850      */
3851     virtual ~SVGViewSpec() {}
3853 protected:
3855     SVGElementPtr viewTarget;
3856     SVGTransformList transform;
3857 };
3864 /*#########################################################################
3865 ## SVGURIReference
3866 #########################################################################*/
3868 /**
3869  *
3870  */
3871 class SVGURIReference
3873 public:
3875     /**
3876      *
3877      */
3878     virtual SVGAnimatedString getHref()
3879         { return href; }
3883     //##################
3884     //# Non-API methods
3885     //##################
3887     /**
3888      *
3889      */
3890     SVGURIReference() {}
3892     /**
3893      *
3894      */
3895     SVGURIReference(const SVGURIReference &other)
3896         {
3897         href = other.href;
3898         }
3900     /**
3901      *
3902      */
3903     virtual ~SVGURIReference() {}
3905 protected:
3907     SVGAnimatedString href;
3909 };
3916 /*#########################################################################
3917 ## SVGCSSRule
3918 #########################################################################*/
3920 /**
3921  *
3922  */
3923 class SVGCSSRule : public css::CSSRule
3925 public:
3928     /**
3929      * Additional CSS RuleType to support ICC color specifications
3930      */
3931     typedef enum
3932         {
3933         COLOR_PROFILE_RULE = 7
3934         } ColorProfileRuleType;
3936     //##################
3937     //# Non-API methods
3938     //##################
3940     /**
3941      *
3942      */
3943     SVGCSSRule()
3944         { type = COLOR_PROFILE_RULE; }
3946     /**
3947      *
3948      */
3949     SVGCSSRule(const SVGCSSRule &other) : css::CSSRule(other)
3950         { type = COLOR_PROFILE_RULE; }
3952     /**
3953      *
3954      */
3955     virtual ~SVGCSSRule() {}
3957 };
3961 /*#########################################################################
3962 ## SVGRenderingIntent
3963 #########################################################################*/
3965 /**
3966  *
3967  */
3968 class SVGRenderingIntent
3970 public:
3972     /**
3973      * Rendering Intent Types
3974      */
3975     typedef enum
3976         {
3977         RENDERING_INTENT_UNKNOWN               = 0,
3978         RENDERING_INTENT_AUTO                  = 1,
3979         RENDERING_INTENT_PERCEPTUAL            = 2,
3980         RENDERING_INTENT_RELATIVE_COLORIMETRIC = 3,
3981         RENDERING_INTENT_SATURATION            = 4,
3982         RENDERING_INTENT_ABSOLUTE_COLORIMETRIC = 5
3983         } RenderingIntentType;
3987     //##################
3988     //# Non-API methods
3989     //##################
3991     /**
3992      *
3993      */
3994     SVGRenderingIntent()
3995         {
3996         renderingIntentType = RENDERING_INTENT_UNKNOWN;
3997         }
3999     /**
4000      *
4001      */
4002     SVGRenderingIntent(const SVGRenderingIntent &other)
4003         {
4004         renderingIntentType = other.renderingIntentType;
4005         }
4007     /**
4008      *
4009      */
4010     virtual ~SVGRenderingIntent() {}
4012 protected:
4014     unsigned short renderingIntentType;
4015 };
4023 /*#########################################################################
4024 ###########################################################################
4025 ## P A T H    S E G M E N T S
4026 ###########################################################################
4027 #########################################################################*/
4029 static char const *const pathSegLetters[] =
4031     "@", // PATHSEG_UNKNOWN,
4032     "z", // PATHSEG_CLOSEPATH
4033     "M", // PATHSEG_MOVETO_ABS
4034     "m", // PATHSEG_MOVETO_REL,
4035     "L", // PATHSEG_LINETO_ABS
4036     "l", // PATHSEG_LINETO_REL
4037     "C", // PATHSEG_CURVETO_CUBIC_ABS
4038     "c", // PATHSEG_CURVETO_CUBIC_REL
4039     "Q", // PATHSEG_CURVETO_QUADRATIC_ABS,
4040     "q", // PATHSEG_CURVETO_QUADRATIC_REL
4041     "A", // PATHSEG_ARC_ABS
4042     "a", // PATHSEG_ARC_REL,
4043     "H", // PATHSEG_LINETO_HORIZONTAL_ABS,
4044     "h", // PATHSEG_LINETO_HORIZONTAL_REL
4045     "V", // PATHSEG_LINETO_VERTICAL_ABS
4046     "v", // PATHSEG_LINETO_VERTICAL_REL
4047     "S", // PATHSEG_CURVETO_CUBIC_SMOOTH_ABS
4048     "s", // PATHSEG_CURVETO_CUBIC_SMOOTH_REL
4049     "T", // PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS
4050     "t"  // PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL
4051 };
4053 /*#########################################################################
4054 ## SVGPathSeg
4055 #########################################################################*/
4057 /**
4058  *
4059  */
4060 class SVGPathSeg
4062 public:
4066     /**
4067      *  Path Segment Types
4068      */
4069     typedef enum
4070         {
4071         PATHSEG_UNKNOWN                      = 0,
4072         PATHSEG_CLOSEPATH                    = 1,
4073         PATHSEG_MOVETO_ABS                   = 2,
4074         PATHSEG_MOVETO_REL                   = 3,
4075         PATHSEG_LINETO_ABS                   = 4,
4076         PATHSEG_LINETO_REL                   = 5,
4077         PATHSEG_CURVETO_CUBIC_ABS            = 6,
4078         PATHSEG_CURVETO_CUBIC_REL            = 7,
4079         PATHSEG_CURVETO_QUADRATIC_ABS        = 8,
4080         PATHSEG_CURVETO_QUADRATIC_REL        = 9,
4081         PATHSEG_ARC_ABS                      = 10,
4082         PATHSEG_ARC_REL                      = 11,
4083         PATHSEG_LINETO_HORIZONTAL_ABS        = 12,
4084         PATHSEG_LINETO_HORIZONTAL_REL        = 13,
4085         PATHSEG_LINETO_VERTICAL_ABS          = 14,
4086         PATHSEG_LINETO_VERTICAL_REL          = 15,
4087         PATHSEG_CURVETO_CUBIC_SMOOTH_ABS     = 16,
4088         PATHSEG_CURVETO_CUBIC_SMOOTH_REL     = 17,
4089         PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18,
4090         PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19
4091         } PathSegmentType;
4093     /**
4094      *
4095      */
4096     virtual unsigned short getPathSegType()
4097         { return type; }
4099     /**
4100      *
4101      */
4102     virtual DOMString getPathSegTypeAsLetter()
4103         {
4104         int typ = type;
4105         if (typ<0 || typ>PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL)
4106             typ = PATHSEG_UNKNOWN;
4107         char const *ch = pathSegLetters[typ];
4108         DOMString letter = ch;
4109         return letter;
4110         }
4114     //##################
4115     //# Non-API methods
4116     //##################
4118     /**
4119      *
4120      */
4121     SVGPathSeg()
4122         { type = PATHSEG_UNKNOWN; }
4124     /**
4125      *
4126      */
4127     SVGPathSeg(const SVGPathSeg &other)
4128         {
4129         type = other.type;
4130         }
4132     /**
4133      *
4134      */
4135     virtual ~SVGPathSeg() {}
4137 protected:
4139     int type;
4141 };
4148 /*#########################################################################
4149 ## SVGPathSegClosePath
4150 #########################################################################*/
4152 /**
4153  *
4154  */
4155 class SVGPathSegClosePath : public SVGPathSeg
4157 public:
4159     //##################
4160     //# Non-API methods
4161     //##################
4163     /**
4164      *
4165      */
4166     SVGPathSegClosePath()
4167         {
4168         type = PATHSEG_CLOSEPATH;
4169         }
4171     /**
4172      *
4173      */
4174     SVGPathSegClosePath(const SVGPathSegClosePath &other) : SVGPathSeg(other)
4175         {
4176         type = PATHSEG_CLOSEPATH;
4177         }
4179     /**
4180      *
4181      */
4182     virtual ~SVGPathSegClosePath() {}
4184 };
4189 /*#########################################################################
4190 ## SVGPathSegMovetoAbs
4191 #########################################################################*/
4193 /**
4194  *
4195  */
4196 class SVGPathSegMovetoAbs : public SVGPathSeg
4198 public:
4200     /**
4201      *
4202      */
4203     virtual double getX()
4204         { return x; }
4206     /**
4207      *
4208      */
4209     virtual void setX(double val) throw (DOMException)
4210         { x = val; }
4212     /**
4213      *
4214      */
4215     virtual double getY()
4216         { return y; }
4218     /**
4219      *
4220      */
4221     virtual void setY(double val) throw (DOMException)
4222         { y = val; }
4224     //##################
4225     //# Non-API methods
4226     //##################
4228     /**
4229      *
4230      */
4231     SVGPathSegMovetoAbs()
4232         {
4233         type = PATHSEG_MOVETO_ABS;
4234         x = y = 0.0;
4235         }
4237     /**
4238      *
4239      */
4240     SVGPathSegMovetoAbs(double xArg, double yArg)
4241         {
4242         type = PATHSEG_MOVETO_ABS;
4243         x = xArg; y = yArg;
4244         }
4246     /**
4247      *
4248      */
4249     SVGPathSegMovetoAbs(const SVGPathSegMovetoAbs &other) : SVGPathSeg(other)
4250         {
4251         type = PATHSEG_MOVETO_ABS;
4252         x = other.x; y = other.y;
4253         }
4255     /**
4256      *
4257      */
4258     virtual ~SVGPathSegMovetoAbs() {}
4260 protected:
4262     double x,y;
4264 };
4271 /*#########################################################################
4272 ## SVGPathSegMovetoRel
4273 #########################################################################*/
4275 /**
4276  *
4277  */
4278 class SVGPathSegMovetoRel : public SVGPathSeg
4280 public:
4282     /**
4283      *
4284      */
4285     virtual double getX()
4286         { return x; }
4288     /**
4289      *
4290      */
4291     virtual void setX(double val) throw (DOMException)
4292         { x = val; }
4294     /**
4295      *
4296      */
4297     virtual double getY()
4298         { return y; }
4300     /**
4301      *
4302      */
4303     virtual void setY(double val) throw (DOMException)
4304         { y = val; }
4306     //##################
4307     //# Non-API methods
4308     //##################
4310     /**
4311      *
4312      */
4313     SVGPathSegMovetoRel()
4314         {
4315         type = PATHSEG_MOVETO_REL;
4316         x = y = 0.0;
4317         }
4320     /**
4321      *
4322      */
4323     SVGPathSegMovetoRel(double xArg, double yArg)
4324         {
4325         type = PATHSEG_MOVETO_REL;
4326         x = xArg; y = yArg;
4327         }
4329     /**
4330      *
4331      */
4332     SVGPathSegMovetoRel(const SVGPathSegMovetoRel &other) : SVGPathSeg(other)
4333         {
4334         type = PATHSEG_MOVETO_REL;
4335         x = other.x; y = other.y;
4336         }
4338     /**
4339      *
4340      */
4341     virtual ~SVGPathSegMovetoRel() {}
4343 protected:
4345     double x,y;
4346 };
4353 /*#########################################################################
4354 ## SVGPathSegLinetoAbs
4355 #########################################################################*/
4357 /**
4358  *
4359  */
4360 class SVGPathSegLinetoAbs : public SVGPathSeg
4362 public:
4364     /**
4365      *
4366      */
4367     virtual double getX()
4368         { return x; }
4370     /**
4371      *
4372      */
4373     virtual void setX(double val) throw (DOMException)
4374         { x = val; }
4376     /**
4377      *
4378      */
4379     virtual double getY()
4380         { return y; }
4382     /**
4383      *
4384      */
4385     virtual void setY(double val) throw (DOMException)
4386         { y = val; }
4388     //##################
4389     //# Non-API methods
4390     //##################
4392     /**
4393      *
4394      */
4395     SVGPathSegLinetoAbs()
4396         {
4397         type = PATHSEG_LINETO_ABS;
4398         x = y = 0.0;
4399         }
4402     /**
4403      *
4404      */
4405     SVGPathSegLinetoAbs(double xArg, double yArg)
4406         {
4407         type = PATHSEG_LINETO_ABS;
4408         x = xArg; y = yArg;
4409         }
4411     /**
4412      *
4413      */
4414     SVGPathSegLinetoAbs(const SVGPathSegLinetoAbs &other) : SVGPathSeg(other)
4415         {
4416         type = PATHSEG_LINETO_ABS;
4417         x = other.x; y = other.y;
4418         }
4420     /**
4421      *
4422      */
4423     virtual ~SVGPathSegLinetoAbs() {}
4425 protected:
4427     double x,y;
4428 };
4435 /*#########################################################################
4436 ## SVGPathSegLinetoRel
4437 #########################################################################*/
4439 /**
4440  *
4441  */
4442 class SVGPathSegLinetoRel : public SVGPathSeg
4444 public:
4446     /**
4447      *
4448      */
4449     virtual double getX()
4450         { return x; }
4452     /**
4453      *
4454      */
4455     virtual void setX(double val) throw (DOMException)
4456         { x = val; }
4458     /**
4459      *
4460      */
4461     virtual double getY()
4462         { return y; }
4464     /**
4465      *
4466      */
4467     virtual void setY(double val) throw (DOMException)
4468         { y = val; }
4470     //##################
4471     //# Non-API methods
4472     //##################
4474     /**
4475      *
4476      */
4477     SVGPathSegLinetoRel()
4478         {
4479         type = PATHSEG_LINETO_REL;
4480         x = y = 0.0;
4481         }
4484     /**
4485      *
4486      */
4487     SVGPathSegLinetoRel(double xArg, double yArg)
4488         {
4489         type = PATHSEG_LINETO_REL;
4490         x = xArg; y = yArg;
4491         }
4493     /**
4494      *
4495      */
4496     SVGPathSegLinetoRel(const SVGPathSegLinetoRel &other) : SVGPathSeg(other)
4497         {
4498         type = PATHSEG_LINETO_REL;
4499         x = other.x; y = other.y;
4500         }
4502     /**
4503      *
4504      */
4505     virtual ~SVGPathSegLinetoRel() {}
4507 protected:
4509     double x,y;
4510 };
4517 /*#########################################################################
4518 ## SVGPathSegCurvetoCubicAbs
4519 #########################################################################*/
4521 /**
4522  *
4523  */
4524 class SVGPathSegCurvetoCubicAbs : public SVGPathSeg
4526 public:
4528     /**
4529      *
4530      */
4531     virtual double getX()
4532         { return x; }
4534     /**
4535      *
4536      */
4537     virtual void setX(double val) throw (DOMException)
4538         { x = val; }
4540     /**
4541      *
4542      */
4543     virtual double getY()
4544         { return y; }
4546     /**
4547      *
4548      */
4549     virtual void setY(double val) throw (DOMException)
4550         { y = val; }
4552     /**
4553      *
4554      */
4555     virtual double getX1()
4556         { return x1; }
4558     /**
4559      *
4560      */
4561     virtual void setX1(double val) throw (DOMException)
4562         { x1 = val; }
4564     /**
4565      *
4566      */
4567     virtual double getY1()
4568         { return y1; }
4570     /**
4571      *
4572      */
4573     virtual void setY1(double val) throw (DOMException)
4574         { y1 = val; }
4577     /**
4578      *
4579      */
4580     virtual double getX2()
4581         { return x2; }
4583     /**
4584      *
4585      */
4586     virtual void setX2(double val) throw (DOMException)
4587         { x2 = val; }
4589     /**
4590      *
4591      */
4592     virtual double getY2()
4593         { return y2; }
4595     /**
4596      *
4597      */
4598     virtual void setY2(double val) throw (DOMException)
4599         { y2 = val; }
4602     //##################
4603     //# Non-API methods
4604     //##################
4607     /**
4608      *
4609      */
4610     SVGPathSegCurvetoCubicAbs()
4611         {
4612         type = PATHSEG_CURVETO_CUBIC_ABS;
4613         x = y = x1 = y1 = x2 = y2 = 0.0;
4614         }
4616     /**
4617      *
4618      */
4619     SVGPathSegCurvetoCubicAbs(double xArg,  double yArg,
4620                               double x1Arg, double y1Arg,
4621                               double x2Arg, double y2Arg)
4622         {
4623         type = PATHSEG_CURVETO_CUBIC_ABS;
4624         x  = xArg;   y  = yArg;
4625         x1 = x1Arg;  y1 = y1Arg;
4626         x2 = x2Arg;  y2 = y2Arg;
4627         }
4629     /**
4630      *
4631      */
4632     SVGPathSegCurvetoCubicAbs(const SVGPathSegCurvetoCubicAbs &other)
4633                      : SVGPathSeg(other)
4634         {
4635         type = PATHSEG_CURVETO_CUBIC_ABS;
4636         x  = other.x;  y  = other.y;
4637         x1 = other.x1; y1 = other.y1;
4638         x2 = other.x2; y2 = other.y2;
4639         }
4641     /**
4642      *
4643      */
4644     virtual ~SVGPathSegCurvetoCubicAbs() {}
4646 protected:
4648     double x, y, x1, y1, x2, y2;
4650 };
4657 /*#########################################################################
4658 ## SVGPathSegCurvetoCubicRel
4659 #########################################################################*/
4661 /**
4662  *
4663  */
4664 class SVGPathSegCurvetoCubicRel : public SVGPathSeg
4666 public:
4668     /**
4669      *
4670      */
4671     virtual double getX()
4672         { return x; }
4674     /**
4675      *
4676      */
4677     virtual void setX(double val) throw (DOMException)
4678         { x = val; }
4680     /**
4681      *
4682      */
4683     virtual double getY()
4684         { return y; }
4686     /**
4687      *
4688      */
4689     virtual void setY(double val) throw (DOMException)
4690         { y = val; }
4692     /**
4693      *
4694      */
4695     virtual double getX1()
4696         { return x1; }
4698     /**
4699      *
4700      */
4701     virtual void setX1(double val) throw (DOMException)
4702         { x1 = val; }
4704     /**
4705      *
4706      */
4707     virtual double getY1()
4708         { return y1; }
4710     /**
4711      *
4712      */
4713     virtual void setY1(double val) throw (DOMException)
4714         { y1 = val; }
4717     /**
4718      *
4719      */
4720     virtual double getX2()
4721         { return x2; }
4723     /**
4724      *
4725      */
4726     virtual void setX2(double val) throw (DOMException)
4727         { x2 = val; }
4729     /**
4730      *
4731      */
4732     virtual double getY2()
4733         { return y2; }
4735     /**
4736      *
4737      */
4738     virtual void setY2(double val) throw (DOMException)
4739         { y2 = val; }
4742     //##################
4743     //# Non-API methods
4744     //##################
4747     /**
4748      *
4749      */
4750     SVGPathSegCurvetoCubicRel()
4751         {
4752         type = PATHSEG_CURVETO_CUBIC_REL;
4753         x = y = x1 = y1 = x2 = y2 = 0.0;
4754         }
4757     /**
4758      *
4759      */
4760     SVGPathSegCurvetoCubicRel(double xArg,  double yArg,
4761                               double x1Arg, double y1Arg,
4762                               double x2Arg, double y2Arg)
4763         {
4764         type = PATHSEG_CURVETO_CUBIC_REL;
4765         x  = xArg;   y  = yArg;
4766         x1 = x1Arg;  y1 = y1Arg;
4767         x2 = x2Arg;  y2 = y2Arg;
4768         }
4770     /**
4771      *
4772      */
4773     SVGPathSegCurvetoCubicRel(const SVGPathSegCurvetoCubicRel &other)
4774                      : SVGPathSeg(other)
4775         {
4776         type = PATHSEG_CURVETO_CUBIC_REL;
4777         x  = other.x;  y  = other.y;
4778         x1 = other.x1; y1 = other.y1;
4779         x2 = other.x2; y2 = other.y2;
4780         }
4782     /**
4783      *
4784      */
4785     virtual ~SVGPathSegCurvetoCubicRel() {}
4787 protected:
4789     double x, y, x1, y1, x2, y2;
4791 };
4798 /*#########################################################################
4799 ## SVGPathSegCurvetoQuadraticAbs
4800 #########################################################################*/
4802 /**
4803  *
4804  */
4805 class SVGPathSegCurvetoQuadraticAbs : public SVGPathSeg
4807 public:
4809     /**
4810      *
4811      */
4812     virtual double getX()
4813         { return x; }
4815     /**
4816      *
4817      */
4818     virtual void setX(double val) throw (DOMException)
4819         { x = val; }
4821     /**
4822      *
4823      */
4824     virtual double getY()
4825         { return y; }
4827     /**
4828      *
4829      */
4830     virtual void setY(double val) throw (DOMException)
4831         { y = val; }
4833     /**
4834      *
4835      */
4836     virtual double getX1()
4837         { return x1; }
4839     /**
4840      *
4841      */
4842     virtual void setX1(double val) throw (DOMException)
4843         { x1 = val; }
4845     /**
4846      *
4847      */
4848     virtual double getY1()
4849         { return y1; }
4851     /**
4852      *
4853      */
4854     virtual void setY1(double val) throw (DOMException)
4855         { y1 = val; }
4858     //##################
4859     //# Non-API methods
4860     //##################
4863     /**
4864      *
4865      */
4866     SVGPathSegCurvetoQuadraticAbs()
4867         {
4868         type = PATHSEG_CURVETO_QUADRATIC_ABS;
4869         x = y = x1 = y1 = 0.0;
4870         }
4872     /**
4873      *
4874      */
4875     SVGPathSegCurvetoQuadraticAbs(double xArg,  double yArg,
4876                               double x1Arg, double y1Arg)
4877         {
4878         type = PATHSEG_CURVETO_QUADRATIC_ABS;
4879         x  = xArg;   y  = yArg;
4880         x1 = x1Arg;  y1 = y1Arg;
4881         }
4883     /**
4884      *
4885      */
4886     SVGPathSegCurvetoQuadraticAbs(const SVGPathSegCurvetoQuadraticAbs &other)
4887                      : SVGPathSeg(other)
4888         {
4889         type = PATHSEG_CURVETO_QUADRATIC_ABS;
4890         x  = other.x;  y  = other.y;
4891         x1 = other.x1; y1 = other.y1;
4892         }
4894     /**
4895      *
4896      */
4897     virtual ~SVGPathSegCurvetoQuadraticAbs() {}
4899 protected:
4901     double x, y, x1, y1;
4903 };
4910 /*#########################################################################
4911 ## SVGPathSegCurvetoQuadraticRel
4912 #########################################################################*/
4914 /**
4915  *
4916  */
4917 class SVGPathSegCurvetoQuadraticRel : public SVGPathSeg
4919 public:
4921     /**
4922      *
4923      */
4924     virtual double getX()
4925         { return x; }
4927     /**
4928      *
4929      */
4930     virtual void setX(double val) throw (DOMException)
4931         { x = val; }
4933     /**
4934      *
4935      */
4936     virtual double getY()
4937         { return y; }
4939     /**
4940      *
4941      */
4942     virtual void setY(double val) throw (DOMException)
4943         { y = val; }
4945     /**
4946      *
4947      */
4948     virtual double getX1()
4949         { return x1; }
4951     /**
4952      *
4953      */
4954     virtual void setX1(double val) throw (DOMException)
4955         { x1 = val; }
4957     /**
4958      *
4959      */
4960     virtual double getY1()
4961         { return y1; }
4963     /**
4964      *
4965      */
4966     virtual void setY1(double val) throw (DOMException)
4967         { y1 = val; }
4970     //##################
4971     //# Non-API methods
4972     //##################
4975     /**
4976      *
4977      */
4978     SVGPathSegCurvetoQuadraticRel()
4979         {
4980         type = PATHSEG_CURVETO_QUADRATIC_REL;
4981         x = y = x1 = y1 = 0.0;
4982         }
4985     /**
4986      *
4987      */
4988     SVGPathSegCurvetoQuadraticRel(double xArg,  double yArg,
4989                                   double x1Arg, double y1Arg)
4990         {
4991         type = PATHSEG_CURVETO_QUADRATIC_REL;
4992         x  = xArg;   y  = yArg;
4993         x1 = x1Arg;  y1 = y1Arg;
4994         }
4996     /**
4997      *
4998      */
4999     SVGPathSegCurvetoQuadraticRel(const SVGPathSegCurvetoQuadraticRel &other)
5000                      : SVGPathSeg(other)
5001         {
5002         type = PATHSEG_CURVETO_QUADRATIC_REL;
5003         x  = other.x;  y  = other.y;
5004         x1 = other.x1; y1 = other.y1;
5005         }
5007     /**
5008      *
5009      */
5010     virtual ~SVGPathSegCurvetoQuadraticRel() {}
5012 protected:
5014     double x, y, x1, y1;
5016 };
5023 /*#########################################################################
5024 ## SVGPathSegArcAbs
5025 #########################################################################*/
5027 /**
5028  *
5029  */
5030 class SVGPathSegArcAbs : public SVGPathSeg
5032 public:
5034     /**
5035      *
5036      */
5037     virtual double getX()
5038         { return x; }
5040     /**
5041      *
5042      */
5043     virtual void setX(double val) throw (DOMException)
5044         { x = val; }
5046     /**
5047      *
5048      */
5049     virtual double getY()
5050         { return y; }
5052     /**
5053      *
5054      */
5055     virtual void setY(double val) throw (DOMException)
5056         { y = val; }
5058     /**
5059      *
5060      */
5061     virtual double getR1()
5062         { return r1; }
5064     /**
5065      *
5066      */
5067     virtual void setR1(double val) throw (DOMException)
5068         { r1 = val; }
5070     /**
5071      *
5072      */
5073     virtual double getR2()
5074         { return r2; }
5076     /**
5077      *
5078      */
5079     virtual void setR2(double val) throw (DOMException)
5080         { r2 = val; }
5082     /**
5083      *
5084      */
5085     virtual double getAngle()
5086         { return angle; }
5088     /**
5089      *
5090      */
5091     virtual void setAngle(double val) throw (DOMException)
5092         { angle = val; }
5094     /**
5095      *
5096      */
5097     virtual bool getLargeArcFlag()
5098         { return largeArcFlag; }
5100     /**
5101      *
5102      */
5103     virtual void setLargeArcFlag(bool val) throw (DOMException)
5104         { largeArcFlag = val; }
5106     /**
5107      *
5108      */
5109     virtual bool getSweepFlag()
5110         { return sweepFlag; }
5112     /**
5113      *
5114      */
5115     virtual void setSweepFlag(bool val) throw (DOMException)
5116         { sweepFlag = val; }
5118     //##################
5119     //# Non-API methods
5120     //##################
5123     /**
5124      *
5125      */
5126     SVGPathSegArcAbs()
5127         {
5128         type = PATHSEG_ARC_ABS;
5129         x = y = r1 = r2 = angle = 0.0;
5130         largeArcFlag = sweepFlag = false;
5131         }
5133     /**
5134      *
5135      */
5136     SVGPathSegArcAbs(double xArg,  double yArg,
5137                      double r1Arg, double r2Arg,
5138                      double angleArg,
5139                      bool largeArcFlagArg,
5140                      bool sweepFlagArg )
5142         {
5143         type = PATHSEG_ARC_ABS;
5144         x  = xArg;   y  = yArg;
5145         r1 = r1Arg;  r2 = r2Arg;
5146         angle        = angleArg;
5147         largeArcFlag = largeArcFlagArg;
5148         sweepFlag    = sweepFlagArg;
5149         }
5151     /**
5152      *
5153      */
5154     SVGPathSegArcAbs(const SVGPathSegArcAbs &other)
5155                      : SVGPathSeg(other)
5156         {
5157         type = PATHSEG_ARC_ABS;
5158         x  = other.x;  y  = other.y;
5159         r1 = other.r1; r2 = other.r2;
5160         angle        = other.angle;
5161         largeArcFlag = other.largeArcFlag;
5162         sweepFlag    = other.sweepFlag;
5163         }
5165     /**
5166      *
5167      */
5168     virtual ~SVGPathSegArcAbs() {}
5170 protected:
5172     double x, y, r1, r2, angle;
5173     bool largeArcFlag;
5174     bool sweepFlag;
5176 };
5180 /*#########################################################################
5181 ## SVGPathSegArcRel
5182 #########################################################################*/
5184 /**
5185  *
5186  */
5187 class SVGPathSegArcRel : public SVGPathSeg
5189 public:
5191     /**
5192      *
5193      */
5194     virtual double getX()
5195         { return x; }
5197     /**
5198      *
5199      */
5200     virtual void setX(double val) throw (DOMException)
5201         { x = val; }
5203     /**
5204      *
5205      */
5206     virtual double getY()
5207         { return y; }
5209     /**
5210      *
5211      */
5212     virtual void setY(double val) throw (DOMException)
5213         { y = val; }
5215     /**
5216      *
5217      */
5218     virtual double getR1()
5219         { return r1; }
5221     /**
5222      *
5223      */
5224     virtual void setR1(double val) throw (DOMException)
5225         { r1 = val; }
5227     /**
5228      *
5229      */
5230     virtual double getR2()
5231         { return r2; }
5233     /**
5234      *
5235      */
5236     virtual void setR2(double val) throw (DOMException)
5237         { r2 = val; }
5239     /**
5240      *
5241      */
5242     virtual double getAngle()
5243         { return angle; }
5245     /**
5246      *
5247      */
5248     virtual void setAngle(double val) throw (DOMException)
5249         { angle = val; }
5251     /**
5252      *
5253      */
5254     virtual bool getLargeArcFlag()
5255         { return largeArcFlag; }
5257     /**
5258      *
5259      */
5260     virtual void setLargeArcFlag(bool val) throw (DOMException)
5261         { largeArcFlag = val; }
5263     /**
5264      *
5265      */
5266     virtual bool getSweepFlag()
5267         { return sweepFlag; }
5269     /**
5270      *
5271      */
5272     virtual void setSweepFlag(bool val) throw (DOMException)
5273         { sweepFlag = val; }
5275     //##################
5276     //# Non-API methods
5277     //##################
5280     /**
5281      *
5282      */
5283     SVGPathSegArcRel()
5284         {
5285         type = PATHSEG_ARC_REL;
5286         x = y = r1 = r2 = angle = 0.0;
5287         largeArcFlag = sweepFlag = false;
5288         }
5291     /**
5292      *
5293      */
5294     SVGPathSegArcRel(double xArg, double yArg,
5295                      double r1Arg, double r2Arg,
5296                      double angleArg,
5297                      bool largeArcFlagArg,
5298                      bool sweepFlagArg )
5300         {
5301         type = PATHSEG_ARC_REL;
5302         x  = xArg;   y  = yArg;
5303         r1 = r1Arg;  r2 = r2Arg;
5304         angle        = angleArg;
5305         largeArcFlag = largeArcFlagArg;
5306         sweepFlag    = sweepFlagArg;
5307         }
5309     /**
5310      *
5311      */
5312     SVGPathSegArcRel(const SVGPathSegArcRel &other)
5313                      : SVGPathSeg(other)
5314         {
5315         type = PATHSEG_ARC_REL;
5316         x  = other.x;  y  = other.y;
5317         r1 = other.r1; r2 = other.r2;
5318         angle        = other.angle;
5319         largeArcFlag = other.largeArcFlag;
5320         sweepFlag    = other.sweepFlag;
5321         }
5323     /**
5324      *
5325      */
5326     virtual ~SVGPathSegArcRel() {}
5328 protected:
5330     double x, y, r1, r2, angle;
5331     bool largeArcFlag;
5332     bool sweepFlag;
5334 };
5341 /*#########################################################################
5342 ## SVGPathSegLinetoHorizontalAbs
5343 #########################################################################*/
5345 /**
5346  *
5347  */
5348 class SVGPathSegLinetoHorizontalAbs : public SVGPathSeg
5350 public:
5352     /**
5353      *
5354      */
5355     virtual double getX()
5356         { return x; }
5358     /**
5359      *
5360      */
5361     virtual void setX(double val) throw (DOMException)
5362         { x = val; }
5364     //##################
5365     //# Non-API methods
5366     //##################
5368     /**
5369      *
5370      */
5371     SVGPathSegLinetoHorizontalAbs()
5372         {
5373         type = PATHSEG_LINETO_HORIZONTAL_ABS;
5374         x = 0.0;
5375         }
5378     /**
5379      *
5380      */
5381     SVGPathSegLinetoHorizontalAbs(double xArg)
5382         {
5383         type = PATHSEG_LINETO_HORIZONTAL_ABS;
5384         x = xArg;
5385         }
5387     /**
5388      *
5389      */
5390     SVGPathSegLinetoHorizontalAbs(const SVGPathSegLinetoHorizontalAbs &other)
5391                      : SVGPathSeg(other)
5392         {
5393         type = PATHSEG_LINETO_HORIZONTAL_ABS;
5394         x = other.x;
5395         }
5397     /**
5398      *
5399      */
5400     virtual ~SVGPathSegLinetoHorizontalAbs() {}
5402 protected:
5404     double x;
5406 };
5413 /*#########################################################################
5414 ## SVGPathSegLinetoHorizontalRel
5415 #########################################################################*/
5417 /**
5418  *
5419  */
5420 class SVGPathSegLinetoHorizontalRel : public SVGPathSeg
5422 public:
5424     /**
5425      *
5426      */
5427     virtual double getX()
5428         { return x; }
5430     /**
5431      *
5432      */
5433     virtual void setX(double val) throw (DOMException)
5434         { x = val; }
5436     //##################
5437     //# Non-API methods
5438     //##################
5440     /**
5441      *
5442      */
5443     SVGPathSegLinetoHorizontalRel()
5444         {
5445         type = PATHSEG_LINETO_HORIZONTAL_REL;
5446         x = 0.0;
5447         }
5450     /**
5451      *
5452      */
5453     SVGPathSegLinetoHorizontalRel(double xArg)
5454         {
5455         type = PATHSEG_LINETO_HORIZONTAL_REL;
5456         x = xArg;
5457         }
5459     /**
5460      *
5461      */
5462     SVGPathSegLinetoHorizontalRel(const SVGPathSegLinetoHorizontalRel &other)
5463                      : SVGPathSeg(other)
5464         {
5465         type = PATHSEG_LINETO_HORIZONTAL_REL;
5466         x = other.x;
5467         }
5469     /**
5470      *
5471      */
5472     virtual ~SVGPathSegLinetoHorizontalRel() {}
5474 protected:
5476     double x;
5478 };
5482 /*#########################################################################
5483 ## SVGPathSegLinetoVerticalAbs
5484 #########################################################################*/
5486 /**
5487  *
5488  */
5489 class SVGPathSegLinetoVerticalAbs : public SVGPathSeg
5491 public:
5493     /**
5494      *
5495      */
5496     virtual double getY()
5497         { return y; }
5499     /**
5500      *
5501      */
5502     virtual void setY(double val) throw (DOMException)
5503         { y = val; }
5505     //##################
5506     //# Non-API methods
5507     //##################
5509     /**
5510      *
5511      */
5512     SVGPathSegLinetoVerticalAbs()
5513         {
5514         type = PATHSEG_LINETO_VERTICAL_ABS;
5515         y = 0.0;
5516         }
5519     /**
5520      *
5521      */
5522     SVGPathSegLinetoVerticalAbs(double yArg)
5523         {
5524         type = PATHSEG_LINETO_VERTICAL_ABS;
5525         y = yArg;
5526         }
5528     /**
5529      *
5530      */
5531     SVGPathSegLinetoVerticalAbs(const SVGPathSegLinetoVerticalAbs &other)
5532                      : SVGPathSeg(other)
5533         {
5534         type = PATHSEG_LINETO_VERTICAL_ABS;
5535         y = other.y;
5536         }
5538     /**
5539      *
5540      */
5541     virtual ~SVGPathSegLinetoVerticalAbs() {}
5543 protected:
5545     double y;
5547 };
5551 /*#########################################################################
5552 ## SVGPathSegLinetoVerticalRel
5553 #########################################################################*/
5555 /**
5556  *
5557  */
5558 class SVGPathSegLinetoVerticalRel : public SVGPathSeg
5560 public:
5562     /**
5563      *
5564      */
5565     virtual double getY()
5566         { return y; }
5568     /**
5569      *
5570      */
5571     virtual void setY(double val) throw (DOMException)
5572         { y = val; }
5574     //##################
5575     //# Non-API methods
5576     //##################
5578     /**
5579      *
5580      */
5581     SVGPathSegLinetoVerticalRel()
5582         {
5583         type = PATHSEG_LINETO_VERTICAL_REL;
5584         y = 0.0;
5585         }
5588     /**
5589      *
5590      */
5591     SVGPathSegLinetoVerticalRel(double yArg)
5592         {
5593         type = PATHSEG_LINETO_VERTICAL_REL;
5594         y = yArg;
5595         }
5597     /**
5598      *
5599      */
5600     SVGPathSegLinetoVerticalRel(const SVGPathSegLinetoVerticalRel &other)
5601                      : SVGPathSeg(other)
5602         {
5603         type = PATHSEG_LINETO_VERTICAL_REL;
5604         y = other.y;
5605         }
5607     /**
5608      *
5609      */
5610     virtual ~SVGPathSegLinetoVerticalRel() {}
5612 protected:
5614     double y;
5616 };
5623 /*#########################################################################
5624 ## SVGPathSegCurvetoCubicSmoothAbs
5625 #########################################################################*/
5627 /**
5628  *
5629  */
5630 class SVGPathSegCurvetoCubicSmoothAbs : public SVGPathSeg
5632 public:
5634     /**
5635      *
5636      */
5637     virtual double getX()
5638         { return x; }
5640     /**
5641      *
5642      */
5643     virtual void setX(double val) throw (DOMException)
5644         { x = val; }
5646     /**
5647      *
5648      */
5649     virtual double getY()
5650         { return y; }
5652     /**
5653      *
5654      */
5655     virtual void setY(double val) throw (DOMException)
5656         { y = val; }
5658     /**
5659      *
5660      */
5661     virtual double getX2()
5662         { return x2; }
5664     /**
5665      *
5666      */
5667     virtual void setX2(double val) throw (DOMException)
5668         { x2 = val; }
5670     /**
5671      *
5672      */
5673     virtual double getY2()
5674         { return y2; }
5676     /**
5677      *
5678      */
5679     virtual void setY2(double val) throw (DOMException)
5680         { y2 = val; }
5683     //##################
5684     //# Non-API methods
5685     //##################
5687     /**
5688      *
5689      */
5690     SVGPathSegCurvetoCubicSmoothAbs()
5691         {
5692         type = PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;
5693         x = y = x2 = y2 = 0.0;
5694         }
5697     /**
5698      *
5699      */
5700     SVGPathSegCurvetoCubicSmoothAbs(double xArg,   double yArg,
5701                                     double x2Arg, double y2Arg)
5702         {
5703         type = PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;
5704         x  = xArg;    y  = yArg;
5705         x2 = x2Arg;   y2 = y2Arg;
5706         }
5708     /**
5709      *
5710      */
5711     SVGPathSegCurvetoCubicSmoothAbs(const SVGPathSegCurvetoCubicSmoothAbs &other)
5712                      : SVGPathSeg(other)
5713         {
5714         type = PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;
5715         x  = other.x;  y  = other.y;
5716         x2 = other.x2; y2 = other.y2;
5717         }
5719     /**
5720      *
5721      */
5722     virtual ~SVGPathSegCurvetoCubicSmoothAbs() {}
5724 protected:
5726     double x, y, x2, y2;
5728 };
5732 /*#########################################################################
5733 ## SVGPathSegCurvetoCubicSmoothRel
5734 #########################################################################*/
5736 /**
5737  *
5738  */
5739 class SVGPathSegCurvetoCubicSmoothRel : public SVGPathSeg
5741 public:
5743     /**
5744      *
5745      */
5746     virtual double getX()
5747         { return x; }
5749     /**
5750      *
5751      */
5752     virtual void setX(double val) throw (DOMException)
5753         { x = val; }
5755     /**
5756      *
5757      */
5758     virtual double getY()
5759         { return y; }
5761     /**
5762      *
5763      */
5764     virtual void setY(double val) throw (DOMException)
5765         { y = val; }
5767     /**
5768      *
5769      */
5770     virtual double getX2()
5771         { return x2; }
5773     /**
5774      *
5775      */
5776     virtual void setX2(double val) throw (DOMException)
5777         { x2 = val; }
5779     /**
5780      *
5781      */
5782     virtual double getY2()
5783         { return y2; }
5785     /**
5786      *
5787      */
5788     virtual void setY2(double val) throw (DOMException)
5789         { y2 = val; }
5792     //##################
5793     //# Non-API methods
5794     //##################
5796     /**
5797      *
5798      */
5799     SVGPathSegCurvetoCubicSmoothRel()
5800         {
5801         type = PATHSEG_CURVETO_CUBIC_SMOOTH_REL;
5802         x = y = x2 = y2 = 0.0;
5803         }
5806     /**
5807      *
5808      */
5809     SVGPathSegCurvetoCubicSmoothRel(double xArg,   double yArg,
5810                                     double x2Arg, double y2Arg)
5811         {
5812         type = PATHSEG_CURVETO_CUBIC_SMOOTH_REL;
5813         x  = xArg;    y  = yArg;
5814         x2 = x2Arg;   y2 = y2Arg;
5815         }
5817     /**
5818      *
5819      */
5820     SVGPathSegCurvetoCubicSmoothRel(const SVGPathSegCurvetoCubicSmoothRel &other)
5821                      : SVGPathSeg(other)
5822         {
5823         type = PATHSEG_CURVETO_CUBIC_SMOOTH_REL;
5824         x  = other.x;  y  = other.y;
5825         x2 = other.x2; y2 = other.y2;
5826         }
5828     /**
5829      *
5830      */
5831     virtual ~SVGPathSegCurvetoCubicSmoothRel() {}
5833 protected:
5835     double x, y, x2, y2;
5837 };
5844 /*#########################################################################
5845 ## SVGPathSegCurvetoQuadraticSmoothAbs
5846 #########################################################################*/
5848 /**
5849  *
5850  */
5851 class SVGPathSegCurvetoQuadraticSmoothAbs : public SVGPathSeg
5853 public:
5855     /**
5856      *
5857      */
5858     virtual double getX()
5859         { return x; }
5861     /**
5862      *
5863      */
5864     virtual void setX(double val) throw (DOMException)
5865         { x = val; }
5867     /**
5868      *
5869      */
5870     virtual double getY()
5871         { return y; }
5873     /**
5874      *
5875      */
5876     virtual void setY(double val) throw (DOMException)
5877         { y = val; }
5881     //##################
5882     //# Non-API methods
5883     //##################
5885     /**
5886      *
5887      */
5888     SVGPathSegCurvetoQuadraticSmoothAbs()
5889         {
5890         type = PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;
5891         x = y = 0.0;
5892         }
5895     /**
5896      *
5897      */
5898     SVGPathSegCurvetoQuadraticSmoothAbs(double xArg, double yArg)
5899         {
5900         type = PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;
5901         x = xArg;     y = yArg;
5902         }
5904     /**
5905      *
5906      */
5907     SVGPathSegCurvetoQuadraticSmoothAbs(const SVGPathSegCurvetoQuadraticSmoothAbs &other)
5908                      : SVGPathSeg(other)
5909         {
5910         type = PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;
5911         x = y = 0.0;
5912         }
5914     /**
5915      *
5916      */
5917     virtual ~SVGPathSegCurvetoQuadraticSmoothAbs() {}
5919 protected:
5921     double x, y;
5923 };
5930 /*#########################################################################
5931 ## SVGPathSegCurvetoQuadraticSmoothRel
5932 #########################################################################*/
5934 /**
5935  *
5936  */
5937 class SVGPathSegCurvetoQuadraticSmoothRel : public SVGPathSeg
5939 public:
5941     /**
5942      *
5943      */
5944     virtual double getX()
5945         { return x; }
5947     /**
5948      *
5949      */
5950     virtual void setX(double val) throw (DOMException)
5951         { x = val; }
5953     /**
5954      *
5955      */
5956     virtual double getY()
5957         { return y; }
5959     /**
5960      *
5961      */
5962     virtual void setY(double val) throw (DOMException)
5963         { y = val; }
5967     //##################
5968     //# Non-API methods
5969     //##################
5971     /**
5972      *
5973      */
5974     SVGPathSegCurvetoQuadraticSmoothRel()
5975         {
5976         type = PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;
5977         x = y = 0.0;
5978         }
5981     /**
5982      *
5983      */
5984     SVGPathSegCurvetoQuadraticSmoothRel(double xArg, double yArg)
5985         {
5986         type = PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;
5987         x = xArg;     y = yArg;
5988         }
5990     /**
5991      *
5992      */
5993     SVGPathSegCurvetoQuadraticSmoothRel(const SVGPathSegCurvetoQuadraticSmoothRel &other)
5994                      : SVGPathSeg(other)
5995         {
5996         type = PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;
5997         x = y = 0.0;
5998         }
6000     /**
6001      *
6002      */
6003     virtual ~SVGPathSegCurvetoQuadraticSmoothRel() {}
6005 protected:
6007     double x, y;
6009 };
6016 /*#########################################################################
6017 ## SVGPathSegList
6018 #########################################################################*/
6020 /**
6021  *
6022  */
6023 class SVGPathSegList
6025 public:
6027     /**
6028      *
6029      */
6030     virtual unsigned long getNumberOfItems()
6031         { return items.size(); }
6034     /**
6035      *
6036      */
6037     virtual void clear () throw( DOMException )
6038         { items.clear(); }
6040     /**
6041      *
6042      */
6043     virtual SVGPathSeg initialize (const SVGPathSeg &newItem)
6044                     throw( DOMException, SVGException )
6045         {
6046         items.clear();
6047         items.push_back(newItem);
6048         return newItem;
6049         }
6051     /**
6052      *
6053      */
6054     virtual SVGPathSeg getItem (unsigned long index)
6055                     throw( DOMException )
6056         {
6057         if (index >= items.size())
6058             {
6059             SVGPathSeg seg;
6060             return seg;
6061             }
6062         return items[index];
6063         }
6065     /**
6066      *
6067      */
6068     virtual SVGPathSeg insertItemBefore(const SVGPathSeg &newItem,
6069                                         unsigned long index )
6070                           throw( DOMException, SVGException )
6071         {
6072         if (index >= items.size())
6073             items.push_back(newItem);
6074         else
6075             {
6076             std::vector<SVGPathSeg>::iterator iter = items.begin() + index;
6077             items.insert(iter, newItem);
6078             }
6079         return newItem;
6080         }
6082     /**
6083      *
6084      */
6085     virtual SVGPathSeg replaceItem(const SVGPathSeg &newItem,
6086                                    unsigned long index )
6087                               throw( DOMException, SVGException )
6088         {
6089         if (index >= items.size())
6090             {
6091             SVGPathSeg seg;
6092             return seg;
6093             }
6094         std::vector<SVGPathSeg>::iterator iter = items.begin() + index;
6095         *iter = newItem;
6096         return newItem;
6097         }
6099     /**
6100      *
6101      */
6102     virtual SVGPathSeg removeItem (unsigned long index)
6103                                   throw (DOMException)
6104         {
6105         if (index >= items.size())
6106             {
6107             SVGPathSeg seg;
6108             return seg;
6109             }
6110         std::vector<SVGPathSeg>::iterator iter = items.begin() + index;
6111         SVGPathSeg olditem = *iter;
6112         items.erase(iter);
6113         return olditem;
6114         }
6116     /**
6117      *
6118      */
6119     virtual SVGPathSeg appendItem (const SVGPathSeg &newItem)
6120                     throw( DOMException, SVGException )
6121         {
6122         items.push_back(newItem);
6123         return newItem;
6124         }
6128     //##################
6129     //# Non-API methods
6130     //##################
6132     /**
6133      *
6134      */
6135     SVGPathSegList() {}
6138     /**
6139      *
6140      */
6141     SVGPathSegList(const SVGPathSegList &other)
6142         {
6143         items = other.items;
6144         }
6147     /**
6148      *
6149      */
6150     virtual ~SVGPathSegList() {}
6152 protected:
6154     std::vector<SVGPathSeg> items;
6156 };
6163 /*#########################################################################
6164 ## SVGAnimatedPathData
6165 #########################################################################*/
6167 /**
6168  *
6169  */
6170 class SVGAnimatedPathData
6172 public:
6174     /**
6175      *
6176      */
6177     virtual SVGPathSegList getPathSegList()
6178         {
6179         SVGPathSegList list;
6180         return list;
6181         }
6183     /**
6184      *
6185      */
6186     virtual SVGPathSegList getNormalizedPathSegList()
6187         {
6188         SVGPathSegList list;
6189         return list;
6190         }
6192     /**
6193      *
6194      */
6195     virtual SVGPathSegList getAnimatedPathSegList()
6196         {
6197         SVGPathSegList list;
6198         return list;
6199         }
6201     /**
6202      *
6203      */
6204     virtual SVGPathSegList getAnimatedNormalizedPathSegList()
6205         {
6206         SVGPathSegList list;
6207         return list;
6208         }
6212     //##################
6213     //# Non-API methods
6214     //##################
6216     /**
6217      *
6218      */
6219    SVGAnimatedPathData()
6220         {}
6222     /**
6223      *
6224      */
6225    SVGAnimatedPathData(const SVGAnimatedPathData &/*other*/)
6226         {
6227         }
6229     /**
6230      *
6231      */
6232     virtual ~SVGAnimatedPathData() {}
6234 };
6241 /*#########################################################################
6242 ## SVGAnimatedPoints
6243 #########################################################################*/
6245 /**
6246  *
6247  */
6248 class SVGAnimatedPoints
6250 public:
6252     /**
6253      *
6254      */
6255     virtual SVGPointList getPoints()
6256         { return points; }
6258     /**
6259      *
6260      */
6261     virtual SVGPointList getAnimatedPoints()
6262         { return animatedPoints; }
6266     //##################
6267     //# Non-API methods
6268     //##################
6270     /**
6271      *
6272      */
6273     SVGAnimatedPoints() {}
6275     /**
6276      *
6277      */
6278     SVGAnimatedPoints(const SVGAnimatedPoints &other)
6279         {
6280         points         = other.points;
6281         animatedPoints = other.animatedPoints;
6282         }
6284     /**
6285      *
6286      */
6287     virtual ~SVGAnimatedPoints() {}
6289 protected:
6291     SVGPointList points;
6292     SVGPointList animatedPoints;
6294 };
6300 /*#########################################################################
6301 ## SVGPaint
6302 #########################################################################*/
6304 /**
6305  *
6306  */
6307 class SVGPaint : public SVGColor
6309 public:
6312     /**
6313      * Paint Types
6314      */
6315     typedef enum
6316         {
6317         SVG_PAINTTYPE_UNKNOWN               = 0,
6318         SVG_PAINTTYPE_RGBCOLOR              = 1,
6319         SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR     = 2,
6320         SVG_PAINTTYPE_NONE                  = 101,
6321         SVG_PAINTTYPE_CURRENTCOLOR          = 102,
6322         SVG_PAINTTYPE_URI_NONE              = 103,
6323         SVG_PAINTTYPE_URI_CURRENTCOLOR      = 104,
6324         SVG_PAINTTYPE_URI_RGBCOLOR          = 105,
6325         SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR = 106,
6326         SVG_PAINTTYPE_URI                   = 107
6327         } PaintType;
6330     /**
6331      *
6332      */
6333     virtual unsigned short getPaintType()
6334         { return paintType; }
6336     /**
6337      *
6338      */
6339     virtual DOMString getUri()
6340         { return uri; }
6342     /**
6343      *
6344      */
6345     virtual void setUri (const DOMString& uriArg )
6346         { uri = uriArg; }
6348     /**
6349      *
6350      */
6351     virtual void setPaint (unsigned short paintTypeArg,
6352                            const DOMString& uriArg,
6353                            const DOMString& /*rgbColor*/,
6354                            const DOMString& /*iccColor*/ )
6355                            throw( SVGException )
6356         {
6357         paintType = paintTypeArg;
6358         uri       = uriArg;
6359         //do something with rgbColor
6360         //do something with iccColor;
6361         }
6365     //##################
6366     //# Non-API methods
6367     //##################
6369     /**
6370      *
6371      */
6372     SVGPaint()
6373         {
6374         uri       = "";
6375         paintType = SVG_PAINTTYPE_UNKNOWN;
6376         }
6378     /**
6379      *
6380      */
6381     SVGPaint(const SVGPaint &other) : css::CSSValue(other), SVGColor(other)
6382         {
6383         uri       = "";
6384         paintType = SVG_PAINTTYPE_UNKNOWN;
6385         }
6387     /**
6388      *
6389      */
6390     virtual ~SVGPaint() {}
6392 protected:
6394     unsigned int paintType;
6395     DOMString uri;
6397 };
6402 /*#########################################################################
6403 ## SVGColorProfileRule
6404 #########################################################################*/
6406 /**
6407  *
6408  */
6409 class SVGColorProfileRule : public SVGCSSRule,
6410                             public SVGRenderingIntent
6413 public:
6414    /**
6415      *
6416      */
6417     virtual DOMString getSrc()
6418         { return src; }
6420     /**
6421      *
6422      */
6423     virtual void setSrc(const DOMString &val) throw (DOMException)
6424         { src = val; }
6426     /**
6427      *
6428      */
6429     virtual DOMString getName()
6430         { return name; }
6432     /**
6433      *
6434      */
6435     virtual void setName(const DOMString &val) throw (DOMException)
6436         { name = val; }
6438     /**
6439      *
6440      */
6441     virtual unsigned short getRenderingIntent()
6442         { return renderingIntent; }
6444     /**
6445      *
6446      */
6447     virtual void setRenderingIntent(unsigned short val) throw (DOMException)
6448         { renderingIntent = val; }
6451     //##################
6452     //# Non-API methods
6453     //##################
6455     /**
6456      *
6457      */
6458     SVGColorProfileRule() {}
6460     /**
6461      *
6462      */
6463     SVGColorProfileRule(const SVGColorProfileRule &other)
6464                : SVGCSSRule(other), SVGRenderingIntent(other)
6465         {
6466         renderingIntent = other.renderingIntent;
6467         src             = other.src;
6468         name            = other.name;
6469         }
6471     /**
6472      *
6473      */
6474     virtual ~SVGColorProfileRule() {}
6476 protected:
6478     unsigned short renderingIntent;
6479     DOMString src;
6480     DOMString name;
6482 };
6486 /*#########################################################################
6487 ## SVGFilterPrimitiveStandardAttributes
6488 #########################################################################*/
6490 /**
6491  *
6492  */
6493 class SVGFilterPrimitiveStandardAttributes : public SVGStylable
6495 public:
6499     /**
6500      *
6501      */
6502     virtual SVGAnimatedLength getX()
6503         { return x; }
6505     /**
6506      *
6507      */
6508     virtual SVGAnimatedLength getY()
6509         { return y; }
6511     /**
6512      *
6513      */
6514     virtual SVGAnimatedLength getWidth()
6515         { return width; }
6517     /**
6518      *
6519      */
6520     virtual SVGAnimatedLength getHeight()
6521         { return height; }
6523     /**
6524      *
6525      */
6526     virtual SVGAnimatedString getResult()
6527         { return result; }
6531     //##################
6532     //# Non-API methods
6533     //##################
6536     /**
6537      *
6538      */
6539     SVGFilterPrimitiveStandardAttributes()
6540         {}
6542     /**
6543      *
6544      */
6545     SVGFilterPrimitiveStandardAttributes(const SVGFilterPrimitiveStandardAttributes &other)
6546                                  : SVGStylable(other)
6547         {
6548         x      = other.x;
6549         y      = other.y;
6550         width  = other.width;
6551         height = other.height;
6552         result = other.result;
6553         }
6555     /**
6556      *
6557      */
6558     virtual ~SVGFilterPrimitiveStandardAttributes() {}
6560 protected:
6562     SVGAnimatedLength x;
6563     SVGAnimatedLength y;
6564     SVGAnimatedLength width;
6565     SVGAnimatedLength height;
6566     SVGAnimatedString result;
6568 };
6580 /*#########################################################################
6581 ## SVGEvent
6582 #########################################################################*/
6584 /**
6585  *
6586  */
6587 class SVGEvent : events::Event
6589 public:
6591     //##################
6592     //# Non-API methods
6593     //##################
6595     /**
6596      *
6597      */
6598     SVGEvent() {}
6600     /**
6601      *
6602      */
6603     SVGEvent(const SVGEvent &other) : events::Event(other)
6604         {}
6606     /**
6607      *
6608      */
6609     virtual ~SVGEvent() {}
6611 };
6616 /*#########################################################################
6617 ## SVGZoomEvent
6618 #########################################################################*/
6620 /**
6621  *
6622  */
6623 class SVGZoomEvent : events::UIEvent
6625 public:
6627     /**
6628      *
6629      */
6630     virtual SVGRect getZoomRectScreen()
6631         { return zoomRectScreen; }
6633     /**
6634      *
6635      */
6636     virtual double getPreviousScale()
6637         { return previousScale; }
6639     /**
6640      *
6641      */
6642     virtual SVGPoint getPreviousTranslate()
6643         { return previousTranslate; }
6645     /**
6646      *
6647      */
6648     virtual double getNewScale()
6649         { return newScale; }
6651    /**
6652      *
6653      */
6654     virtual SVGPoint getNewTranslate()
6655         { return newTranslate; }
6659     //##################
6660     //# Non-API methods
6661     //##################
6663     /**
6664      *
6665      */
6666     SVGZoomEvent()
6667         {}
6669     /**
6670      *
6671      */
6672     SVGZoomEvent(const SVGZoomEvent &other) : events::Event(other),
6673                                               events::UIEvent(other)
6674         {
6675         zoomRectScreen    = other.zoomRectScreen;
6676         previousScale     = other.previousScale;
6677         previousTranslate = other.previousTranslate;
6678         newScale          = other.newScale;
6679         newTranslate      = other.newTranslate;
6680         }
6682     /**
6683      *
6684      */
6685     virtual ~SVGZoomEvent() {}
6687 protected:
6689     SVGRect  zoomRectScreen;
6690     double   previousScale;
6691     SVGPoint previousTranslate;
6692     double   newScale;
6693     SVGPoint newTranslate;
6695 };
6699 /*#########################################################################
6700 ## SVGElementInstance
6701 #########################################################################*/
6703 /**
6704  *
6705  */
6706 class SVGElementInstance : public events::EventTarget
6708 public:
6710     /**
6711      *
6712      */
6713     virtual SVGElementPtr getCorrespondingElement()
6714         { return correspondingElement; }
6716     /**
6717      *
6718      */
6719     virtual SVGUseElementPtr getCorrespondingUseElement()
6720         { return correspondingUseElement; }
6722     /**
6723      *
6724      */
6725     virtual SVGElementInstance getParentNode()
6726         {
6727         SVGElementInstance ret;
6728         return ret;
6729         }
6731     /**
6732      *  Since we are using stack types and this is a circular definition,
6733      *  we will instead implement this as a global function below:
6734      *   SVGElementInstanceList getChildNodes(const SVGElementInstance instance);
6735      */
6736     //virtual SVGElementInstanceList getChildNodes();
6738     /**
6739      *
6740      */
6741     virtual SVGElementInstance getFirstChild()
6742         {
6743         SVGElementInstance ret;
6744         return ret;
6745         }
6747     /**
6748      *
6749      */
6750     virtual SVGElementInstance getLastChild()
6751         {
6752         SVGElementInstance ret;
6753         return ret;
6754         }
6756     /**
6757      *
6758      */
6759     virtual SVGElementInstance getPreviousSibling()
6760         {
6761         SVGElementInstance ret;
6762         return ret;
6763         }
6765     /**
6766      *
6767      */
6768     virtual SVGElementInstance getNextSibling()
6769         {
6770         SVGElementInstance ret;
6771         return ret;
6772         }
6775     //##################
6776     //# Non-API methods
6777     //##################
6779     /**
6780      *
6781      */
6782     SVGElementInstance() {}
6784     /**
6785      *
6786      */
6787     SVGElementInstance(const SVGElementInstance &other)
6788                         : events::EventTarget(other)
6789         {
6790         }
6792     /**
6793      *
6794      */
6795     virtual ~SVGElementInstance() {}
6797 protected:
6799     SVGElementPtr      correspondingElement;
6800     SVGUseElementPtr   correspondingUseElement;
6802 };
6809 /*#########################################################################
6810 ## SVGElementInstanceList
6811 #########################################################################*/
6813 /**
6814  *
6815  */
6816 class SVGElementInstanceList
6818 public:
6821     /**
6822      *
6823      */
6824     virtual unsigned long getLength()
6825         { return items.size(); }
6827     /**
6828      *
6829      */
6830     virtual SVGElementInstance item (unsigned long index )
6831         {
6832         if (index >= items.size())
6833             {
6834             SVGElementInstance ret;
6835             return ret;
6836             }
6837         return items[index];
6838         }
6840     /**
6841      *  This static method replaces the circular definition of:
6842      *        SVGElementInstanceList SVGElementInstance::getChildNodes()
6843      *
6844      */
6845     static SVGElementInstanceList getChildNodes(const SVGElementInstance &/*instance*/)
6846         {
6847         SVGElementInstanceList list;
6848         return list;
6849         }
6852     //##################
6853     //# Non-API methods
6854     //##################
6856     /**
6857      *
6858      */
6859     SVGElementInstanceList() {}
6861     /**
6862      *
6863      */
6864     SVGElementInstanceList(const SVGElementInstanceList &other)
6865         {
6866         items = other.items;
6867         }
6869     /**
6870      *
6871      */
6872     virtual ~SVGElementInstanceList() {}
6874 protected:
6876     std::vector<SVGElementInstance> items;
6879 };
6893 }  //namespace svg
6894 }  //namespace dom
6895 }  //namespace w3c
6896 }  //namespace org
6898 #endif /* __SVGTYPES_H__ */
6899 /*#########################################################################
6900 ## E N D    O F    F I L E
6901 #########################################################################*/