]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetcharstyle.h
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[lyx.git] / src / insets / insetcharstyle.h
index c4fcad97083f64dccaceef6c2f973b0c62e7a961..39231e9a57d7c83f6f26eceb7d44fdbb84f52bec 100644 (file)
 #ifndef INSETCHARSTYLE_H
 #define INSETCHARSTYLE_H
 
-
 #include "insetcollapsable.h"
 #include "lyxtextclass.h"
 
 
- struct InsetCharStyleParams {
+namespace lyx {
+
+
+class InsetCharStyleParams {
+public:
        ///
        void write(std::ostream & os) const;
        ///
@@ -35,6 +38,8 @@
        LyXFont font;
        ///
        LyXFont labelfont;
+       ///
+       bool show_label;
 };
 
 
 */
 class InsetCharStyle : public InsetCollapsable {
 public:
+       /// Construct an undefined character style
+       InsetCharStyle(BufferParams const &, std::string const);
        ///
-
-
        InsetCharStyle(BufferParams const &, CharStyles::iterator);
-       /// Copy constructor
-       InsetCharStyle(InsetCharStyle const &);
+       /// 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);
        ///
-       virtual std::auto_ptr<InsetBase> clone() const;
+       virtual docstring const editMessage() const;
        ///
-       std::string 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 setButtonLabel();
+       bool metrics(MetricsInfo &, Dimension &) const;
        ///
-       void 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);
        ///
-       virtual
-       DispatchResult
-       priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
+       bool getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus &) const;
 
 private:
        friend class InsetCharStyleParams;
 
+       virtual std::auto_ptr<InsetBase> doClone() const;
+
        /// used by the constructors
        void init();
        ///
        InsetCharStyleParams params_;
 };
 
+
+} // namespace lyx
+
 #endif