]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetlatexaccent.h
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[lyx.git] / src / insets / insetlatexaccent.h
index 707b0853f5446f9689ede2c3285bf8e0b96ec477..33446bd11a227e1b1b330ac48ceeb5a3e46ecf1e 100644 (file)
@@ -6,15 +6,20 @@
  *
  * \author Lars Gullik Bjønnes
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #ifndef INSET_LATEX_ACCENT_H
 #define INSET_LATEX_ACCENT_H
 
 #include "inset.h"
-#include "LString.h"
-#include "dimension.h"
+#include "support/types.h"
+
+
+namespace lyx {
+
+class Dimension;
+
 
 /** Insertion of accents
 
   it also can handle other special characters (e.g. Hstroke)
   Initiated by Ivan Schreter, later modified by Lgb.
   */
-class InsetLatexAccent : public Inset {
+class InsetLatexAccent : public InsetOld {
 public:
        ///
        InsetLatexAccent();
        ///
-       explicit
-       InsetLatexAccent(string const & string);
+       explicit InsetLatexAccent(std::string const & str);
        ///
-       void metrics(MetricsInfo &, Dimension &) const;
+       bool metrics(MetricsInfo &, Dimension &) const;
        ///
        void draw(PainterInfo & pi, int x, int y) const;
        ///
-       int lbearing(LyXFont const & font) const;
-       ///
-       int rbearing(LyXFont const & font) const;
-       ///
        bool displayISO8859_9(PainterInfo & pi, int x, int y) const;
        ///
-       void write(Buffer const *, std::ostream &) const;
+       void write(Buffer const &, std::ostream &) const;
        ///
-       void read(Buffer const *, LyXLex & lex);
+       void read(Buffer const &, LyXLex & lex);
        ///
-       int latex(Buffer const *, std::ostream &,
-                 LatexRunParams const &) const;
+       int latex(Buffer const &, odocstream &,
+                 OutputParams const &) const;
        ///
-       int ascii(Buffer const *, std::ostream &, int linelen) const;
+       int plaintext(Buffer const &, odocstream &,
+                 OutputParams const &) const;
        ///
-       int linuxdoc(Buffer const *, std::ostream &) const;
-       ///
-       int docbook(Buffer const *, std::ostream &, bool mixcont) const;
+       int docbook(Buffer const &, odocstream &,
+                   OutputParams const &) const;
+       /// the string that is passed to the TOC
+       virtual int textString(Buffer const &, odocstream &,
+               OutputParams const &) const;
        ///
        bool directWrite() const;
        ///
-       virtual Inset * clone() const;
-       ///
-       Inset::Code lyxCode()const;
+       InsetBase::Code lyxCode()const;
        ///
        inline bool canDisplay();
        // should this inset be handled like a normal charater
        bool isChar() const { return true; }
 
+       /// is this equivalent to a letter?
+       virtual bool isLetter() const { return candisp; }
+
        /// all the accent types
        enum ACCENT_TYPES{
                ///
@@ -112,10 +116,15 @@ public:
        };
 private:
        friend std::ostream & operator<<(std::ostream &, ACCENT_TYPES);
+
+       virtual std::auto_ptr<InsetBase> doClone() const;
+
        /// Check if we know the modifier and can display it ok on screen.
        void checkContents();
        ///
-       string contents;
+       void drawAccent(PainterInfo const & pi, int x, int y, char_type accent) const;
+       ///
+       std::string contents;
        /// can display as proper char
        bool  candisp;
        /// modifier type
@@ -129,8 +138,6 @@ private:
        bool  plusdesc;
        /// international char
        mutable char  ic;
-       ///
-       mutable Dimension dim_;
 };
 
 
@@ -139,4 +146,7 @@ bool InsetLatexAccent::canDisplay()
        return candisp;
 }
 
+
+} // namespace lyx
+
 #endif