]> git.lyx.org Git - lyx.git/blobdiff - src/layout.h
Fix working of the spellchecker dialog with ispell when there are no
[lyx.git] / src / layout.h
index bc9dd8c15382919b25fa2a3f431e3720cf6bcfc3..4b66dbbfcf02c97039c816a8cea0cfad751ba9c3 100644 (file)
@@ -5,7 +5,7 @@
  *           LyX, The Document Processor
  *      
  *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2000 The LyX Team.
+ *           Copyright 1995-2001 The LyX Team.
  *
  * ====================================================== */
 
 #pragma interface
 #endif
 
-#include "lyxlex.h"
+class LyXLeX;
 #include "lyxfont.h"
 #include "Spacing.h"
-
+#include <boost/utility.hpp>
 
 /// Reads the style files
 extern void LyXSetStyle();
 
 ///
-enum { // no good name for this
+enum no_good_name_for_this {
        ///
         LYX_ENVIRONMENT_DEFAULT = 97,
        ///
        LYX_LAYOUT_DEFAULT = 99
 };
+
+
 // Could this cause confusion that both DUMMY_LAYOUT and  LAYOUT_DEFAULT has
 // the same value? (Lgb)
 ///
 #define LYX_DUMMY_LAYOUT 99
 
+
 /// The different output types
 enum OutputType {
         ///
@@ -83,7 +86,7 @@ enum LyXAlignment {
         LYX_ALIGN_SPECIAL = 32
 };
 
-
+///
 inline
 void operator|=(LyXAlignment & la1, LyXAlignment la2) {
        la1 = static_cast<LyXAlignment>(la1 | la2);
@@ -140,11 +143,10 @@ enum LYX_LABEL_TYPES {
        ///
        LABEL_COUNTER_ENUMIII,
        ///
-       LABEL_COUNTER_ENUMIV,
-       ///
-       LABEL_FIRST_COUNTER = LABEL_COUNTER_CHAPTER
+       LABEL_COUNTER_ENUMIV
 };
 
+///
 enum LYX_END_LABEL_TYPES {
        ///
        END_LABEL_NO_LABEL,
@@ -180,7 +182,7 @@ enum LYX_END_LABEL_TYPES {
  */ 
 
 
-/// Attributes of a layout/paragraph environment
+// Attributes of a layout/paragraph environment
 class LyXTextClass;
 
 ///
@@ -191,21 +193,37 @@ public:
 
        ///
        bool Read (LyXLex &, LyXTextClass const &);
+       ///
        void readAlign(LyXLex &);
+       ///
        void readAlignPossible(LyXLex &);
+       ///
        void readLabelType(LyXLex &);
+       ///
        void readEndLabelType(LyXLex &);
+       ///
        void readMargin(LyXLex &);
+       ///
        void readLatexType(LyXLex &);
+       ///
        void readSpacing(LyXLex &);
+       ///
        string const & name() const { return name_; }
-       void name(string const & n) { name_ = n; }
+       ///
+       void setName(string const & n) { name_ = n; }
+       ///
        string const & obsoleted_by() const { return obsoleted_by_; }
+       ///
        string const & latexname() const { return latexname_; }
+       ///
        string const & labelstring() const { return labelstring_; }
+       ///
        string const & endlabelstring() const { return endlabelstring_; }
+       ///
        string const & preamble() const { return preamble_; }
+       ///
        string const & latexparam() const { return latexparam_; }
+       ///
        string const & labelstring_appendix() const {
                return labelstring_appendix_;
        }
@@ -303,8 +321,12 @@ public:
 
        ///
        bool free_spacing;
-       /// true when the fragile commands in the paragraph need to be
-       /// \protect'ed.
+
+       ///
+       bool pass_thru;
+
+       /** true when the fragile commands in the paragraph need to be
+           \protect'ed. */
        bool needprotect;
        /// true when empty paragraphs should be kept.
        bool keepempty;
@@ -378,8 +400,11 @@ public:
        
        ///
        bool Read(string const & filename, bool merge = false);
+       ///
        void readOutputType(LyXLex &);
+       ///
        void readMaxCounter(LyXLex &);
+       ///
        void readClassOptions(LyXLex &);
        ///
        bool hasLayout(string const & name) const;
@@ -412,18 +437,25 @@ public:
 
        /// Packages that are already loaded by the class
        enum Provides {
+               ///
                nothing = 0,
+               ///
                amsmath = 1,
+               ///
                makeidx = 2,
+               ///
                url = 4
        };
+       ///
        bool provides(Provides p) const { return provides_ & p; }
        
        ///
        unsigned int columns() const { return columns_; }
        ///
        enum PageSides {
+               ///
                OneSide,
+               ///
                TwoSides
        };
        ///
@@ -506,7 +538,6 @@ private:
        bool loaded;
 };
 
-
 ///
 inline
 void operator|=(LyXTextClass::Provides & p1, LyXTextClass::Provides p2)
@@ -520,7 +551,7 @@ std::ostream & operator<<(std::ostream & os, LyXTextClass::PageSides p);
 
 
 ///
-class LyXTextClassList {
+class LyXTextClassList : boost::noncopyable {
 public:
        ///
        typedef std::vector<LyXTextClass> ClassList;
@@ -538,7 +569,7 @@ public:
                                LyXTextClass::size_type layout) const;
 
        /// Gets layout number from textclass number and layout name
-       std::pair<bool, LyXTextClass::size_type>
+       std::pair<bool, LyXTextClass::size_type> const
        NumberOfLayout(size_type textclass,
                       string const & name) const;
 
@@ -550,7 +581,7 @@ public:
        /** Gets textclass number from name.
            Returns -1 if textclass name does not exist
        */
-       std::pair<bool, size_type>
+       std::pair<bool, size_type> const
        NumberOfClass(string const & textclass) const;
 
        ///
@@ -581,7 +612,7 @@ private:
        void Add (LyXTextClass const &);
 };
 
-/// Should not be declared here!! (Lgb) Why not? (Asger)
+/// 
 extern LyXTextClassList textclasslist;
  
 #endif