You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
151 lines
4.0 KiB
151 lines
4.0 KiB
15 years ago
|
/*
|
||
|
* This file is part of the DOM implementation for KDE.
|
||
|
*
|
||
|
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
|
||
|
* (C) 1999 Antti Koivisto (koivisto@kde.org)
|
||
|
*
|
||
|
* This library is free software; you can redistribute it and/or
|
||
|
* modify it under the terms of the GNU Library General Public
|
||
|
* License as published by the Free Software Foundation; either
|
||
|
* version 2 of the License, or (at your option) any later version.
|
||
|
*
|
||
|
* This library is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
* Library General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU Library General Public License
|
||
|
* along with this library; see the file COPYING.LIB. If not, write to
|
||
|
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
* Boston, MA 02110-1301, USA.
|
||
|
*
|
||
|
*/
|
||
|
#ifndef HTML_IMAGEIMPL_H
|
||
|
#define HTML_IMAGEIMPL_H
|
||
|
|
||
|
#include "html/html_inlineimpl.h"
|
||
12 years ago
|
#include "misc/tdehtmllayout.h"
|
||
15 years ago
|
#include "misc/loader_client.h"
|
||
|
#include "rendering/render_object.h"
|
||
|
|
||
15 years ago
|
#include <tqregion.h>
|
||
15 years ago
|
|
||
|
namespace DOM {
|
||
|
|
||
|
class DOMString;
|
||
|
class HTMLFormElementImpl;
|
||
|
|
||
|
class HTMLImageElementImpl
|
||
12 years ago
|
: public HTMLElementImpl, public tdehtml::CachedObjectClient
|
||
15 years ago
|
{
|
||
|
friend class HTMLFormElementImpl;
|
||
|
public:
|
||
|
HTMLImageElementImpl(DocumentImpl *doc, HTMLFormElementImpl *f = 0);
|
||
|
~HTMLImageElementImpl();
|
||
|
|
||
|
virtual Id id() const;
|
||
|
|
||
|
virtual void parseAttribute(AttributeImpl *);
|
||
|
|
||
|
virtual void attach();
|
||
|
virtual void removedFromDocument();
|
||
|
virtual void insertedIntoDocument();
|
||
15 years ago
|
virtual void addId(const TQString& id);
|
||
|
virtual void removeId(const TQString& id);
|
||
15 years ago
|
|
||
|
|
||
|
long width() const;
|
||
|
long height() const;
|
||
|
|
||
|
bool isServerMap() const { return ( ismap && !usemap.length() ); }
|
||
|
/** Return the image for this element.
|
||
|
* This has to convert the pixmap into an image first.
|
||
|
* This will return undefined results if complete() is not true.
|
||
|
*/
|
||
15 years ago
|
TQImage currentImage() const;
|
||
15 years ago
|
/** Return the pixmap for this element.
|
||
|
* This will return undefined results if complete() is not true.
|
||
|
*/
|
||
15 years ago
|
TQPixmap currentPixmap() const;
|
||
15 years ago
|
|
||
|
DOMString altText() const;
|
||
|
|
||
|
DOMString imageMap() const { return usemap; }
|
||
|
/** See if the image has been completely downloaded.
|
||
|
* @return True if and only if the image is completely downloaded yet*/
|
||
|
bool complete() const;
|
||
|
|
||
12 years ago
|
virtual void notifyFinished(tdehtml::CachedObject *finishedObj);
|
||
15 years ago
|
void dispatchLoadEvent();
|
||
|
protected:
|
||
|
DOMString usemap;
|
||
|
bool ismap : 1;
|
||
|
bool loadEventSent : 1;
|
||
12 years ago
|
tdehtml::CachedImage *m_image;
|
||
15 years ago
|
HTMLFormElementImpl *m_form;
|
||
|
DOMString m_name;
|
||
|
};
|
||
|
|
||
|
|
||
|
//------------------------------------------------------------------
|
||
|
|
||
|
class HTMLAreaElementImpl : public HTMLAnchorElementImpl
|
||
|
{
|
||
|
public:
|
||
|
|
||
|
enum Shape { Default, Poly, Rect, Circle, Unknown };
|
||
|
|
||
|
HTMLAreaElementImpl(DocumentImpl *doc);
|
||
|
~HTMLAreaElementImpl();
|
||
|
|
||
|
virtual Id id() const;
|
||
|
|
||
|
virtual void parseAttribute(AttributeImpl *attr);
|
||
|
|
||
13 years ago
|
bool isDefault() const { return shape==Default; }
|
||
15 years ago
|
|
||
|
bool mapMouseEvent(int x_, int y_, int width_, int height_,
|
||
12 years ago
|
tdehtml::RenderObject::NodeInfo& info);
|
||
15 years ago
|
|
||
15 years ago
|
virtual TQRect getRect() const;
|
||
15 years ago
|
|
||
15 years ago
|
TQRegion cachedRegion() const { return region; }
|
||
15 years ago
|
|
||
|
protected:
|
||
15 years ago
|
TQRegion getRegion(int width_, int height) const;
|
||
|
TQRegion region;
|
||
12 years ago
|
tdehtml::Length* m_coords;
|
||
15 years ago
|
int m_coordsLen;
|
||
|
int lastw, lasth;
|
||
13 years ago
|
Shape shape : 3;
|
||
15 years ago
|
bool nohref : 1;
|
||
|
};
|
||
|
|
||
|
|
||
|
// -------------------------------------------------------------------------
|
||
|
|
||
|
class HTMLMapElementImpl : public HTMLElementImpl
|
||
|
{
|
||
|
public:
|
||
|
HTMLMapElementImpl(DocumentImpl *doc);
|
||
|
|
||
|
~HTMLMapElementImpl();
|
||
|
|
||
|
virtual Id id() const;
|
||
|
|
||
|
virtual DOMString getName() const { return name; }
|
||
|
|
||
|
virtual void parseAttribute(AttributeImpl *attr);
|
||
|
|
||
|
bool mapMouseEvent(int x_, int y_, int width_, int height_,
|
||
12 years ago
|
tdehtml::RenderObject::NodeInfo& info);
|
||
15 years ago
|
private:
|
||
|
|
||
15 years ago
|
TQString name;
|
||
15 years ago
|
};
|
||
|
|
||
|
|
||
|
} //namespace
|
||
|
|
||
|
#endif
|