+ /// whether or not embedding is enabled in the current buffer
+ /**
+ * An embedded file needs to know the temp path of a buffer to know
+ * where its embedded copy is. This has to be stored within EmbeddedFile
+ * because this class is often used when Buffer is unavailable. However,
+ * when an embedded file is copied to another buffer, temp_path_ has
+ * to be updated and file copying may be needed.
+ */
+ bool enabled() const { return !temp_path_.empty(); }
+ /// enable embedding of this file
+ void enable(bool flag, Buffer const * buf, bool updateFile);
+
+ /// extract file, does not change embedding status
+ bool extract() const;
+ /// update embedded file from external file, does not change embedding status
+ bool updateFromExternalFile() const;
+ /// copy an embedded file to another buffer
+ EmbeddedFile copyTo(Buffer const * buf);
+ ///
+ /// After the embedding status is changed, update all insets related
+ /// to this file item. For example, a graphic inset may need to monitor
+ /// embedded file instead of external file.
+ void updateInsets() const;
+
+ /// Check readability of availableFile
+ bool isReadableFile() const;
+ /// Calculate checksum of availableFile
+ unsigned long checksum() const;
+
+ // calculate inzip_name_ from filename
+ std::string calcInzipName(std::string const & buffer_path);
+ // move an embedded disk file with an existing inzip_name_ to
+ // a calculated inzip_name_, if they differ.
+ void syncInzipFile(std::string const & buffer_path);
+