]> git.lyx.org Git - lyx.git/blobdiff - src/buffer.h
Dekels tabular/textinset patches
[lyx.git] / src / buffer.h
index a81c0efaaa51108d2c8da4cc7c1e2a0c3a4a343a..3a6465b3b1c3f8d3d9dcd4405be075ddf29130dc 100644 (file)
@@ -38,6 +38,7 @@ class LyXRC;
 class TeXErrors;
 class LaTeXFeatures;
 class auto_mem_buffer;
+class Language;
 
 ///
 struct DEPCLEAN {
@@ -165,6 +166,11 @@ public:
        void latexParagraphs(std::ostream & os, LyXParagraph * par,
                             LyXParagraph * endpar, TexRow & texrow) const;
 
+        ///
+       void SimpleDocBookOnePar(std::ostream &, string & extra,
+                                LyXParagraph * par, int & desc_on,
+                                int depth) const ;
+
        ///
        int runChktex();
 
@@ -176,7 +182,7 @@ public:
                             bool nice, bool only_body = false);
 
        /// returns the main language for the buffer (document)
-       string const GetLanguage() const {
+       Language const * GetLanguage() const {
                return params.language;
        }
        
@@ -235,7 +241,7 @@ public:
        string const getLatexName(bool no_path = true) const;
 
        /// Change name of buffer. Updates "read-only" flag.
-       void fileName(string const & newfile);
+       void setFileName(string const & newfile);
 
        /// Name of the document's parent
        void setParentName(string const &);
@@ -365,10 +371,6 @@ private:
         ///
        void SimpleLinuxDocOnePar(std::ostream & os, LyXParagraph * par,
                                  int desc_on, int depth);
-        ///
-       void SimpleDocBookOnePar(std::ostream &, string & extra,
-                                LyXParagraph * par, int & desc_on,
-                                int depth);
 
        /// LinuxDoc.
        void push_tag(std::ostream & os, string const & tag,
@@ -412,6 +414,13 @@ public:
        ///
        class inset_iterator {
        public:
+               typedef std::input_iterator_tag iterator_category;
+               typedef Inset value_type;
+               typedef ptrdiff_t difference_type;
+               typedef Inset * pointer;
+               typedef Inset & reference;
+               
+               
                ///
                inset_iterator() : par(0) /*, it(0)*/ {}
                //
@@ -422,7 +431,7 @@ public:
                inset_iterator(LyXParagraph * paragraph,
                               LyXParagraph::size_type pos);
                ///
-               inset_iterator & operator++() {
+               inset_iterator & operator++() { // prefix ++
                        if (par) {
                                ++it;
                                if (it == par->inset_iterator_end()) {
@@ -433,11 +442,24 @@ public:
                        return *this;
                }
                ///
-               Inset * operator*() {return *it; }
+               inset_iterator operator++(int) { // postfix ++
+                       inset_iterator tmp(par, it.getPos());
+                       if (par) {
+                               ++it;
+                               if (it == par->inset_iterator_end()) {
+                                       par = par->next;
+                                       SetParagraph();
+                               }
+                       }
+                       return tmp;
+               }
+               ///
+               Inset * operator*() { return *it; }
+               
                ///
                LyXParagraph * getPar() { return par; }
                ///
-               LyXParagraph::size_type getPos() {return it.getPos(); }
+               LyXParagraph::size_type getPos() const { return it.getPos(); }
                ///
                friend
                bool operator==(inset_iterator const & iter1,