]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/FloatPlacement.h
QDialogButtonBox for the remaining dialogs.
[lyx.git] / src / frontends / qt4 / FloatPlacement.h
index 3d95db9da0bf04d13dcc5129f3c2301b96c1e1c5..d5d9449538bd1c942e92717297a2e1a62f7021ff 100644 (file)
 #ifndef FLOATPLACEMENT_H
 #define FLOATPLACEMENT_H
 
+#include "InsetParamsWidget.h"
 #include "ui_FloatPlacementUi.h"
 
-#include <QWidget>
-
 #include "support/docstring.h"
 
 namespace lyx {
 
+class FloatList;
 class Inset;
 class InsetFloatParams;
 
-class FloatPlacement : public QWidget, public Ui::FloatPlacementUi {
+namespace frontend {
+
+class FloatPlacement : public InsetParamsWidget, public Ui::FloatPlacementUi {
        Q_OBJECT
 public:
        FloatPlacement(bool show_options = false, QWidget * parent = 0);
 
-       ///
+       /// \name DialogView inherited methods
+       //@{
+       InsetCode insetCode() const { return FLOAT_CODE; }
+       FuncCode creationCode() const { return LFUN_FLOAT_INSERT; }
+       QString dialogTitle() const { return qt_("Float Settings"); }
        void paramsToDialog(Inset const *);
-       ///
        docstring dialogToParams() const;
+       bool checkWidgets(bool readonly) const;
+       //@}
        ///
        void useWide();
        ///
        void useSideways();
        ///
-       void set(std::string const & placement);
+       void setPlacement(std::string const & placement);
+       ///
+       void setAlignment(std::string const & placement);
+       ///
+       std::string const getPlacement() const;
        ///
-       std::string const get() const;
+       std::string const getAlignment() const;
 
 private Q_SLOTS:
-       void on_defaultsCB_stateChanged(int state);
+       void on_placementCO_currentIndexChanged(QString const &);
        void changedSlot();
 
-Q_SIGNALS:
-       void changed();
-
 private:
        ///
-       void checkAllowed();
+       void checkAllowed() const;
+       ///
+       void initFloatTypeCO(FloatList const & floats);
+       ///
+       void initFloatPlacementCO(bool const);
        ///
-       std::string const get(bool & wide, bool & sideways) const;
+       bool possiblePlacement(char const & p) const;
 
        /// one of figure or table?
        bool standardfloat_;
        ///
-       std::string float_type_;
+       std::string allowed_placement_;
+       ///
+       bool allows_wide_;
+       ///
+       bool allows_sideways_;
+       ///
+       FloatList const * float_list_;
 };
 
+} // namespace frontend
 } // namespace lyx
 
 #endif // FLOATPLACEMENT_H