]> git.lyx.org Git - lyx.git/blobdiff - src/OutputParams.h
inputenc only expects one option
[lyx.git] / src / OutputParams.h
index ec9461371e1f2cc22ebbc2363d01e9ded03e338c..65b4fc266f83975822775666a0cccf6d14ee4f00 100644 (file)
@@ -26,21 +26,32 @@ class Encoding;
 class ExportData;
 class Font;
 class Language;
+class InsetArgument;
+
+
+enum class Flavor : int {
+       DviLuaTeX,
+       LaTeX,
+       LuaTeX,
+       PdfLaTeX,
+       XeTeX,
+       DocBook5,
+       Html,
+       Text,
+       LyX
+};
+
+enum class CtObject : int {
+       Normal,
+       Object,
+       DisplayObject,
+       UDisplayObject,
+       OmitObject
+};
+
 
 class OutputParams {
 public:
-       enum FLAVOR {
-               DVILUATEX,
-               LATEX,
-               LUATEX,
-               PDFLATEX,
-               XETEX,
-               DOCBOOK5,
-               HTML,
-               TEXT,
-               LYX
-       };
-
        enum MathFlavor {
                NotApplicable,
                MathAsMathML,
@@ -61,21 +72,13 @@ public:
                SUBFLOAT
        };
 
-       enum CtObject {
-               CT_NORMAL,
-               CT_OBJECT,
-               CT_DISPLAYOBJECT,
-               CT_UDISPLAYOBJECT,
-               CT_OMITOBJECT
-       };
-
        OutputParams(Encoding const *);
        ~OutputParams();
 
        /** The file that we export depends occasionally on what is to
            compile the file.
        */
-       FLAVOR flavor = LATEX;
+       Flavor flavor = Flavor::LaTeX;
        /// is it some flavor of LaTeX?
        bool isLaTeX() const;
        /// does this flavour support full unicode?
@@ -118,7 +121,7 @@ public:
        */
        mutable bool need_maketitle = false;
 
-       /** have_maketitle == true means that \maketitle already hase been output.
+       /** have_maketitle == true means that \maketitle already has been output.
        */
        mutable bool have_maketitle = false;
 
@@ -136,7 +139,26 @@ public:
        mutable int inulemcmd = 0;
 
        /** the font at the point where the inset is
-        */
+        *
+        * Note from lasgouttes: I have doubts on the semantics of this
+        * variable. Until this is sorted out, here are some notes on the
+        * history of local_font.
+        *
+        * A research that excludes test and assignment [*] shows that
+        * this is only used to remember language, which is a different
+        * story (and not changed by this patch). The only exception being
+        * in InsetMathHull::getCtObject and InsetMathNest::latex to
+        * support change tracking in insets, but I am not 100% sure that
+        * this is required. And historically [**] local_font used to be
+        * local_lang; it may be good to return to this simpler variable
+        * later.
+        *
+        *  [*] git grep local_font src|grep -v 'local_font [!=]*='
+        *
+        * [**] before afed118a, which improved support for InsetLine;
+        * however, since 0e7ab29f, InsetLine does not depend on the
+        * current font anymore.
+       */
        Font const * local_font = nullptr;
 
        /** Document language lyx name
@@ -242,6 +264,11 @@ public:
         */
        mutable docstring post_macro;
 
+       /** Whether we in a command that is not \\long (i.e. cannot have multiple
+        *  paragraphs)
+        */
+       mutable bool isNonLong = false;
+
        /** Whether we are entering a display math inset.
         *  Needed to correctly strike out deleted math in change tracking.
         */
@@ -275,7 +302,7 @@ public:
 
        /** Whether we are in a table cell.
         *  For newline, it matters whether its content is aligned or not.
-         */
+       */
        TableCell inTableCell = NO;
 
        /** Whether we are inside a float or subfloat.
@@ -306,7 +333,7 @@ public:
        /** What kind of change tracking object is this?
         * Relevant for strikeout method in output
         */
-       mutable CtObject ctObject = CT_NORMAL;
+       mutable CtObject ctObject = CtObject::Normal;
 
        /** allow output of only part of the top-level paragraphs
         *  par_begin: beginning paragraph
@@ -358,6 +385,9 @@ public:
        /// Are we already in a paragraph?
        bool docbook_in_par = false;
 
+       /// Is this element's allowMultiPar useable or not?
+       bool docbook_consider_allow_multi_par = true;
+
        /// Does the present context even permit paragraphs?
        bool docbook_make_pars = true;
 
@@ -379,6 +409,15 @@ public:
        /// Should the layouts that should/must go into <info> be generated?
        bool docbook_generate_info = true;
 
+       /// Should wrappers be ignored? Mostly useful to avoid generation of <abstract>.
+       bool docbook_ignore_wrapper = false;
+
+       /// Some parameters are output before the rest of the paragraph, they should not be generated a second time.
+       std::set<InsetArgument const *> docbook_prepended_arguments = {};
+
+       /// Some parameters are output after the rest of the paragraph, they should not be generated a second time.
+       std::set<InsetArgument const *> docbook_appended_arguments = {};
+
        /// Are we generating this material for inclusion in a TOC-like entity?
        bool for_toc = false;
 
@@ -386,7 +425,20 @@ public:
        bool for_tooltip = false;
 
        /// Are we generating this material for use by advanced search?
-       bool for_search = false;
+       enum Search {
+               NoSearch = 0,
+               SearchWithDeleted = 1,
+               SearchWithoutDeleted = 2,
+               SearchQuick = 4,
+               SearchNonOutput = 8
+       };
+               
+       inline bool find_effective(void) const { return (for_search != OutputParams::NoSearch); }
+       inline bool find_with_non_output() const { return ((for_search & OutputParams::SearchNonOutput) != 0); }
+       inline bool find_with_deleted() const { return ((for_search & OutputParams::SearchWithDeleted) != 0); }
+       inline void find_set_feature(enum Search set_) { for_search = set_; }
+       inline void find_add_feature(enum Search add_) { for_search |= add_; }
+       inline void find_clean_features(void) { for_search = OutputParams::NoSearch; }
 
        /// Are we generating this material for instant preview?
        bool for_preview = false;
@@ -396,6 +448,11 @@ public:
 
        /// Explicit output folder, if any is desired
        std::string export_folder;
+
+       /// A postponed \\noindent (after VSpace)
+       mutable bool need_noindent = false;
+private:
+       int for_search = NoSearch;
 };