render_root.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
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
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.