2003-10-10 21:08:55 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-04-25 01:24:38 +00:00
|
|
|
* \file RenderButton.h
|
2003-10-10 21:08:55 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Angus Leeming
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
#ifndef RENDERBUTTON_H
|
|
|
|
#define RENDERBUTTON_H
|
2003-10-10 21:08:55 +00:00
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
#include "RenderBase.h"
|
2006-10-11 19:40:50 +00:00
|
|
|
#include "support/docstring.h"
|
2003-10-10 21:08:55 +00:00
|
|
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
|
2003-10-10 21:08:55 +00:00
|
|
|
class RenderButton : public RenderBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
RenderButton();
|
|
|
|
|
2020-10-01 07:42:11 +00:00
|
|
|
RenderBase * clone(Inset const *) const override;
|
2003-10-10 21:08:55 +00:00
|
|
|
|
|
|
|
/// compute the size of the object returned in dim
|
2020-10-01 07:42:11 +00:00
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const override;
|
2003-10-10 21:08:55 +00:00
|
|
|
/// draw inset and update (xo, yo)-cache
|
2020-12-13 08:51:32 +00:00
|
|
|
void draw(PainterInfo & pi, int x, int y, bool const darkmode = false) const override;
|
2003-10-10 21:08:55 +00:00
|
|
|
|
|
|
|
/// Provide the text for the button
|
2020-03-14 13:17:30 +00:00
|
|
|
void update(docstring const &, bool editable,
|
|
|
|
bool inherit, bool broken = false);
|
2003-10-10 21:08:55 +00:00
|
|
|
|
2003-10-25 20:09:52 +00:00
|
|
|
/// equivalent to dynamic_cast
|
2020-10-01 07:42:11 +00:00
|
|
|
RenderButton * asButton() override { return this; }
|
2003-10-25 20:09:52 +00:00
|
|
|
|
2003-10-10 21:08:55 +00:00
|
|
|
private:
|
|
|
|
/// The stored data.
|
2006-10-21 00:16:43 +00:00
|
|
|
docstring text_;
|
2003-10-10 21:08:55 +00:00
|
|
|
bool editable_;
|
2020-03-14 13:17:30 +00:00
|
|
|
bool broken_;
|
2017-05-24 09:28:08 +00:00
|
|
|
bool inherit_font_;
|
2003-10-10 21:08:55 +00:00
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
#endif // NOT RENDERBUTTON_H
|