]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/ButtonPolicies.h
use anon namespace, somewhat better comp. handling of minipages, not quite there yet
[lyx.git] / src / frontends / ButtonPolicies.h
index 047d680ec4cdd2d6fb71c39b047b7b99c11526ed..a3603b67b3557fa81497b28104e32ec400908ba5 100644 (file)
@@ -23,6 +23,7 @@
 #include <vector>
 #include <boost/utility.hpp>
 
+#include "support/LOstream.h"
 
 /** An abstract base class for button policies.
     A state machine implementation of the various button policies used by the
@@ -65,7 +66,7 @@
 
     The IgnorantPolicy is a special case that allows anything.
  */
-class ButtonPolicy : public noncopyable {
+class ButtonPolicy : public boost::noncopyable {
 public:
        ///
        virtual ~ButtonPolicy() {}
@@ -160,19 +161,21 @@ public:
 
 
 inline
-ostream & operator<<(ostream & os, ButtonPolicy::SMInput smi) 
+std::ostream & operator<<(std::ostream & os, ButtonPolicy::State st)
 {
-       os << int(smi);
+       os << int(st);
        return os;
 }
 
+
 inline
-ostream & operator<<(ostream & os, ButtonPolicy::State st)
+std::ostream & operator<<(std::ostream & os, ButtonPolicy::SMInput smi)
 {
-       os << int(st);
+       os << int(smi);
        return os;
 }
 
+
 //--------------------- Actual Policy Classes -----------------------------
 
 /** Ok and Cancel buttons for dialogs with read-only operation.
@@ -186,7 +189,7 @@ public:
        ///
        OkCancelPolicy();
        ///
-       virtual ~OkCancelPolicy() {}
+       //virtual ~OkCancelPolicy() {}
        
        /// Trigger a transition with this input.
        virtual void input(SMInput);
@@ -213,13 +216,14 @@ private:
        StateMachine state_machine_;
 };
 
-
 /** Ok and Cancel buttons for dialogs where read-only operation is blocked.
     The state machine design for this policy allows changes to occur within
     the dialog while a file is read-only -- the okay button is disabled until
     a read-write input is given.  When the file is made read-write the dialog
-    will then be in the correct state (as if the file had always been read-write).
-    Note: This scheme supports the relabelling of Cancel to Close and vice versa.
+    will then be in the correct state (as if the file had always been
+    read-write).
+    Note: This scheme supports the relabelling of Cancel to Close
+    and vice versa.
     This is based on the value of the bool state of the Button::CANCEL.
     true == Cancel, false == Close
  */
@@ -228,7 +232,7 @@ public:
        ///
        OkCancelReadOnlyPolicy();
        ///
-       virtual ~OkCancelReadOnlyPolicy() {}
+       //virtual ~OkCancelReadOnlyPolicy() {}
        
        /// Trigger a transition with this input.
        virtual void input(SMInput);
@@ -253,16 +257,18 @@ private:
 };
 
 
-/** Ok, Apply and Cancel buttons for dialogs where read-only operation is blocked.
+/** Ok, Apply and Cancel buttons for dialogs where read-only operation
+    is blocked.
     Repeated Apply are not allowed.  Likewise,  Ok cannot follow Apply without
-    some valid input. That is, the dialog contents must change between each Apply
-    or Apply and Ok.
+    some valid input. That is, the dialog contents must change between
+    each Apply or Apply and Ok.
     The state machine design for this policy allows changes to occur within
     the dialog while a file is read-only -- the Ok+Apply buttons are disabled
     until a read-write input is given.  When the file is made read-write the
     dialog will then be in the correct state (as if the file had always been
     read-write).
-    Note: This scheme supports the relabelling of Cancel to Close and vice versa.
+    Note: This scheme supports the relabelling of Cancel to Close
+    and vice versa.
     This is based on the value of the bool state of the Button::CANCEL.
     true == Cancel, false == Close
  */
@@ -272,7 +278,7 @@ public:
        ///
        NoRepeatedApplyReadOnlyPolicy();
        ///
-       virtual ~NoRepeatedApplyReadOnlyPolicy() {}
+       //virtual ~NoRepeatedApplyReadOnlyPolicy() {}
        
        /// Trigger a transition with this input.
        virtual void input(SMInput);
@@ -297,14 +303,16 @@ private:
 };
 
 
-/** Ok, Apply and Cancel buttons for dialogs where read-only operation is blocked.
+/** Ok, Apply and Cancel buttons for dialogs where read-only
+    operation is blocked.
     Repeated Apply is allowed.  Likewise,  Ok can follow Apply.
     The state machine design for this policy allows changes to occur within
     the dialog while a file is read-only -- the Ok+Apply buttons are disabled
     until a read-write input is given.  When the file is made read-write the
     dialog will then be in the correct state (as if the file had always been
     read-write).
-    Note: This scheme supports the relabelling of Cancel to Close and vice versa.
+    Note: This scheme supports the relabelling of Cancel to Close
+    and vice versa.
     This is based on the value of the bool state of the Button::CANCEL.
     true == Cancel, false == Close
  */
@@ -313,7 +321,7 @@ public:
        ///
        OkApplyCancelReadOnlyPolicy();
        ///
-       virtual ~OkApplyCancelReadOnlyPolicy() {}
+       //virtual ~OkApplyCancelReadOnlyPolicy() {}
        
        /// Trigger a transition with this input.
        virtual void input(SMInput);
@@ -339,7 +347,8 @@ private:
 
 
 /** Ok, Apply and Cancel buttons for dialogs where repeated Apply is allowed.
-    Note: This scheme supports the relabelling of Cancel to Close and vice versa.
+    Note: This scheme supports the relabelling of Cancel to Close
+    and vice versa.
     This is based on the value of the bool state of the Button::CANCEL.
     true == Cancel, false == Close
  */
@@ -348,7 +357,7 @@ public:
        ///
        OkApplyCancelPolicy();
        ///
-       virtual ~OkApplyCancelPolicy() {}
+       //virtual ~OkApplyCancelPolicy() {}
        
        /// Trigger a transition with this input.
        virtual void input(SMInput);
@@ -371,7 +380,8 @@ private:
 
 
 /** Ok, Apply and Cancel buttons for dialogs with no repeated Apply.
-    Note: This scheme supports the relabelling of Cancel to Close and vice versa.
+    Note: This scheme supports the relabelling of Cancel to Close
+    and vice versa.
     This is based on the value of the bool state of the Button::CANCEL.
     true == Cancel, false == Close
  */
@@ -380,7 +390,7 @@ public:
        ///
        NoRepeatedApplyPolicy();
        ///
-       virtual ~NoRepeatedApplyPolicy() {}
+       //virtual ~NoRepeatedApplyPolicy() {}
        
        /// Trigger a transition with this input.
        virtual void input(SMInput);
@@ -404,7 +414,8 @@ private:
 
 /** Defines the policy used by the Preferences dialog.
     Four buttons: Ok (Save), Apply, Cancel/Close, Restore.
-    Note: This scheme supports the relabelling of Cancel to Close and vice versa.
+    Note: This scheme supports the relabelling of Cancel to Close
+    and vice versa.
     This is based on the value of the bool state of the Button::CANCEL.
     true == Cancel, false == Close
  */
@@ -413,7 +424,7 @@ public:
        ///
        PreferencesPolicy();
        ///
-       virtual ~PreferencesPolicy() {}
+       //virtual ~PreferencesPolicy() {}
        
        /// Trigger a transition with this input.
        virtual void input(SMInput);
@@ -443,7 +454,7 @@ private:
  */
 class IgnorantPolicy : public ButtonPolicy {
 public:
-       virtual ~IgnorantPolicy() {}
+       //virtual ~IgnorantPolicy() {}
        
        /// Trigger a transition with this input.
        virtual void input(SMInput) {}