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
|
|
|
|
|
2003-09-18 11:48:11 +00:00
|
|
|
|
class LColor_color;
|
2003-06-04 07:14:05 +00:00
|
|
|
|
class UpdatableInset;
|
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-25 21:20:24 +00:00
|
|
|
|
InsetOld(InsetOld const & in);
|
2003-05-26 09:13:55 +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
|
|
|
|
|
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
void setInsetName(std::string const & s) { name_ = s; }
|
2000-04-19 14:42:19 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string 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;
|
2001-07-24 10:13:19 +00:00
|
|
|
|
///
|
2004-01-30 11:41:12 +00:00
|
|
|
|
int xo() const { return xo_; }
|
2000-05-15 14:49:36 +00:00
|
|
|
|
///
|
2004-01-30 11:41:12 +00:00
|
|
|
|
int yo() const { return yo_; }
|
2003-11-10 18:13:00 +00:00
|
|
|
|
/// returns the actual scroll-value
|
|
|
|
|
virtual int scroll(bool recursive = true) const;
|
2003-02-14 02:21:01 +00:00
|
|
|
|
|
2003-10-14 13:01:49 +00:00
|
|
|
|
///
|
2004-01-26 10:13:15 +00:00
|
|
|
|
bool forceDefaultParagraphs(InsetBase const * inset) const;
|
2000-05-15 14:49:36 +00:00
|
|
|
|
protected:
|
|
|
|
|
///
|
2003-11-10 15:38:20 +00:00
|
|
|
|
mutable int xo_;
|
2001-04-04 20:40:16 +00:00
|
|
|
|
///
|
2003-11-10 15:38:20 +00:00
|
|
|
|
mutable int yo_;
|
2001-04-04 20:40:16 +00:00
|
|
|
|
///
|
2000-08-07 15:21:05 +00:00
|
|
|
|
mutable int scx;
|
2001-07-06 15:57:54 +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:
|
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string 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
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2003-09-18 10:52:29 +00:00
|
|
|
|
/** \c InsetOld_code is a wrapper for InsetOld::Code.
|
|
|
|
|
* It can be forward-declared and passed as a function argument without
|
|
|
|
|
* having to expose inset.h.
|
|
|
|
|
*/
|
|
|
|
|
class InsetOld_code {
|
|
|
|
|
InsetOld::Code val_;
|
|
|
|
|
public:
|
|
|
|
|
InsetOld_code(InsetOld::Code val) : val_(val) {}
|
2003-11-10 09:55:30 +00:00
|
|
|
|
operator InsetOld::Code() const { return val_; }
|
2003-09-18 10:52:29 +00:00
|
|
|
|
};
|
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
|
#endif
|