# khtml Library API Documentation

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

# render_root.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_root.h,v 1.44.2.2 2003/05/18 12:34:40 mueller Exp $
    00022  */
    00023 #ifndef render_root_h
    00024 #define render_root_h
    00025
    00026 #include "render_flow.h"
    00027
    00028 class KHTMLView;
    00029 class QScrollView;
    00030
    00031 namespace khtml {
    00032
    00033 class RenderRoot : public RenderFlow
    00034 {
    00035 public:
    00036     RenderRoot(DOM::NodeImpl* node, KHTMLView *view);
    00037     virtual ~RenderRoot();
    00038
    00039     virtual const char *renderName() const { return "RenderRoot"; }
    00040
    00041     virtual bool isRendered() const { return true; }
    00042     virtual bool isRoot() const { return true; }
    00043
    00044     virtual void layout();
    00045     virtual void calcWidth();
    00046     virtual void calcMinMaxWidth();
    00047     virtual bool absolutePosition(int &xPos, int&yPos, bool f = false);
    00048     virtual void close();
    00049
    00050     int docHeight() const;
    00051     int docWidth() const;
    00052
    00053     KHTMLView *view() const { return m_view; }
    00054
    00055     virtual void repaint();
    00056     virtual void repaintRectangle(int x, int y, int w, int h, bool f=false);
    00057     virtual void paint( QPainter *, int x, int y, int w, int h, int tx, int ty);
    00058     void paintObject(QPainter *p, int _x, int _y,
    00059                      int _w, int _h, int _tx, int _ty);
    00060
    00061     virtual void setSelection(RenderObject *s, int sp, RenderObject *e, int ep);
    00062     virtual void clearSelection();
    00063     virtual RenderObject *selectionStart() const { return m_selectionStart; }
    00064     virtual RenderObject *selectionEnd() const { return m_selectionEnd; }
    00065
    00066     void setPrintingMode(bool print ) { m_printingMode = print; }
    00067     bool printingMode() const { return m_printingMode; }
    00068     void setPrintImages(bool enable) { m_paintImages = enable; }
    00069     bool paintImages() const { return m_paintImages; }
    00070     void setTruncatedAt(int y) { m_truncatedAt = y; }
    00071     int truncatedAt() const { return m_truncatedAt; }
    00072
    00073     virtual void setWidth( int width ) { m_rootWidth = m_width = width; }
    00074     virtual void setHeight( int height ) { m_rootHeight = m_height = height; }
    00075
    00076     int viewportWidth() const { return m_viewportWidth; }
    00077     int viewportHeight() const { return m_viewportHeight; }
    00078
    00079 protected:
    00080
    00081     virtual void selectionStartEnd(int& spos, int& epos);
    00082
    00083     virtual QRect viewRect() const;
    00084
    00085     KHTMLView *m_view;
    00086
    00087     RenderObject* m_selectionStart;
    00088     RenderObject* m_selectionEnd;
    00089     int m_selectionStartPos;
    00090     int m_selectionEndPos;
    00091
    00092     int m_rootWidth;
    00093     int m_rootHeight;
    00094
    00095     int m_viewportWidth;
    00096     int m_viewportHeight;
    00097
    00098     // used to ignore viewport width when painting to the printer
    00099     bool m_printingMode;
    00100     bool m_paintImages;
    00101     int m_truncatedAt;
    00102 };
    00103
    00104 }
    00105 #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