]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetquotes.h
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[lyx.git] / src / insets / insetquotes.h
index f19a7b77927afe228f7593121185959118c5bd62..cbd2f5dcbfcdff84687a51709ca9e19eb23e4f85 100644 (file)
@@ -1,33 +1,34 @@
 // -*- C++ -*-
-/* This file is part of*
- * ======================================================
+/**
+ * \file insetquotes.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *           LyX, The Document Processor
- *      
- *         Copyright 1995 Matthias Ettrich
- *          Copyright 1995-2000 The LyX Team
+ * \author Jean-Marc Lasgouttes
  *
- * ====================================================== */
+ * Full author contact details are available in file CREDITS.
+ */
 
 #ifndef INSET_QUOTES_H
 #define INSET_QUOTES_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
 
-#include "lyxinset.h"
+#include "inset.h"
 
-class BufferParams;
+#include "support/types.h"
 
-struct LaTeXFeatures;
 
+namespace lyx {
+
+class BufferParams;
+class Language;
+class LaTeXFeatures;
 
-/** Quotes.
 
+/** Quotes.
   Used for the various quotes. German, English, French, all either
-  double or single **/ 
-class InsetQuotes : public Inset {
+  double or single **/
+class InsetQuotes : public InsetOld {
 public:
        ///
        enum quote_language {
@@ -49,74 +50,80 @@ public:
                ///
                LeftQ,
                ///
-               RightQ 
+               RightQ
        };
        ///
        enum quote_times {
                ///
                SingleQ,
                ///
-               DoubleQ 
+               DoubleQ
        };
-       
+
        /** The constructor works like this:
          \begin{itemize}
-           \item fls <- french single quote left 
-           \item grd <- german double quote right 
+           \item fls <- french single quote left
+           \item grd <- german double quote right
            \item etc.
          \end{itemize}
          */
        explicit
-       InsetQuotes(string const & str = "eld");
+       InsetQuotes(std::string const & str = "eld");
        /// Create the right quote inset after character c
-       InsetQuotes(char c, BufferParams const & params);
-
-       ///
-       int ascent(BufferView *, LyXFont const &) const;
-       ///
-       int descent(BufferView *, LyXFont const &) const;
+       InsetQuotes(char_type c, BufferParams const & params);
+       /// Direct access to inner/outer quotation marks
+       InsetQuotes(char_type c, quote_language l, quote_times t);
        ///
-       int width(BufferView *, LyXFont const &) const;
+       bool metrics(MetricsInfo &, Dimension &) const;
        ///
-       void draw(BufferView *, LyXFont const &, int, float &, bool) const;
+       void draw(PainterInfo & pi, int x, int y) const;
+#if 0
        ///
-       LyXFont ConvertFont(LyXFont const & font) const;
-       //LyXFont ConvertFont(LyXFont font);
-       ///
-       void Write(Buffer const *, std::ostream &) const;
-       ///
-       void Read(Buffer const *, LyXLex & lex);
+       LyXFont const convertFont(LyXFont const & font) const;
+#endif
        ///
-       int Latex(Buffer const *, std::ostream &,
-                 bool fragile, bool free_spc) const;
+       void write(Buffer const &, std::ostream &) const;
        ///
-       int Ascii(Buffer const *, std::ostream &) const;
+       void read(Buffer const &, LyXLex & lex);
        ///
-       int Linuxdoc(Buffer const *, std::ostream &) const;
+       int latex(Buffer const &, odocstream &, OutputParams const &) const;
        ///
-       int DocBook(Buffer const *, std::ostream &) const;
+       int plaintext(Buffer const &, odocstream &, OutputParams const &) const;
        ///
-       void Validate(LaTeXFeatures &) const;
+       int docbook(Buffer const &, odocstream &, OutputParams const &) const;
+
+       /// the string that is passed to the TOC
+       virtual void textString(Buffer const &, odocstream &) const;
+
        ///
-       Inset * Clone() const;
+       void validate(LaTeXFeatures &) const;
        ///
-       Inset::Code LyxCode() const;
+       InsetBase::Code lyxCode() const;
+       // should this inset be handled like a normal character
+       bool isChar() const { return true; }
+
 private:
+       virtual std::auto_ptr<InsetBase> doClone() const;
+
        ///
-       quote_language language;
+       quote_language language_;
        ///
-       quote_side side;
+       quote_side side_;
        ///
-       quote_times times;
+       quote_times times_;
 
        /** The parameters of the constructor are the language, the
            side and the multiplicity of the quote.
         */
        InsetQuotes(quote_language l, quote_side s, quote_times t);
+       /// Decide whether we need left or right quotation marks
+       void getPosition(char_type c);
        ///
-       void ParseString(string const &);
+       void parseString(std::string const &);
        ///
-       string DispString() const;
+       lyx::docstring const dispString(Language const *) const;
 };
-#endif
 
+} // namespace lyx
+
+#endif