]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/ButtonPolicies.h
Small fix from Angus
[lyx.git] / src / frontends / ButtonPolicies.h
index 4c2c118e29d8da3660aba5a688da852683c69e18..d4d48534bdda89bb0841318ef4bb3690033b1249 100644 (file)
@@ -38,6 +38,7 @@
     NoRepeatedApply            |       N  |    Y         |     N
     NoRepeatedApplyReadOnly    |       Y  |    Y         |     N
     Preferences                        |       N  |    Y         | No (Ok-Close)
+    Ignorant                   |      N/A |    N/A       |    N/A
     ========================================================================
 
     Policy
@@ -61,6 +62,8 @@
        has its own special version of repeated apply handling because its Ok
        button is actually a Save button -- its always reasonable to Save the
        preferences if the dialog has changed since the last save.
+
+    The IgnorantPolicy is a special case that allows anything.
  */
 class ButtonPolicy : public noncopyable {
 public:
@@ -417,4 +420,27 @@ private:
        StateMachine state_machine_;
 };
 
+
+/** Defines the policy used by dialogs that are forced to support a button
+    controller when they either don't have a use for one or are not ready to
+    use one.  This may be useful when testing a new button policy but wishing
+    to minimise problems to users by supplying an anything-goes policy via a
+    preprocessor directive.
+ */
+class IgnorantPolicy : public ButtonPolicy {
+public:
+       virtual ~IgnorantPolicy() {}
+       
+       /// Trigger a transition with this input.
+       virtual void input(SMInput) {}
+       /// Activation status of a button.
+       virtual bool buttonStatus(Button) const {
+               return true;
+       }
+       /// Are we in a read-only state?
+       virtual bool isReadOnly() const {
+               return false;
+       }
+};
+
 #endif