html_imageimpl.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_IMAGEIMPL_H
00025 #define HTML_IMAGEIMPL_H
00026
00027 #include "html/html_inlineimpl.h"
00028 #include "misc/khtmllayout.h"
00029 #include "rendering/render_object.h"
00030
00031 #include <qregion.h>
00032
00033 namespace DOM {
00034
00035 class DOMString;
00036
00037 class HTMLImageElementImpl
00038 : public HTMLElementImpl
00039 {
00040 public:
00041 HTMLImageElementImpl(DocumentPtr *doc)
00042 : HTMLElementImpl(doc), ismap(false) {}
00043
00044 virtual Id id() const;
00045
00046 virtual void parseAttribute(AttributeImpl *);
00047
00048 virtual void attach();
00049
00050 long width() const;
00051 long height() const;
00052
00053 bool isServerMap() const { return ( ismap && !usemap.length() ); }
00054 QImage currentImage() const;
00055
00056 DOMString altText() const;
00057
00058 DOMString imageMap() const { return usemap; }
00059
00060 bool complete() const;
00061 protected:
00062 DOMString usemap;
00063 bool ismap;
00064 };
00065
00066
00067
00068
00069 class HTMLAreaElementImpl : public HTMLAnchorElementImpl
00070 {
00071 public:
00072
00073 enum Shape { Default, Poly, Rect, Circle, Unknown };
00074
00075 HTMLAreaElementImpl(DocumentPtr *doc);
00076 ~HTMLAreaElementImpl();
00077
00078 virtual Id id() const;
00079
00080 virtual void parseAttribute(AttributeImpl *attr);
00081
00082 bool isDefault() const { return shape==Default; }
00083
00084 bool mapMouseEvent(int x_, int y_, int width_, int height_,
00085 khtml::RenderObject::NodeInfo& info);
00086
00087 virtual QRect getRect() const;
00088
00089 protected:
00090 QRegion getRegion(int width_, int height) const;
00091 QRegion region;
00092 khtml::Length* m_coords;
00093 int m_coordsLen;
00094 int lastw, lasth;
00095 Shape shape : 3;
00096 bool nohref : 1;
00097 };
00098
00099
00100
00101
00102 class HTMLMapElementImpl : public HTMLElementImpl
00103 {
00104 public:
00105 HTMLMapElementImpl(DocumentPtr *doc);
00106
00107 ~HTMLMapElementImpl();
00108
00109 virtual Id id() const;
00110
00111 virtual DOMString getName() const { return name; }
00112
00113 virtual void parseAttribute(AttributeImpl *attr);
00114
00115 bool mapMouseEvent(int x_, int y_, int width_, int height_,
00116 khtml::RenderObject::NodeInfo& info);
00117 private:
00118
00119 QString name;
00120 };
00121
00122
00123 };
00124
00125 #endif
This file is part of the documentation for kdelibs Version 3.1.0.