| # khtml Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# 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.4 2003/06/24 22:00:24 faure 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 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 } //namespace
    00127
    00128 #endif

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:33:54 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001