]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetinclude.h
clear()->erase() ; lots of using directives for cxx
[lyx.git] / src / insets / insetinclude.h
index c632dea04288f8eb55edbc08a80aaadd6c01ef12..e713fb8f02d0fa6cd8fb57d29c01e089740fe2e5 100644 (file)
@@ -4,12 +4,12 @@
  *
  *           LyX, The Document Processor
  *      
- *         Copyright (C) 1997 LyX Team (this file was created this year)
+ *         Copyright 1997 LyX Team (this file was created this year)
  * 
- *======================================================*/
+ * ====================================================== */
 
-#ifndef _INSET_INCLUDE_H
-#define _INSET_INCLUDE_H
+#ifndef INSET_INCLUDE_H
+#define INSET_INCLUDE_H
 
 #ifdef __GNUG__
 #pragma interface
@@ -17,7 +17,7 @@
 
 #include "insetcommand.h"
 #include "buffer.h"
-#include "filetools.h"
+#include "support/filetools.h"
 
 struct LaTeXFeatures;
 
@@ -33,69 +33,62 @@ public:
                flag = InsetInclude::INCLUDE;
        }
        ///
-       InsetInclude(LString const &,  Buffer*);
+       InsetInclude(string const &,  Buffer *);
        ///
        ~InsetInclude();
         ///
-        Inset* Clone();
+        Inset * Clone() const;
        ///
        Inset::Code LyxCode() const { return Inset::INCLUDE_CODE; }
        /// This is 1 if the childs have labels, 0 otherwise
        int GetNumberOfLabels() const;
        /// This returns the list of labels on the child buffer
-       LString getLabel(int) const;
+       string getLabel(int) const;
        /// This returns the list of bibkeys on the child buffer
-       LString getKeys() const;
+       string getKeys(char delim) const;
        ///
-       void Edit(int, int);
+       void Edit(BufferView *, int x, int y, unsigned int button);
        ///
-       unsigned char Editable() const
+       EDITABLE Editable() const
        {
-               return 1;
+               return IS_EDITABLE;
        }
         /// With lyx3 we won't overload these 3 methods
-        void Write(FILE *);
+        void Write(std::ostream &) const;
         ///
        void Read(LyXLex &);
        /// 
-       int Latex(FILE *file, signed char fragile);
-       ///
-       int Latex(LString &file, signed char fragile);
-       
+       int Latex(std::ostream &, bool fragile, bool free_spc) const;
        ///
        void Validate(LaTeXFeatures &) const;
        
         /// Input inserts anything inside a paragraph, Display can give some visual feedback 
-       bool Display() const { return !(isInput()); }
+       bool display() const;
        ///
-       LString getScreenLabel() const;
+       string getScreenLabel() const;
        ///
-       void setContents(LString const & c) {
-               InsetCommand::setContents(c);
-               filename = MakeAbsPath(contents, 
-                                      OnlyPath(getMasterFilename())); 
-       }
+       void setContents(string const & c);
         ///
-        void setFilename(LString const & n) { setContents(n); }
+        void setFilename(string const & n) { setContents(n); }
         ///
-        LString getMasterFilename() const { return master->getFileName(); }
+        string getMasterFilename() const { return master->fileName(); }
         ///
-        LString getFileName() const { 
+        string getFileName() const { 
                return filename;
        }
         ///  In "input" mode uses \input instead of \include.
-       bool isInput() const { return (bool)(flag == InsetInclude::INPUT); }
+       bool isInput() const { return flag == InsetInclude::INPUT; }
         ///  If this is true, the child file shouldn't be loaded by lyx
-       bool isNoLoad() const { return (bool)(noload); }
+       bool isNoLoad() const { return noload; }
 
         /**  A verbatim file shouldn't be loaded by LyX
         *  No need to generate LaTeX code of a verbatim file
         */ 
        bool isVerb() const;
        ///
-       bool isVerbVisibleSpace() const { return (bool)(flag==InsetInclude::VERBAST);}
+       bool isVerbVisibleSpace() const { return flag == InsetInclude::VERBAST;}
         ///  
-       bool isInclude() const { return (bool)(flag == InsetInclude::INCLUDE);}
+       bool isInclude() const { return flag == InsetInclude::INCLUDE;}
         ///  
        void setInput();
         ///  
@@ -112,7 +105,7 @@ private:
         ///
         enum Include_Flags {
                ///
-               INCLUDE=0,
+               INCLUDE= 0,
                ///
                VERB = 1,
                ///
@@ -126,16 +119,16 @@ private:
        ///
         int flag;
         ///
-       Buffer *master;
+       Buffer * master;
        ///
-       LString filename;
+       string filename;
 };
 
 
 inline 
 bool InsetInclude::isVerb() const
 {
-    return (bool)(flag==InsetInclude::VERB || flag==InsetInclude::VERBAST)
+       return flag == InsetInclude::VERB || flag == InsetInclude::VERBAST
 }
 
 
@@ -179,10 +172,10 @@ void InsetInclude::setVerb()
 inline
 void InsetInclude::setVisibleSpace(bool b)
 {
-        if (b && flag==InsetInclude::VERB) {
+        if (b && flag == InsetInclude::VERB) {
            setCmdName("verbatiminput*");
            flag = InsetInclude::VERBAST;
-       } else if (!b && flag==InsetInclude::VERBAST) {
+       } else if (!b && flag == InsetInclude::VERBAST) {
            setCmdName("verbatiminput");
            flag = InsetInclude::VERB;
        }