32#include <QtGui/QScrollArea>
40 class HTMLDocumentImpl;
43 class HTMLTitleElementImpl;
44 class HTMLGenericFormElementImpl;
45 class HTMLFormElementImpl;
46 class HTMLAnchorElementImpl;
47 class HTMLInputElementImpl;
61 class RenderPartObject;
65 class CSSStyleSelector;
69 class KHTMLWidgetPrivate;
81class KHTMLViewPrivate;
96 friend class DOM::HTMLDocumentImpl;
97 friend class DOM::HTMLTitleElementImpl;
98 friend class DOM::HTMLGenericFormElementImpl;
99 friend class DOM::HTMLFormElementImpl;
100 friend class DOM::HTMLAnchorElementImpl;
101 friend class DOM::HTMLInputElementImpl;
102 friend class DOM::NodeImpl;
103 friend class DOM::ElementImpl;
104 friend class DOM::DocumentImpl;
108 friend class khtml::RenderCanvas;
109 friend class khtml::RenderObject;
110 friend class khtml::RenderLineEdit;
111 friend class khtml::RenderPartObject;
112 friend class khtml::RenderWidget;
113 friend class khtml::KHTMLWidgetPrivate;
114 friend class khtml::RenderLayer;
115 friend class khtml::RenderBox;
116 friend class khtml::CSSStyleSelector;
117 friend class khtml::LineEditWidget;
118 friend class khtml::HTMLTokenizer;
119 friend class KJS::WindowFunc;
120 friend class KJS::ExternalFunc;
142 void setMarginWidth(
int x);
154 void setMarginHeight(
int y);
170 virtual void setVerticalScrollBarPolicy( Qt::ScrollBarPolicy policy );
179 virtual void setHorizontalScrollBarPolicy( Qt::ScrollBarPolicy policy );
185 void print(
bool quick =
false );
190 void displayAccessKeys();
195 int contentsWidth()
const;
200 int contentsHeight()
const;
206 int contentsX()
const;
212 int contentsY()
const;
217 int visibleWidth()
const;
222 int visibleHeight()
const;
228 void setContentsPos(
int x,
int y);
235 QPoint contentsToViewport(
const QPoint& p)
const;
242 QPoint viewportToContents(
const QPoint& p)
const;
252 void viewportToContents(
int x,
int y,
int& cx,
int& cy)
const;
262 void contentsToViewport(
int x,
int y,
int& cx,
int& cy)
const;
269 void scrollBy(
int x,
int y);
275 void updateContents(
const QRect& r );
276 void updateContents(
int x,
int y,
int w,
int h);
278 void addChild(
QWidget *child,
int dx,
int dy);
284 void repaintContents(
const QRect& r );
285 void repaintContents(
int x,
int y,
int w,
int h);
291 void setZoomLevel(
int percent );
297 int zoomLevel()
const;
315 void setSmoothScrollingMode( SmoothScrollingMode m );
322 SmoothScrollingMode smoothScrollingMode()
const;
330 virtual void resizeContents(
int w,
int h);
353 virtual bool event (
QEvent * event );
354 virtual void paintEvent( QPaintEvent * );
355 virtual void resizeEvent ( QResizeEvent * event );
356 virtual void showEvent ( QShowEvent * );
357 virtual void hideEvent ( QHideEvent *);
358 virtual bool focusNextPrevChild(
bool next );
359 virtual void mousePressEvent( QMouseEvent * );
360 virtual void focusInEvent( QFocusEvent * );
361 virtual void focusOutEvent( QFocusEvent * );
362 virtual void mouseDoubleClickEvent( QMouseEvent * );
363 virtual void mouseMoveEvent(QMouseEvent *);
364 virtual void mouseReleaseEvent(QMouseEvent *);
365#ifndef QT_NO_WHEELEVENT
366 virtual void wheelEvent(QWheelEvent*);
368 virtual void dragEnterEvent( QDragEnterEvent* );
369 virtual void dropEvent( QDropEvent* );
370 virtual void closeEvent ( QCloseEvent * );
371 virtual bool widgetEvent(
QEvent * );
372 virtual bool viewportEvent(
QEvent * e );
374 virtual void scrollContentsBy(
int dx,
int dy );
376 void keyPressEvent( QKeyEvent *_ke );
377 void keyReleaseEvent ( QKeyEvent *_ke );
379 void timerEvent ( QTimerEvent * );
384 void slotPaletteChanged();
387 void tripleClickTimeout();
388 void accessKeysTimeout();
395 void slotMouseScrollTimer();
398 void resizeContentsToViewport();
400 void scheduleRelayout(khtml::RenderObject* clippedObj=0);
401 void unscheduleRelayout();
403 bool hasLayoutPending();
405 void scheduleRepaint(
int x,
int y,
int w,
int h,
bool asap=
false);
406 void unscheduleRepaint();
408 bool needsFullRepaint()
const;
410 void closeChildDialogs();
411 bool dialogsAllowed();
413 void setMouseEventsTarget(
QWidget* w );
414 QWidget* mouseEventsTarget()
const;
429 void paint(QPainter *p,
const QRect &rc,
int yOff = 0,
bool *more = 0);
431 void render(QPainter *p,
const QRect& r,
const QPoint& off);
443 void setMediaType(
const QString &medium );
444 QString mediaType()
const;
446 bool pagedMode()
const;
448 bool scrollTo(
const QRect &);
450 bool focusNextPrevNode(
bool next);
451 bool handleAccessKey(
const QKeyEvent* ev);
452 bool focusNodeWithAccessKey(QChar c,
KHTMLView* caller = NULL);
455 bool isScrollingFromMouseWheel()
const;
456 void setHasStaticBackground(
bool partial=
false);
457 void setHasNormalBackground();
458 void addStaticObject(
bool fixed);
459 void removeStaticObject(
bool fixed);
460 void applyTransforms(
int& x,
int& y,
int& w,
int& h)
const;
461 void revertTransforms(
int& x,
int& y,
int& w,
int& h)
const;
462 void revertTransforms(
int& x,
int& y )
const;
463 void checkExternalWidgetsPosition();
465 void setIgnoreWheelEvents(
bool e);
469 DOM::NodeImpl *nodeUnderMouse()
const;
470 DOM::NodeImpl *nonSharedNodeUnderMouse()
const;
472 void restoreScrollBar();
474 QStringList formCompletionItems(
const QString &name)
const;
475 void clearCompletionHistory(
const QString& name);
476 void addFormCompletionItem(
const QString &name,
const QString &value);
478 void addNonPasswordStorableSite(
const QString& host );
479 void delNonPasswordStorableSite(
const QString& host );
480 bool nonPasswordStorableSite(
const QString& host )
const;
482 bool dispatchMouseEvent(
int eventId, DOM::NodeImpl *targetNode,
483 DOM::NodeImpl *targetNodeNonShared,
bool cancelable,
484 int detail,QMouseEvent *_mouse,
bool setUnder,
485 int mouseEventType,
int orientation=0);
486 bool dispatchKeyEvent( QKeyEvent *_ke );
487 bool dispatchKeyEventHelper( QKeyEvent *_ke,
bool generate_keypress );
489 void complete(
bool pendingAction );
491 void updateScrollBars();
492 void setupSmoothScrolling(
int dx,
int dy);
498 int caretDisplayPolicyNonFocused()
const;
505 void setCaretDisplayPolicyNonFocused(
int policy);
513 bool caretKeyPressEvent(QKeyEvent *);
517 friend class KHTMLViewPrivate;
518 enum LinkCursor { LINK_NORMAL, LINK_MAILTO, LINK_NEWWINDOW };
520 void setWidgetVisible(::khtml::RenderWidget*,
bool visible);
530 KHTMLViewPrivate*
const d;
This class implements the find activity for the KHTMLPart.
This class is khtml's main class.
Renders and displays HTML in a QScrollArea.
KHTMLPart * part() const
Returns a pointer to the KHTMLPart that is rendering the page.
void finishedLayout()
This signal is used for internal layouting.
int marginHeight()
Returns the margin height.
int marginWidth() const
Returns the margin width.
void findAheadActive(bool)
SmoothScrollingMode
Smooth Scrolling Mode enumeration.
This library provides a full-featured HTML parser and widget.
KAction * print(const QObject *recvr, const char *slot, QObject *parent)
KAction * clear(const QObject *recvr, const char *slot, QObject *parent)
void applyRule(DOM::CSSProperty *prop)