Code

updated spanish.nsh and inkscape.nsi to reflect latest file-changes
[inkscape.git] / trunk / src / dom / views-level3.h
1 #ifndef __VIEWS_LEVEL3_H__
2 #define __VIEWS_LEVEL3_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) 2005-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  */
33 /**
34  * Currently CSS is not at level 3, so we will probably not use this
35  * Level 3 Views implementation.  Rather, we'll regress back to Level 2.
36  * This should not affect using the rest of DOM Core 3
37  */ 
39 #include "dom.h"
43 namespace org
44 {
45 namespace w3c
46 {
47 namespace dom
48 {
49 namespace views
50 {
53 //local aliases
54 typedef dom::Node Node;
55 typedef dom::DOMString DOMString;
57 //forward declarations
58 class Segment;
59 class VisualResource;
60 class VisualCharacter;
61 class VisualCharacterRun;
62 class VisualFrame;
63 class VisualImage;
64 class VisualFormButton;
65 class VisualFormField;
70 /*#########################################################################
71 ## Match
72 #########################################################################*/
74 /**
75  *
76  */
77 class Match
78 {
79 public:
81     typedef enum
82         {
83         IS_EQUAL                       = 0,
84         IS_NOT_EQUAL                   = 1,
85         INT_PRECEDES                   = 2,
86         INT_PRECEDES_OR_EQUALS         = 3,
87         INT_FOLLOWS                    = 4,
88         INT_FOLLOWS_OR_EQUALS          = 5,
89         STR_STARTS_WITH                = 6,
90         STR_ENDS_WITH                  = 7,
91         STR_CONTAINS                   = 8,
92         SET_ANY                        = 9,
93         SET_ALL                        = 10,
94         SET_NOT_ANY                    = 11,
95         SET_NOT_ALL                    = 12
96         } MatchTestGroup;
98     /**
99      *
100      */
101     virtual unsigned short test()
102         { return IS_NOT_EQUAL; }
104     //##################
105     //# Non-API methods
106     //##################
108     /**
109      *
110      */
111     Match() {}
113     /**
114      *
115      */
116     Match(const Match &/*other*/)
117         {
118         }
120     /**
121      *
122      */
123     virtual ~Match() {}
124 };
128 /*#########################################################################
129 ## MatchString
130 #########################################################################*/
132 /**
133  *
134  */
135 class MatchString : virtual public Match
137 public:
139     /**
140      *
141      */
142     virtual DOMString getName()
143         { return name; }
145     /**
146      *
147      */
148     virtual DOMString getValue()
149         { return value; }
151     //##################
152     //# Non-API methods
153     //##################
155     /**
156      *
157      */
158     MatchString() {}
160     /**
161      *
162      */
163     MatchString(const MatchString &other) : Match(other)
164         {
165         name  = other.name;
166         value = other.value;
167         }
169     /**
170      *
171      */
172     virtual ~MatchString() {}
174 protected:
176     DOMString name;
177     DOMString value;
180 };
184 /*#########################################################################
185 ## MatchInteger
186 #########################################################################*/
188 /**
189  *
190  */
191 class MatchInteger : virtual public Match
193 public:
195     /**
196      *
197      */
198     virtual DOMString getName()
199         { return name; }
201     /**
202      *
203      */
204     virtual long getValue()
205         { return value; }
207     //##################
208     //# Non-API methods
209     //##################
211     /**
212      *
213      */
214     MatchInteger() {}
216     /**
217      *
218      */
219     MatchInteger(const MatchInteger &other) : Match(other)
220         {
221         name  = other.name;
222         value = other.value;
223         }
225     /**
226      *
227      */
228     virtual ~MatchInteger() {}
230 protected:
232     DOMString name;
233     long value;
234 };
238 /*#########################################################################
239 ## MatchBoolean
240 #########################################################################*/
242 /**
243  *
244  */
245 class MatchBoolean : virtual public Match
247 public:
249     /**
250      *
251      */
252     virtual DOMString getName()
253         { return name; }
255     /**
256      *
257      */
258     virtual bool getValue()
259         { return value; }
261     //##################
262     //# Non-API methods
263     //##################
265     /**
266      *
267      */
268     MatchBoolean() {}
270     /**
271      *
272      */
273     MatchBoolean(const MatchBoolean &other) : Match(other)
274         {
275         name  = other.name;
276         value = other.value;
277         }
279     /**
280      *
281      */
282     virtual ~MatchBoolean() {}
284 protected:
286     DOMString name;
287     bool value;
288 };
292 /*#########################################################################
293 ## MatchContent
294 #########################################################################*/
296 /**
297  *
298  */
299 class MatchContent : virtual public Match
301 public:
303     /**
304      *
305      */
306     virtual DOMString getName()
307         { return name; }
309     /**
310      *
311      */
312     virtual NodePtr getNodeArg()
313         { return nodeArg; }
316     /**
317      *
318      */
319     virtual unsigned long getOffset()
320         { return offset; }
322     //##################
323     //# Non-API methods
324     //##################
326     /**
327      *
328      */
329     MatchContent()
330         {
331         nodeArg = NULL;
332         offset  = 0L;
333         }
335     /**
336      *
337      */
338     MatchContent(const MatchContent &other) : Match(other)
339         {
340         name    = other.name;
341         nodeArg = other.nodeArg;
342         offset  = other.offset;
343         }
345     /**
346      *
347      */
348     virtual ~MatchContent() {}
350 protected:
352     DOMString     name;
353     NodePtr       nodeArg;
354     unsigned long offset;
358 };
362 /*#########################################################################
363 ## MatchSet
364 #########################################################################*/
366 /**
367  *
368  */
369 class MatchSet : virtual public Match
371 public:
373     /**
374      *
375      */
376     virtual NodePtr getNodeArg()
377         { return nodeArg; }
379     /**
380      *
381      */
382     virtual void addMatch(const Match &match)
383         { matches.push_back(match); }
385     /**
386      *
387      */
388     virtual Match getMatch(unsigned long index)
389         {
390         if (index >= matches.size())
391             {
392             Match match;
393             return match;
394             }
395         return matches[index];
396         }
398     //##################
399     //# Non-API methods
400     //##################
402     /**
403      *
404      */
405     MatchSet()
406         {
407         nodeArg = NULL;
408         }
410     /**
411      *
412      */
413     MatchSet(const MatchSet &other) : Match(other)
414         {
415         nodeArg = other.nodeArg;
416         matches = other.matches;
417         }
419     /**
420      *
421      */
422     virtual ~MatchSet() {}
424 protected:
426     NodePtr nodeArg;
428     std::vector<Match> matches;
430 };
434 /*#########################################################################
435 ## Item
436 #########################################################################*/
438 /**
439  *
440  */
441 class Item
443 public:
445     /**
446      *
447      */
448     virtual bool getExists()
449         { return exists; }
451     /**
452      *
453      */
454     virtual DOMString getName()
455         { return name; }
457     //##################
458     //# Non-API methods
459     //##################
461     /**
462      *
463      */
464     Item() {}
466     /**
467      *
468      */
469     Item(const Item &other)
470         {
471         exists = other.exists;
472         name   = other.name;
473         }
475     /**
476      *
477      */
478     virtual ~Item() {}
480 protected:
482     bool exists;
484     DOMString name;
487 };
491 /*#########################################################################
492 ## StringItem
493 #########################################################################*/
495 /**
496  *
497  */
498 class StringItem : virtual public Item
500 public:
502     /**
503      *
504      */
505     virtual DOMString getValue()
506         { return value; }
508     //##################
509     //# Non-API methods
510     //##################
512     /**
513      *
514      */
515     StringItem() {}
517     /**
518      *
519      */
520     StringItem(const StringItem &other) : Item(other)
521         {
522         value = other.value;
523         }
525     /**
526      *
527      */
528     virtual ~StringItem() {}
530 protected:
532     DOMString value;
535 };
539 /*#########################################################################
540 ## IntegerItem
541 #########################################################################*/
543 /**
544  *
545  */
546 class IntegerItem : virtual public Item
548 public:
551     /**
552      *
553      */
554     virtual long getValue()
555         { return value; }
557     //##################
558     //# Non-API methods
559     //##################
561     /**
562      *
563      */
564     IntegerItem() {}
566     /**
567      *
568      */
569     IntegerItem(const IntegerItem &other) : Item(other)
570         {
571         value = other.value;
572         }
574     /**
575      *
576      */
577     virtual ~IntegerItem() {}
579 protected:
581     long value;
583 };
586 /*#########################################################################
587 ## BooleanItem
588 #########################################################################*/
590 /**
591  *
592  */
593 class BooleanItem : virtual public Item
595 public:
597     /**
598      *
599      */
600     virtual bool getValue()
601         { return value; }
603     //##################
604     //# Non-API methods
605     //##################
607     /**
608      *
609      */
610     BooleanItem() {}
612     /**
613      *
614      */
615     BooleanItem(const BooleanItem &other) : Item(other)
616         {
617         value = other.value;
618         }
620     /**
621      *
622      */
623     virtual ~BooleanItem() {}
625 protected:
627     bool value;
629 };
632 /*#########################################################################
633 ## ContentItem
634 #########################################################################*/
636 /**
637  *
638  */
639 class ContentItem : virtual public Item
641 public:
643     /**
644      *
645      */
646     virtual NodePtr getNodeArg()
647         { return nodeArg; }
649     /**
650      *
651      */
652     virtual unsigned long getOffset()
653         { return offset; }
655     //##################
656     //# Non-API methods
657     //##################
659     /**
660      *
661      */
662     ContentItem()
663         {
664         nodeArg = NULL;
665         }
667     /**
668      *
669      */
670     ContentItem(const ContentItem &other) : Item(other)
671         {
672         nodeArg = other.nodeArg;
673         offset  = other.offset;
674         }
676     /**
677      *
678      */
679     virtual ~ContentItem() {}
681 protected:
683     NodePtr nodeArg;
684     long offset;
687 };
695 /*#########################################################################
696 ## Segment
697 #########################################################################*/
699 /**
700  *
701  */
702 class Segment : virtual public Match
704 public:
706     /**
707      *
708      */
709     virtual Match getCriteria()
710         { return criteria; }
712     /**
713      *
714      */
715     virtual void setCriteria(const Match &val)
716         { criteria = val; }
719     /**
720      *
721      */
722     virtual DOMString getOrder()
723         { return order; }
725     /**
726      *
727      */
728     virtual void setOrder(const DOMString &val)
729         { order = val; }
731     /**
732      *
733      */
734     virtual MatchString createMatchString(unsigned short /*test*/,
735                                           const DOMString &/*name*/,
736                                           const DOMString &/*value*/)
737         {
738         MatchString ret;
739         return ret;
740         }
742     /**
743      *
744      */
745     virtual MatchInteger createMatchInteger(unsigned short /*test*/,
746                                             const DOMString &/*name*/,
747                                             long /*value*/)
748         {
749         MatchInteger ret;
750         return ret;
751         }
753     /**
754      *
755      */
756     virtual MatchBoolean createMatchBoolean(unsigned short /*test*/,
757                                             const DOMString &/*name*/,
758                                             bool /*value*/)
759         {
760         MatchBoolean ret;
761         return ret;
762         }
764     /**
765      *
766      */
767     virtual MatchContent createMatchContent(unsigned short /*test*/,
768                                             const DOMString &/*name*/,
769                                             unsigned long /*offset*/,
770                                             const NodePtr /*nodeArg*/)
771         {
772         MatchContent ret;
773         return ret;
774         }
776     /**
777      *
778      */
779     virtual MatchSet createMatchSet(unsigned short /*test*/)
780         {
781         MatchSet ret;
782         return ret;
783         }
785     /**
786      *
787      */
788     virtual StringItem createStringItem(const DOMString &/*name*/)
789         {
790         StringItem ret;
791         return ret;
792         }
794     /**
795      *
796      */
797     virtual IntegerItem createIntegerItem(const DOMString &/*name*/)
798         {
799         IntegerItem ret;
800         return ret;
801         }
803     /**
804      *
805      */
806     virtual BooleanItem createBooleanItem(const DOMString &/*name*/)
807         {
808         BooleanItem ret;
809         return ret;
810         }
812     /**
813      *
814      */
815     virtual ContentItem createContentItem(const DOMString &/*name*/)
816         {
817         ContentItem ret;
818         return ret;
819         }
821     /**
822      *
823      */
824     virtual void addItem(const Item &item)
825         {
826         items.push_back(item);
827         }
829     /**
830      *
831      */
832     virtual Item getItem(unsigned long index)
833         {
834         if (index >= items.size())
835             {
836             Item item;
837             return item;
838             }
839         return items[index];
840         }
842     /**
843      *
844      */
845     virtual bool getNext()
846         {
847         return false;
848         }
850     //##################
851     //# Non-API methods
852     //##################
854     /**
855      *
856      */
857     Segment() {}
859     /**
860      *
861      */
862     Segment(const Segment &other) : Match(other)
863         {
864         criteria = other.criteria;
865         order    = other.order;
866         items    = other.items;
867         }
869     /**
870      *
871      */
872     virtual ~Segment() {}
874 protected:
876     Match criteria;
878     DOMString order;
880     std::vector<Item> items;
882 };
895 /*#########################################################################
896 ## View
897 #########################################################################*/
899 /**
900  *
901  */
902 class View
904 public:
906     /**
907      *
908      */
909     virtual void select(const NodePtr /*boundary*/,
910                         unsigned long /*offset*/,
911                         bool /*extend*/,
912                         bool /*add*/)
913         {
914         }
916     /**
917      *
918      */
919     virtual Segment createSegment()
920         {
921         Segment ret;
922         return ret;
923         }
925     /**
926      *
927      */
928     virtual bool matchFirstSegment(Segment &/*todo*/) //inout parm, not const
929                                         throw(dom::DOMException)
930         {
931         return false;
932         }
934     /**
935      *
936      */
937     virtual long getIntegerProperty(const DOMString &/*name*/)
938                                         throw(dom::DOMException)
939         {
940         long val=0;
941         return val;
942         }
944     /**
945      *
946      */
947     virtual DOMString getStringProperty(const DOMString &/*name*/)
948                                         throw(dom::DOMException)
949         {
950         DOMString val;
951         return val;
952         }
954     /**
955      *
956      */
957     virtual bool getBooleanProperty(bool /*name*/)
958                                         throw(dom::DOMException)
959         {
960         bool val=false;
961         return val;
962         }
964     /**
965      *
966      */
967     virtual NodePtr getContentPropertyNode(const DOMString &/*name*/)
968                                         throw(dom::DOMException)
969         {
970         NodePtr val = NULL;
971         return val;
972         }
974     /**
975      *
976      */
977     virtual unsigned long getContentPropertyOffset(const DOMString &/*name*/)
978                                         throw(dom::DOMException)
979         {
980         long val=0;
981         return val;
982         }
984     //##################
985     //# Non-API methods
986     //##################
988     /**
989      *
990      */
991     View() {}
993     /**
994      *
995      */
996     View(const View &/*other*/)
997         {
998         }
1000     /**
1001      *
1002      */
1003     virtual ~View() {}
1004 };
1007 /*#########################################################################
1008 ## VisualResource
1009 #########################################################################*/
1011 /**
1012  *
1013  */
1014 class VisualResource
1016 public:
1019     //##################
1020     //# Non-API methods
1021     //##################
1023     /**
1024      *
1025      */
1026     VisualResource() {}
1028     /**
1029      *
1030      */
1031     VisualResource(const VisualResource &/*other*/)
1032         {
1033         }
1035     /**
1036      *
1037      */
1038     virtual ~VisualResource() {}
1039 };
1042 /*#########################################################################
1043 ## VisualFont
1044 #########################################################################*/
1046 /**
1047  *
1048  */
1049 class VisualFont : virtual public VisualResource
1051 public:
1053     /**
1054      *
1055      */
1056     virtual DOMString getMatchFontName()
1057         { return matchFontName; }
1059     /**
1060      *
1061      */
1062     virtual void setMatchFontName(const DOMString &val)
1063         { matchFontName = val; }
1065     /**
1066      *
1067      */
1068     virtual bool getExists()
1069         { return true; }
1071     /**
1072      *
1073      */
1074     virtual DOMString getFontName()
1075         { return fontName; }
1077     /**
1078      *
1079      */
1080     virtual bool getNext()
1081         { return next; }
1083     //##################
1084     //# Non-API methods
1085     //##################
1087     /**
1088      *
1089      */
1090     VisualFont() {}
1092     /**
1093      *
1094      */
1095     VisualFont(const VisualFont &other) : VisualResource(other)
1096         {
1097         matchFontName = other.matchFontName;
1098         fontName      = other.fontName;
1099         next          = other.next;
1100         }
1102     /**
1103      *
1104      */
1105     virtual ~VisualFont() {}
1107 protected:
1109     DOMString matchFontName;
1110     DOMString fontName;
1111     bool next;
1114 };
1117 /*#########################################################################
1118 ## VisualSegment
1119 #########################################################################*/
1121 /**
1122  *
1123  */
1124 class VisualSegment : virtual public VisualResource
1126 public:
1129     /**
1130      *
1131      */
1132     virtual bool getMatchPosition()
1133         { return matchPosition; }
1135     /**
1136      *
1137      */
1138     virtual void setMatchPosition(bool val)
1139         { matchPosition = val; }
1141     /**
1142      *
1143      */
1144     virtual bool getMatchInside()
1145         { return matchInside; }
1147     /**
1148      *
1149      */
1150     virtual void setMatchInside(bool val)
1151         { matchInside = val; }
1153     /**
1154      *
1155      */
1156     virtual bool getMatchContaining()
1157         { return matchContaining; }
1159     /**
1160      *
1161      */
1162     virtual void setMatchContaining(bool val)
1163         { matchContaining = val; }
1165     /**
1166      *
1167      */
1168     virtual long getMatchX()
1169         { return matchX; }
1171     /**
1172      *
1173      */
1174     virtual void setMatchX(long val)
1175         { matchX = val; }
1177     /**
1178      *
1179      */
1180     virtual long getMatchY()
1181         { return matchY; }
1183     /**
1184      *
1185      */
1186     virtual void setMatchY(long val)
1187         { matchY = val; }
1189     /**
1190      *
1191      */
1192     virtual long getMatchXR()
1193         { return matchXR; }
1195     /**
1196      *
1197      */
1198     virtual void setMatchXR(long val)
1199         { matchXR = val; }
1201     /**
1202      *
1203      */
1204     virtual long getMatchYR()
1205         { return matchYR; }
1207     /**
1208      *
1209      */
1210     virtual void setMatchYR(long val)
1211         { matchYR = val; }
1213     /**
1214      *
1215      */
1216     virtual bool getMatchContent()
1217         { return matchContent; }
1219     /**
1220      *
1221      */
1222     virtual void setMatchContent(bool val)
1223         { matchContent = val; }
1225     /**
1226      *
1227      */
1228     virtual bool getMatchRange()
1229         { return matchRange; }
1231     /**
1232      *
1233      */
1234     virtual void setMatchRange(bool val)
1235         { matchRange = val; }
1237     /**
1238      *
1239      */
1240     virtual NodePtr getMatchNode()
1241         { return matchNode; }
1243     /**
1244      *
1245      */
1246     virtual void setMatchNode(const NodePtr val)
1247         { matchNode = (NodePtr )val; }
1249     /**
1250      *
1251      */
1252     virtual unsigned long getMatchOffset()
1253         { return matchOffset; }
1255     /**
1256      *
1257      */
1258     virtual void setMatchOffset(unsigned long val)
1259         { matchOffset = val; }
1261     /**
1262      *
1263      */
1264     virtual NodePtr getMatchNodeR()
1265         { return matchNodeR; }
1267     /**
1268      *
1269      */
1270     virtual void setMatchNodeR(const NodePtr val)
1271         { matchNodeR = (NodePtr )val; }
1273     /**
1274      *
1275      */
1276     virtual unsigned long getMatchOffsetR()
1277         { return matchOffsetR; }
1279     /**
1280      *
1281      */
1282     virtual void setMatchOffsetR(unsigned long val)
1283         { matchOffsetR = val; }
1285     /**
1286      *
1287      */
1288     virtual bool getMatchContainsSelected()
1289         { return matchContainsSelected; }
1291     /**
1292      *
1293      */
1294     virtual void setMatchContainsSelected(bool val)
1295         { matchContainsSelected = val; }
1297     /**
1298      *
1299      */
1300     virtual bool getMatchContainsVisible()
1301         { return matchContainsVisible; }
1303     /**
1304      *
1305      */
1306     virtual void setMatchContainsVisible(bool val)
1307         { matchContainsVisible = val; }
1310     /**
1311      *
1312      */
1313     virtual bool getExists()
1314         { return exists; }
1316     /**
1317      *
1318      */
1319     virtual NodePtr getStartNode()
1320         { return startNode; }
1322     /**
1323      *
1324      */
1325     virtual unsigned long getStartOffset()
1326         { return startOffset; }
1328     /**
1329      *
1330      */
1331     virtual NodePtr getEndNode()
1332         { return endNode; }
1334     /**
1335      *
1336      */
1337     virtual unsigned long getEndOffset()
1338         { return endOffset; }
1340     /**
1341      *
1342      */
1343     virtual long getTopOffset()
1344         { return topOffset; }
1346     /**
1347      *
1348      */
1349     virtual long getBottomOffset()
1350         { return bottomOffset; }
1352     /**
1353      *
1354      */
1355     virtual long getLeftOffset()
1356         { return leftOffset; }
1358     /**
1359      *
1360      */
1361     virtual long  getRightOffset()
1362         { return rightOffset; }
1364     /**
1365      *
1366      */
1367     virtual unsigned long getWidth()
1368         { return width; }
1370     /**
1371      *
1372      */
1373     virtual unsigned long getHeight()
1374         { return height; }
1376     /**
1377      *
1378      */
1379     virtual bool getSelected()
1380         { return selected; }
1382     /**
1383      *
1384      */
1385     virtual bool getVisible()
1386         { return visible; }
1388     /**
1389      *
1390      */
1391     virtual unsigned long getForegroundColor()
1392         { return foregroundColor; }
1394     /**
1395      *
1396      */
1397     virtual unsigned long getBackgroundColor()
1398         { return backgroundColor; }
1400     /**
1401      *
1402      */
1403     virtual DOMString getFontName()
1404         { return fontName; }
1406     /**
1407      *
1408      */
1409     virtual DOMString getFontHeight()
1410         { return fontHeight; }
1412     /**
1413      *
1414      */
1415     virtual bool getNext()
1416         { return next; }
1418     //##################
1419     //# Non-API methods
1420     //##################
1422     /**
1423      *
1424      */
1425     VisualSegment() {}
1427     /**
1428      *
1429      */
1430     VisualSegment(const VisualSegment &other) : VisualResource(other)
1431         {
1432         matchPosition         = other.matchPosition;
1433         matchInside           = other.matchInside;
1434         matchContaining       = other.matchContaining;
1435         matchX                = other.matchX;
1436         matchY                = other.matchY;
1437         matchXR               = other.matchXR;
1438         matchYR               = other.matchYR;
1439         matchContent          = other.matchContent;
1440         matchRange            = other.matchRange;
1441         matchNode             = other.matchNode;
1442         matchOffset           = other.matchOffset;
1443         matchNodeR            = other.matchNodeR;
1444         matchOffsetR          = other.matchOffsetR;
1445         matchContainsSelected = other.matchContainsSelected;
1446         matchContainsVisible  = other.matchContainsVisible;
1447         exists                = other.exists;
1448         startNode             = other.startNode;
1449         startOffset           = other.startOffset;
1450         endNode               = other.endNode;
1451         endOffset             = other.endOffset;
1452         topOffset             = other.topOffset;
1453         bottomOffset          = other.bottomOffset;
1454         leftOffset            = other.leftOffset;
1455         rightOffset           = other.rightOffset;
1456         width                 = other.width;
1457         height                = other.height;
1458         selected              = other.selected;
1459         visible               = other.visible;
1460         foregroundColor       = other.foregroundColor;
1461         backgroundColor       = other.backgroundColor;
1462         fontName              = other.fontName;
1463         fontHeight            = other.fontHeight;
1464         next                  = other.next;
1465         }
1467     /**
1468      *
1469      */
1470     virtual ~VisualSegment() {}
1473 protected:
1475     bool            matchPosition;
1476     bool            matchInside;
1477     bool            matchContaining;
1478     long            matchX;
1479     long            matchY;
1480     long            matchXR;
1481     long            matchYR;
1482     bool            matchContent;
1483     bool            matchRange;
1484     NodePtr         matchNode;
1485     unsigned long   matchOffset;
1486     NodePtr         matchNodeR;
1487     unsigned long   matchOffsetR;
1488     bool            matchContainsSelected;
1489     bool            matchContainsVisible;
1490     bool            exists;
1491     NodePtr         startNode;
1492     unsigned long   startOffset;
1493     NodePtr         endNode;
1494     unsigned long   endOffset;
1495     long            topOffset;
1496     long            bottomOffset;
1497     long            leftOffset;
1498     long            rightOffset;
1499     unsigned long   width;
1500     unsigned long   height;
1501     bool            selected;
1502     bool            visible;
1503     unsigned long   foregroundColor;
1504     unsigned long   backgroundColor;
1505     DOMString       fontName;
1506     DOMString       fontHeight;
1507     bool            next;
1510 };
1513 /*#########################################################################
1514 ## VisualCharacter
1515 #########################################################################*/
1517 /**
1518  *
1519  */
1520 class VisualCharacter : virtual public VisualSegment
1522 public:
1524     //##################
1525     //# Non-API methods
1526     //##################
1528     /**
1529      *
1530      */
1531     VisualCharacter()
1532         {}
1534     /**
1535      *
1536      */
1537     VisualCharacter(const VisualCharacter &other) : VisualResource(other),
1538                                                     VisualSegment(other)
1539         {
1540         }
1542     /**
1543      *
1544      */
1545     virtual ~VisualCharacter() {}
1546 };
1550 /*#########################################################################
1551 ## VisualCharacterRun
1552 #########################################################################*/
1554 /**
1555  *
1556  */
1557 class VisualCharacterRun : virtual public VisualSegment
1559 public:
1562     //##################
1563     //# Non-API methods
1564     //##################
1566     /**
1567      *
1568      */
1569     VisualCharacterRun() {}
1571     /**
1572      *
1573      */
1574     VisualCharacterRun(const VisualCharacterRun &other) : VisualResource(other),
1575                                                           VisualSegment(other)
1576         {
1577         }
1579     /**
1580      *
1581      */
1582     virtual ~VisualCharacterRun() {}
1584 protected:
1587 };
1591 /*#########################################################################
1592 ## VisualFrame
1593 #########################################################################*/
1595 /**
1596  *
1597  */
1598 class VisualFrame : virtual public VisualSegment
1600 public:
1603     /**
1604      *
1605      */
1606     virtual VisualSegment getEmbedded()
1607         { return embedded; }
1609     //##################
1610     //# Non-API methods
1611     //##################
1613     /**
1614      *
1615      */
1616     VisualFrame() {}
1618     /**
1619      *
1620      */
1621     VisualFrame(const VisualFrame &other) : VisualResource(other),
1622                                             VisualSegment(other)
1623         {
1624         embedded = other.embedded;
1625         }
1627     /**
1628      *
1629      */
1630     virtual ~VisualFrame() {}
1632 protected:
1634     VisualSegment embedded;
1635 };
1639 /*#########################################################################
1640 ## VisualImage
1641 #########################################################################*/
1643 /**
1644  *
1645  */
1646 class VisualImage : virtual public VisualSegment
1648 public:
1650     /**
1651      *
1652      */
1653     virtual DOMString getImageURL()
1654         { return imageURL; }
1656     /**
1657      *
1658      */
1659     virtual bool getIsLoaded()
1660         { return isLoaded; }
1663     //##################
1664     //# Non-API methods
1665     //##################
1667     /**
1668      *
1669      */
1670     VisualImage() {}
1672     /**
1673      *
1674      */
1675     VisualImage(const VisualImage &other) : VisualResource(other),
1676                                             VisualSegment(other)
1677         {
1678         imageURL = other.imageURL;
1679         isLoaded = other.isLoaded;
1680         }
1682     /**
1683      *
1684      */
1685     virtual ~VisualImage() {}
1687 protected:
1689     DOMString imageURL;
1690     bool isLoaded;
1692 };
1696 /*#########################################################################
1697 ## VisualFormButton
1698 #########################################################################*/
1700 /**
1701  *
1702  */
1703 class VisualFormButton : virtual public VisualSegment
1705 public:
1707     /**
1708      *
1709      */
1710     virtual bool getIsPressed()
1711         { return isPressed; }
1713     //##################
1714     //# Non-API methods
1715     //##################
1717     /**
1718      *
1719      */
1720     VisualFormButton()
1721         { isPressed = false; }
1723     /**
1724      *
1725      */
1726     VisualFormButton(const VisualFormButton &other) : VisualResource(other),
1727                                                       VisualSegment(other)
1728         {
1729         isPressed = other.isPressed;
1730         }
1732     /**
1733      *
1734      */
1735     virtual ~VisualFormButton() {}
1737 protected:
1739     bool isPressed;
1741 };
1745 /*#########################################################################
1746 ## VisualFormField
1747 #########################################################################*/
1749 /**
1750  *
1751  */
1752 class VisualFormField : virtual public VisualSegment
1754 public:
1756     /**
1757      *
1758      */
1759     virtual DOMString getFormValue()
1760         { return formValue; }
1762     //##################
1763     //# Non-API methods
1764     //##################
1766     /**
1767      *
1768      */
1769     VisualFormField() {}
1771     /**
1772      *
1773      */
1774     VisualFormField(const VisualFormField &other) : VisualResource(other),
1775                                                     VisualSegment(other)
1776         {
1777         formValue = other.formValue;
1778         }
1780     /**
1781      *
1782      */
1783     virtual ~VisualFormField() {}
1785 protected:
1787     DOMString formValue;
1789 };
1793 /*#########################################################################
1794 ## VisualView
1795 #########################################################################*/
1797 /**
1798  *
1799  */
1800 class VisualView
1802 public:
1804     /**
1805      *
1806      */
1807     virtual bool getValue()
1808         { return value; }
1810     /**
1811      *
1812      */
1813     virtual DOMString getFontScheme()
1814         { return fontScheme; }
1816     /**
1817      *
1818      */
1819     virtual unsigned long getWidth()
1820         { return width; }
1822     /**
1823      *
1824      */
1825     virtual unsigned long getHeight()
1826         { return height; }
1828     /**
1829      *
1830      */
1831     virtual unsigned long getHorizontalDPI()
1832         { return horizontalDPI; }
1834     /**
1835      *
1836      */
1837     virtual unsigned long getVerticalDPI()
1838         { return verticalDPI; }
1840     /**
1841      *
1842      */
1843     virtual VisualCharacter createVisualCharacter()
1844         {
1845         VisualCharacter ret;
1846         return ret;
1847         }
1849     /**
1850      *
1851      */
1852     virtual VisualCharacterRun createVisualCharacterRun()
1853         {
1854         VisualCharacterRun ret;
1855         return ret;
1856         }
1857     /**
1858      *
1859      */
1860     virtual VisualFrame createVisualFrame()
1861         {
1862         VisualFrame ret;
1863         return ret;
1864         }
1867     /**
1868      *
1869      */
1870     virtual VisualImage createVisualImage()
1871         {
1872         VisualImage ret;
1873         return ret;
1874         }
1876     /**
1877      *
1878      */
1879     virtual VisualFormButton createVisualFormButton()
1880         {
1881         VisualFormButton ret;
1882         return ret;
1883         }
1885     /**
1886      *
1887      */
1888     virtual VisualFormField createVisualFormField()
1889         {
1890         VisualFormField ret;
1891         return ret;
1892         }
1894     /**
1895      *
1896      */
1897     virtual void select(const NodePtr /*boundary*/,
1898                         unsigned long /*offset*/,
1899                         bool /*extend*/,
1900                         bool /*add*/)
1901         {
1902         }
1904     /**
1905      *
1906      */
1907     virtual void matchSegment(const VisualResource */*segment*/)
1908         {
1909         }
1912     //##################
1913     //# Non-API methods
1914     //##################
1916     /**
1917      *
1918      */
1919     VisualView() {}
1921     /**
1922      *
1923      */
1924     VisualView(const VisualView &other)
1925         {
1926         value         = other.value;
1927         fontScheme    = other.fontScheme;
1928         width         = other.width;
1929         height        = other.height;
1930         horizontalDPI = other.horizontalDPI;
1931         verticalDPI   = other.verticalDPI;
1932         }
1934     /**
1935      *
1936      */
1937     virtual ~VisualView() {}
1939 protected:
1941     bool value;
1943     DOMString fontScheme;
1945     unsigned long width;
1946     unsigned long height;
1947     unsigned long horizontalDPI;
1948     unsigned long verticalDPI;
1950 };
1955 }  //namespace views
1956 }  //namespace dom
1957 }  //namespace w3c
1958 }  //namespace org
1961 #endif  /* __VIEWS_LEVEL3_H__ */
1962 /*#########################################################################
1963 ## E N D    O F    F I L E
1964 #########################################################################*/