// -*- C++ -*-
-/* ButtonPolicies.h
+/*
+ * \file ButtonPolicies.h
+ * \author Allan Rae, rae@lyx.org
+ *
* Provides a state machine implementation of the various button policies
* used by the dialogs.
- * Author: Allan Rae <rae@lyx.org>
+ *
* This file is part of
* ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-2000 The LyX Team.
+ * Copyright 1995-2001 The LyX Team.
*
* This file Copyright 2000
* Allan Rae
The IgnorantPolicy is a special case that allows anything.
*/
-class ButtonPolicy : public noncopyable {
+class ButtonPolicy : boost::noncopyable {
public:
///
virtual ~ButtonPolicy() {}
///
CANCEL = 4,
///
- UNDO_ALL = 8
+ RESTORE = 8
};
///
static const Button ALL_BUTTONS =
- Button(OKAY | APPLY | CANCEL | UNDO_ALL);
+ Button(OKAY | APPLY | CANCEL | RESTORE);
/** State machine inputs.
All the policies so far have both CANCEL and HIDE always going to
HIDE are treated differently.
*/
enum SMInput {
- ///
+ /// the dialog contents are now valid
SMI_VALID = 0,
- ///
+ /// the dialog contents are now invalid
SMI_INVALID,
- ///
+ /// an apply-and-hide action has happened
SMI_OKAY,
- ///
+ /// an apply action has happened
SMI_APPLY,
- ///
+ /// a cancel action has happened
SMI_CANCEL,
- ///
- SMI_UNDO_ALL,
- ///
+ /// a restore action has happened
+ SMI_RESTORE,
+ /// the dialog has been hidden
SMI_HIDE,
- ///
+ /// the dialog contents are read-only
SMI_READ_ONLY,
- ///
+ /// the dialog contents can be modified
SMI_READ_WRITE,
- ///
+ /// the state of the dialog contents has not changed
SMI_NOOP,
- ///
- SMI_TOTAL // not a real input
+ /// for internal use
+ SMI_TOTAL
};
/// Trigger a transition with this input.