// -*- C++ -*-
-/* This file is part of
- * ======================================================
- *
- * LyX, The Document Processor
- *
- * Copyright 2001 The LyX Team.
+/**
+ * \file ControlButtons.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
*
- * ======================================================
+ * \author Angus Leeming
*
- * \file ControlButtons.h
- * \author Angus Leeming <a.leeming@ic.ac.uk>
+ * Full author contact details are available in file CREDITS
*
* ControlButtons serves only to control the activation of the Ok, Apply, Cancel
* and Restore buttons on the View dialog.
#ifndef CONTROLBUTTONS_H
#define CONTROLBUTTONS_H
-#ifdef __GNUG__
-#pragma interface
-#endif
-#include "DialogBase.h" // This can go eventually
+#include <boost/utility.hpp>
+#include <boost/scoped_ptr.hpp>
class ViewBase;
-class ButtonControllerBase;
+class ButtonController;
/** Abstract base class for Controllers with a ButtonController.
*/
-class ControlButtons : public DialogBase
-{
+class ControlButtons : boost::noncopyable {
public:
///
ControlButtons();
///
- virtual ~ControlButtons() {}
+ virtual ~ControlButtons();
/** These functions are called by the view when the appropriate buttons
* are pressed.
bool IconifyWithMain() const;
///
- ButtonControllerBase & bc();
+ ButtonController & bc();
///
void setView(ViewBase &);
- ///
- void setButtonController(ButtonControllerBase &);
+ /** When Applying it's useful to know whether the dialog is about
+ to close or not (no point refreshing the display for example). */
+ bool isClosing() const { return is_closing_; }
protected:
///
ViewBase & view();
- /** When Applying it's useful to know whether the dialog is about
- to close or not (no point refreshing the display for example). */
- bool isClosing() const { return is_closing_; }
-
/// Get changed parameters and Dispatch them to the kernel.
virtual void apply() = 0;
/// Disconnect signals and hide View.
/** This flag can be set by one of the miriad the controller methods
to ensure that the dialog is shut down. */
bool emergency_exit_;
-
private:
///
bool is_closing_;
- /// We own neither of these pointers.
- ButtonControllerBase * bc_ptr_;
///
+ boost::scoped_ptr<ButtonController> bc_ptr_;
+ /// We do not own this pointer.
ViewBase * view_ptr_;
};