]> git.lyx.org Git - lyx.git/blobdiff - src/layout.h
Dekel patch to add EndLabelString tag to layout files.
[lyx.git] / src / layout.h
index cef49cad6e3b109e1373d1db18be91e81c2a8376..bc9dd8c15382919b25fa2a3f431e3720cf6bcfc3 100644 (file)
@@ -5,13 +5,15 @@
  *           LyX, The Document Processor
  *      
  *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-1999 The LyX Team.
+ *           Copyright 1995-2000 The LyX Team.
  *
  * ====================================================== */
 
 #ifndef LAYOUT_H
 #define LAYOUT_H
 
+#include <vector>
+
 #ifdef __GNUG__
 #pragma interface
 #endif
@@ -20,9 +22,6 @@
 #include "lyxfont.h"
 #include "Spacing.h"
 
-#include <vector>
-using std::vector;
-using std::pair;
 
 /// Reads the style files
 extern void LyXSetStyle();
@@ -42,7 +41,7 @@ enum { // no good name for this
 /// The different output types
 enum OutputType {
         ///
-        LATEX,
+        LATEX = 1,
        ///
        LINUXDOC,
        ///
@@ -54,7 +53,7 @@ enum OutputType {
 /// The different margin types
 enum LYX_MARGIN_TYPE {
        ///
-       MARGIN_MANUAL,
+       MARGIN_MANUAL = 1,
        ///
        MARGIN_FIRST_DYNAMIC,
        ///
@@ -66,14 +65,6 @@ enum LYX_MARGIN_TYPE {
 };
 
 
-///
-enum LyXDirection {
-       ///
-       LYX_DIR_LEFT_TO_RIGHT = 1,
-       ///
-       LYX_DIR_RIGHT_TO_LEFT = -1
-};
-  
 ///
 enum LyXAlignment {
        ///
@@ -93,14 +84,15 @@ enum LyXAlignment {
 };
 
 
-inline void operator|=(LyXAlignment & la1, LyXAlignment la2) {
+inline
+void operator|=(LyXAlignment & la1, LyXAlignment la2) {
        la1 = static_cast<LyXAlignment>(la1 | la2);
 }
 
 /// The different LaTeX-Types
 enum LYX_LATEX_TYPES {
        ///
-       LATEX_PARAGRAPH,
+       LATEX_PARAGRAPH = 1,
        ///
        LATEX_COMMAND,
        ///
@@ -153,7 +145,21 @@ enum LYX_LABEL_TYPES {
        LABEL_FIRST_COUNTER = LABEL_COUNTER_CHAPTER
 };
 
-
+enum LYX_END_LABEL_TYPES {
+       ///
+       END_LABEL_NO_LABEL,
+       ///
+       END_LABEL_BOX,
+       ///
+       END_LABEL_FILLED_BOX,
+       ///
+       END_LABEL_STATIC,
+       ///
+       END_LABEL_ENUM_FIRST = END_LABEL_NO_LABEL,
+       ///
+       END_LABEL_ENUM_LAST = END_LABEL_STATIC
+};
+               
 /* Fix labels are printed flushright, manual labels flushleft. 
  * MARGIN_MANUAL and MARGIN_FIRST_DYNAMIC are *only* for LABEL_MANUAL,
  * MARGIN_DYNAMIC and MARGIN_STATIC are *not* for LABEL_MANUAL. 
@@ -188,6 +194,7 @@ public:
        void readAlign(LyXLex &);
        void readAlignPossible(LyXLex &);
        void readLabelType(LyXLex &);
+       void readEndLabelType(LyXLex &);
        void readMargin(LyXLex &);
        void readLatexType(LyXLex &);
        void readSpacing(LyXLex &);
@@ -196,6 +203,7 @@ public:
        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 {
@@ -276,7 +284,10 @@ public:
        char labeltype; // add approp. type
 
        ///
-       char margintype; // add approp. type
+       char endlabeltype;
+
+       ///
+       LYX_MARGIN_TYPE margintype;
 
        ///
        bool fill_top;
@@ -331,6 +342,9 @@ private:
        /// Label string. "Abstract", "Reference", "Caption"...
        string labelstring_;
 
+       ///
+       string endlabelstring_;
+
        /// Label string inside appendix. "Appendix", ...
        string labelstring_appendix_;
 
@@ -346,12 +360,13 @@ private:
 class LyXTextClass {
 public:
        ///
-       typedef vector<LyXLayout> LayoutList;
+       typedef std::vector<LyXLayout> LayoutList;
        ///
        typedef LayoutList::const_iterator const_iterator;
        ///
        typedef LayoutList::size_type size_type;
        ///
+       explicit
        LyXTextClass (string const & = string(), 
                      string const & = string(), 
                      string const & = string());
@@ -493,32 +508,22 @@ private:
 
 
 ///
-inline void operator|=(LyXTextClass::Provides & p1, LyXTextClass::Provides p2)
+inline
+void operator|=(LyXTextClass::Provides & p1, LyXTextClass::Provides p2)
 {
        p1 = static_cast<LyXTextClass::Provides>(p1 | p2);
 }
 
 
 ///
-inline ostream & operator<<(ostream & os, LyXTextClass::PageSides p)
-{
-       switch (p) {
-       case LyXTextClass::OneSide:
-               os << "1";
-               break;
-       case LyXTextClass::TwoSides:
-               os << "2";
-               break;
-       }
-       return os;
-}
+std::ostream & operator<<(std::ostream & os, LyXTextClass::PageSides p);
 
 
 ///
 class LyXTextClassList {
 public:
        ///
-       typedef vector<LyXTextClass> ClassList;
+       typedef std::vector<LyXTextClass> ClassList;
        ///
        typedef ClassList::const_iterator const_iterator;
        ///
@@ -533,7 +538,7 @@ public:
                                LyXTextClass::size_type layout) const;
 
        /// Gets layout number from textclass number and layout name
-       pair<bool, LyXTextClass::size_type>
+       std::pair<bool, LyXTextClass::size_type>
        NumberOfLayout(size_type textclass,
                       string const & name) const;
 
@@ -545,7 +550,7 @@ public:
        /** Gets textclass number from name.
            Returns -1 if textclass name does not exist
        */
-       pair<bool, size_type>
+       std::pair<bool, size_type>
        NumberOfClass(string const & textclass) const;
 
        ///