• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KHTML

Public Types | Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | List of all members
KHTMLView Class Reference

#include <khtmlview.h>

Inheritance diagram for KHTMLView:
QScrollArea khtml::KHTMLWidget

Public Types

enum  SmoothScrollingMode { SSMDisabled = 0 , SSMWhenEfficient , SSMEnabled }
 

Public Slots

void layout ()
 
virtual void resizeContents (int w, int h)
 

Signals

void cleared ()
 
void findAheadActive (bool)
 
void finishedLayout ()
 
void hideAccessKeys ()
 
void repaintAccessKeys ()
 
void zoomView (int)
 

Public Member Functions

 KHTMLView (KHTMLPart *part, QWidget *parent)
 
virtual ~KHTMLView ()
 
void addChild (QWidget *child, int dx, int dy)
 
int contentsHeight () const
 
QPoint contentsToViewport (const QPoint &p) const
 
void contentsToViewport (int x, int y, int &cx, int &cy) const
 
int contentsWidth () const
 
int contentsX () const
 
int contentsY () const
 
void displayAccessKeys ()
 
int frameWidth () const
 
int marginHeight ()
 
int marginWidth () const
 
KHTMLPart * part () const
 
void print (bool quick=false)
 
void repaintContents (const QRect &r)
 
void repaintContents (int x, int y, int w, int h)
 
void scrollBy (int x, int y)
 
void setContentsPos (int x, int y)
 
virtual void setHorizontalScrollBarPolicy (Qt::ScrollBarPolicy policy)
 
void setMarginHeight (int y)
 
void setMarginWidth (int x)
 
void setSmoothScrollingMode (SmoothScrollingMode m)
 
virtual void setVerticalScrollBarPolicy (Qt::ScrollBarPolicy policy)
 
void setZoomLevel (int percent)
 
SmoothScrollingMode smoothScrollingMode () const
 
void updateContents (const QRect &r)
 
void updateContents (int x, int y, int w, int h)
 
QPoint viewportToContents (const QPoint &p) const
 
void viewportToContents (int x, int y, int &cx, int &cy) const
 
int visibleHeight () const
 
int visibleWidth () const
 
int zoomLevel () const
 
- Public Member Functions inherited from khtml::KHTMLWidget
 KHTMLWidget ()
 
 ~KHTMLWidget ()
 

Protected Slots

void slotPaletteChanged ()
 

Protected Member Functions

void clear ()
 
virtual void closeEvent (QCloseEvent *)
 
void doAutoScroll ()
 
virtual void dragEnterEvent (QDragEnterEvent *)
 
virtual void dropEvent (QDropEvent *)
 
virtual bool event (QEvent *event)
 
virtual bool eventFilter (QObject *, QEvent *)
 
virtual void focusInEvent (QFocusEvent *)
 
virtual bool focusNextPrevChild (bool next)
 
virtual void focusOutEvent (QFocusEvent *)
 
virtual void hideEvent (QHideEvent *)
 
void keyPressEvent (QKeyEvent *_ke)
 
void keyReleaseEvent (QKeyEvent *_ke)
 
virtual void mouseDoubleClickEvent (QMouseEvent *)
 
virtual void mouseMoveEvent (QMouseEvent *)
 
virtual void mousePressEvent (QMouseEvent *)
 
virtual void mouseReleaseEvent (QMouseEvent *)
 
virtual void paintEvent (QPaintEvent *)
 
virtual void resizeEvent (QResizeEvent *event)
 
virtual void scrollContentsBy (int dx, int dy)
 
void setSmoothScrollingModeDefault (SmoothScrollingMode m)
 
virtual void showEvent (QShowEvent *)
 
void timerEvent (QTimerEvent *)
 
virtual bool viewportEvent (QEvent *e)
 
virtual void wheelEvent (QWheelEvent *)
 
virtual bool widgetEvent (QEvent *)
 

Additional Inherited Members

- Public Attributes inherited from khtml::KHTMLWidget
KHTMLWidgetPrivate * m_kwp
 

Detailed Description

Renders and displays HTML in a QScrollArea.

Suitable for use as an application's main view.

Definition at line 92 of file khtmlview.h.

Member Enumeration Documentation

◆ SmoothScrollingMode

enum KHTMLView::SmoothScrollingMode

Smooth Scrolling Mode enumeration.

  • SSMDisabled smooth scrolling is disabled
  • SSMWhenEfficient only use smooth scrolling on pages that do not require a full repaint of the content area when scrolling
  • SSMAlways smooth scrolling is performed unconditionally
Enumerator
SSMDisabled 
SSMWhenEfficient 
SSMEnabled 

Definition at line 305 of file khtmlview.h.

Constructor & Destructor Documentation

◆ KHTMLView()

KHTMLView::KHTMLView ( KHTMLPart *  part,
QWidget *  parent 
)

Constructs a KHTMLView.

Definition at line 549 of file khtmlview.cpp.

◆ ~KHTMLView()

KHTMLView::~KHTMLView ( )
virtual

Definition at line 563 of file khtmlview.cpp.

Member Function Documentation

◆ addChild()

void KHTMLView::addChild ( QWidget *  child,
int  dx,
int  dy 
)

Definition at line 3952 of file khtmlview.cpp.

◆ clear()

void KHTMLView::clear ( )
protected

Definition at line 621 of file khtmlview.cpp.

◆ cleared

void KHTMLView::cleared ( )
signal

◆ closeEvent()

void KHTMLView::closeEvent ( QCloseEvent *  ev)
protectedvirtual

Definition at line 1062 of file khtmlview.cpp.

◆ contentsHeight()

int KHTMLView::contentsHeight ( ) const

Returns the contents area's height.

Definition at line 676 of file khtmlview.cpp.

◆ contentsToViewport() [1/2]

QPoint KHTMLView::contentsToViewport ( const QPoint &  p) const

Returns a point translated to viewport coordinates.

Parameters
pthe contents area point to translate

Definition at line 747 of file khtmlview.cpp.

◆ contentsToViewport() [2/2]

void KHTMLView::contentsToViewport ( int  x,
int  y,
int &  cx,
int &  cy 
) const

Returns a point translated to viewport coordinates.

Parameters
xx coordinate of contents area point to translate
yy coordinate of contents area point to translate
cxresulting x coordinate
cyresulting y coordinate

Definition at line 752 of file khtmlview.cpp.

◆ contentsWidth()

int KHTMLView::contentsWidth ( ) const

Returns the contents area's width.

Definition at line 671 of file khtmlview.cpp.

◆ contentsX()

int KHTMLView::contentsX ( ) const

Returns the x coordinate of the contents area point that is currently located at the top left in the viewport.

Definition at line 690 of file khtmlview.cpp.

◆ contentsY()

int KHTMLView::contentsY ( ) const

Returns the y coordinate of the contents area point that is currently located at the top left in the viewport.

Definition at line 695 of file khtmlview.cpp.

◆ displayAccessKeys()

void KHTMLView::displayAccessKeys ( )

Display all accesskeys in small tooltips.

Definition at line 2502 of file khtmlview.cpp.

◆ doAutoScroll()

void KHTMLView::doAutoScroll ( )
protected

Definition at line 1887 of file khtmlview.cpp.

◆ dragEnterEvent()

void KHTMLView::dragEnterEvent ( QDragEnterEvent *  ev)
protectedvirtual

Definition at line 3716 of file khtmlview.cpp.

◆ dropEvent()

void KHTMLView::dropEvent ( QDropEvent *  ev)
protectedvirtual

Definition at line 3722 of file khtmlview.cpp.

◆ event()

bool KHTMLView::event ( QEvent *  event)
protectedvirtual

Definition at line 481 of file khtmlview.cpp.

◆ eventFilter()

bool KHTMLView::eventFilter ( QObject *  o,
QEvent *  e 
)
protectedvirtual

Definition at line 2024 of file khtmlview.cpp.

◆ findAheadActive

void KHTMLView::findAheadActive ( bool  )
signal

◆ finishedLayout

void KHTMLView::finishedLayout ( )
signal

This signal is used for internal layouting.

Don't use it to check if rendering finished. Use KHTMLPart completed() signal instead.

◆ focusInEvent()

void KHTMLView::focusInEvent ( QFocusEvent *  e)
protectedvirtual

Definition at line 3728 of file khtmlview.cpp.

◆ focusNextPrevChild()

bool KHTMLView::focusNextPrevChild ( bool  next)
protectedvirtual

Definition at line 1868 of file khtmlview.cpp.

◆ focusOutEvent()

void KHTMLView::focusOutEvent ( QFocusEvent *  e)
protectedvirtual

Definition at line 3739 of file khtmlview.cpp.

◆ frameWidth()

int KHTMLView::frameWidth ( ) const
inline

Definition at line 137 of file khtmlview.h.

◆ hideAccessKeys

void KHTMLView::hideAccessKeys ( )
signal

◆ hideEvent()

void KHTMLView::hideEvent ( QHideEvent *  e)
protectedvirtual

Definition at line 641 of file khtmlview.cpp.

◆ keyPressEvent()

void KHTMLView::keyPressEvent ( QKeyEvent *  _ke)
protected

Definition at line 1676 of file khtmlview.cpp.

◆ keyReleaseEvent()

void KHTMLView::keyReleaseEvent ( QKeyEvent *  _ke)
protected

Definition at line 1826 of file khtmlview.cpp.

◆ layout

void KHTMLView::layout ( )
slot

ensure the display is up to date

Definition at line 954 of file khtmlview.cpp.

◆ marginHeight()

int KHTMLView::marginHeight ( )
inline

Returns the margin height.

A return value of -1 means the default value will be used.

Definition at line 161 of file khtmlview.h.

◆ marginWidth()

int KHTMLView::marginWidth ( ) const
inline

Returns the margin width.

A return value of -1 means the default value will be used.

Definition at line 149 of file khtmlview.h.

◆ mouseDoubleClickEvent()

void KHTMLView::mouseDoubleClickEvent ( QMouseEvent *  _mouse)
protectedvirtual

Definition at line 1242 of file khtmlview.cpp.

◆ mouseMoveEvent()

void KHTMLView::mouseMoveEvent ( QMouseEvent *  _mouse)
protectedvirtual

Definition at line 1301 of file khtmlview.cpp.

◆ mousePressEvent()

void KHTMLView::mousePressEvent ( QMouseEvent *  _mouse)
protectedvirtual

Definition at line 1113 of file khtmlview.cpp.

◆ mouseReleaseEvent()

void KHTMLView::mouseReleaseEvent ( QMouseEvent *  _mouse)
protectedvirtual

Definition at line 1545 of file khtmlview.cpp.

◆ paintEvent()

void KHTMLView::paintEvent ( QPaintEvent *  e)
protectedvirtual

Definition at line 869 of file khtmlview.cpp.

◆ part()

KHTMLPart * KHTMLView::part ( ) const
inline

Returns a pointer to the KHTMLPart that is rendering the page.

Definition at line 135 of file khtmlview.h.

◆ print()

void KHTMLView::print ( bool  quick = false)

Prints the HTML document.

Parameters
quickif true, fully automated printing, without print dialog

Definition at line 3027 of file khtmlview.cpp.

◆ repaintAccessKeys

void KHTMLView::repaintAccessKeys ( )
signal

◆ repaintContents() [1/2]

void KHTMLView::repaintContents ( const QRect &  r)

Requests an immediate repaint of the content area.

Parameters
rthe content area rectangle to repaint

Definition at line 800 of file khtmlview.cpp.

◆ repaintContents() [2/2]

void KHTMLView::repaintContents ( int  x,
int  y,
int  w,
int  h 
)

Definition at line 789 of file khtmlview.cpp.

◆ resizeContents

void KHTMLView::resizeContents ( int  w,
int  h 
)
virtualslot

Resize the contents area.

Parameters
wthe new width
hthe new height

Definition at line 681 of file khtmlview.cpp.

◆ resizeEvent()

void KHTMLView::resizeEvent ( QResizeEvent *  event)
protectedvirtual

Definition at line 837 of file khtmlview.cpp.

◆ scrollBy()

void KHTMLView::scrollBy ( int  x,
int  y 
)

Scrolls the content area by a given amount.

Parameters
xx offset
yy offset

Definition at line 739 of file khtmlview.cpp.

◆ scrollContentsBy()

void KHTMLView::scrollContentsBy ( int  dx,
int  dy 
)
protectedvirtual

Definition at line 3752 of file khtmlview.cpp.

◆ setContentsPos()

void KHTMLView::setContentsPos ( int  x,
int  y 
)

Place the contents area point x/y at the top left of the viewport.

Definition at line 732 of file khtmlview.cpp.

◆ setHorizontalScrollBarPolicy()

void KHTMLView::setHorizontalScrollBarPolicy ( Qt::ScrollBarPolicy  policy)
virtual

Sets horizontal scrollbar mode.

WARNING: do not call this method on a base class pointer unless you specifically want QAbstractScrollArea's variant (not recommended). QAbstractScrollArea::setHorizontalScrollBarPolicy is not virtual.

Definition at line 3377 of file khtmlview.cpp.

◆ setMarginHeight()

void KHTMLView::setMarginHeight ( int  y)

Definition at line 948 of file khtmlview.cpp.

◆ setMarginWidth()

void KHTMLView::setMarginWidth ( int  x)

Sets a margin in x direction.

Definition at line 942 of file khtmlview.cpp.

◆ setSmoothScrollingMode()

void KHTMLView::setSmoothScrollingMode ( SmoothScrollingMode  m)

Set the smooth scrolling mode.

Smooth scrolling mode is normally controlled by the configuration file's SmoothScrolling key. Using this setter will override the configuration file's settings.

Since
4.1

Definition at line 1085 of file khtmlview.cpp.

◆ setSmoothScrollingModeDefault()

void KHTMLView::setSmoothScrollingModeDefault ( SmoothScrollingMode  m)
protected

Definition at line 1093 of file khtmlview.cpp.

◆ setVerticalScrollBarPolicy()

void KHTMLView::setVerticalScrollBarPolicy ( Qt::ScrollBarPolicy  policy)
virtual

Sets vertical scrollbar mode.

WARNING: do not call this method on a base class pointer unless you specifically want QAbstractScrollArea's variant (not recommended). QAbstractScrollArea::setVerticalScrollBarPolicy is not virtual.

Definition at line 3367 of file khtmlview.cpp.

◆ setZoomLevel()

void KHTMLView::setZoomLevel ( int  percent)

Apply a zoom level to the content area.

Parameters
percenta zoom level expressed as a percentage

Definition at line 1068 of file khtmlview.cpp.

◆ showEvent()

void KHTMLView::showEvent ( QShowEvent *  e)
protectedvirtual

Definition at line 646 of file khtmlview.cpp.

◆ slotPaletteChanged

void KHTMLView::slotPaletteChanged ( )
protectedslot

Definition at line 3215 of file khtmlview.cpp.

◆ smoothScrollingMode()

KHTMLView::SmoothScrollingMode KHTMLView::smoothScrollingMode ( ) const

Retrieve the current smooth scrolling mode.

Since
4.1

Definition at line 1103 of file khtmlview.cpp.

◆ timerEvent()

void KHTMLView::timerEvent ( QTimerEvent *  e)
protected

Definition at line 3965 of file khtmlview.cpp.

◆ updateContents() [1/2]

void KHTMLView::updateContents ( const QRect &  r)

Requests an update of the content area.

Parameters
rthe content area rectangle to update

Definition at line 784 of file khtmlview.cpp.

◆ updateContents() [2/2]

void KHTMLView::updateContents ( int  x,
int  y,
int  w,
int  h 
)

Definition at line 773 of file khtmlview.cpp.

◆ viewportEvent()

bool KHTMLView::viewportEvent ( QEvent *  e)
protectedvirtual

Definition at line 1979 of file khtmlview.cpp.

◆ viewportToContents() [1/2]

QPoint KHTMLView::viewportToContents ( const QPoint &  p) const

Returns a point translated to contents area coordinates.

Parameters
pthe viewport point to translate

Definition at line 760 of file khtmlview.cpp.

◆ viewportToContents() [2/2]

void KHTMLView::viewportToContents ( int  x,
int  y,
int &  cx,
int &  cy 
) const

Returns a point translated to contents area coordinates.

Parameters
xx coordinate of viewport point to translate
yy coordinate of viewport point to translate
cxresulting x coordinate
cyresulting y coordinate

Definition at line 765 of file khtmlview.cpp.

◆ visibleHeight()

int KHTMLView::visibleHeight ( ) const

Returns the height of the viewport.

Definition at line 716 of file khtmlview.cpp.

◆ visibleWidth()

int KHTMLView::visibleWidth ( ) const

Returns the width of the viewport.

Definition at line 700 of file khtmlview.cpp.

◆ wheelEvent()

void KHTMLView::wheelEvent ( QWheelEvent *  e)
protectedvirtual

Definition at line 3636 of file khtmlview.cpp.

◆ widgetEvent()

bool KHTMLView::widgetEvent ( QEvent *  e)
protectedvirtual

Definition at line 2195 of file khtmlview.cpp.

◆ zoomLevel()

int KHTMLView::zoomLevel ( ) const

Retrieve the current zoom level.

Definition at line 1080 of file khtmlview.cpp.

◆ zoomView

void KHTMLView::zoomView ( int  )
signal

The documentation for this class was generated from the following files:
  • khtmlview.h
  • khtmlview.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHTML

Skip menu "KHTML"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal