]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/GraphicsCacheItem.h
Remove obsolete (and false) comment.
[lyx.git] / src / graphics / GraphicsCacheItem.h
index 02dd95897e8d035600e82cdf50c9c82d7aac9fd7..6f7f968bc6a44086af831849470043faa4053c0e 100644 (file)
@@ -1,17 +1,19 @@
 // -*- C++ -*-
-/*
+/**
  * \file GraphicsCacheItem.h
- * Copyright 2002 the LyX Team
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author Baruch Even <baruch.even@writeme.com>
- * \author Angus Leeming <leeming@lyx.org>
+ * \author Baruch Even
+ * \author Angus Leeming
  *
- * The graphics cache is a container of grfx::CacheItems.
- * Each grfx::CacheItem, definedhere represents a separate image file.
+ * Full author contact details are available in file CREDITS.
+ *
+ * The graphics cache is a container of graphics::CacheItems.
+ * Each graphics::CacheItem, defined here represents a separate image file.
  *
  * The routines here can be used to load the graphics file into memory at
- * which point (status() == grfx::Loaded).
+ * which point (status() == graphics::Loaded).
  * The user is then free to access image() in order to copy it and to then
  * transform the copy (rotate, scale, clip) and to generate the pixmap.
  *
  * file conversion to a loadable format;
  * file loading.
  *
- * Whether you get that, of course, depends on grfx::Converter and on the
- * grfx::Image-derived image class.
+ * Whether you get that, of course, depends on graphics::Converter and
+ * on the graphics::Image-derived image class.
  */
 
 #ifndef GRAPHICSCACHEITEM_H
 #define GRAPHICSCACHEITEM_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
-
 #include "GraphicsTypes.h"
-#include "LString.h"
 
-#include <boost/utility.hpp>
-#include <boost/scoped_ptr.hpp>
-#include <boost/signals/signal0.hpp>
+#include "support/signals.h"
+
 
-class InsetGraphics;
+namespace lyx {
 
-namespace grfx {
+namespace support { class FileName; }
+
+namespace graphics {
 
 class Image;
 class Converter;
 
-/// A grfx::Cache item holder.
-class CacheItem : boost::noncopyable {
+/// A graphics::Cache item holder.
+class CacheItem {
 public:
        ///
-       CacheItem(string const & file);
-
-       /// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy.
+       CacheItem(support::FileName const & file, support::FileName const & doc_file);
+       /// Needed for the pimpl
        ~CacheItem();
 
        ///
-       string const & filename() const;
+       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;
 
-       /** Get the image associated with filename_.
+       /** 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.
@@ -72,18 +82,22 @@ public:
        /** Connect and you'll be informed when the loading status of the image
         *  changes.
         */
-       typedef boost::signal0<void>::slot_type slot_type;
+       typedef signals2::signal<void()>::slot_type slot_type;
        ///
-       boost::signals::connection connect(slot_type const &) const;
+       signals2::connection connect(slot_type const &) const;
 
 private:
+       /// noncopyable
+       CacheItem(CacheItem const &);
+       void operator=(CacheItem const &);
+
        /// Use the Pimpl idiom to hide the internals.
        class Impl;
-
        /// The pointer never changes although *pimpl_'s contents may.
-       boost::scoped_ptr<Impl> const pimpl_;
+       Impl * const pimpl_;
 };
 
-} // namespace grfx
+} // namespace graphics
+} // namespace lyx
 
 #endif // GRAPHICSCACHEITEM_H