2003-11-12 14:38:26 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file insetcharstyle.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Angus Leeming
|
|
|
|
* \author Martin Vermeer
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef INSETCHARSTYLE_H
|
|
|
|
#define INSETCHARSTYLE_H
|
|
|
|
|
|
|
|
#include "insetcollapsable.h"
|
|
|
|
#include "lyxtextclass.h"
|
|
|
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
|
2005-01-19 15:03:31 +00:00
|
|
|
class InsetCharStyleParams {
|
|
|
|
public:
|
2003-11-12 14:38:26 +00:00
|
|
|
///
|
|
|
|
void write(std::ostream & os) const;
|
|
|
|
///
|
|
|
|
void read(LyXLex & lex);
|
|
|
|
///
|
|
|
|
std::string type;
|
|
|
|
///
|
|
|
|
std::string latextype;
|
|
|
|
///
|
|
|
|
std::string latexname;
|
|
|
|
///
|
2003-12-01 16:01:50 +00:00
|
|
|
std::string latexparam;
|
|
|
|
///
|
2003-11-12 14:38:26 +00:00
|
|
|
LyXFont font;
|
|
|
|
///
|
|
|
|
LyXFont labelfont;
|
2006-10-16 07:06:41 +00:00
|
|
|
///
|
|
|
|
bool show_label;
|
2003-11-12 14:38:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/** The CharStyle inset, also XML short element
|
|
|
|
|
|
|
|
*/
|
|
|
|
class InsetCharStyle : public InsetCollapsable {
|
|
|
|
public:
|
2005-05-04 11:21:14 +00:00
|
|
|
/// Construct an undefined character style
|
2006-01-01 20:28:05 +00:00
|
|
|
InsetCharStyle(BufferParams const &, std::string const);
|
2003-11-12 14:38:26 +00:00
|
|
|
///
|
|
|
|
InsetCharStyle(BufferParams const &, CharStyles::iterator);
|
2005-05-04 11:21:14 +00:00
|
|
|
/// Is this character style defined in the document's textclass?
|
|
|
|
/// May be wrong after textclass change or paste from another document
|
|
|
|
bool undefined() const;
|
|
|
|
/// Set the character style to "undefined"
|
|
|
|
void setUndefined();
|
|
|
|
/// (Re-)set the character style parameters from \p cs
|
|
|
|
void setDefined(CharStyles::iterator cs);
|
2003-11-12 14:38:26 +00:00
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
virtual docstring const editMessage() const;
|
2003-11-12 14:38:26 +00:00
|
|
|
///
|
2004-11-25 19:13:07 +00:00
|
|
|
InsetBase::Code lyxCode() const { return InsetBase::CHARSTYLE_CODE; }
|
2003-11-12 14:38:26 +00:00
|
|
|
///
|
|
|
|
void write(Buffer const &, std::ostream &) const;
|
|
|
|
///
|
|
|
|
void read(Buffer const & buf, LyXLex & lex);
|
|
|
|
///
|
2006-11-28 15:15:49 +00:00
|
|
|
bool metrics(MetricsInfo &, Dimension &) const;
|
2003-11-12 14:38:26 +00:00
|
|
|
///
|
2003-12-06 09:31:30 +00:00
|
|
|
void draw(PainterInfo &, int, int) const;
|
|
|
|
///
|
2003-11-12 14:38:26 +00:00
|
|
|
void getDrawFont(LyXFont &) const;
|
|
|
|
///
|
2006-03-25 16:23:06 +00:00
|
|
|
bool forceDefaultParagraphs(idx_type) const { return true; }
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
int latex(Buffer const &, odocstream &,
|
2003-11-12 14:38:26 +00:00
|
|
|
OutputParams const &) const;
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
int docbook(Buffer const &, odocstream &,
|
2003-11-12 14:38:26 +00:00
|
|
|
OutputParams const &) const;
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
int plaintext(Buffer const &, odocstream &,
|
2003-11-12 14:38:26 +00:00
|
|
|
OutputParams const &) const;
|
2005-11-25 14:40:34 +00:00
|
|
|
/// the string that is passed to the TOC
|
2006-10-21 00:16:43 +00:00
|
|
|
virtual int textString(Buffer const &, odocstream &,
|
2005-11-25 14:40:34 +00:00
|
|
|
OutputParams const &) const;
|
2003-11-12 14:38:26 +00:00
|
|
|
///
|
|
|
|
void validate(LaTeXFeatures &) const;
|
|
|
|
|
|
|
|
///
|
|
|
|
InsetCharStyleParams const & params() const { return params_; }
|
|
|
|
|
2005-09-10 06:51:58 +00:00
|
|
|
/// should paragraph indendation be ommitted in any case?
|
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
|
|
|
bool neverIndent(Buffer const &) const { return true; }
|
2005-09-10 06:51:58 +00:00
|
|
|
|
2003-11-12 14:38:26 +00:00
|
|
|
protected:
|
2004-11-23 23:04:52 +00:00
|
|
|
InsetCharStyle(InsetCharStyle const &);
|
2004-11-24 21:58:42 +00:00
|
|
|
virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
|
2004-11-04 19:50:04 +00:00
|
|
|
///
|
|
|
|
bool getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus &) const;
|
2003-11-12 14:38:26 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
friend class InsetCharStyleParams;
|
|
|
|
|
2004-11-23 23:04:52 +00:00
|
|
|
virtual std::auto_ptr<InsetBase> doClone() const;
|
|
|
|
|
2003-11-12 14:38:26 +00:00
|
|
|
/// used by the constructors
|
|
|
|
void init();
|
|
|
|
///
|
|
|
|
InsetCharStyleParams params_;
|
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
2003-11-12 14:38:26 +00:00
|
|
|
#endif
|