class EmbeddedFile : public support::DocFileName
{
public:
+ EmbeddedFile() {};
+
EmbeddedFile(std::string const & file, std::string const & inzip_name,
bool embedded, Inset const * inset);
/// filename in the zip file, usually the relative path
std::string inzipName() const { return inzip_name_; }
+ void setInzipName(std::string name) { inzip_name_ = name; }
/// embedded file, equals to temppath()/inzipName()
std::string embeddedFile(Buffer const * buf) const;
/// embeddedFile() or absFilename() depending on embedding status
bool extract(Buffer const * buf) const;
/// update embedded file from external file, does not change embedding status
bool updateFromExternalFile(Buffer const * buf) const;
+ ///
+ /// After the embedding status is changed, update all insets related
+ /// to this file item.
+ /// Because inset pointers may not be up to date, EmbeddedFiles::update()
+ /// would better be called before this function is called.
+ void updateInsets(Buffer const * buf) const;
private:
/// filename in zip file
* \param inset Inset pointer
* \param inzipName suggested inzipname
*/
- void registerFile(std::string const & filename, bool embed = false,
+ EmbeddedFile & registerFile(std::string const & filename, bool embed = false,
Inset const * inset = 0,
std::string const & inzipName = std::string());
/// update all files from external, used when enable embedding
bool updateFromExternalFile() const;
///
- bool readManifest(Lexer & lex, ErrorList & errorList);
- void writeManifest(std::ostream & os) const;
+ /// update all insets to use embedded files when embedding status is changed
+ void updateInsets() const;
private:
/// get a unique inzip name, a suggestion can be given.
std::string const getInzipName(std::string const & name, std::string const & inzipName);