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