// -*- C++ -*- /** * \file FormMathsPanel.h * See the file COPYING. * * \author Alejandro Aguilar Sierra * \author John Levon * \author Angus Leeming * * Full author contact details are available in file CREDITS */ #ifndef FORM_MATHSPANEL_H #define FORM_MATHSPANEL_H #include "commandtags.h" #ifdef __GNUG__ #pragma interface #endif #include "MathsCallbacks.h" #include "FormBaseDeprecated.h" #include class FormMathsBitmap; class FormMathsDeco; class FormMathsDelim; class FormMathsMatrix; class FormMathsSpace; class FormMathsStyle; class FormMathsSub; struct FD_maths_panel; /** * This class provides an XForms implementation of the maths panel. */ class FormMathsPanel : public FormBaseBD { public: /// FormMathsPanel(LyXView &, Dialogs &); /// void setActive(FormMathsSub *) const; /// dispatch an LFUN: void dispatchFunc(kb_action action) const; /// dispatch a symbol insert void insertSymbol(string const & sym, bool bs = true) const; private: /// Pointer to the actual instantiation of the ButtonController. virtual xformsBC & bc(); /// Build the dialog virtual void build(); /// input handler virtual bool input(FL_OBJECT *, long); /// Pointer to the actual instantiation of the xforms form virtual FL_FORM * form() const; // Real GUI implementation boost::scoped_ptr dialog_; /// send LFUN_MATH_DISPLAY void mathDisplay() const; /// Subdialogs boost::scoped_ptr deco_; boost::scoped_ptr delim_; boost::scoped_ptr matrix_; boost::scoped_ptr space_; boost::scoped_ptr style_; boost::scoped_ptr arrow_; boost::scoped_ptr boperator_; boost::scoped_ptr brelats_; boost::scoped_ptr greek_; boost::scoped_ptr misc_; boost::scoped_ptr dots_; boost::scoped_ptr varsize_; boost::scoped_ptr ams_misc_; boost::scoped_ptr ams_arrows_; boost::scoped_ptr ams_rel_; boost::scoped_ptr ams_nrel_; boost::scoped_ptr ams_ops_; /// A pointer to the currently active subdialog mutable FormMathsSub * active_; /// The ButtonController ButtonController bc_; }; class FormMathsSub : public FormBaseBD { friend class FormMathsPanel; // has subdialogs to manipulate public: /// FormMathsSub(LyXView &, Dialogs &, FormMathsPanel const &, string const &, bool allowResize = true); protected: /// Pointer to the actual instantiation of the ButtonController. virtual xformsBC & bc(); /// The parent Maths Panel FormMathsPanel const & parent_; private: /// virtual void connect(); /// virtual void disconnect(); /// The ButtonController ButtonController bc_; }; inline xformsBC & FormMathsSub::bc() { return bc_; } inline xformsBC & FormMathsPanel::bc() { return bc_; } #endif // FORM_MATHSPANEL_H