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