2000-04-12 15:11:29 +00:00
|
|
|
// -*- C++ -*-
|
2003-03-12 22:17:50 +00:00
|
|
|
/**
|
|
|
|
* \file bufferview_funcs.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:27:08 +00:00
|
|
|
*
|
2003-03-12 22:17:50 +00:00
|
|
|
* \author Lars Gullik Bjønnes
|
|
|
|
* \author Jean-Marc Lasgouttes
|
|
|
|
* \author Angus Leeming
|
2002-03-21 17:27:08 +00:00
|
|
|
*
|
2003-03-12 22:17:50 +00:00
|
|
|
* Full author contact details are available in file CREDITS
|
|
|
|
*/
|
2000-07-24 13:53:19 +00:00
|
|
|
|
2000-04-12 15:11:29 +00:00
|
|
|
#ifndef BUFFERVIEW_FUNCS_H
|
|
|
|
#define BUFFERVIEW_FUNCS_H
|
|
|
|
|
|
|
|
#include "LString.h"
|
|
|
|
|
|
|
|
class BufferView;
|
|
|
|
class LyXFont;
|
2000-12-22 14:44:29 +00:00
|
|
|
class LyXText;
|
2000-04-12 15:11:29 +00:00
|
|
|
|
2003-04-03 00:36:31 +00:00
|
|
|
namespace bv_funcs {
|
|
|
|
|
2003-07-10 12:26:40 +00:00
|
|
|
///
|
|
|
|
void resizeInsets(BufferView * bv);
|
2003-03-12 22:17:50 +00:00
|
|
|
/** Set \param data using \param font and \param toggle.
|
|
|
|
* If successful, returns true.
|
|
|
|
*/
|
|
|
|
bool font2string(LyXFont const & font, bool toggle, string & data);
|
|
|
|
/** Set \param font and \param toggle using \param data.
|
|
|
|
* If successful, returns true.
|
|
|
|
*/
|
|
|
|
bool string2font(string const & data, LyXFont & font, bool & toggle);
|
|
|
|
/** Returns the current freefont, encoded as a string to be passed to the
|
|
|
|
* frontends.
|
|
|
|
*/
|
|
|
|
string const freefont2string();
|
|
|
|
/** Set the freefont using the contents of \param data dispatched from
|
|
|
|
* the frontends and apply it at the current cursor location.
|
|
|
|
*/
|
|
|
|
void update_and_apply_freefont(BufferView * bv, string const & data);
|
|
|
|
/** Apply the contents of freefont at the current cursor location.
|
|
|
|
*/
|
|
|
|
void apply_freefont(BufferView * bv);
|
|
|
|
|
2003-04-03 00:36:31 +00:00
|
|
|
/// what type of depth change to make
|
|
|
|
enum DEPTH_CHANGE {
|
|
|
|
INC_DEPTH,
|
|
|
|
DEC_DEPTH
|
|
|
|
};
|
|
|
|
|
2003-04-03 01:26:02 +00:00
|
|
|
/**
|
|
|
|
* Increase or decrease the nesting depth of the selected paragraph(s)
|
|
|
|
* if test_only, don't change any depths. Returns whether something
|
|
|
|
* (would have) changed
|
|
|
|
*/
|
|
|
|
extern bool changeDepth(BufferView *, LyXText *, DEPTH_CHANGE, bool test_only);
|
2003-03-12 22:17:50 +00:00
|
|
|
|
2000-04-12 15:11:29 +00:00
|
|
|
///
|
2001-08-02 18:46:53 +00:00
|
|
|
extern void emph(BufferView *);
|
2000-04-12 15:11:29 +00:00
|
|
|
///
|
2001-08-02 18:46:53 +00:00
|
|
|
extern void bold(BufferView *);
|
2000-04-12 15:11:29 +00:00
|
|
|
///
|
2001-08-02 18:46:53 +00:00
|
|
|
extern void noun(BufferView *);
|
2000-04-12 15:11:29 +00:00
|
|
|
///
|
2001-08-02 18:46:53 +00:00
|
|
|
extern void lang(BufferView *, string const &);
|
2000-04-12 15:11:29 +00:00
|
|
|
///
|
2001-08-02 18:46:53 +00:00
|
|
|
extern void number(BufferView *);
|
2000-10-09 12:30:52 +00:00
|
|
|
///
|
2001-08-02 18:46:53 +00:00
|
|
|
extern void tex(BufferView *);
|
2000-04-12 15:11:29 +00:00
|
|
|
///
|
2001-08-02 18:46:53 +00:00
|
|
|
extern void code(BufferView *);
|
2000-04-12 15:11:29 +00:00
|
|
|
///
|
2001-08-02 18:46:53 +00:00
|
|
|
extern void sans(BufferView *);
|
2000-04-12 15:11:29 +00:00
|
|
|
///
|
2001-08-02 18:46:53 +00:00
|
|
|
extern void roman(BufferView *);
|
2000-04-12 15:11:29 +00:00
|
|
|
///
|
2001-08-02 18:46:53 +00:00
|
|
|
extern void styleReset(BufferView *);
|
2000-04-12 15:11:29 +00:00
|
|
|
///
|
2001-08-02 18:46:53 +00:00
|
|
|
extern void underline(BufferView *);
|
2000-04-12 15:11:29 +00:00
|
|
|
///
|
2001-08-02 18:46:53 +00:00
|
|
|
extern void fontSize(BufferView *, string const &);
|
2002-03-21 17:27:08 +00:00
|
|
|
/// Returns the current font and depth as a message.
|
2001-08-02 18:46:53 +00:00
|
|
|
extern string const currentState(BufferView *);
|
2000-04-12 15:11:29 +00:00
|
|
|
///
|
2001-08-02 18:46:53 +00:00
|
|
|
extern void toggleAndShow(BufferView *, LyXFont const &,
|
|
|
|
bool toggleall = true);
|
2003-04-03 00:36:31 +00:00
|
|
|
|
|
|
|
}; // namespace bv_funcs
|
|
|
|
|
2000-04-12 15:11:29 +00:00
|
|
|
#endif
|