diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 47d455dd55be855e4cc691c32f687f723d9247ee (patch) | |
tree | 52e236aaa2576bdb3840ebede26619692fed6d7d /kpdf/core/observer.h | |
download | tdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.tar.gz tdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kpdf/core/observer.h')
-rw-r--r-- | kpdf/core/observer.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/kpdf/core/observer.h b/kpdf/core/observer.h new file mode 100644 index 00000000..28f07bf5 --- /dev/null +++ b/kpdf/core/observer.h @@ -0,0 +1,58 @@ +/*************************************************************************** + * Copyright (C) 2005 by Enrico Ros <[email protected]> * + * Copyright (C) 2005 by Albert Astals Cid <[email protected]> * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ + +#ifndef _KPDF_DOCUMENTOBSERVER_H_ +#define _KPDF_DOCUMENTOBSERVER_H_ + +#include <qvaluevector.h> +#include <qrect.h> + +/** IDs for observers. Globally defined here. **/ +#define PRESENTATION_ID 1 +#define PART_ID 2 +#define PAGEVIEW_ID 3 +#define THUMBNAILS_ID 4 +#define TOC_ID 5 +#define MINIBAR_ID 6 + +/** PRIORITIES for requests. Globally defined here. **/ +#define PAGEVIEW_PRIO 1 +#define PAGEVIEW_PRELOAD_PRIO 4 +#define THUMBNAILS_PRIO 2 +#define THUMBNAILS_PRELOAD_PRIO 5 +#define PRESENTATION_PRIO 0 +#define PRESENTATION_PRELOAD_PRIO 3 + +class KPDFPage; + +/** + * @short Base class for objects being notified when something changes. + * + * Inherit this class and call KPDFDocument->addObserver( yourClass ) to get + * notified of asyncronous events (new pixmap generated, or changed, etc..). + */ +class DocumentObserver +{ + public: + // you must give each observer a unique ID (used for notifications) + virtual uint observerId() const = 0; + + // commands from the Document to all observers + enum ChangedFlags { Pixmap = 1, Bookmark = 2, Highlights = 4 }; + virtual void notifySetup( const QValueVector< KPDFPage * > & /*pages*/, bool /*documentChanged*/ ) {}; + virtual void notifyViewportChanged( bool /*smoothMove*/ ) {}; + virtual void notifyPageChanged( int /*pageNumber*/, int /*changedFlags*/ ) {}; + virtual void notifyContentsCleared( int /*changedFlags*/ ) {}; + + // queries to observers + virtual bool canUnloadPixmap( int /*pageNum*/ ) { return true; } +}; + +#endif |