]> git.lyx.org Git - lyx.git/blob - src/insets/insetcommandparams.h
e863a3772d570815b507c6aeff2d84c4439ffa47
[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 #include <string>
16 #include <iosfwd>
17
18
19 class LyXLex;
20
21
22 class InsetCommandParams {
23 public:
24         ///
25         InsetCommandParams();
26         ///
27         explicit InsetCommandParams(std::string const & n,
28                             std::string const & c = std::string(),
29                             std::string const & o = std::string());
30         ///
31         void read(LyXLex &);
32         /// Parse the command
33         void scanCommand(std::string const &);
34         ///
35         void write(std::ostream &) const;
36         /// Build the complete LaTeX command
37         std::string const getCommand() const;
38         ///
39         std::string const & getCmdName() const { return cmdname; }
40         ///
41         std::string const & getOptions() const { return options; }
42         ///
43         std::string const & getContents() const { return contents; }
44         ///
45         void setCmdName(std::string const & n) { cmdname = n; }
46         ///
47         void setOptions(std::string const & o) { options = o; }
48         ///
49         void setContents(std::string const & c) { contents = c; }
50         ///
51         bool preview() const { return preview_; }
52         ///
53         void preview(bool p) { preview_ = p; }
54
55 private:
56         ///
57         std::string cmdname;
58         ///
59         std::string contents;
60         ///
61         std::string options;
62         ///
63         bool preview_;
64 };
65
66
67 ///
68 bool operator==(InsetCommandParams const &, InsetCommandParams const &);
69
70 ///
71 bool operator!=(InsetCommandParams const &, InsetCommandParams const &);
72
73 #endif