]> git.lyx.org Git - lyx.git/blob - src/insets/insetcommandparams.h
Collapse all those LFUN_XYZ_APPLY to a single LFUN_INSET_APPLY.
[lyx.git] / src / insets / insetcommandparams.h
1 // -*- C++ -*-
2 /**
3  * \file insetcommandparams.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Angus Leeming
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #ifndef INSETCOMMANDPARAMS_H
13 #define INSETCOMMANDPARAMS_H
14
15
16 #include <config.h>
17
18 #include "LString.h"
19
20 #include <iosfwd>
21
22 class LyXLex;
23
24 class InsetCommandParams {
25 public:
26         ///
27         InsetCommandParams();
28         ///
29         explicit
30         InsetCommandParams(string const & n,
31                             string const & c = string(),
32                             string const & o = string());
33         ///
34         void read(LyXLex &);
35         /// Parse the command
36         void scanCommand(string const &);
37         ///
38         void write(std::ostream &) const;
39         /// Build the complete LaTeX command
40         string const getCommand() const;
41         ///
42         string const & getCmdName() const { return cmdname; }
43         ///
44         string const & getOptions() const { return options; }
45         ///
46         string const & getContents() const { return contents; }
47         ///
48         void setCmdName(string const & n) { cmdname = n; }
49         ///
50         void setOptions(string const & o) { options = o; }
51         ///
52         void setContents(string const & c) { contents = c; }
53         ///
54         string const getAsString() const;
55         ///
56         void setFromString(string const &);
57         ///
58         bool preview() const { return preview_; }
59         ///
60         void preview(bool p) { preview_ = p; }
61
62 private:
63         ///
64         string cmdname;
65         ///
66         string contents;
67         ///
68         string options;
69         ///
70         bool preview_;
71 };
72
73
74 ///
75 bool operator==(InsetCommandParams const &,
76                 InsetCommandParams const &);
77
78 ///
79 bool operator!=(InsetCommandParams const &,
80                 InsetCommandParams const &);
81
82 #endif