]> git.lyx.org Git - lyx.git/blobdiff - src/EmbeddedFiles.h
Allow using \binom without amsmath and add support for \brace and \brack
[lyx.git] / src / EmbeddedFiles.h
index 5a8df6985393719aabe14ee989497689731b6cd7..e5136cd0d06f931f132748d8d51b54bafb877391 100644 (file)
@@ -94,6 +94,7 @@ class ErrorList;
 class EmbeddedFile : public support::DocFileName
 {
 public:
+       ///
        EmbeddedFile(std::string const & file = std::string(),
                std::string const & buffer_path = std::string());
        
@@ -142,7 +143,7 @@ public:
        /// set embedding status. 
        void setEmbed(bool embed);
 
-       /// whether or not embedding is enabled in the current buffer
+       /// whether or not embedding is enabled for the current file
        /**
         * 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
@@ -150,16 +151,16 @@ public:
         * 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(); }
+       bool isEnabled() const { return !temp_path_.empty(); }
        /// enable embedding of this file
-       void enable(bool flag, Buffer const * buf, bool updateFile);
+       void enable(bool enabled, 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);
+       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
@@ -176,7 +177,6 @@ public:
        // 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);
-       
 private:
        /// filename in zip file
        std::string inzip_name_;
@@ -201,21 +201,23 @@ class EmbeddedFileList : public std::vector<EmbeddedFile> {
 public:
        /// set buffer params embedded flag. Files will be updated or extracted
        /// if such an operation fails, enable will fail.
-       void enable(bool flag, Buffer & buffer, bool updateFile);
+       void enable(bool enabled, Buffer & buffer, bool updateFile);
 
        /// add a file item.
-       /* \param file Embedded file to add
-        * \param inset Inset pointer
+       /** \param file Embedded file to add
+        *  \param inset Inset pointer
         */
        void registerFile(EmbeddedFile const & file, Inset const * inset,
                Buffer const & buffer);
+       /// returns a pointer to the Embedded file representing this object,
+       /// or null if not found. The filename should be absolute.
+       const_iterator findFile(std::string const & filename) const;
+       iterator findFile(std::string const & filename);
 
        /// validate embedded fies after a file is read.
        void validate(Buffer const & buffer);
-
        /// scan the buffer and get a list of EmbeddedFile
        void update(Buffer const & buffer);
-
        /// write a zip file
        bool writeFile(support::DocFileName const & filename, Buffer const & buffer);
 };