2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2008-09-20 13:44:51 +00:00
|
|
|
* \file FloatPlacement.h
|
2006-03-05 17:24:44 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Edwin Leuven
|
|
|
|
* \author John Levon
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2008-09-20 13:44:51 +00:00
|
|
|
#ifndef FLOATPLACEMENT_H
|
|
|
|
#define FLOATPLACEMENT_H
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2010-02-15 23:17:45 +00:00
|
|
|
#include "InsetParamsWidget.h"
|
2007-08-11 15:48:15 +00:00
|
|
|
#include "ui_FloatPlacementUi.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2010-02-08 22:09:40 +00:00
|
|
|
#include "support/docstring.h"
|
2006-10-21 00:16:43 +00:00
|
|
|
|
2008-09-20 13:44:51 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
2010-02-10 17:33:39 +00:00
|
|
|
class FloatList;
|
2010-02-08 22:09:40 +00:00
|
|
|
class Inset;
|
2008-09-20 13:44:51 +00:00
|
|
|
class InsetFloatParams;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2010-02-15 23:17:45 +00:00
|
|
|
namespace frontend {
|
|
|
|
|
|
|
|
class FloatPlacement : public InsetParamsWidget, public Ui::FloatPlacementUi {
|
2006-03-05 17:24:44 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2010-02-10 12:26:59 +00:00
|
|
|
FloatPlacement(bool show_options = false, QWidget * parent = 0);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2010-02-15 23:17:45 +00:00
|
|
|
/// \name DialogView inherited methods
|
|
|
|
//@{
|
2020-10-01 07:42:11 +00:00
|
|
|
InsetCode insetCode() const override { return FLOAT_CODE; }
|
|
|
|
FuncCode creationCode() const override { return LFUN_FLOAT_INSERT; }
|
|
|
|
QString dialogTitle() const override { return qt_("Float Settings"); }
|
|
|
|
void paramsToDialog(Inset const *) override;
|
|
|
|
docstring dialogToParams() const override;
|
|
|
|
bool checkWidgets(bool readonly) const override;
|
2010-02-15 23:17:45 +00:00
|
|
|
//@}
|
2010-02-08 22:09:40 +00:00
|
|
|
///
|
2006-03-05 17:24:44 +00:00
|
|
|
void useWide();
|
2010-02-08 22:09:40 +00:00
|
|
|
///
|
2006-03-05 17:24:44 +00:00
|
|
|
void useSideways();
|
2010-02-10 12:26:59 +00:00
|
|
|
///
|
2018-05-10 18:15:11 +00:00
|
|
|
void setPlacement(std::string const & placement);
|
2010-02-10 12:26:59 +00:00
|
|
|
///
|
2018-05-10 18:15:11 +00:00
|
|
|
void setAlignment(std::string const & placement);
|
|
|
|
///
|
|
|
|
std::string const getPlacement() const;
|
|
|
|
///
|
|
|
|
std::string const getAlignment() const;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2010-02-10 12:26:59 +00:00
|
|
|
private Q_SLOTS:
|
2018-05-10 18:15:11 +00:00
|
|
|
void on_placementCO_currentIndexChanged(QString const &);
|
2006-03-05 17:24:44 +00:00
|
|
|
void changedSlot();
|
|
|
|
|
2008-01-11 18:56:53 +00:00
|
|
|
private:
|
2010-02-10 12:26:59 +00:00
|
|
|
///
|
2015-05-11 09:35:02 +00:00
|
|
|
void checkAllowed() const;
|
2010-02-10 12:26:59 +00:00
|
|
|
///
|
2010-02-10 17:33:39 +00:00
|
|
|
void initFloatTypeCO(FloatList const & floats);
|
2015-05-22 08:37:14 +00:00
|
|
|
///
|
2018-05-10 18:15:11 +00:00
|
|
|
void initFloatPlacementCO(bool const);
|
|
|
|
///
|
2020-10-16 07:19:34 +00:00
|
|
|
bool possiblePlacement(char p) const;
|
2010-02-10 12:26:59 +00:00
|
|
|
|
2008-01-11 18:56:53 +00:00
|
|
|
/// one of figure or table?
|
|
|
|
bool standardfloat_;
|
2010-02-10 07:06:14 +00:00
|
|
|
///
|
2015-05-22 08:37:14 +00:00
|
|
|
std::string allowed_placement_;
|
|
|
|
///
|
2015-05-22 16:59:17 +00:00
|
|
|
bool allows_wide_;
|
|
|
|
///
|
|
|
|
bool allows_sideways_;
|
|
|
|
///
|
2010-02-10 17:33:39 +00:00
|
|
|
FloatList const * float_list_;
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
2010-02-15 23:17:45 +00:00
|
|
|
} // namespace frontend
|
2008-09-20 13:44:51 +00:00
|
|
|
} // namespace lyx
|
2006-10-21 00:16:43 +00:00
|
|
|
|
2008-09-20 13:44:51 +00:00
|
|
|
#endif // FLOATPLACEMENT_H
|