• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kviewshell

DocumentWidget Class Reference

#include <documentWidget.h>

Inheritance diagram for DocumentWidget:

Inheritance graph
[legend]

List of all members.


Public Slots

void flash (int)
void select (const TextSelection &)
void selectAll ()
void setPageSize (int width, int height)
void setPageSize (const QSize &)
void slotEnableMoveTool (bool enable)

Signals

void clearSelection ()
void localLink (const QString &)
void resized ()
void setStatusBarText (const QString &)

Public Member Functions

 DocumentWidget (QWidget *parent, PageView *sv, DocumentPageCache *cache, const char *name)
void drawScrollGuide (int ycoord)
Q_UINT16 getPageNumber () const
bool isVisible ()
QRect pageRect () const
QSize pageSize () const
void setPageNumber (Q_UINT16 pageNr)

Protected Member Functions

virtual void mouseMoveEvent (QMouseEvent *)
virtual void mousePressEvent (QMouseEvent *e)
virtual void mouseReleaseEvent (QMouseEvent *)
virtual void paintEvent (QPaintEvent *)
virtual void setStandardCursor ()
void timerEvent (QTimerEvent *e)
void updateSelection (const TextSelection &newTextSelection)

Protected Attributes

int animationCounter
QTimer clearStatusBarTimer
DocumentPageCache * documentCache
QPoint firstSelectedPoint
int flashOffset
int indexOfUnderlinedLink
Q_UINT16 pageNr
bool pixmapRequested
PageView * scrollView
QRect selectedRectangle
QRegion selectedRegion
int timerIdent

Detailed Description

Definition at line 30 of file documentWidget.h.


Constructor & Destructor Documentation

DocumentWidget::DocumentWidget ( QWidget *  parent,
PageView *  sv,
DocumentPageCache *  cache,
const char *  name 
)

Definition at line 68 of file documentWidget.cpp.


Member Function Documentation

void DocumentWidget::clearSelection (  )  [signal]

This signal is emitted when the selection needs to be cleared.

void DocumentWidget::drawScrollGuide ( int  ycoord  ) 

Draw a red vertical line at y-coordinate ycoord.

The line is removed again after one second. This is used to make it easier to regain reading focus if the whole page is scrolled up or down.

Definition at line 364 of file documentWidget.cpp.

void DocumentWidget::flash ( int  fo  )  [slot]

Definition at line 154 of file documentWidget.cpp.

Q_UINT16 DocumentWidget::getPageNumber (  )  const [inline]

Definition at line 38 of file documentWidget.h.

bool DocumentWidget::isVisible (  ) 

Checks if the page is currently visible in the PageView.

Definition at line 757 of file documentWidget.cpp.

void DocumentWidget::localLink ( const QString &   )  [signal]

void DocumentWidget::mouseMoveEvent ( QMouseEvent *  e  )  [protected, virtual]

This method is used by the DocumentWidget to find out of the mouse pointer hovers over a hyperlink, and to update the statusbar accordingly.

Scrolling with the left mouse button pressed, and the text copy functions are also implemented here. Re-implementations of this method should do the following:

0) Immediately return if pageNr == 0, i.e. if no page number has been set

1) Call the standard implementation using

DocumentWidget::mouseMoveEvent(e);

2) Ignore the QMouseEvent if a mouse button is pressed

3) If no mouse button is pressed, analyze the mouse movement and take appropriate actions. To set statusbar text, do

clearStatusBarTimer.stop(); emit setStatusBarText( i18n("Whatever string") );

To clear the statusbar, use the following code

if (!clearStatusBarTimer.isActive()) clearStatusBarTimer.start(200, true);

This clears the statusbar after 200 msec and avoids awful flickering when the mouse is swiftly moved across various areas in the widget.

Reimplemented from QWidget.

Definition at line 515 of file documentWidget.cpp.

void DocumentWidget::mousePressEvent ( QMouseEvent *  e  )  [protected, virtual]

Reimplemented from QWidget.

Definition at line 429 of file documentWidget.cpp.

void DocumentWidget::mouseReleaseEvent ( QMouseEvent *  e  )  [protected, virtual]

Reimplemented from QWidget.

Definition at line 482 of file documentWidget.cpp.

QRect DocumentWidget::pageRect (  )  const

Returns the bounding rectangle of the widget without the page shadow.

Definition at line 710 of file documentWidget.cpp.

QSize DocumentWidget::pageSize (  )  const

Returns the size of the widget without the page shadow.

Definition at line 704 of file documentWidget.cpp.

void DocumentWidget::paintEvent ( QPaintEvent *  e  )  [protected, virtual]

Reimplemented from QWidget.

Definition at line 171 of file documentWidget.cpp.

void DocumentWidget::resized (  )  [signal]

This signal is emitted when the widget resizes itself.

void DocumentWidget::select ( const TextSelection &  newSelection  )  [slot]

Definition at line 380 of file documentWidget.cpp.

void DocumentWidget::selectAll (  )  [slot]

Definition at line 397 of file documentWidget.cpp.

void DocumentWidget::setPageNumber ( Q_UINT16  pageNr  ) 

Definition at line 106 of file documentWidget.cpp.

void DocumentWidget::setPageSize ( int  width,
int  height 
) [slot]

Definition at line 730 of file documentWidget.cpp.

void DocumentWidget::setPageSize ( const QSize &  pageSize  )  [slot]

Sets the size of the widget so that the page is of the given size.

The widget gets slightly bigger because of the page shadow.

Definition at line 718 of file documentWidget.cpp.

void DocumentWidget::setStandardCursor (  )  [protected, virtual]

Sets the cursor to an arrow if the move tool is selected, and to the text selection cursor if the selection tool is active.

Definition at line 744 of file documentWidget.cpp.

void DocumentWidget::setStatusBarText ( const QString &   )  [signal]

Passed through to the top-level kpart.

void DocumentWidget::slotEnableMoveTool ( bool  enable  )  [slot]

Definition at line 736 of file documentWidget.cpp.

void DocumentWidget::timerEvent ( QTimerEvent *  e  )  [protected]

Definition at line 132 of file documentWidget.cpp.

void DocumentWidget::updateSelection ( const TextSelection &  newTextSelection  )  [protected]

Definition at line 621 of file documentWidget.cpp.


Member Data Documentation

int DocumentWidget::animationCounter [protected]

Definition at line 121 of file documentWidget.h.

QTimer DocumentWidget::clearStatusBarTimer [protected]

Definition at line 131 of file documentWidget.h.

DocumentPageCache* DocumentWidget::documentCache [protected]

Definition at line 141 of file documentWidget.h.

QPoint DocumentWidget::firstSelectedPoint [protected]

Definition at line 134 of file documentWidget.h.

int DocumentWidget::flashOffset [protected]

Definition at line 122 of file documentWidget.h.

int DocumentWidget::indexOfUnderlinedLink [protected]

This is set to the index of the link over which the mouse pointer currently resides, and -1 if the no link is hovered.

Is used when "Underline Links" is set to "Only on Hover".

Definition at line 149 of file documentWidget.h.

Q_UINT16 DocumentWidget::pageNr [protected]

Definition at line 124 of file documentWidget.h.

bool DocumentWidget::pixmapRequested [protected]

True if there is already a request for this page to the renderer.

Definition at line 152 of file documentWidget.h.

PageView* DocumentWidget::scrollView [protected]

Pointer to the PageView that contains this widget.

This pointer is used in the re-implementation of the paintEvent() method ---see the explanation there.

Definition at line 140 of file documentWidget.h.

QRect DocumentWidget::selectedRectangle [protected]

Definition at line 135 of file documentWidget.h.

QRegion DocumentWidget::selectedRegion [protected]

Currently selected Region.

Definition at line 144 of file documentWidget.h.

int DocumentWidget::timerIdent [protected]

Methods and counters used for the animation to mark the target of an hyperlink.

Definition at line 119 of file documentWidget.h.


The documentation for this class was generated from the following files:
  • documentWidget.h
  • documentWidget.cpp

kviewshell

Skip menu "kviewshell"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • kviewshell
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal