# khtml Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# render_replaced.h

    00001 /*
    00002  * This file is part of the HTML widget for KDE.
    00003  *
    00004  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
    00005  *
    00006  * This library is free software; you can redistribute it and/or
    00007  * modify it under the terms of the GNU Library General Public
    00008  * License as published by the Free Software Foundation; either
    00009  * version 2 of the License, or (at your option) any later version.
    00010  *
    00011  * This library is distributed in the hope that it will be useful,
    00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00014  * Library General Public License for more details.
    00015  *
    00016  * You should have received a copy of the GNU Library General Public License
    00017  * along with this library; see the file COPYING.LIB.  If not, write to
    00018  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00019  * Boston, MA 02111-1307, USA.
    00020  *
    00021  * $Id: render_replaced.h,v 1.39.2.5 2003/10/25 13:36:02 ggarand Exp $
    00022  */
    00023 #ifndef render_replaced_h
    00024 #define render_replaced_h
    00025
    00026 #include "render_flow.h"
    00027 #include <qobject.h>
    00028 class KHTMLView;
    00029 class QWidget;
    00030
    00031 namespace khtml {
    00032
    00033 class RenderReplaced : public RenderBox
    00034 {
    00035 public:
    00036     RenderReplaced(DOM::NodeImpl* node);
    00037
    00038     virtual const char *renderName() const { return "RenderReplaced"; }
    00039
    00040     virtual bool isRendered() const { return true; }
    00041
    00042     virtual short lineHeight( bool firstLine) const;
    00043     virtual short baselinePosition( bool firstLine ) const;
    00044
    00045     virtual void calcMinMaxWidth();
    00046
    00047     virtual void paint( QPainter *, int x, int y, int w, int h,
    00048                         int tx, int ty);
    00049     virtual void paintObject(QPainter *p, int x, int y, int w, int h, int tx, int ty) = 0;
    00050
    00051     virtual short intrinsicWidth() const { return m_intrinsicWidth; }
    00052     virtual int intrinsicHeight() const { return m_intrinsicHeight; }
    00053
    00054     void setIntrinsicWidth(int w) {  m_intrinsicWidth = w; }
    00055     void setIntrinsicHeight(int h) { m_intrinsicHeight = h; }
    00056
    00057     virtual void position(int x, int y, int from, int len, int width, bool reverse, bool firstLine, int);
    00058
    00059 protected:
    00060     short m_intrinsicWidth;
    00061     short m_intrinsicHeight;
    00062 };
    00063
    00064
    00065 class RenderWidget : public QObject, public RenderReplaced, public khtml::Shared<RenderWidget>
    00066 {
    00067     Q_OBJECT
    00068 public:
    00069     RenderWidget(DOM::NodeImpl* node);
    00070     virtual ~RenderWidget();
    00071
    00072     virtual void setStyle(RenderStyle *style);
    00073
    00074     virtual void paintObject(QPainter *p, int x, int y, int w, int h, int tx, int ty);
    00075
    00076     virtual bool isWidget() const { return true; };
    00077
    00078     virtual void detach();
    00079     virtual void layout( );
    00080
    00081     virtual void updateFromElement();
    00082
    00083     QWidget *widget() const { return m_widget; }
    00084     KHTMLView* view() const { return m_view; }
    00085
    00086
    00087 public slots:
    00088     void slotWidgetDestructed();
    00089
    00090 protected:
    00091     virtual void handleFocusOut() {}
    00092     bool event( QEvent *e );
    00093
    00094     bool eventFilter(QObject* /*o*/, QEvent* e);
    00095     void setQWidget(QWidget *widget);
    00096     void resizeWidget( int w, int h );
    00097
    00098     QWidget *m_widget;
    00099     KHTMLView* m_view;
    00100 };
    00101
    00102
    00103 class RenderReplacedFlow : public RenderFlow
    00104 {
    00105 public:
    00106     RenderReplacedFlow(DOM::NodeImpl* node);
    00107
    00108     virtual const char *renderName() const { return "RenderReplacedFlow"; }
    00109
    00110 protected:
    00111     virtual void calcMinMaxWidth();
    00112     virtual short intrinsicWidth() const { return m_intrinsicWidth; }
    00113     short calcObjectWidth( RenderObject *o, short width );
    00114     void setIntrinsicWidth(int w) {  m_intrinsicWidth = w; }
    00115     short m_intrinsicWidth;
    00116 };
    00117
    00118
    00119 }
    00120
    00121 #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:34:39 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001