4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
9 * Full author contact details are available in file CREDITS.
16 #include "ButtonController.h"
24 /** \c Dialog collects the different parts of a Model-Controller-View
25 * split of a generic dialog together.
27 class GuiDialog : public QDialog, public Dialog
32 /// \param lv is the access point for the dialog to the LyX kernel.
33 /// \param name is the identifier given to the dialog by its parent
35 GuiDialog(LyXView & lv, std::string const & name);
36 //GuiDialog(GuiDialog &, docstring const &);
39 // dialog closed from WM
41 // Restore button clicked
45 // Apply button clicked
47 // Close button clicked
52 * These methods are publicly accessible because they are invoked
53 * by the View when the user presses... guess what ;-)
62 /** Check whether we may apply our data.
64 * The buttons are disabled if not and (re-)enabled if yes.
67 void setButtonsValid(bool valid);
69 /** \name Dialog Components
70 * Methods to access the various components making up a dialog.
73 ButtonController const & bc() const { return bc_; }
74 ButtonController & bc() { return bc_; }
83 bool readOnly() const;
85 /// the dialog has changed contents
86 virtual void changed();
88 /// default: do nothing
89 virtual void applyView() {}
90 /// default: do nothing
91 virtual void update_contents() {}
95 virtual void hideView();
96 /// Create the dialog if necessary, update it and display it.
97 virtual void showView();
99 virtual bool isVisibleView() const;
100 /// is the dialog currently valid ?
101 virtual bool isValid();
104 /// update the dialog
105 virtual void updateView();
107 ButtonController bc_;
108 /// are we updating ?
112 } // namespace frontend
115 #endif // GUIDIALOG_H