- /// d-tor, frees the image structures.
- ~GraphicsCacheItem();
-
- /// Get the height of the image. Returns -1 on error.
- int getHeight() const { return height_; }
-
- /// Get the width of the image. Returns -1 on error.
- int getWidth() const { return width_; }
-
- /// Return a pixmap that can be displayed on X server.
- Pixmap getImage() const { return pixmap_; }
-
- enum ImageStatus {
- Loading = 1,
- ErrorConverting,
- ErrorReading,
- Loaded
- };
-
- /// Is the pixmap ready for display?
- ImageStatus getImageStatus() const { return imageStatus_; }
-
- /// Get a notification when the image conversion is done.
- /// used by an internal callback mechanism.
- void imageConverted(int retval);
-
- /// A signal objects can connect to in order to know when the image
- /// has arrived.
- Signal0<void> imageDone;
+ ///
+ CacheItem(support::FileName const & file, support::FileName const & doc_file);
+ /// Needed for the pimpl
+ ~CacheItem();
+
+ ///
+ support::FileName const & filename() const;
+
+ /// Try to load a display format.
+ bool tryDisplayFormat() const;
+
+ /// It's in the cache. Now start the loading process.
+ void startLoading() const;
+
+ /** Monitor any changes to the file.
+ * There is no point monitoring the file before startLoading() is
+ * invoked.
+ */
+ void startMonitoring() const;
+ ///
+ bool monitoring() const;
+ /// perform a modification check asynchronously
+ void checkModifiedAsync() const;
+
+ /** Get the image associated with filename().
+ * If the image is not yet loaded, returns 0.
+ * This routine returns a pointer to const; if you want to modify it,
+ * create a copy and modify that.
+ */
+ Image const * image() const;
+
+ /// How far have we got in loading the image?
+ ImageStatus status() const;
+
+ /** Connect and you'll be informed when the loading status of the image
+ * changes.
+ */
+ typedef signals2::signal<void()>::slot_type slot_type;
+ ///
+ signals2::connection connect(slot_type const &) const;
+