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

okular

Okular::DocumentObserver

Okular::DocumentObserver Class Reference

#include <observer.h>

Inheritance diagram for Okular::DocumentObserver:

Inheritance graph
[legend]

List of all members.


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 52 of file observer.h.


Public Types

enum  ChangedFlags {
  Pixmap = 1, Bookmark = 2, Highlights = 4, TextSelection = 8,
  Annotations = 16
}
enum  SetupFlags { DocumentChanged = 1, NewLayoutForPages = 2 }

Public Member Functions

 DocumentObserver ()
virtual ~DocumentObserver ()
virtual uint observerId () const =0
virtual void notifySetup (const QVector< Okular::Page * > &pages, int setupFlags)
virtual void notifyViewportChanged (bool smoothMove)
virtual void notifyPageChanged (int page, int flags)
virtual void notifyContentsCleared (int flags)
virtual void notifyVisibleRectsChanged ()
virtual void notifyZoom (int factor)
virtual bool canUnloadPixmap (int page) const

Member Enumeration Documentation

enum Okular::DocumentObserver::ChangedFlags

Flags that can be sent from the document to all observers to inform them about the type of object that has been changed.

Enumerator:
Pixmap  Pixmaps has been changed.
Bookmark  Bookmarks has been changed.
Highlights  Highlighting information has been changed.
TextSelection  Text selection has been changed.
Annotations  Annotations has been changed.

Definition at line 70 of file observer.h.

enum Okular::DocumentObserver::SetupFlags

..

Enumerator:
DocumentChanged  The document is a new document.
NewLayoutForPages  All the pages have.

Definition at line 81 of file observer.h.


Constructor & Destructor Documentation

DocumentObserver::DocumentObserver (  ) 

Definition at line 15 of file observer.cpp.

DocumentObserver::~DocumentObserver (  )  [virtual]

Destroys the document observer.

Definition at line 19 of file observer.cpp.


Member Function Documentation

virtual uint Okular::DocumentObserver::observerId (  )  const [pure virtual]

Must return an unique ID for each observer (used for notifications).

Implemented in Part.

void DocumentObserver::notifySetup ( const QVector< Okular::Page * > &  pages,
int  setupFlags 
) [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

Reimplemented in Part.

Definition at line 23 of file observer.cpp.

void DocumentObserver::notifyViewportChanged ( bool  smoothMove  )  [virtual]

This method is called whenever the viewport has been changed.

Parameters:
smoothMove If true, the move shall be animated.

Reimplemented in Part.

Definition at line 27 of file observer.cpp.

void DocumentObserver::notifyPageChanged ( int  page,
int  flags 
) [virtual]

This method is called whenever the content on page described by the passed flags has been changed.

Reimplemented in Part.

Definition at line 31 of file observer.cpp.

void DocumentObserver::notifyContentsCleared ( int  flags  )  [virtual]

This method is called whenever the content described by the passed flags has been cleared.

Definition at line 35 of file observer.cpp.

void DocumentObserver::notifyVisibleRectsChanged (  )  [virtual]

This method is called whenever the visible rects have been changed.

Definition at line 39 of file observer.cpp.

void DocumentObserver::notifyZoom ( int  factor  )  [virtual]

This method is called whenever the zoom of the document has been changed.

Definition at line 43 of file observer.cpp.

bool DocumentObserver::canUnloadPixmap ( int  page  )  const [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 47 of file observer.cpp.


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

okular

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

kdegraphics

Skip menu "kdegraphics"
  • okular
Generated for kdegraphics by doxygen 1.5.4
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