2000-06-12 11:27:15 +00:00
|
|
|
|
// -*- C++ -*-
|
2002-09-25 14:26:13 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file insetbutton.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2000-06-12 11:27:15 +00:00
|
|
|
|
*
|
2002-09-25 14:26:13 +00:00
|
|
|
|
* \author Asger Alstrup Nielsen
|
|
|
|
|
* \author J<EFBFBD>rgen Vigna
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
2002-03-21 17:09:55 +00:00
|
|
|
|
*
|
2002-09-25 14:26:13 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS
|
|
|
|
|
*/
|
2000-06-12 11:27:15 +00:00
|
|
|
|
|
|
|
|
|
#ifndef INSET_BUTTON_H
|
|
|
|
|
#define INSET_BUTTON_H
|
|
|
|
|
|
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
#include "inset.h"
|
2000-06-12 11:27:15 +00:00
|
|
|
|
#include "LString.h"
|
2003-02-25 14:51:38 +00:00
|
|
|
|
#include <boost/weak_ptr.hpp>
|
2000-06-12 11:27:15 +00:00
|
|
|
|
|
|
|
|
|
/** Used to provide an inset that looks like a button.
|
|
|
|
|
*/
|
|
|
|
|
class InsetButton: public Inset {
|
|
|
|
|
public:
|
|
|
|
|
///
|
2000-07-05 14:57:48 +00:00
|
|
|
|
int ascent(BufferView *, LyXFont const &) const;
|
2000-06-12 11:27:15 +00:00
|
|
|
|
///
|
2000-07-05 14:57:48 +00:00
|
|
|
|
int descent(BufferView *, LyXFont const &) const;
|
2000-06-12 11:27:15 +00:00
|
|
|
|
///
|
2000-07-05 14:57:48 +00:00
|
|
|
|
int width(BufferView *, LyXFont const &) const;
|
2000-06-12 11:27:15 +00:00
|
|
|
|
///
|
2000-06-23 15:02:46 +00:00
|
|
|
|
void draw(BufferView *, LyXFont const &, int, float &, bool) const;
|
2000-06-12 11:27:15 +00:00
|
|
|
|
|
|
|
|
|
protected:
|
2003-02-25 14:51:38 +00:00
|
|
|
|
///
|
|
|
|
|
virtual void cache(BufferView *) const;
|
|
|
|
|
///
|
|
|
|
|
virtual BufferView * view() const;
|
2000-06-12 11:27:15 +00:00
|
|
|
|
/// This should provide the text for the button
|
2001-07-28 12:24:16 +00:00
|
|
|
|
virtual string const getScreenLabel(Buffer const *) const = 0;
|
2003-02-25 14:51:38 +00:00
|
|
|
|
private:
|
|
|
|
|
mutable boost::weak_ptr<BufferView> view_;
|
2000-06-12 11:27:15 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|