]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetbox.h
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[lyx.git] / src / insets / insetbox.h
index 7a1604f2df1937e41ca98be84cea8d21659a4b5a..8786c1c649efb1301eeaec92995e0f9d7ddc9f63 100644 (file)
 #ifndef INSETBOX_H
 #define INSETBOX_H
 
-
 #include "insetcollapsable.h"
 #include "lyxlength.h"
-#include "support/translator.h"
+#include "mailinset.h"
+
 
+namespace lyx {
 
-struct InsetBoxParams {
+class InsetBoxParams {
+public:
        ///
        InsetBoxParams(std::string const &);
        ///
@@ -57,16 +59,12 @@ class InsetBox : public InsetCollapsable {
 public:
        ///
        InsetBox(BufferParams const &, std::string const &);
-       /// Copy constructor
-       InsetBox(InsetBox const &);
        ///
        ~InsetBox();
        ///
-       virtual std::auto_ptr<InsetBase> clone() const;
-       ///
-       std::string const editMessage() const;
+       virtual docstring const editMessage() const;
        ///
-       InsetOld::Code lyxCode() const { return InsetOld::BOX_CODE; }
+       InsetBase::Code lyxCode() const { return InsetBase::BOX_CODE; }
        ///
        void write(Buffer const &, std::ostream &) const;
        ///
@@ -74,26 +72,31 @@ public:
        ///
        void setButtonLabel();
        ///
-       void metrics(MetricsInfo &, Dimension &) const;
+       bool metrics(MetricsInfo &, Dimension &) const;
        /// show the Box dialog
        bool showInsetDialog(BufferView * bv) const;
        ///
-       int latex(Buffer const &, std::ostream &,
-                       LatexRunParams const &) const;
+       bool display() const { return false; }
        ///
-       int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const;
+       bool forceDefaultParagraphs(idx_type) const;
        ///
-       int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const &) const;
+       bool neverIndent(Buffer const &) const { return true; }
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const & runparams) const;
+       bool noFontChange() const { return true; }
+       ///
+       int latex(Buffer const &, odocstream &, OutputParams const &) const;
+       ///
+       int docbook(Buffer const &, odocstream &, OutputParams const &) const;
+       ///
+       int plaintext(Buffer const &, odocstream &,
+                 OutputParams const & runparams) const;
        ///
        void validate(LaTeXFeatures &) const;
        ///
        InsetBoxParams const & params() const { return params_; }
        ///
+       bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const;
+       ///
        enum BoxType {
                Frameless,
                Boxed,
@@ -103,13 +106,15 @@ public:
                Doublebox
        };
 protected:
-       ///
-       virtual
-       DispatchResult
-       priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
+       InsetBox(InsetBox const &);
+       virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
+       /// Is the width forced to some value?
+       virtual bool hasFixedWidth() const;
 private:
        friend class InsetBoxParams;
 
+       virtual std::auto_ptr<InsetBase> doClone() const;
+
        /// used by the constructors
        void init();
        ///
@@ -117,17 +122,6 @@ private:
 };
 
 
-namespace {
-
-typedef Translator<std::string, InsetBox::BoxType> BoxTranslator;
-BoxTranslator const & boxtranslator();
-BoxTranslator const & boxtranslator_loc();
-
-} // anon
-
-
-#include "mailinset.h"
-
 class InsetBoxMailer : public MailInset {
 public:
        ///
@@ -150,4 +144,7 @@ private:
        InsetBox & inset_;
 };
 
+
+} // namespace lyx
+
 #endif // INSET_BOX_H