]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormParagraph.h
Bugfixes: checkboxes to radiobuttons (from J�rgen S) and remove a little
[lyx.git] / src / frontends / xforms / FormParagraph.h
index b34a1e23d435a5b56181da6604064d54d4f67f45..224b4b4a9ea871f94e5de561e998b0d307152e64 100644 (file)
@@ -4,7 +4,7 @@
  * 
  *           LyX, The Document Processor
  *      
- *           Copyright (C) 2000 The LyX Team.
+ *           Copyright 2000-2001 The LyX Team.
  *
  *           @author Jürgen Vigna
  *
 #ifndef FORM_PARAGRAPH_H
 #define FORM_PARAGRAPH_H
 
-#include "DialogBase.h"
-#include <boost/utility.hpp>
-#include <vector>
+#include <boost/smart_ptr.hpp>
 
 #ifdef __GNUG_
 #pragma interface
 #endif
 
-class LyXView;
-class Dialogs;
-class NoRepeatedApplyReadOnlyPolicy;
-//template <class x> class ButtonController;
-class ButtonController;
+#include "FormBaseDeprecated.h"
 
-struct FD_form_tabbed_paragraph;
-struct FD_form_paragraph_general;
-struct FD_form_paragraph_extra;
+class Paragraph;
+struct FD_form_paragraph;
 
-#ifdef SIGC_CXX_NAMESPACES
-using SigC::Connection;
-#endif
-
-/** This class provides an XForms implementation of the FormParagraph Popup.
-    The table-layout-form here changes values for latex-tabulars
+/** This class provides an XForms implementation of the FormParagraph dialog.
+ *           @author Jürgen Vigna
  */
-class FormParagraph : public DialogBase, public noncopyable {
+class FormParagraph : public FormBaseBD {
 public:
-    FormParagraph(LyXView *, Dialogs *);
-    ~FormParagraph();
-    ///
-    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 VSpaceCB(FL_OBJECT *, long);
-    ///
-    enum EnumPopupStatus {
        ///
-        POPUP_UNMODIFIED,
+       FormParagraph(LyXView *, Dialogs *);
+private:
+       /// 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();
+       /// Apply from dialog
+       virtual void apply();
+       /// Update the dialog
+       virtual void update();
+       /// Filter the inputs on callback from xforms
+       virtual bool input(FL_OBJECT * ob, long);
+       /// Connect signals
+       virtual void connect();
+       /// Disconnect signals
+       virtual void disconnect();
        ///
-        POPUP_MODIFIED,
+       void changedParagraph();
        ///
-        POPUP_READONLY
-    };
+       Paragraph const * getCurrentParagraph() const;
+       ///
+       virtual FL_FORM * form() const;
+       
+       /// Fdesign generated method
+       FD_form_paragraph * build_paragraph();
 
-private:
-    /// Create the popup if necessary, update it and display it.
-    void show();
-    /// Hide the popup.
-    void hide();
-    /// Update the popup.
-    void update();
-    ///
-    void general_update();
-    ///
-    void extra_update();
-    /// Apply from popup
-    void apply();
-    ///
-    void general_apply();
-    ///
-    void extra_apply();
-    /// Cancel from popup
-    void cancel();
-    /// Build the popup
-    void build();
-    /// Explicitly free the popup.
-    void free();
-    ///
-    bool CheckParagraphInput(FL_OBJECT * ob, long);
+       /// Real GUI implementation.
+       boost::scoped_ptr<FD_form_paragraph> dialog_;
 
+       /// The ButtonController
+       ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_;
 
-    /// Typedefinitions from the fdesign produced Header file
-    FD_form_tabbed_paragraph * build_tabbed_paragraph();
-    ///
-    FD_form_paragraph_general * build_paragraph_general();
-    ///
-    FD_form_paragraph_extra * build_paragraph_extra();
+       /// Changed Paragraph connection.
+       SigC::Connection cp_;
 
-    /// Real GUI implementation.
-    FD_form_tabbed_paragraph  * dialog_;
-    ///
-    FD_form_paragraph_general * general_;
-    ///
-    FD_form_paragraph_extra   * extra_;
-    /// 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;
-    ///
-       ButtonController/*<NoRepeatedApplyReadOnlyPolicy>*/ * bc_;
+       /// The current Paragraph
+       Paragraph const * par_;
 };
 
+
+inline
+xformsBC & FormParagraph::bc()
+{
+       return bc_;
+}
 #endif