2002-09-11 08:26:02 +00:00
|
|
|
|
// -*- C++ -*-
|
2002-12-01 22:59:25 +00:00
|
|
|
|
/**
|
2003-08-19 13:00:56 +00:00
|
|
|
|
* \file command_inset.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-09-11 08:26:02 +00:00
|
|
|
|
*
|
2003-08-19 13:00:56 +00:00
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
2002-09-11 08:26:02 +00:00
|
|
|
|
*
|
2003-08-19 13:00:56 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-09-11 08:26:02 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2002-06-24 15:51:35 +00:00
|
|
|
|
#ifndef COMMAND_INSET_H
|
|
|
|
|
#define COMMAND_INSET_H
|
|
|
|
|
|
2003-06-12 08:52:36 +00:00
|
|
|
|
#include "math_nestinset.h"
|
2004-02-16 11:58:51 +00:00
|
|
|
|
|
2003-10-10 21:08:55 +00:00
|
|
|
|
#include "insets/render_button.h"
|
2003-06-12 08:52:36 +00:00
|
|
|
|
|
2002-06-24 15:51:35 +00:00
|
|
|
|
|
2002-09-11 08:26:02 +00:00
|
|
|
|
/// Inset for things like \name[options]{contents}
|
2003-06-12 08:52:36 +00:00
|
|
|
|
class CommandInset : public MathNestInset {
|
2002-06-24 15:51:35 +00:00
|
|
|
|
public:
|
2003-03-04 18:54:56 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
explicit CommandInset(std::string const & name);
|
2002-06-24 15:51:35 +00:00
|
|
|
|
///
|
2003-06-12 08:52:36 +00:00
|
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const;
|
|
|
|
|
///
|
|
|
|
|
void draw(PainterInfo & pi, int x, int y) const;
|
|
|
|
|
///
|
2005-11-22 13:52:25 +00:00
|
|
|
|
InsetBase * editXY(LCursor &, int, int);
|
|
|
|
|
///
|
2002-06-24 15:51:35 +00:00
|
|
|
|
void write(WriteStream & os) const;
|
2003-06-28 01:23:11 +00:00
|
|
|
|
//
|
|
|
|
|
// void infoize(std::ostream & os) const;
|
2002-06-24 15:51:35 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
virtual std::string const screenLabel() const;
|
2003-06-12 08:52:36 +00:00
|
|
|
|
/// generate something that will be understood by the Dialogs.
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string const createDialogStr(std::string const & name) const;
|
2004-04-18 19:57:58 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string const & commandname() const { return name_; }
|
2003-06-12 08:52:36 +00:00
|
|
|
|
private:
|
2004-11-23 23:04:52 +00:00
|
|
|
|
virtual std::auto_ptr<InsetBase> doClone() const;
|
|
|
|
|
|
2004-04-18 19:57:58 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string name_;
|
2004-04-18 19:57:58 +00:00
|
|
|
|
///
|
2003-06-12 08:52:36 +00:00
|
|
|
|
mutable bool set_label_;
|
2004-04-18 19:57:58 +00:00
|
|
|
|
///
|
2003-10-10 21:08:55 +00:00
|
|
|
|
mutable RenderButton button_;
|
2002-06-24 15:51:35 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|