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"
19 #include "support/strfwd.h"
32 // FIXME: Get rid of CheckedLineEdit in ButtonController and rename this one
37 CheckedWidget(QLineEdit * input, QWidget * label = 0);
48 typedef QList<CheckedWidget> CheckedWidgets;
50 class InsetParamsWidget : public QWidget
57 InsetParamsWidget(QWidget * parent) : QWidget(parent) {}
58 /// This is a base class; destructor must exist and be virtual.
59 virtual ~InsetParamsWidget() {}
61 virtual QString dialogTitle() const;
63 virtual InsetCode insetCode() const = 0;
65 virtual FuncCode creationCode() const = 0;
67 virtual void paramsToDialog(Inset const *) = 0;
69 virtual docstring dialogToParams() const = 0;
71 virtual bool initialiseParams(std::string const & /*data*/)
74 /// \return true if all CheckedWidgets are in a valid state.
75 virtual bool checkWidgets(bool readonly = false) const;
78 /// Add a widget to the list of all widgets whose validity should
79 /// be checked explicitly when the buttons are refreshed.
80 void addCheckedWidget(QLineEdit * input, QWidget * label = 0);
83 CheckedWidgets checked_widgets_;
86 } // namespace frontend
89 #endif // INSET_PARAMS_WIDGET_H