3 * \file InsetParamsWidget.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Abdelrazak Younes
9 * Full author contact details are available in file CREDITS.
12 #ifndef INSET_PARAMS_WIDGET_H
13 #define INSET_PARAMS_WIDGET_H
15 #include "insets/InsetCode.h"
16 #include "insets/Inset.h"
18 #include "qt_helpers.h"
22 #include "support/strfwd.h"
35 // FIXME: Get rid of CheckedLineEdit in ButtonController and rename this one
40 CheckedWidget(QLineEdit * input, QWidget * label = 0);
51 typedef QList<CheckedWidget> CheckedWidgets;
53 class InsetParamsWidget : public QWidget
60 InsetParamsWidget(QWidget * parent);
61 /// This is a base class; destructor must exist and be virtual.
62 virtual ~InsetParamsWidget() {}
64 virtual QString dialogTitle() const { return toqstr(insetName(insetCode())); }
66 virtual InsetCode insetCode() const = 0;
68 virtual FuncCode creationCode() const = 0;
70 virtual void paramsToDialog(Inset const *) = 0;
72 virtual docstring dialogToParams() const = 0;
74 virtual bool initialiseParams(std::string const & /*data*/)
77 /// \return true if all CheckedWidgets are in a valid state.
78 virtual bool checkWidgets(bool readonly = false) const;
81 /// Add a widget to the list of all widgets whose validity should
82 /// be checked explicitly when the buttons are refreshed.
83 void addCheckedWidget(QLineEdit * input, QWidget * label = 0);
86 CheckedWidgets checked_widgets_;
89 } // namespace frontend
92 #endif // INSET_PARAMS_WIDGET_H