home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / lyx-0.13.2.tar.gz / lyx-0.13.2.tar / lyx-0.13.2 / src / insetquotes.h < prev    next >
C/C++ Source or Header  |  1998-04-23  |  2KB  |  118 lines

  1. // -*- C++ -*-
  2. /* This file is part of*
  3.  * ======================================================
  4.  *
  5.  *           LyX, The Document Processor
  6.  *      
  7.  *        Copyright (C) 1995 Matthias Ettrich
  8.  *
  9.  *======================================================*/
  10.  
  11. #ifndef _INSET_QUOTES_H
  12. #define _INSET_QUOTES_H
  13.  
  14. #ifdef __GNUG__
  15. #pragma interface
  16. #endif
  17.  
  18. #include "lyxinset.h"
  19.  
  20. class BufferParams;
  21.  
  22. class LString;
  23. struct LaTeXFeatures;
  24.  
  25.  
  26. /** Quotes.
  27.  
  28.   Used for the various quotes. German, English, French, all either
  29.   double or single **/ 
  30. class InsetQuotes: public Inset {
  31. public:
  32.     ///
  33.     enum quote_language {
  34.         ///
  35.         EnglishQ,
  36.         ///
  37.         SwedishQ,
  38.         ///
  39.         GermanQ,
  40.         ///
  41.         PolishQ,
  42.         ///
  43.         FrenchQ,
  44.         ///
  45.         DanishQ
  46.     };
  47.     ///
  48.     enum quote_side {
  49.         ///
  50.         LeftQ,
  51.         ///
  52.         RightQ 
  53.     };
  54.     ///
  55.     enum quote_times {
  56.         ///
  57.         SingleQ,
  58.         ///
  59.         DoubleQ 
  60.     };
  61.     
  62.     /** The constructor works like this:
  63.       \begin{itemize}
  64.         \item fls <- french single quote left 
  65.         \item grd <- german double quote right 
  66.         \item etc.
  67.       \end{itemize}
  68.       */ 
  69.     InsetQuotes(LString const &string = "eld");
  70.     /// Create the right quote inset after character c
  71.     InsetQuotes(char c, BufferParams const ¶ms);
  72.     ///
  73.     ~InsetQuotes() {}; //nothing to do
  74.  
  75.     ///
  76.     int Ascent(LyXFont const &font) const;
  77.     ///
  78.     int Descent(LyXFont const &font) const;
  79.     ///
  80.     int Width(LyXFont const &font) const;
  81.     ///
  82.     void Draw(LyXFont font, LyXScreen &scr, int baseline, float &x);
  83.     ///
  84.     LyXFont ConvertFont(LyXFont font);
  85.     ///
  86.     void Write(FILE *file);
  87.     ///
  88.     void Read(LyXLex &lex);
  89.     ///
  90.     int Latex(FILE *file, signed char fragile);
  91.     ///
  92.     int Latex(LString &file, signed char fragile);
  93.     ///
  94.     void Validate(LaTeXFeatures &) const;
  95.     ///
  96.     Inset* Clone();
  97.     ///
  98.     Inset::Code LyxCode() const;
  99. private:
  100.     ///
  101.     quote_language language;
  102.     ///
  103.     quote_side side;
  104.     ///
  105.     quote_times times;
  106.  
  107.     /** The parameters of the constructor are the language, the
  108.         side and the multiplicity of the quote.
  109.      */
  110.     InsetQuotes(quote_language l, quote_side s, quote_times t);
  111.     ///
  112.     void ParseString(LString string);
  113.     ///
  114.     LString DispString() const;
  115. };
  116.  
  117. #endif
  118.