]> git.lyx.org Git - lyx.git/blob - src/frontends/qt/FloatPlacement.h
No need (any longer?) to create a new view for lyxfiles-open
[lyx.git] / src / frontends / qt / FloatPlacement.h
1 // -*- C++ -*-
2 /**
3  * \file FloatPlacement.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Edwin Leuven
8  * \author John Levon
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef FLOATPLACEMENT_H
14 #define FLOATPLACEMENT_H
15
16 #include "InsetParamsWidget.h"
17 #include "ui_FloatPlacementUi.h"
18
19 #include "support/docstring.h"
20
21 namespace lyx {
22
23 class FloatList;
24 class Inset;
25 class InsetFloatParams;
26
27 namespace frontend {
28
29 class FloatPlacement : public InsetParamsWidget, public Ui::FloatPlacementUi {
30         Q_OBJECT
31 public:
32         FloatPlacement(bool show_options = false, QWidget * parent = 0);
33
34         /// \name DialogView inherited methods
35         //@{
36         InsetCode insetCode() const override { return FLOAT_CODE; }
37         FuncCode creationCode() const override { return LFUN_FLOAT_INSERT; }
38         QString dialogTitle() const override { return qt_("Float Settings"); }
39         void paramsToDialog(Inset const *) override;
40         docstring dialogToParams() const override;
41         bool checkWidgets(bool readonly) const override;
42         //@}
43         ///
44         void useWide();
45         ///
46         void useSideways();
47         ///
48         void setPlacement(std::string const & placement);
49         ///
50         void setAlignment(std::string const & alignment);
51         ///
52         std::string const getPlacement() const;
53         ///
54         std::string const getAlignment() const;
55
56 private Q_SLOTS:
57         void on_placementCO_currentIndexChanged(int);
58         void changedSlot();
59
60 private:
61         ///
62         void checkAllowed() const;
63         ///
64         void initFloatTypeCO(FloatList const & floats);
65         ///
66         void initFloatPlacementCO(bool const);
67         ///
68         bool possiblePlacement(char p) const;
69
70         /// one of figure or table?
71         bool standardfloat_;
72         ///
73         std::string allowed_placement_;
74         ///
75         bool allows_wide_;
76         ///
77         bool allows_sideways_;
78         ///
79         FloatList const * float_list_;
80 };
81
82 } // namespace frontend
83 } // namespace lyx
84
85 #endif // FLOATPLACEMENT_H