]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/FloatPlacement.h
Amend f441590c
[lyx.git] / src / frontends / qt4 / 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 { return FLOAT_CODE; }
37         FuncCode creationCode() const { return LFUN_FLOAT_INSERT; }
38         void paramsToDialog(Inset const *);
39         docstring dialogToParams() const;
40         bool checkWidgets(bool readonly) const;
41         //@}
42         ///
43         void useWide();
44         ///
45         void useSideways();
46         ///
47         void set(std::string const & placement);
48         ///
49         std::string const get() const;
50
51 private Q_SLOTS:
52         void on_defaultsCB_stateChanged(int state);
53         void changedSlot();
54
55 private:
56         ///
57         void checkAllowed() const;
58         ///
59         std::string const get(bool & wide, bool & sideways) const;
60         ///
61         void initFloatTypeCO(FloatList const & floats);
62         ///
63         bool possiblePlacement(char const & p) const;
64
65         /// one of figure or table?
66         bool standardfloat_;
67         ///
68         std::string allowed_placement_;
69         ///
70         bool allows_wide_;
71         ///
72         bool allows_sideways_;
73         ///
74         FloatList const * float_list_;
75 };
76
77 } // namespace frontend
78 } // namespace lyx
79
80 #endif // FLOATPLACEMENT_H