X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetcharstyle.h;h=39231e9a57d7c83f6f26eceb7d44fdbb84f52bec;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=ae06acf1b89196c2ae55a56074d57ba19868699e;hpb=183239b7def8ca0e51432f2d88891d4b9f055953;p=lyx.git diff --git a/src/insets/insetcharstyle.h b/src/insets/insetcharstyle.h index ae06acf1b8..39231e9a57 100644 --- a/src/insets/insetcharstyle.h +++ b/src/insets/insetcharstyle.h @@ -17,7 +17,11 @@ #include "lyxtextclass.h" -struct InsetCharStyleParams { +namespace lyx { + + +class InsetCharStyleParams { +public: /// void write(std::ostream & os) const; /// @@ -34,6 +38,8 @@ struct InsetCharStyleParams { LyXFont font; /// LyXFont labelfont; + /// + bool show_label; }; @@ -42,40 +48,53 @@ struct InsetCharStyleParams { */ class InsetCharStyle : public InsetCollapsable { public: + /// Construct an undefined character style + InsetCharStyle(BufferParams const &, std::string const); /// InsetCharStyle(BufferParams const &, CharStyles::iterator); + /// 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); /// - std::string const editMessage() const; + virtual docstring const editMessage() const; /// - InsetOld::Code lyxCode() const { return InsetOld::CHARSTYLE_CODE; } + InsetBase::Code lyxCode() const { return InsetBase::CHARSTYLE_CODE; } /// void write(Buffer const &, std::ostream &) const; /// void read(Buffer const & buf, LyXLex & lex); /// - void metrics(MetricsInfo &, Dimension &) const; + bool metrics(MetricsInfo &, Dimension &) const; /// void draw(PainterInfo &, int, int) const; /// void getDrawFont(LyXFont &) const; /// - int latex(Buffer const &, std::ostream &, - OutputParams const &) const; + bool forceDefaultParagraphs(idx_type) const { return true; } /// - int linuxdoc(Buffer const &, std::ostream &, - OutputParams const &) const; + int latex(Buffer const &, odocstream &, + OutputParams const &) const; /// - int docbook(Buffer const &, std::ostream &, + int docbook(Buffer const &, odocstream &, OutputParams const &) const; /// - int plaintext(Buffer const &, std::ostream &, + int plaintext(Buffer const &, odocstream &, OutputParams const &) const; + /// the string that is passed to the TOC + virtual void textString(Buffer const &, odocstream &) const; /// void validate(LaTeXFeatures &) const; /// InsetCharStyleParams const & params() const { return params_; } + /// should paragraph indendation be ommitted in any case? + bool neverIndent(Buffer const &) const { return true; } + protected: InsetCharStyle(InsetCharStyle const &); virtual void doDispatch(LCursor & cur, FuncRequest & cmd); @@ -91,8 +110,9 @@ private: void init(); /// InsetCharStyleParams params_; - /// - bool has_label_; }; + +} // namespace lyx + #endif