2000-07-17 18:27:53 +00:00
|
|
|
|
// -*- C++ -*-
|
2002-09-25 14:26:13 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file insetcaption.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 Lars Gullik Bj<EFBFBD>nnes
|
2000-07-17 18:27:53 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2000-07-17 18:27:53 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef INSETCAPTION_H
|
|
|
|
|
#define INSETCAPTION_H
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "insettext.h"
|
2006-05-05 05:51:51 +00:00
|
|
|
|
#include "lyxtextclass.h"
|
2000-07-17 18:27:53 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
|
2000-07-17 18:27:53 +00:00
|
|
|
|
/** A caption inset
|
|
|
|
|
*/
|
|
|
|
|
class InsetCaption : public InsetText {
|
|
|
|
|
public:
|
2001-03-11 03:20:44 +00:00
|
|
|
|
///
|
2002-03-03 20:25:07 +00:00
|
|
|
|
InsetCaption(BufferParams const &);
|
2000-07-18 17:45:27 +00:00
|
|
|
|
///
|
2003-08-28 07:41:31 +00:00
|
|
|
|
void write(Buffer const & buf, std::ostream & os) const;
|
2000-07-18 17:45:27 +00:00
|
|
|
|
///
|
2003-08-28 07:41:31 +00:00
|
|
|
|
void read(Buffer const & buf, LyXLex & lex);
|
2000-07-18 17:45:27 +00:00
|
|
|
|
///
|
2003-05-19 17:03:12 +00:00
|
|
|
|
virtual bool display() const;
|
2001-03-11 03:20:44 +00:00
|
|
|
|
///
|
Move BufferView cached pointer out of LyXText:
* LyXText
- bv(), bv_owner, : deleted.
- These methods now need a (Buffer const &) argument: getFont(), applyOuterFont(), getLayoutFont(), getLabelFont(), setCharFont(), setLayout(), singleWidth(), leftMargin(), rightMargin(), computeRowMetrics(), isMainText(), spacing(), isRTL(), cursorX(), rowBreakPoint(), setRowWidth(), labelFill(), labelEnd().
- These methods now need a (BufferView const &) argument and are propably candidates for future removal when 1.6 is opened for development: redoParagraph(), x2pos(), getRowNearY(), getColumnNearX(), checkInsetHit(), setHeightOfRow().
- recUndo(): now need a LCursor argument.
* CoordCache::get(LyXText const *, pit_type):
- now const.
- use const_iterator instead of iterator.
* FontIterator:
- add (Buffer const &) argument to ctor
- buffer_: new const reference to applicable BufferView.
* InsetBase
- xo(), yo(), covers() and neverIndent() are now const.
* InsetText::setViewCache(): deleted
All other changes are due to the LyXText and InsetBase API changes.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15618 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-30 12:45:33 +00:00
|
|
|
|
virtual bool neverIndent(Buffer const &) const { return true; }
|
2006-05-05 05:51:51 +00:00
|
|
|
|
///
|
2004-11-25 19:13:07 +00:00
|
|
|
|
virtual InsetBase::Code lyxCode() const;
|
2001-03-11 03:20:44 +00:00
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
virtual docstring const editMessage() const;
|
2001-03-11 03:20:44 +00:00
|
|
|
|
///
|
2006-10-17 16:23:27 +00:00
|
|
|
|
virtual void cursorPos(BufferView const & bv,
|
|
|
|
|
CursorSlice const & sl, bool boundary, int & x, int & y) const;
|
2006-05-05 05:51:51 +00:00
|
|
|
|
///
|
2006-05-28 17:02:57 +00:00
|
|
|
|
bool descendable() const { return true; }
|
|
|
|
|
///
|
2006-05-05 05:51:51 +00:00
|
|
|
|
virtual void metrics(MetricsInfo & mi, Dimension & dim) const;
|
|
|
|
|
///
|
2003-05-30 06:48:24 +00:00
|
|
|
|
virtual void draw(PainterInfo & pi, int x, int y) const;
|
2001-03-11 03:20:44 +00:00
|
|
|
|
///
|
2006-05-05 05:51:51 +00:00
|
|
|
|
virtual void edit(LCursor & cur, bool left);
|
|
|
|
|
///
|
|
|
|
|
virtual InsetBase * editXY(LCursor & cur, int x, int y);
|
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
virtual int latex(Buffer const & buf, odocstream & os,
|
2003-11-05 12:06:20 +00:00
|
|
|
|
OutputParams const &) const;
|
2001-03-11 03:20:44 +00:00
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
int plaintext(Buffer const & buf, odocstream & os,
|
2003-11-05 12:06:20 +00:00
|
|
|
|
OutputParams const & runparams) const;
|
2001-03-11 03:20:44 +00:00
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
int docbook(Buffer const & buf, odocstream & os,
|
2003-11-05 12:06:20 +00:00
|
|
|
|
OutputParams const & runparams) const;
|
2006-05-28 17:02:57 +00:00
|
|
|
|
///
|
|
|
|
|
void setCount(int c) { counter_ = c; }
|
2005-02-23 12:01:50 +00:00
|
|
|
|
private:
|
2006-05-28 17:02:57 +00:00
|
|
|
|
///
|
|
|
|
|
void setLabel(LCursor & cur) const;
|
2005-02-23 12:01:50 +00:00
|
|
|
|
///
|
|
|
|
|
virtual std::auto_ptr<InsetBase> doClone() const;
|
2006-05-05 05:51:51 +00:00
|
|
|
|
///
|
2006-11-11 20:55:40 +00:00
|
|
|
|
mutable docstring label;
|
2006-05-05 05:51:51 +00:00
|
|
|
|
///
|
|
|
|
|
mutable int labelwidth_;
|
|
|
|
|
///
|
2006-05-28 17:02:57 +00:00
|
|
|
|
mutable int counter_;
|
|
|
|
|
///
|
2006-05-05 05:51:51 +00:00
|
|
|
|
LyXTextClass const & textclass_;
|
2000-07-17 18:27:53 +00:00
|
|
|
|
};
|
|
|
|
|
|
2001-03-11 03:20:44 +00:00
|
|
|
|
|
|
|
|
|
inline
|
|
|
|
|
bool InsetCaption::display() const
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline
|
2004-11-25 19:13:07 +00:00
|
|
|
|
InsetBase::Code InsetCaption::lyxCode() const
|
2001-03-11 03:20:44 +00:00
|
|
|
|
{
|
|
|
|
|
return CAPTION_CODE;
|
|
|
|
|
}
|
2003-05-19 17:03:12 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
2000-07-17 18:27:53 +00:00
|
|
|
|
#endif
|