khtml Library API Documentation

html_imageimpl.h

00001 /*
00002  * This file is part of the DOM implementation for KDE.
00003  *
00004  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
00005  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Library General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Library General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Library General Public License
00018  * along with this library; see the file COPYING.LIB.  If not, write to
00019  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020  * Boston, MA 02111-1307, USA.
00021  *
00022  * $Id: html_imageimpl.h,v 1.61.2.2 2003/01/13 22:04:47 mueller Exp $
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 }; //namespace
00124 
00125 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:22:37 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001