X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fcontrollers%2FControlButtons.h;h=f9ebcff63dd7f401e404f4aa52c8e65c7e86c5bc;hb=120c89f24fae05379fbdc8539d3cfae574c2aecd;hp=2918724acb5598668170df3dab14662320722c11;hpb=62f5f89becf0d9a5c6b5a277ea5eeeafd170d174;p=lyx.git diff --git a/src/frontends/controllers/ControlButtons.h b/src/frontends/controllers/ControlButtons.h index 2918724acb..f9ebcff63d 100644 --- a/src/frontends/controllers/ControlButtons.h +++ b/src/frontends/controllers/ControlButtons.h @@ -1,14 +1,12 @@ -/* This file is part of - * ====================================================== +// -*- C++ -*- +/** + * \file ControlButtons.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * - * LyX, The Document Processor + * \author Angus Leeming * - * Copyright 2001 The LyX Team. - * - * ====================================================== - * - * \file ControlButtonss.h - * \author Angus Leeming + * 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. @@ -28,26 +26,24 @@ #ifndef CONTROLBUTTONS_H #define CONTROLBUTTONS_H -#ifdef __GNUG__ -#pragma interface -#endif -#include "DialogBase.h" // This can go eventually +#include class ViewBase; class ButtonControllerBase; /** Abstract base class for Controllers with a ButtonController. */ -class ControlButtons : public DialogBase -{ -public: // methods +class ControlButtons : boost::noncopyable { +public: /// - ControlButtons() {} + ControlButtons(); /// virtual ~ControlButtons() {} - /// These functions are called when the controlling buttons are pressed. + /** These functions are called by the view when the appropriate buttons + * are pressed. + */ /// void ApplyButton(); /// @@ -57,12 +53,24 @@ public: // methods /// void RestoreButton(); - /** Allow the view to access the ButtonController. This method must be - instantiated in a daughter class that creates the actual instance - of the ButtonController. */ - virtual ButtonControllerBase & bc() = 0; + /// Returns the user-specified iconification policy. + bool IconifyWithMain() const; + + /// + ButtonControllerBase & 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(); + /// Get changed parameters and Dispatch them to the kernel. virtual void apply() = 0; /// Disconnect signals and hide View. @@ -70,10 +78,16 @@ protected: /// Update dialog before showing it. virtual void update() = 0; - /** Allow the Controller to access the View. This method must be - instantiated in a daughter class that creates the actual instance - of the View. */ - virtual ViewBase & view() = 0; + /** 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_; + /// + ViewBase * view_ptr_; }; #endif // CONTROLBUTTONS_H