Okular::DocumentObserver
#include <observer.h>
Public Types | |
enum | ChangedFlags { Pixmap = 1 , Bookmark = 2 , Highlights = 4 , TextSelection = 8 , Annotations = 16 , BoundingBox = 32 } |
enum | SetupFlags { DocumentChanged = 1 , NewLayoutForPages = 2 , UrlChanged = 4 } |
Public Member Functions | |
DocumentObserver (const DocumentObserver &)=delete | |
virtual | ~DocumentObserver () |
virtual bool | canUnloadPixmap (int page) const |
virtual void | notifyContentsCleared (int flags) |
virtual void | notifyCurrentPageChanged (int previous, int current) |
virtual void | notifyPageChanged (int page, int flags) |
virtual void | notifySetup (const QVector< Okular::Page * > &pages, int setupFlags) |
virtual void | notifyViewportChanged (bool smoothMove) |
virtual void | notifyVisibleRectsChanged () |
virtual void | notifyZoom (int factor) |
DocumentObserver & | operator= (const DocumentObserver &)=delete |
Detailed Description
Base class for objects being notified when something changes.
Inherit this class and call Document->addObserver( yourClass ) to get notified of asynchronous events (new pixmap generated, or changed, etc..).
Definition at line 28 of file observer.h.
Member Enumeration Documentation
◆ ChangedFlags
Flags that can be sent from the document to all observers to inform them about the type of object that has been changed.
Definition at line 44 of file observer.h.
◆ SetupFlags
...
Enumerator | |
---|---|
DocumentChanged | The document is a new document. |
NewLayoutForPages | All the pages have. |
UrlChanged | The URL has changed.
|
Definition at line 56 of file observer.h.
Constructor & Destructor Documentation
◆ DocumentObserver()
DocumentObserver::DocumentObserver | ( | ) |
Definition at line 12 of file observer.cpp.
◆ ~DocumentObserver()
|
virtual |
Destroys the document observer.
Definition at line 17 of file observer.cpp.
Member Function Documentation
◆ canUnloadPixmap()
|
virtual |
Returns whether the observer agrees that all pixmaps for the given page
can be unloaded to improve memory usage.
Returns true per default.
Definition at line 45 of file observer.cpp.
◆ notifyContentsCleared()
|
virtual |
This method is called whenever the content described by the passed flags
has been cleared.
Definition at line 33 of file observer.cpp.
◆ notifyCurrentPageChanged()
|
virtual |
This method is called after the current page of the document has been entered.
- Parameters
-
previous The number of the previous page (is -1
for the initial page change).current The number of the current page.
- Since
- 0.16 (KDE 4.10)
Definition at line 50 of file observer.cpp.
◆ notifyPageChanged()
|
virtual |
This method is called whenever the content on page
described by the passed flags
has been changed.
Definition at line 29 of file observer.cpp.
◆ notifySetup()
|
virtual |
This method is called whenever the document is initialized or reconstructed.
- Parameters
-
pages The vector of pages of the document. setupFlags the flags with the information about the setup
Definition at line 21 of file observer.cpp.
◆ notifyViewportChanged()
|
virtual |
This method is called whenever the viewport has been changed.
- Parameters
-
smoothMove If true, the move shall be animated.
Definition at line 25 of file observer.cpp.
◆ notifyVisibleRectsChanged()
|
virtual |
This method is called whenever the visible rects have been changed.
Definition at line 37 of file observer.cpp.
◆ notifyZoom()
|
virtual |
This method is called whenever the zoom of the document has been changed.
Definition at line 41 of file observer.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:14:50 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.