]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/GraphicsCacheItem.h
Fix bug in replacement of "$$s/" in converter commands, introduced in 8b66f9ce.
[lyx.git] / src / graphics / GraphicsCacheItem.h
index c95d45c05f56e2bf4868937cac0f987789bf4c43..289b827a4fff15f5049d232e6b278a2d2bbbaa32 100644 (file)
@@ -9,11 +9,11 @@
  *
  * Full author contact details are available in file CREDITS.
  *
- * The graphics cache is a container of lyx::graphics::CacheItems.
- * Each lyx::graphics::CacheItem, defined here represents a separate image file.
+ * 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() == lyx::graphics::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 lyx::graphics::Converter and
- * on the lyx::graphics::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
 
 #include "GraphicsTypes.h"
-#include "support/std_string.h"
 
-#include <boost/utility.hpp>
-#include <boost/scoped_ptr.hpp>
-#include <boost/signals/signal0.hpp>
+#include <boost/signals2.hpp>
 
-class InsetGraphics;
 
 namespace lyx {
+
+namespace support { class FileName; }
+
 namespace graphics {
 
 class Image;
 class Converter;
 
-/// A lyx::graphics::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);
+       /// 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;
@@ -65,7 +66,7 @@ public:
        void startMonitoring() const;
        ///
        bool monitoring() const;
-       /** Returns the check sum of filename() so that, for example, you can
+       /** Returns the check checksum of filename() so that, for example, you can
         *  ascertain whether to output a new PostScript version of the file
         *  for a LaTeX run.
         */
@@ -84,16 +85,20 @@ public:
        /** Connect and you'll be informed when the loading status of the image
         *  changes.
         */
-       typedef boost::signal0<void>::slot_type slot_type;
+       typedef boost::signals2::signal<void()> sig_type;
+       typedef sig_type::slot_type slot_type;
        ///
-       boost::signals::connection connect(slot_type const &) const;
+       boost::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 graphics