]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormDocument.h
Disable various buttons when buffer is read only
[lyx.git] / src / frontends / xforms / FormDocument.h
index 2805d4cf763b0cf0dc78305241c6a6b97ca0e165..5b28972e5ca074c11c7af8c34461ea5006b70dd9 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_DOCUMENT_H
 #define FORM_DOCUMENT_H
 
-#include "FormBase.h"
 #include <vector>
+#include <boost/smart_ptr.hpp>
 
 #ifdef __GNUG_
 #pragma interface
 #endif
 
-class LyXView;
-class Dialogs;
+#include "FormBaseDeprecated.h"
+
 class Combox;
 class BufferParams;
 
@@ -32,19 +32,15 @@ struct FD_form_doc_language;
 struct FD_form_doc_options;
 struct FD_form_doc_bullet;
 
-/** 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 FormBaseBD {
 public:
-       /// #FormDocument x(Communicator ..., Popups ...);#
        FormDocument(LyXView *, Dialogs *);
        ///
-       ~FormDocument();
-       ///
        static void ComboInputCB(int, void *, Combox *);
-
 private:
        ///
        enum State {
@@ -79,15 +75,20 @@ private:
                ///
                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 popup.
+       /// Update the dialog.
        virtual void update();
-       /// Apply from popup
+       /// Apply from dialog
        virtual void apply();
-       /// Cancel from popup
+       /// Cancel from dialog
        virtual void cancel();
 
        ///
@@ -136,7 +137,7 @@ private:
        ///
        void bullets_apply();
 
-       /// Typedefinitions from the fdesign produced Header file
+       /// Fdesign generated methods
        FD_form_tabbed_document * build_tabbed_document();
        ///
        FD_form_doc_paper * build_doc_paper();
@@ -150,17 +151,17 @@ private:
        FD_form_doc_bullet * build_doc_bullet();
 
        /// Real GUI implementation.
-       FD_form_tabbed_document * dialog_;
+       boost::scoped_ptr<FD_form_tabbed_document> dialog_;
        ///
-       FD_form_doc_paper       * paper_;
+       boost::scoped_ptr<FD_form_doc_paper>       paper_;
        ///
-       FD_form_doc_class       * class_;
+       boost::scoped_ptr<FD_form_doc_class>       class_;
        ///
-       FD_form_doc_language    * language_;
+       boost::scoped_ptr<FD_form_doc_language>    language_;
        ///
-       FD_form_doc_options     * options_;
+       boost::scoped_ptr<FD_form_doc_options>     options_;
        ///
-       FD_form_doc_bullet      * bullets_;
+       boost::scoped_ptr<FD_form_doc_bullet>      bullets_;
        ///
        int ActCell;
        ///
@@ -172,9 +173,18 @@ private:
        ///
        FL_OBJECT * fbullet;
        ///
-       Combox * combo_language;
+       boost::scoped_ptr<Combox> combo_language;
        ///
-       Combox * combo_doc_class;
+       boost::scoped_ptr<Combox> combo_doc_class;
+       /// The ButtonController
+       ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_;
 };
 
+
+inline
+xformsBC & FormDocument::bc()
+{
+       return bc_;
+}
+
 #endif