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