1999-09-27 18:44:28 +00:00
|
|
|
|
// -*- C++ -*-
|
2002-09-25 14:26:13 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file inset.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:09:55 +00:00
|
|
|
|
*
|
2002-09-25 14:26:13 +00:00
|
|
|
|
* \author Alejandro Aguilar Sierra
|
|
|
|
|
* \author J<EFBFBD>rgen Vigna
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
* \author Matthias Ettrich
|
2002-03-21 17:09:55 +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
|
|
|
|
*/
|
1999-11-04 01:40:20 +00:00
|
|
|
|
|
2003-07-25 21:20:24 +00:00
|
|
|
|
#ifndef INSETOLD_H
|
|
|
|
|
#define INSETOLD_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2003-02-17 17:12:50 +00:00
|
|
|
|
#include "insetbase.h"
|
2003-07-18 07:47:07 +00:00
|
|
|
|
#include "dimension.h"
|
2003-10-06 15:43:21 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
|
2003-09-18 11:48:11 +00:00
|
|
|
|
class LColor_color;
|
2000-02-22 00:36:17 +00:00
|
|
|
|
|
2004-01-20 14:25:24 +00:00
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
|
/// Insets
|
2003-07-25 21:20:24 +00:00
|
|
|
|
class InsetOld : public InsetBase {
|
1999-09-27 18:44:28 +00:00
|
|
|
|
public:
|
2000-07-04 11:30:07 +00:00
|
|
|
|
///
|
2000-09-26 13:54:57 +00:00
|
|
|
|
enum {
|
|
|
|
|
///
|
|
|
|
|
TEXT_TO_INSET_OFFSET = 2
|
|
|
|
|
};
|
2000-07-04 11:30:07 +00:00
|
|
|
|
|
2000-04-19 14:42:19 +00:00
|
|
|
|
///
|
2003-07-25 21:20:24 +00:00
|
|
|
|
InsetOld();
|
2001-07-24 15:07:09 +00:00
|
|
|
|
///
|
2003-07-18 07:47:07 +00:00
|
|
|
|
int ascent() const;
|
2000-02-10 17:53:36 +00:00
|
|
|
|
///
|
2003-07-18 07:47:07 +00:00
|
|
|
|
int descent() const;
|
2003-05-19 17:03:12 +00:00
|
|
|
|
///
|
2003-07-18 07:47:07 +00:00
|
|
|
|
int width() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
|
void setInsetName(docstring const & s) { name_ = s; }
|
2000-04-19 14:42:19 +00:00
|
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
|
virtual docstring const & getInsetName() const { return name_; }
|
2000-04-19 14:42:19 +00:00
|
|
|
|
///
|
2003-12-01 13:35:49 +00:00
|
|
|
|
virtual void setBackgroundColor(LColor_color);
|
2001-07-24 10:13:19 +00:00
|
|
|
|
///
|
2003-09-18 11:48:11 +00:00
|
|
|
|
LColor_color backgroundColor() const;
|
2004-01-30 11:41:12 +00:00
|
|
|
|
/// set x/y drawing position cache
|
|
|
|
|
void setPosCache(PainterInfo const &, int, int) const;
|
2003-02-14 02:21:01 +00:00
|
|
|
|
|
2000-05-15 14:49:36 +00:00
|
|
|
|
protected:
|
2004-11-23 23:04:52 +00:00
|
|
|
|
///
|
|
|
|
|
InsetOld(InsetOld const & in);
|
2001-04-04 20:40:16 +00:00
|
|
|
|
///
|
2003-07-18 07:47:07 +00:00
|
|
|
|
mutable Dimension dim_;
|
2001-07-06 15:57:54 +00:00
|
|
|
|
|
2000-04-19 14:42:19 +00:00
|
|
|
|
private:
|
2004-11-23 23:04:52 +00:00
|
|
|
|
InsetOld & operator=(InsetOld const &) const;
|
2004-11-25 19:13:07 +00:00
|
|
|
|
|
2000-04-19 14:42:19 +00:00
|
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
|
docstring name_;
|
2003-09-16 09:44:34 +00:00
|
|
|
|
/** We store the LColor::color value as an int to get LColor.h out
|
|
|
|
|
* of the header file.
|
|
|
|
|
*/
|
|
|
|
|
int background_color_;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2004-11-25 19:13:07 +00:00
|
|
|
|
/** \c InsetBase_code is a wrapper for InsetBase::Code.
|
2003-09-18 10:52:29 +00:00
|
|
|
|
* It can be forward-declared and passed as a function argument without
|
|
|
|
|
* having to expose inset.h.
|
|
|
|
|
*/
|
2004-11-25 19:13:07 +00:00
|
|
|
|
class InsetBase_code {
|
2004-11-23 23:04:52 +00:00
|
|
|
|
InsetBase::Code val_;
|
2003-09-18 10:52:29 +00:00
|
|
|
|
public:
|
2004-11-25 19:13:07 +00:00
|
|
|
|
InsetBase_code(InsetBase::Code val) : val_(val) {}
|
2004-11-23 23:04:52 +00:00
|
|
|
|
operator InsetBase::Code() const { return val_; }
|
2003-09-18 10:52:29 +00:00
|
|
|
|
};
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
|
#endif
|