html_miscimpl.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef HTML_MISCIMPL_H
00025 #define HTML_MISCIMPL_H
00026
00027 #include "html_elementimpl.h"
00028 #include "misc/shared.h"
00029
00030 namespace DOM {
00031
00032 class Node;
00033 class DOMString;
00034 class HTMLCollection;
00035
00036 class HTMLBaseFontElementImpl : public HTMLElementImpl
00037 {
00038 public:
00039 HTMLBaseFontElementImpl(DocumentPtr *doc);
00040
00041 ~HTMLBaseFontElementImpl();
00042
00043 virtual Id id() const;
00044 };
00045
00046
00047
00048 class HTMLCollectionImpl : public khtml::Shared<HTMLCollectionImpl>
00049 {
00050 friend class DOM::HTMLCollection;
00051 public:
00052 enum Type {
00053
00054 DOC_IMAGES,
00055 DOC_APPLETS,
00056 DOC_FORMS,
00057 DOC_LINKS,
00058 DOC_ANCHORS,
00059
00060 TABLE_ROWS,
00061 TABLE_TBODIES,
00062 TSECTION_ROWS,
00063 TR_CELLS,
00064
00065 SELECT_OPTIONS,
00066
00067 MAP_AREAS,
00068 DOC_ALL,
00069 NODE_CHILDREN
00070 };
00071
00072 HTMLCollectionImpl(NodeImpl *_base, int _tagId);
00073
00074 virtual ~HTMLCollectionImpl();
00075 unsigned long length() const;
00076
00077 NodeImpl *item ( unsigned long index ) const;
00078 virtual NodeImpl *firstItem() const;
00079 virtual NodeImpl *nextItem() const;
00080
00081 NodeImpl *namedItem ( const DOMString &name ) const;
00082
00083 NodeImpl *nextNamedItem( const DOMString &name ) const;
00084
00085 protected:
00086 virtual unsigned long calcLength(NodeImpl *current) const;
00087 virtual NodeImpl *getItem(NodeImpl *current, int index, int &pos) const;
00088 virtual NodeImpl *getNamedItem(NodeImpl *current, int attr_id, const DOMString &name) const;
00089 virtual NodeImpl *nextNamedItemInternal( const DOMString &name ) const;
00090
00091 NodeImpl *base;
00092
00093 int type;
00094
00095
00096
00097
00098
00099
00100
00101
00102 mutable NodeImpl *currentItem;
00103
00104 mutable bool idsDone;
00105 };
00106
00107
00108
00109
00110 class HTMLFormCollectionImpl : public HTMLCollectionImpl
00111 {
00112 public:
00113
00114 HTMLFormCollectionImpl(NodeImpl* _base)
00115 : HTMLCollectionImpl(_base, 0)
00116 {};
00117 ~HTMLFormCollectionImpl() { };
00118
00119 virtual NodeImpl *firstItem() const;
00120 virtual NodeImpl *nextItem() const;
00121 protected:
00122 virtual unsigned long calcLength(NodeImpl* current) const;
00123 virtual NodeImpl *getItem(NodeImpl *current, int index, int& pos) const;
00124 virtual NodeImpl *getNamedItem(NodeImpl* current, int attr_id, const DOMString& name) const;
00125 virtual NodeImpl *nextNamedItemInternal( const DOMString &name ) const;
00126 private:
00127 NodeImpl* getNamedFormItem(int attr_id, const DOMString& name, int duplicateNumber) const;
00128 NodeImpl* getNamedImgItem(NodeImpl* current, int attr_id, const DOMString& name, int& duplicateNumber) const;
00129 mutable int currentPos;
00130 };
00131
00132
00133 };
00134
00135 #endif
This file is part of the documentation for kdelibs Version 3.1.0.