2002-07-04 13:54:28 +00:00
|
|
|
// -*- C++ -*-
|
2002-09-25 14:26:13 +00:00
|
|
|
/**
|
|
|
|
* \file insetcommandparams.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-07-04 13:54:28 +00:00
|
|
|
*
|
2002-09-25 14:26:13 +00:00
|
|
|
* \author Angus Leeming
|
2002-07-04 13:54:28 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-09-25 14:26:13 +00:00
|
|
|
*/
|
2002-07-04 13:54:28 +00:00
|
|
|
|
|
|
|
#ifndef INSETCOMMANDPARAMS_H
|
|
|
|
#define INSETCOMMANDPARAMS_H
|
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
#include <string>
|
2002-07-04 13:54:28 +00:00
|
|
|
#include <iosfwd>
|
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
|
2002-07-04 13:54:28 +00:00
|
|
|
class LyXLex;
|
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
|
2002-07-04 13:54:28 +00:00
|
|
|
class InsetCommandParams {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
InsetCommandParams();
|
|
|
|
///
|
2004-02-16 11:58:51 +00:00
|
|
|
explicit InsetCommandParams(std::string const & n,
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string const & c = std::string(),
|
|
|
|
std::string const & o = std::string());
|
2002-07-04 13:54:28 +00:00
|
|
|
///
|
|
|
|
void read(LyXLex &);
|
|
|
|
/// Parse the command
|
2003-10-06 15:43:21 +00:00
|
|
|
void scanCommand(std::string const &);
|
2002-07-04 13:54:28 +00:00
|
|
|
///
|
|
|
|
void write(std::ostream &) const;
|
|
|
|
/// Build the complete LaTeX command
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string const getCommand() const;
|
2002-07-04 13:54:28 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string const & getCmdName() const { return cmdname; }
|
2002-07-04 13:54:28 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string const & getOptions() const { return options; }
|
2002-07-04 13:54:28 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string const & getContents() const { return contents; }
|
2002-07-04 13:54:28 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
void setCmdName(std::string const & n) { cmdname = n; }
|
2002-07-04 13:54:28 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
void setOptions(std::string const & o) { options = o; }
|
2002-07-04 13:54:28 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
void setContents(std::string const & c) { contents = c; }
|
2002-07-04 13:54:28 +00:00
|
|
|
///
|
2002-08-02 18:25:25 +00:00
|
|
|
bool preview() const { return preview_; }
|
|
|
|
///
|
|
|
|
void preview(bool p) { preview_ = p; }
|
|
|
|
|
2002-07-04 13:54:28 +00:00
|
|
|
private:
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string cmdname;
|
2002-07-04 13:54:28 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string contents;
|
2002-07-04 13:54:28 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string options;
|
2002-08-02 18:25:25 +00:00
|
|
|
///
|
|
|
|
bool preview_;
|
2002-07-04 13:54:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2002-07-04 17:45:35 +00:00
|
|
|
///
|
2003-12-12 13:57:20 +00:00
|
|
|
bool operator==(InsetCommandParams const &, InsetCommandParams const &);
|
2002-07-04 17:45:35 +00:00
|
|
|
|
|
|
|
///
|
2003-12-12 13:57:20 +00:00
|
|
|
bool operator!=(InsetCommandParams const &, InsetCommandParams const &);
|
2002-07-04 17:45:35 +00:00
|
|
|
|
2002-07-04 13:54:28 +00:00
|
|
|
#endif
|