]> git.lyx.org Git - lyx.git/blob - src/insets/insetcommandparams.h
The speed patch: redraw only rows that have changed
[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                             std::string const & s = 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 & getSecOptions() const { return sec_options; }
45         ///
46         std::string const & getContents() const { return contents; }
47         ///
48         void setCmdName(std::string const & n) { cmdname = n; }
49         ///
50         void setOptions(std::string const & o) { options = o; }
51         ///
52         void setSecOptions(std::string const & s) { sec_options = s; }
53         ///
54         void setContents(std::string const & c) { contents = c; }
55         ///
56         bool preview() const { return preview_; }
57         ///
58         void preview(bool p) { preview_ = p; }
59
60 private:
61         ///
62         std::string cmdname;
63         ///
64         std::string contents;
65         ///
66         std::string options;
67         ///
68         std::string sec_options;
69         ///
70         bool preview_;
71 };
72
73
74 ///
75 bool operator==(InsetCommandParams const &, InsetCommandParams const &);
76
77 ///
78 bool operator!=(InsetCommandParams const &, InsetCommandParams const &);
79
80 #endif