2 /* This file is part of*
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright (C) 1995 Matthias Ettrich
8 * Copyright (C) 1996-1998 The LyX Team.
10 *======================================================*/
12 #ifndef _INSET_LATEXCOMMAND_H
13 #define _INSET_LATEXCOMMAND_H
22 // Created by Alejandro 970222
23 /** Used to insert a LaTeX command automatically
25 * Similar to InsetLaTeX but having control of the basic structure of a
26 * LaTeX command: \name[options]{contents}.
28 class InsetCommand: public Inset {
33 InsetCommand(string const & name, string const & arg = string(),
34 string const & opt = string());
38 int Ascent(LyXFont const &font) const;
40 int Descent(LyXFont const &font) const;
42 int Width(LyXFont const &font) const;
44 void Draw(LyXFont, LyXScreen &scr, int baseline, float &x);
46 void Write(FILE *file);
47 /// Parse the command.
48 void scanCommand(string const &cmd);
49 /// Will not be used when lyxf3
50 void Read(LyXLex &lex);
52 virtual int Latex(FILE *file, signed char fragile);
54 virtual int Latex(string &file, signed char fragile);
56 virtual int Linuxdoc(string &file);
58 virtual int DocBook(string &file);
62 Inset::Code LyxCode() const
64 return Inset::NO_CODE;
67 /** Get the label that appears at screen.
69 I thought it was enough to eliminate the argument to avoid
70 confusion with lyxinset::getLabel(int), but I've seen that
71 it wasn't. I hope you never confuse again both methods. (ale)
73 virtual string getScreenLabel() const
78 /// Build the complete LaTeX command
79 string getCommand() const;
81 string const &getCmdName() const {
85 string const &getOptions() const {
89 string const &getContents() const {
93 void setCmdName(string const & n) {
97 void setOptions(string const & o) {
101 virtual void setContents(string const & c) {