]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetInclude.h
Check character encodability with pass-thru in command insets
[lyx.git] / src / insets / InsetInclude.h
old mode 100644 (file)
new mode 100755 (executable)
index 3e28346..69c778e
@@ -17,7 +17,8 @@
 
 #include "RenderButton.h"
 
-#include <boost/scoped_ptr.hpp>
+#include "support/unique_ptr.h"
+
 
 namespace lyx {
 
@@ -35,6 +36,10 @@ namespace support {
 
 /// for including tex/lyx files
 class InsetInclude : public InsetCommand {
+       // Disable assignment operator, since it is not used, and cannot be
+       // implemented consistently with the copy constructor, because
+       // include_label is const.
+       InsetInclude & operator=(InsetInclude const &);
 public:
        ///
        InsetInclude(Buffer * buf, InsetCommandParams const &);
@@ -54,16 +59,10 @@ public:
         */
        void updateBibfilesCache();
 
-       /** Return the cache with all bibfiles in use of the child buffer
-        *  (including bibfiles of grandchild documents).
-        *  Return an empty vector if the child doc is not loaded.
-        *  \param buffer the Buffer containing this inset.
-        */
-       support::FileNameList const &
-               getBibfilesCache() const;
-
        ///
        void updateCommand();
+       ///
+       void write(std::ostream &) const;
 
        /// \name Public functions inherited from Inset class
        //@{
@@ -85,7 +84,7 @@ public:
         *  \param keys the list of bibkeys in the child buffer.
         *  \param it not used here
         */
-       void collectBibKeys(InsetIterator const &) const;
+       void collectBibKeys(InsetIterator const &, support::FileNameList &) const;
        ///
        bool hasSettings() const { return true; }
        ///
@@ -102,7 +101,8 @@ public:
        ///
        void addPreview(DocIterator const &, graphics::PreviewLoader &) const;
        ///
-       void addToToc(DocIterator const & di, bool output_active) const;
+       void addToToc(DocIterator const & di, bool output_active,
+                                 UpdateType utype, TocBackend & backend) const;
        ///
        void updateBuffer(ParIterator const &, UpdateType);
        ///
@@ -117,6 +117,9 @@ public:
        static std::string defaultCommand() { return "include"; }
        ///
        static bool isCompatibleCommand(std::string const & s);
+       ///
+       bool needsCProtection(bool const maintext = false,
+                             bool const fragile = false) const;
        //@}
 
 protected:
@@ -134,6 +137,8 @@ private:
        void editIncluded(std::string const & file);
        ///
        bool isChildIncluded() const;
+       /// check whether the included file exist
+       bool includedFileExist() const;
 
        /// \name Private functions inherited from Inset class
        //@{
@@ -151,15 +156,15 @@ private:
        void setParams(InsetCommandParams const & params);
        /// get the text displayed on the button
        docstring screenLabel() const;
-       //@}    
-       
+       //@}
+
        /// holds the entity name that defines the file location (SGML)
        docstring const include_label;
 
        /// The pointer never changes although *preview_'s contents may.
-       boost::scoped_ptr<RenderMonitoredPreview> const preview_;
+       unique_ptr<RenderMonitoredPreview> const preview_;
 
-       /// 
+       ///
        mutable bool failedtoload_;
        /// cache
        mutable bool set_label_;
@@ -167,6 +172,7 @@ private:
        mutable docstring listings_label_;
        InsetLabel * label_;
        mutable Buffer * child_buffer_;
+       mutable bool file_exist_;
 };