X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fxforms%2FFormDocument.h;h=5b28972e5ca074c11c7af8c34461ea5006b70dd9;hb=06c830f488023d8ff5c22cccee22c4effc8f65c3;hp=323b2ebc1b2aff6fb4c621de46065fc1eb85cacd;hpb=5f3c7736a28b13d30eb0bfc2bd7661f091a7d606;p=lyx.git diff --git a/src/frontends/xforms/FormDocument.h b/src/frontends/xforms/FormDocument.h index 323b2ebc1b..5b28972e5c 100644 --- a/src/frontends/xforms/FormDocument.h +++ b/src/frontends/xforms/FormDocument.h @@ -4,7 +4,7 @@ * * LyX, The Document Processor * - * Copyright (C) 2000 The LyX Team. + * Copyright 2000-2001 The LyX Team. * * @author Jürgen Vigna * @@ -13,20 +13,17 @@ #ifndef FORM_DOCUMENT_H #define FORM_DOCUMENT_H -#include "DialogBase.h" -#include "support/utility.hpp" #include +#include #ifdef __GNUG_ #pragma interface #endif -class LyXView; -class Dialogs; +#include "FormBaseDeprecated.h" + class Combox; class BufferParams; -class NoRepeatedApplyReadOnlyPolicy; -template class ButtonController; struct FD_form_tabbed_document; struct FD_form_doc_paper; @@ -35,159 +32,159 @@ struct FD_form_doc_language; struct FD_form_doc_options; struct FD_form_doc_bullet; -#ifdef SIGC_CXX_NAMESPACES -using SigC::Connection; -#endif - -/** This class provides an XForms implementation of the FormDocument Popup. +/** This class provides an XForms implementation of the FormDocument dialog. The table-layout-form here changes values for latex-tabulars + @author Jürgen Vigna */ -class FormDocument : public DialogBase, public noncopyable { +class FormDocument : public FormBaseBD { public: - /// #FormDocument x(Communicator ..., Popups ...);# - FormDocument(LyXView *, Dialogs *); - /// - ~FormDocument(); - /// - static int WMHideCB(FL_FORM *, void *); - /// - static void OKCB(FL_OBJECT *, long); - /// - static void ApplyCB(FL_OBJECT *, long); - /// - static void CancelCB(FL_OBJECT *, long); - /// - static void RestoreCB(FL_OBJECT *, long); - /// - static void InputCB(FL_OBJECT *, long); - /// - static void ChoiceClassCB(FL_OBJECT *, long); - /// - static void ChoiceBulletSizeCB(FL_OBJECT * ob, long); - /// - static void InputBulletLaTeXCB(FL_OBJECT * ob, long); - /// - static void BulletDepthCB(FL_OBJECT * ob, long); - /// - static void BulletPanelCB(FL_OBJECT * ob, long); - /// - static void BulletBMTableCB(FL_OBJECT * ob, long); - /// - enum EnumPopupStatus { - /// - POPUP_UNMODIFIED, - /// - POPUP_MODIFIED, - /// - POPUP_READONLY - }; - + FormDocument(LyXView *, Dialogs *); + /// + static void ComboInputCB(int, void *, Combox *); private: - /// - bool CheckDocumentInput(FL_OBJECT * ob, long); - /// - void ChoiceBulletSize(FL_OBJECT * ob, long); - /// - void InputBulletLaTeX(FL_OBJECT * ob, long); - /// - void BulletDepth(FL_OBJECT * ob, long); - /// - void BulletPanel(FL_OBJECT * ob, long); - /// - void BulletBMTable(FL_OBJECT * ob, long); - /// - void checkMarginValues(); - /// - void checkReadOnly(); - /// - void CheckChoiceClass(FL_OBJECT * ob, long); - /// - void UpdateLayoutDocument(BufferParams const & params); - - /// Create the popup if necessary, update it and display it. - void show(); - /// Hide the popup. - void hide(); - /// Update the popup. - void update(); - /// - void paper_update(BufferParams const &); - /// - void class_update(BufferParams const &); - /// - void language_update(BufferParams const &); - /// - void options_update(BufferParams const &); - /// - void bullets_update(BufferParams const &); - /// Apply from popup - void apply(); - /// - void paper_apply(); - /// - bool class_apply(); - /// - bool language_apply(); - /// - bool options_apply(); - /// - void bullets_apply(); - /// Cancel from popup - void cancel(); - /// Build the popup - void build(); - /// Explicitly free the popup. - void free(); - - /// Typedefinitions from the fdesign produced Header file - FD_form_tabbed_document * build_tabbed_document(); - /// - FD_form_doc_paper * build_doc_paper(); - /// - FD_form_doc_class * build_doc_class(); - /// - FD_form_doc_language * build_doc_language(); - /// - FD_form_doc_options * build_doc_options(); - /// - FD_form_doc_bullet * build_doc_bullet(); - - /// Real GUI implementation. - FD_form_tabbed_document * dialog_; - /// - FD_form_doc_paper * paper_; - /// - FD_form_doc_class * class_; - /// - FD_form_doc_language * language_; - /// - FD_form_doc_options * options_; - /// - FD_form_doc_bullet * bullets_; - /// Which LyXView do we belong to? - LyXView * lv_; - /// - Dialogs * d_; - /// Update connection. - Connection u_; - /// Hide connection. - Connection h_; - /// has form contents changed? Used to control OK/Apply - EnumPopupStatus status; - /// - int ActCell; - /// - int Confirmed; - /// - int current_bullet_panel; - /// - int current_bullet_depth; - /// - FL_OBJECT * fbullet; - /// - Combox * combo_language; - /// - ButtonController * bc_; + /// + enum State { + /// + INPUT, + /// + CHECKCHOICECLASS, + /// + CHOICEBULLETSIZE, + /// + INPUTBULLETLATEX, + /// + BULLETDEPTH1, + /// + BULLETDEPTH2, + /// + BULLETDEPTH3, + /// + BULLETDEPTH4, + /// + BULLETPANEL1, + /// + BULLETPANEL2, + /// + BULLETPANEL3, + /// + BULLETPANEL4, + /// + BULLETPANEL5, + /// + BULLETPANEL6, + /// + BULLETBMTABLE + }; + /// Pointer to the actual instantiation of the ButtonController. + virtual xformsBC & bc(); + /** Redraw the form (on receipt of a Signal indicating, for example, + that the xforms colours have been re-mapped). */ + virtual void redraw(); + /// Build the dialog + virtual void build(); + /// Filter the inputs + virtual bool input( FL_OBJECT *, long ); + /// Update the dialog. + virtual void update(); + /// Apply from dialog + virtual void apply(); + /// Cancel from dialog + virtual void cancel(); + + /// + virtual FL_FORM * form() const; + + /// + bool CheckDocumentInput(FL_OBJECT * ob, long); + /// + void ChoiceBulletSize(FL_OBJECT * ob, long); + /// + void InputBulletLaTeX(FL_OBJECT * ob, long); + /// + void BulletDepth(FL_OBJECT * ob, State); + /// + void BulletPanel(FL_OBJECT * ob, State); + /// + void BulletBMTable(FL_OBJECT * ob, long); + /// + void checkMarginValues(); + /// + void checkReadOnly(); + /// + void CheckChoiceClass(FL_OBJECT * ob, long); + /// + void UpdateLayoutDocument(BufferParams const & params); + + /// + void paper_update(BufferParams const &); + /// + void class_update(BufferParams const &); + /// + void language_update(BufferParams const &); + /// + void options_update(BufferParams const &); + /// + void bullets_update(BufferParams const &); + + /// + void paper_apply(); + /// + bool class_apply(); + /// + bool language_apply(); + /// + bool options_apply(); + /// + void bullets_apply(); + + /// Fdesign generated methods + FD_form_tabbed_document * build_tabbed_document(); + /// + FD_form_doc_paper * build_doc_paper(); + /// + FD_form_doc_class * build_doc_class(); + /// + FD_form_doc_language * build_doc_language(); + /// + FD_form_doc_options * build_doc_options(); + /// + FD_form_doc_bullet * build_doc_bullet(); + + /// Real GUI implementation. + boost::scoped_ptr dialog_; + /// + boost::scoped_ptr paper_; + /// + boost::scoped_ptr class_; + /// + boost::scoped_ptr language_; + /// + boost::scoped_ptr options_; + /// + boost::scoped_ptr bullets_; + /// + int ActCell; + /// + int Confirmed; + /// + int current_bullet_panel; + /// + int current_bullet_depth; + /// + FL_OBJECT * fbullet; + /// + boost::scoped_ptr combo_language; + /// + boost::scoped_ptr combo_doc_class; + /// The ButtonController + ButtonController bc_; }; + +inline +xformsBC & FormDocument::bc() +{ + return bc_; +} + #endif