Inset::xhtml(XHTMLStream &, ...)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32089 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2009-11-19 20:22:04 +00:00
parent 4125830098
commit 502dc7ca52
4 changed files with 26 additions and 2 deletions

View File

@ -28,6 +28,7 @@
#include "FuncRequest.h"
#include "FuncStatus.h"
#include "MetricsInfo.h"
#include "output_xhtml.h"
#include "Text.h"
#include "TextClass.h"
@ -406,6 +407,12 @@ int Inset::docbook(odocstream &, OutputParams const &) const
}
docstring Inset::xhtml(XHTMLStream & xs, OutputParams const &) const
{
xs << "[[Inset: " << from_ascii(insetName(lyxCode())) << "]]";
return docstring();
}
docstring Inset::xhtml(odocstream & od, OutputParams const &) const
{
od << "[[Inset: " << from_ascii(insetName(lyxCode())) << "]]";

View File

@ -53,6 +53,7 @@ class ParConstIterator;
class ParIterator;
class Text;
class TocList;
class XHTMLStream;
namespace graphics { class PreviewLoader; }
@ -297,7 +298,13 @@ public:
virtual int plaintext(odocstream &, OutputParams const &) const = 0;
/// docbook output
virtual int docbook(odocstream & os, OutputParams const &) const;
/// LyX HTML output
/// XHTML output
/// the inset is expected to write XHTML to the XHTMLStream
/// \return any "deferred" material that should be written outside the
/// normal stream, and which will in fact be written after the current
/// paragraph closes. this is appropriate e.g. for floats.
virtual docstring xhtml(XHTMLStream & xs, OutputParams const &) const;
// the old one, to be removed
virtual docstring xhtml(odocstream & os, OutputParams const &) const;
/// the string that is passed to the TOC
virtual void tocString(odocstream &) const {}

View File

@ -174,15 +174,23 @@ void XHTMLStream::clearTagDeque()
}
}
XHTMLStream & XHTMLStream::operator<<(docstring const & d)
{
// I'm tempted to make sure here that there are no tags in the input
clearTagDeque();
os_ << html::htmlize(d);
return *this;
}
XHTMLStream & XHTMLStream::operator<<(const char * s)
{
clearTagDeque();
os_ << html::htmlize(from_ascii(s));
return *this;
}
XHTMLStream & XHTMLStream::operator<<(char_type c)
{
clearTagDeque();

View File

@ -89,6 +89,8 @@ public:
///
XHTMLStream & operator<<(docstring const &);
///
XHTMLStream & operator<<(const char *);
///
XHTMLStream & operator<<(char_type);
///
XHTMLStream & operator<<(StartTag const &);