Code

moving trunk for module inkscape
[inkscape.git] / src / dom / views.h
1 #ifndef __VIEWS_H__
2 #define __VIEWS_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 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  */
35 #include "dom.h"
39 namespace org
40 {
41 namespace w3c
42 {
43 namespace dom
44 {
45 namespace views
46 {
49 //local aliases
50 typedef dom::Node Node;
51 typedef dom::DOMString DOMString;
53 //forward declarations
54 class Segment;
55 class VisualResource;
56 class VisualCharacter;
57 class VisualCharacterRun;
58 class VisualFrame;
59 class VisualImage;
60 class VisualFormButton;
61 class VisualFormField;
66 /*#########################################################################
67 ## Match
68 #########################################################################*/
70 /**
71  *
72  */
73 class Match
74 {
75 public:
77     typedef enum
78         {
79         IS_EQUAL                       = 0,
80         IS_NOT_EQUAL                   = 1,
81         INT_PRECEDES                   = 2,
82         INT_PRECEDES_OR_EQUALS         = 3,
83         INT_FOLLOWS                    = 4,
84         INT_FOLLOWS_OR_EQUALS          = 5,
85         STR_STARTS_WITH                = 6,
86         STR_ENDS_WITH                  = 7,
87         STR_CONTAINS                   = 8,
88         SET_ANY                        = 9,
89         SET_ALL                        = 10,
90         SET_NOT_ANY                    = 11,
91         SET_NOT_ALL                    = 12
92         } MatchTestGroup;
94     /**
95      *
96      */
97     virtual unsigned short test()
98         { return IS_NOT_EQUAL; }
100     //##################
101     //# Non-API methods
102     //##################
104     /**
105      *
106      */
107     Match() {}
109     /**
110      *
111      */
112     Match(const Match &other)
113         {
114         }
116     /**
117      *
118      */
119     virtual ~Match() {}
120 };
124 /*#########################################################################
125 ## MatchString
126 #########################################################################*/
128 /**
129  *
130  */
131 class MatchString : virtual public Match
133 public:
135     /**
136      *
137      */
138     virtual DOMString getName()
139         { return name; }
141     /**
142      *
143      */
144     virtual DOMString getValue()
145         { return value; }
147     //##################
148     //# Non-API methods
149     //##################
151     /**
152      *
153      */
154     MatchString() {}
156     /**
157      *
158      */
159     MatchString(const MatchString &other) : Match(other)
160         {
161         name  = other.name;
162         value = other.value;
163         }
165     /**
166      *
167      */
168     virtual ~MatchString() {}
170 protected:
172     DOMString name;
173     DOMString value;
176 };
180 /*#########################################################################
181 ## MatchInteger
182 #########################################################################*/
184 /**
185  *
186  */
187 class MatchInteger : virtual public Match
189 public:
191     /**
192      *
193      */
194     virtual DOMString getName()
195         { return name; }
197     /**
198      *
199      */
200     virtual long getValue()
201         { return value; }
203     //##################
204     //# Non-API methods
205     //##################
207     /**
208      *
209      */
210     MatchInteger() {}
212     /**
213      *
214      */
215     MatchInteger(const MatchInteger &other) : Match(other)
216         {
217         name  = other.name;
218         value = other.value;
219         }
221     /**
222      *
223      */
224     virtual ~MatchInteger() {}
226 protected:
228     DOMString name;
229     long value;
230 };
234 /*#########################################################################
235 ## MatchBoolean
236 #########################################################################*/
238 /**
239  *
240  */
241 class MatchBoolean : virtual public Match
243 public:
245     /**
246      *
247      */
248     virtual DOMString getName()
249         { return name; }
251     /**
252      *
253      */
254     virtual bool getValue()
255         { return value; }
257     //##################
258     //# Non-API methods
259     //##################
261     /**
262      *
263      */
264     MatchBoolean() {}
266     /**
267      *
268      */
269     MatchBoolean(const MatchBoolean &other) : Match(other)
270         {
271         name  = other.name;
272         value = other.value;
273         }
275     /**
276      *
277      */
278     virtual ~MatchBoolean() {}
280 protected:
282     DOMString name;
283     bool value;
284 };
288 /*#########################################################################
289 ## MatchContent
290 #########################################################################*/
292 /**
293  *
294  */
295 class MatchContent : virtual public Match
297 public:
299     /**
300      *
301      */
302     virtual DOMString getName()
303         { return name; }
305     /**
306      *
307      */
308     virtual Node *getNodeArg()
309         { return nodeArg; }
312     /**
313      *
314      */
315     virtual unsigned long getOffset()
316         { return offset; }
318     //##################
319     //# Non-API methods
320     //##################
322     /**
323      *
324      */
325     MatchContent()
326         {
327         nodeArg = NULL;
328         offset  = 0L;
329         }
331     /**
332      *
333      */
334     MatchContent(const MatchContent &other) : Match(other)
335         {
336         name    = other.name;
337         nodeArg = other.nodeArg;
338         offset  = other.offset;
339         }
341     /**
342      *
343      */
344     virtual ~MatchContent() {}
346 protected:
348     DOMString     name;
349     Node          *nodeArg;
350     unsigned long offset;
354 };
358 /*#########################################################################
359 ## MatchSet
360 #########################################################################*/
362 /**
363  *
364  */
365 class MatchSet : virtual public Match
367 public:
369     /**
370      *
371      */
372     virtual Node *getNodeArg()
373         { return nodeArg; }
375     /**
376      *
377      */
378     virtual void addMatch(const Match &match)
379         { matches.push_back(match); }
381     /**
382      *
383      */
384     virtual Match getMatch(unsigned long index)
385         {
386         if (index >= matches.size())
387             {
388             Match match;
389             return match;
390             }
391         return matches[index];
392         }
394     //##################
395     //# Non-API methods
396     //##################
398     /**
399      *
400      */
401     MatchSet()
402         {
403         nodeArg = NULL;
404         }
406     /**
407      *
408      */
409     MatchSet(const MatchSet &other) : Match(other)
410         {
411         nodeArg = other.nodeArg;
412         matches = other.matches;
413         }
415     /**
416      *
417      */
418     virtual ~MatchSet() {}
420 protected:
422     Node *nodeArg;
424     std::vector<Match> matches;
426 };
430 /*#########################################################################
431 ## Item
432 #########################################################################*/
434 /**
435  *
436  */
437 class Item
439 public:
441     /**
442      *
443      */
444     virtual bool getExists()
445         { return exists; }
447     /**
448      *
449      */
450     virtual DOMString getName()
451         { return name; }
453     //##################
454     //# Non-API methods
455     //##################
457     /**
458      *
459      */
460     Item() {}
462     /**
463      *
464      */
465     Item(const Item &other)
466         {
467         exists = other.exists;
468         name   = other.name;
469         }
471     /**
472      *
473      */
474     virtual ~Item() {}
476 protected:
478     bool exists;
480     DOMString name;
483 };
487 /*#########################################################################
488 ## StringItem
489 #########################################################################*/
491 /**
492  *
493  */
494 class StringItem : virtual public Item
496 public:
498     /**
499      *
500      */
501     virtual DOMString getValue()
502         { return value; }
504     //##################
505     //# Non-API methods
506     //##################
508     /**
509      *
510      */
511     StringItem() {}
513     /**
514      *
515      */
516     StringItem(const StringItem &other) : Item(other)
517         {
518         value = other.value;
519         }
521     /**
522      *
523      */
524     virtual ~StringItem() {}
526 protected:
528     DOMString value;
531 };
535 /*#########################################################################
536 ## IntegerItem
537 #########################################################################*/
539 /**
540  *
541  */
542 class IntegerItem : virtual public Item
544 public:
547     /**
548      *
549      */
550     virtual long getValue()
551         { return value; }
553     //##################
554     //# Non-API methods
555     //##################
557     /**
558      *
559      */
560     IntegerItem() {}
562     /**
563      *
564      */
565     IntegerItem(const IntegerItem &other) : Item(other)
566         {
567         value = other.value;
568         }
570     /**
571      *
572      */
573     virtual ~IntegerItem() {}
575 protected:
577     long value;
579 };
582 /*#########################################################################
583 ## BooleanItem
584 #########################################################################*/
586 /**
587  *
588  */
589 class BooleanItem : virtual public Item
591 public:
593     /**
594      *
595      */
596     virtual bool getValue()
597         { return value; }
599     //##################
600     //# Non-API methods
601     //##################
603     /**
604      *
605      */
606     BooleanItem() {}
608     /**
609      *
610      */
611     BooleanItem(const BooleanItem &other) : Item(other)
612         {
613         value = other.value;
614         }
616     /**
617      *
618      */
619     virtual ~BooleanItem() {}
621 protected:
623     bool value;
625 };
628 /*#########################################################################
629 ## ContentItem
630 #########################################################################*/
632 /**
633  *
634  */
635 class ContentItem : virtual public Item
637 public:
639     /**
640      *
641      */
642     virtual Node *getNodeArg()
643         { return nodeArg; }
645     /**
646      *
647      */
648     virtual unsigned long getOffset()
649         { return offset; }
651     //##################
652     //# Non-API methods
653     //##################
655     /**
656      *
657      */
658     ContentItem()
659         {
660         nodeArg = NULL;
661         }
663     /**
664      *
665      */
666     ContentItem(const ContentItem &other) : Item(other)
667         {
668         nodeArg = other.nodeArg;
669         offset  = other.offset;
670         }
672     /**
673      *
674      */
675     virtual ~ContentItem() {}
677 protected:
679     Node *nodeArg;
680     long offset;
683 };
691 /*#########################################################################
692 ## Segment
693 #########################################################################*/
695 /**
696  *
697  */
698 class Segment : virtual public Match
700 public:
702     /**
703      *
704      */
705     virtual Match getCriteria()
706         { return criteria; }
708     /**
709      *
710      */
711     virtual void setCriteria(const Match &val)
712         { criteria = val; }
715     /**
716      *
717      */
718     virtual DOMString getOrder()
719         { return order; }
721     /**
722      *
723      */
724     virtual void setOrder(const DOMString &val)
725         { order = val; }
727     /**
728      *
729      */
730     virtual MatchString createMatchString(unsigned short test,
731                                          const DOMString &name,
732                                          const DOMString &value)
733         {
734         MatchString ret;
735         return ret;
736         }
738     /**
739      *
740      */
741     virtual MatchInteger createMatchInteger(unsigned short test,
742                                           const DOMString &name,
743                                           long value)
744         {
745         MatchInteger ret;
746         return ret;
747         }
749     /**
750      *
751      */
752     virtual MatchBoolean createMatchBoolean(unsigned short test,
753                                           const DOMString &name,
754                                           bool value)
755         {
756         MatchBoolean ret;
757         return ret;
758         }
760     /**
761      *
762      */
763     virtual MatchContent createMatchContent(unsigned short test,
764                                           const DOMString &name,
765                                           unsigned long offset,
766                                           const Node *nodeArg)
767         {
768         MatchContent ret;
769         return ret;
770         }
772     /**
773      *
774      */
775     virtual MatchSet createMatchSet(unsigned short test)
776         {
777         MatchSet ret;
778         return ret;
779         }
781     /**
782      *
783      */
784     virtual StringItem createStringItem(const DOMString &name)
785         {
786         StringItem ret;
787         return ret;
788         }
790     /**
791      *
792      */
793     virtual IntegerItem createIntegerItem(const DOMString &name)
794         {
795         IntegerItem ret;
796         return ret;
797         }
799     /**
800      *
801      */
802     virtual BooleanItem createBooleanItem(const DOMString &name)
803         {
804         BooleanItem ret;
805         return ret;
806         }
808     /**
809      *
810      */
811     virtual ContentItem createContentItem(const DOMString &name)
812         {
813         ContentItem ret;
814         return ret;
815         }
817     /**
818      *
819      */
820     virtual void addItem(const Item &item)
821         {
822         items.push_back(item);
823         }
825     /**
826      *
827      */
828     virtual Item getItem(unsigned long index)
829         {
830         if (index >= items.size())
831             {
832             Item item;
833             return item;
834             }
835         return items[index];
836         }
838     /**
839      *
840      */
841     virtual bool getNext()
842         {
843         return false;
844         }
846     //##################
847     //# Non-API methods
848     //##################
850     /**
851      *
852      */
853     Segment() {}
855     /**
856      *
857      */
858     Segment(const Segment &other) : Match(other)
859         {
860         criteria = other.criteria;
861         order    = other.order;
862         items    = other.items;
863         }
865     /**
866      *
867      */
868     virtual ~Segment() {}
870 protected:
872     Match criteria;
874     DOMString order;
876     std::vector<Item> items;
878 };
891 /*#########################################################################
892 ## View
893 #########################################################################*/
895 /**
896  *
897  */
898 class View
900 public:
902     /**
903      *
904      */
905     virtual void select(const Node *boundary,
906                         unsigned long offset,
907                         bool extend,
908                         bool add)
909         {
910         }
912     /**
913      *
914      */
915     virtual Segment createSegment()
916         {
917         Segment ret;
918         return ret;
919         }
921     /**
922      *
923      */
924     virtual bool matchFirstSegment(Segment &todo) //inout parm, not const
925                                         throw(dom::DOMException)
926         {
927         return false;
928         }
930     /**
931      *
932      */
933     virtual long getIntegerProperty(const DOMString &name)
934                                         throw(dom::DOMException)
935         {
936         long val=0;
937         return val;
938         }
940     /**
941      *
942      */
943     virtual DOMString getStringProperty(const DOMString &name)
944                                         throw(dom::DOMException)
945         {
946         DOMString val;
947         return val;
948         }
950     /**
951      *
952      */
953     virtual bool getBooleanProperty(bool name)
954                                         throw(dom::DOMException)
955         {
956         bool val=false;
957         return val;
958         }
960     /**
961      *
962      */
963     virtual Node *getContentPropertyNode(const DOMString &name)
964                                         throw(dom::DOMException)
965         {
966         Node *val = NULL;
967         return val;
968         }
970     /**
971      *
972      */
973     virtual unsigned long getContentPropertyOffset(const DOMString &name)
974                                         throw(dom::DOMException)
975         {
976         long val=0;
977         return val;
978         }
980     //##################
981     //# Non-API methods
982     //##################
984     /**
985      *
986      */
987     View() {}
989     /**
990      *
991      */
992     View(const View &other)
993         {
994         }
996     /**
997      *
998      */
999     virtual ~View() {}
1000 };
1003 /*#########################################################################
1004 ## VisualResource
1005 #########################################################################*/
1007 /**
1008  *
1009  */
1010 class VisualResource
1012 public:
1015     //##################
1016     //# Non-API methods
1017     //##################
1019     /**
1020      *
1021      */
1022     VisualResource() {}
1024     /**
1025      *
1026      */
1027     VisualResource(const VisualResource &other)
1028         {
1029         }
1031     /**
1032      *
1033      */
1034     virtual ~VisualResource() {}
1035 };
1038 /*#########################################################################
1039 ## VisualFont
1040 #########################################################################*/
1042 /**
1043  *
1044  */
1045 class VisualFont : virtual public VisualResource
1047 public:
1049     /**
1050      *
1051      */
1052     virtual DOMString getMatchFontName()
1053         { return matchFontName; }
1055     /**
1056      *
1057      */
1058     virtual void setMatchFontName(const DOMString &val)
1059         { matchFontName = val; }
1061     /**
1062      *
1063      */
1064     virtual bool getExists()
1065         { return true; }
1067     /**
1068      *
1069      */
1070     virtual DOMString getFontName()
1071         { return fontName; }
1073     /**
1074      *
1075      */
1076     virtual bool getNext()
1077         { return next; }
1079     //##################
1080     //# Non-API methods
1081     //##################
1083     /**
1084      *
1085      */
1086     VisualFont() {}
1088     /**
1089      *
1090      */
1091     VisualFont(const VisualFont &other) : VisualResource(other)
1092         {
1093         matchFontName = other.matchFontName;
1094         fontName      = other.fontName;
1095         next          = other.next;
1096         }
1098     /**
1099      *
1100      */
1101     virtual ~VisualFont() {}
1103 protected:
1105     DOMString matchFontName;
1106     DOMString fontName;
1107     bool next;
1110 };
1113 /*#########################################################################
1114 ## VisualSegment
1115 #########################################################################*/
1117 /**
1118  *
1119  */
1120 class VisualSegment : virtual public VisualResource
1122 public:
1125     /**
1126      *
1127      */
1128     virtual bool getMatchPosition()
1129         { return matchPosition; }
1131     /**
1132      *
1133      */
1134     virtual void setMatchPosition(bool val)
1135         { matchPosition = val; }
1137     /**
1138      *
1139      */
1140     virtual bool getMatchInside()
1141         { return matchInside; }
1143     /**
1144      *
1145      */
1146     virtual void setMatchInside(bool val)
1147         { matchInside = val; }
1149     /**
1150      *
1151      */
1152     virtual bool getMatchContaining()
1153         { return matchContaining; }
1155     /**
1156      *
1157      */
1158     virtual void setMatchContaining(bool val)
1159         { matchContaining = val; }
1161     /**
1162      *
1163      */
1164     virtual long getMatchX()
1165         { return matchX; }
1167     /**
1168      *
1169      */
1170     virtual void setMatchX(long val)
1171         { matchX = val; }
1173     /**
1174      *
1175      */
1176     virtual long getMatchY()
1177         { return matchY; }
1179     /**
1180      *
1181      */
1182     virtual void setMatchY(long val)
1183         { matchY = val; }
1185     /**
1186      *
1187      */
1188     virtual long getMatchXR()
1189         { return matchXR; }
1191     /**
1192      *
1193      */
1194     virtual void setMatchXR(long val)
1195         { matchXR = val; }
1197     /**
1198      *
1199      */
1200     virtual long getMatchYR()
1201         { return matchYR; }
1203     /**
1204      *
1205      */
1206     virtual void setMatchYR(long val)
1207         { matchYR = val; }
1209     /**
1210      *
1211      */
1212     virtual bool getMatchContent()
1213         { return matchContent; }
1215     /**
1216      *
1217      */
1218     virtual void setMatchContent(bool val)
1219         { matchContent = val; }
1221     /**
1222      *
1223      */
1224     virtual bool getMatchRange()
1225         { return matchRange; }
1227     /**
1228      *
1229      */
1230     virtual void setMatchRange(bool val)
1231         { matchRange = val; }
1233     /**
1234      *
1235      */
1236     virtual Node *getMatchNode()
1237         { return matchNode; }
1239     /**
1240      *
1241      */
1242     virtual void setMatchNode(const Node *val)
1243         { matchNode = (Node *)val; }
1245     /**
1246      *
1247      */
1248     virtual unsigned long getMatchOffset()
1249         { return matchOffset; }
1251     /**
1252      *
1253      */
1254     virtual void setMatchOffset(unsigned long val)
1255         { matchOffset = val; }
1257     /**
1258      *
1259      */
1260     virtual Node *getMatchNodeR()
1261         { return matchNodeR; }
1263     /**
1264      *
1265      */
1266     virtual void setMatchNodeR(const Node *val)
1267         { matchNodeR = (Node *)val; }
1269     /**
1270      *
1271      */
1272     virtual unsigned long getMatchOffsetR()
1273         { return matchOffsetR; }
1275     /**
1276      *
1277      */
1278     virtual void setMatchOffsetR(unsigned long val)
1279         { matchOffsetR = val; }
1281     /**
1282      *
1283      */
1284     virtual bool getMatchContainsSelected()
1285         { return matchContainsSelected; }
1287     /**
1288      *
1289      */
1290     virtual void setMatchContainsSelected(bool val)
1291         { matchContainsSelected = val; }
1293     /**
1294      *
1295      */
1296     virtual bool getMatchContainsVisible()
1297         { return matchContainsVisible; }
1299     /**
1300      *
1301      */
1302     virtual void setMatchContainsVisible(bool val)
1303         { matchContainsVisible = val; }
1306     /**
1307      *
1308      */
1309     virtual bool getExists()
1310         { return exists; }
1312     /**
1313      *
1314      */
1315     virtual Node *getStartNode()
1316         { return startNode; }
1318     /**
1319      *
1320      */
1321     virtual unsigned long getStartOffset()
1322         { return startOffset; }
1324     /**
1325      *
1326      */
1327     virtual Node *getEndNode()
1328         { return endNode; }
1330     /**
1331      *
1332      */
1333     virtual unsigned long getEndOffset()
1334         { return endOffset; }
1336     /**
1337      *
1338      */
1339     virtual long getTopOffset()
1340         { return topOffset; }
1342     /**
1343      *
1344      */
1345     virtual long getBottomOffset()
1346         { return bottomOffset; }
1348     /**
1349      *
1350      */
1351     virtual long getLeftOffset()
1352         { return leftOffset; }
1354     /**
1355      *
1356      */
1357     virtual long  getRightOffset()
1358         { return rightOffset; }
1360     /**
1361      *
1362      */
1363     virtual unsigned long getWidth()
1364         { return width; }
1366     /**
1367      *
1368      */
1369     virtual unsigned long getHeight()
1370         { return height; }
1372     /**
1373      *
1374      */
1375     virtual bool getSelected()
1376         { return selected; }
1378     /**
1379      *
1380      */
1381     virtual bool getVisible()
1382         { return visible; }
1384     /**
1385      *
1386      */
1387     virtual unsigned long getForegroundColor()
1388         { return foregroundColor; }
1390     /**
1391      *
1392      */
1393     virtual unsigned long getBackgroundColor()
1394         { return backgroundColor; }
1396     /**
1397      *
1398      */
1399     virtual DOMString getFontName()
1400         { return fontName; }
1402     /**
1403      *
1404      */
1405     virtual DOMString getFontHeight()
1406         { return fontHeight; }
1408     /**
1409      *
1410      */
1411     virtual bool getNext()
1412         { return next; }
1414     //##################
1415     //# Non-API methods
1416     //##################
1418     /**
1419      *
1420      */
1421     VisualSegment() {}
1423     /**
1424      *
1425      */
1426     VisualSegment(const VisualSegment &other) : VisualResource(other)
1427         {
1428         matchPosition         = other.matchPosition;
1429         matchInside           = other.matchInside;
1430         matchContaining       = other.matchContaining;
1431         matchX                = other.matchX;
1432         matchY                = other.matchY;
1433         matchXR               = other.matchXR;
1434         matchYR               = other.matchYR;
1435         matchContent          = other.matchContent;
1436         matchRange            = other.matchRange;
1437         matchNode             = other.matchNode;
1438         matchOffset           = other.matchOffset;
1439         matchNodeR            = other.matchNodeR;
1440         matchOffsetR          = other.matchOffsetR;
1441         matchContainsSelected = other.matchContainsSelected;
1442         matchContainsVisible  = other.matchContainsVisible;
1443         exists                = other.exists;
1444         startNode             = other.startNode;
1445         startOffset           = other.startOffset;
1446         endNode               = other.endNode;
1447         endOffset             = other.endOffset;
1448         topOffset             = other.topOffset;
1449         bottomOffset          = other.bottomOffset;
1450         leftOffset            = other.leftOffset;
1451         rightOffset           = other.rightOffset;
1452         width                 = other.width;
1453         height                = other.height;
1454         selected              = other.selected;
1455         visible               = other.visible;
1456         foregroundColor       = other.foregroundColor;
1457         backgroundColor       = other.backgroundColor;
1458         fontName              = other.fontName;
1459         fontHeight            = other.fontHeight;
1460         next                  = other.next;
1461         }
1463     /**
1464      *
1465      */
1466     virtual ~VisualSegment() {}
1469 protected:
1471     bool            matchPosition;
1472     bool            matchInside;
1473     bool            matchContaining;
1474     long            matchX;
1475     long            matchY;
1476     long            matchXR;
1477     long            matchYR;
1478     bool            matchContent;
1479     bool            matchRange;
1480     Node *          matchNode;
1481     unsigned long   matchOffset;
1482     Node *          matchNodeR;
1483     unsigned long   matchOffsetR;
1484     bool            matchContainsSelected;
1485     bool            matchContainsVisible;
1486     bool            exists;
1487     Node *          startNode;
1488     unsigned long   startOffset;
1489     Node *          endNode;
1490     unsigned long   endOffset;
1491     long            topOffset;
1492     long            bottomOffset;
1493     long            leftOffset;
1494     long            rightOffset;
1495     unsigned long   width;
1496     unsigned long   height;
1497     bool            selected;
1498     bool            visible;
1499     unsigned long   foregroundColor;
1500     unsigned long   backgroundColor;
1501     DOMString       fontName;
1502     DOMString       fontHeight;
1503     bool            next;
1506 };
1509 /*#########################################################################
1510 ## VisualCharacter
1511 #########################################################################*/
1513 /**
1514  *
1515  */
1516 class VisualCharacter : virtual public VisualSegment
1518 public:
1520     //##################
1521     //# Non-API methods
1522     //##################
1524     /**
1525      *
1526      */
1527     VisualCharacter()
1528         {}
1530     /**
1531      *
1532      */
1533     VisualCharacter(const VisualCharacter &other) : VisualResource(other),
1534                                                     VisualSegment(other)
1535         {
1536         }
1538     /**
1539      *
1540      */
1541     virtual ~VisualCharacter() {}
1542 };
1546 /*#########################################################################
1547 ## VisualCharacterRun
1548 #########################################################################*/
1550 /**
1551  *
1552  */
1553 class VisualCharacterRun : virtual public VisualSegment
1555 public:
1558     //##################
1559     //# Non-API methods
1560     //##################
1562     /**
1563      *
1564      */
1565     VisualCharacterRun() {}
1567     /**
1568      *
1569      */
1570     VisualCharacterRun(const VisualCharacterRun &other) : VisualResource(other),
1571                                                           VisualSegment(other)
1572         {
1573         }
1575     /**
1576      *
1577      */
1578     virtual ~VisualCharacterRun() {}
1580 protected:
1583 };
1587 /*#########################################################################
1588 ## VisualFrame
1589 #########################################################################*/
1591 /**
1592  *
1593  */
1594 class VisualFrame : virtual public VisualSegment
1596 public:
1599     /**
1600      *
1601      */
1602     virtual VisualSegment getEmbedded()
1603         { return embedded; }
1605     //##################
1606     //# Non-API methods
1607     //##################
1609     /**
1610      *
1611      */
1612     VisualFrame() {}
1614     /**
1615      *
1616      */
1617     VisualFrame(const VisualFrame &other) : VisualResource(other),
1618                                             VisualSegment(other)
1619         {
1620         embedded = other.embedded;
1621         }
1623     /**
1624      *
1625      */
1626     virtual ~VisualFrame() {}
1628 protected:
1630     VisualSegment embedded;
1631 };
1635 /*#########################################################################
1636 ## VisualImage
1637 #########################################################################*/
1639 /**
1640  *
1641  */
1642 class VisualImage : virtual public VisualSegment
1644 public:
1646     /**
1647      *
1648      */
1649     virtual DOMString getImageURL()
1650         { return imageURL; }
1652     /**
1653      *
1654      */
1655     virtual bool getIsLoaded()
1656         { return isLoaded; }
1659     //##################
1660     //# Non-API methods
1661     //##################
1663     /**
1664      *
1665      */
1666     VisualImage() {}
1668     /**
1669      *
1670      */
1671     VisualImage(const VisualImage &other) : VisualResource(other),
1672                                             VisualSegment(other)
1673         {
1674         imageURL = other.imageURL;
1675         isLoaded = other.isLoaded;
1676         }
1678     /**
1679      *
1680      */
1681     virtual ~VisualImage() {}
1683 protected:
1685     DOMString imageURL;
1686     bool isLoaded;
1688 };
1692 /*#########################################################################
1693 ## VisualFormButton
1694 #########################################################################*/
1696 /**
1697  *
1698  */
1699 class VisualFormButton : virtual public VisualSegment
1701 public:
1703     /**
1704      *
1705      */
1706     virtual bool getIsPressed()
1707         { return isPressed; }
1709     //##################
1710     //# Non-API methods
1711     //##################
1713     /**
1714      *
1715      */
1716     VisualFormButton()
1717         { isPressed = false; }
1719     /**
1720      *
1721      */
1722     VisualFormButton(const VisualFormButton &other) : VisualResource(other),
1723                                                       VisualSegment(other)
1724         {
1725         isPressed = other.isPressed;
1726         }
1728     /**
1729      *
1730      */
1731     virtual ~VisualFormButton() {}
1733 protected:
1735     bool isPressed;
1737 };
1741 /*#########################################################################
1742 ## VisualFormField
1743 #########################################################################*/
1745 /**
1746  *
1747  */
1748 class VisualFormField : virtual public VisualSegment
1750 public:
1752     /**
1753      *
1754      */
1755     virtual DOMString getFormValue()
1756         { return formValue; }
1758     //##################
1759     //# Non-API methods
1760     //##################
1762     /**
1763      *
1764      */
1765     VisualFormField() {}
1767     /**
1768      *
1769      */
1770     VisualFormField(const VisualFormField &other) : VisualResource(other),
1771                                                     VisualSegment(other)
1772         {
1773         formValue = other.formValue;
1774         }
1776     /**
1777      *
1778      */
1779     virtual ~VisualFormField() {}
1781 protected:
1783     DOMString formValue;
1785 };
1789 /*#########################################################################
1790 ## VisualView
1791 #########################################################################*/
1793 /**
1794  *
1795  */
1796 class VisualView
1798 public:
1800     /**
1801      *
1802      */
1803     virtual bool getValue()
1804         { return value; }
1806     /**
1807      *
1808      */
1809     virtual DOMString getFontScheme()
1810         { return fontScheme; }
1812     /**
1813      *
1814      */
1815     virtual unsigned long getWidth()
1816         { return width; }
1818     /**
1819      *
1820      */
1821     virtual unsigned long getHeight()
1822         { return height; }
1824     /**
1825      *
1826      */
1827     virtual unsigned long getHorizontalDPI()
1828         { return horizontalDPI; }
1830     /**
1831      *
1832      */
1833     virtual unsigned long getVerticalDPI()
1834         { return verticalDPI; }
1836     /**
1837      *
1838      */
1839     virtual VisualCharacter createVisualCharacter()
1840         {
1841         VisualCharacter ret;
1842         return ret;
1843         }
1845     /**
1846      *
1847      */
1848     virtual VisualCharacterRun createVisualCharacterRun()
1849         {
1850         VisualCharacterRun ret;
1851         return ret;
1852         }
1853     /**
1854      *
1855      */
1856     virtual VisualFrame createVisualFrame()
1857         {
1858         VisualFrame ret;
1859         return ret;
1860         }
1863     /**
1864      *
1865      */
1866     virtual VisualImage createVisualImage()
1867         {
1868         VisualImage ret;
1869         return ret;
1870         }
1872     /**
1873      *
1874      */
1875     virtual VisualFormButton createVisualFormButton()
1876         {
1877         VisualFormButton ret;
1878         return ret;
1879         }
1881     /**
1882      *
1883      */
1884     virtual VisualFormField createVisualFormField()
1885         {
1886         VisualFormField ret;
1887         return ret;
1888         }
1890     /**
1891      *
1892      */
1893     virtual void select(const Node *boundary,
1894                         unsigned long offset,
1895                         bool extend,
1896                         bool add)
1897         {
1898         }
1900     /**
1901      *
1902      */
1903     virtual void matchSegment(const VisualResource *segment)
1904         {
1905         }
1908     //##################
1909     //# Non-API methods
1910     //##################
1912     /**
1913      *
1914      */
1915     VisualView() {}
1917     /**
1918      *
1919      */
1920     VisualView(const VisualView &other)
1921         {
1922         value         = other.value;
1923         fontScheme    = other.fontScheme;
1924         width         = other.width;
1925         height        = other.height;
1926         horizontalDPI = other.horizontalDPI;
1927         verticalDPI   = other.verticalDPI;
1928         }
1930     /**
1931      *
1932      */
1933     virtual ~VisualView() {}
1935 protected:
1937     bool value;
1939     DOMString fontScheme;
1941     unsigned long width;
1942     unsigned long height;
1943     unsigned long horizontalDPI;
1944     unsigned long verticalDPI;
1946 };
1951 }  //namespace views
1952 }  //namespace dom
1953 }  //namespace w3c
1954 }  //namespace org
1957 #endif  /* __VIEWS_H__ */
1958 /*#########################################################################
1959 ## E N D    O F    F I L E
1960 #########################################################################*/