]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/ButtonPolicies.h
Move LaTeX and VC logs to GUI-I on xforms
[lyx.git] / src / frontends / ButtonPolicies.h
index 94f3eea983a740da1d9d82ce03352d6574d302db..56755f433b1a9076f4a7181d6d43530da74f09a3 100644 (file)
@@ -216,7 +216,32 @@ private:
        StateMachine state_machine_;
 };
 
-
+/** OK button policy for dialogs that can't mutate the document,
+    and are always valid
+ */ 
+class OkViewPolicy : public ButtonPolicy {
+public:
+       ///
+       OkViewPolicy();
+       /// Trigger a transition with this input
+       virtual void input(SMInput);
+       /// activation status
+       virtual bool buttonStatus(Button button) const {
+               return button & outputs_[state_];
+       }
+       /// are we in a read-only state ?
+       virtual bool isReadOnly() const { 
+               return false;
+       }
+private:
+       /// current state
+       State state_;
+       /// which buttons are active
+       StateOutputs outputs_;
+       ///
+       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