UNNAMED_READER/corelibrary
UNNAMED_READER::readerWidget Class Reference
#include <readerWidget.h>

Detailed Description
UNNAMED_READER Main Widget.
- Note:
- At times, readerWidgets delete themselves by using the method "deleteLater()", e.g. when a document is corruped, or when the user asks to close the document. This has a few consequences:
- since deletion takes place in the event loop of the render thread, only the render thread may use pointers to readerWidgets
- even in the render thread, never store a pointer to a render class; the pointer may become invalid next time control is given to the event loop. Use a QPointer instead, and make sure to check its validity before use.
Definition at line 52 of file readerWidget.h.
Signals | |
| void | documentFullyLoaded (readerWidget *this_widget) |
Public Member Functions | |
| bool | askToClose (void) |
| KUrl | document () const |
| QString | documentTitle () const |
| readerWidget * | duplicate () |
| void | goTo (QString reference) |
| QString | humanReadableDocumentFileName () const |
| bool | isFullyLoaded () const |
| readerWidget (QWidget *parent, KUrl url, bool *ok=0) | |
| void | reload () |
| void | showFullScreen () |
| void | showPresentation () |
| virtual | ~readerWidget () |
Protected Attributes | |
| Ui_readerWidget * | dlg |
Constructor & Destructor Documentation
| UNNAMED_READER::readerWidget::readerWidget | ( | QWidget * | parent, | |
| KUrl | url, | |||
| bool * | ok = 0 | |||
| ) |
Default Constructor.
This method constructs a new reader widget that will display the document named in the URL. If the document cannot be opened, a dialog opens, and the variable ok will be set to 'false'.
- parent the usual parent widget, or 0
- url a URL pointing to the document that this widget will
- show. If the URL has a reference part, the constructor will use the method goTo() to make sure that the document is opened at the place that the reference points to.
- ok either zero, or a pointer to a bool which is set to
- 'true' on success, and 'false' otherwise.
Definition at line 34 of file readerWidget.cpp.
| UNNAMED_READER::readerWidget::~readerWidget | ( | ) | [virtual] |
Member Function Documentation
| bool UNNAMED_READER::readerWidget::askToClose | ( | void | ) |
Schedules deletion of the widget.
If the document has been modified, ask the user if the document can be closed. If ok, schedule this widget for deletion, using QObject::deleteLater().
- Returns:
- 'true' if the widget was scheduled for deletion, 'fals' if it is not going to be deleted
Definition at line 92 of file readerWidget.cpp.
| KUrl UNNAMED_READER::readerWidget::document | ( | ) | const [inline] |
Returns a URL pointing to document shown in this widget.
Definition at line 85 of file readerWidget.h.
| void UNNAMED_READER::readerWidget::documentFullyLoaded | ( | readerWidget * | this_widget | ) | [signal] |
This signal is emitted when the document is fully loaded, and all information is available.
| QString UNNAMED_READER::readerWidget::documentTitle | ( | ) | const |
Returns the title of the document.
Returns the title of the document, or an empty string if the document does not have a title, or if the title is unknown.
Definition at line 69 of file readerWidget.cpp.
| readerWidget * UNNAMED_READER::readerWidget::duplicate | ( | ) |
Produces a clone of the current readerWidget.
Returns 0 if a copy could not be made
Definition at line 143 of file readerWidget.cpp.
| void UNNAMED_READER::readerWidget::goTo | ( | QString | reference | ) |
Moves the view to show the reference.
Moves the viewport, so that the reference is visible, and marks it visually. If the string cannot be parsed, or if the reference does not exist, an error dialog will be shown to the user. If the document cannot be rendered yet, the reference is shown as soon as rendering is possible.
- reference a string of type "page:number", "anchor:name" or
- "src:number:filename", as explained in the user documentation, section "The reference part of the URL". If the reference is empty, the method will return quietly.
Definition at line 103 of file readerWidget.cpp.
| QString UNNAMED_READER::readerWidget::humanReadableDocumentFileName | ( | ) | const |
Returns the fileName of the document in human-readable form.
Returns the file name of the document, the full URL if there is no filename, or the words "temporary file", whatever is more appropriate
Definition at line 82 of file readerWidget.cpp.
| bool UNNAMED_READER::readerWidget::isFullyLoaded | ( | ) | const [inline] |
| void UNNAMED_READER::readerWidget::reload | ( | ) |
| void UNNAMED_READER::readerWidget::showFullScreen | ( | ) |
Open a full screen view of the document.
This method opens a full screen view widget of the document. If there is already one full screen view, nothing happens.
Reimplemented from QWidget.
Definition at line 129 of file readerWidget.cpp.
| void UNNAMED_READER::readerWidget::showPresentation | ( | ) |
Open a presentation view of the document.
This method opens a full screen view widget of the document. If there is already one full screen view, nothing happens.
Definition at line 136 of file readerWidget.cpp.
Member Data Documentation
Ui_readerWidget* UNNAMED_READER::readerWidget::dlg [protected] |
Pointer to the class created by the Qt designer this sets up the GUI.
Definition at line 175 of file readerWidget.h.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference