X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fbufferview_funcs.h;h=8be453589c0f72cedd0d5e5d0b16427995f90ad6;hb=09e01879979643949f1f2c7216023f1f35d5ada2;hp=ada69da5ea9fcc786dd5b2dcf1732fcf01195b9b;hpb=ce363ba1012d517db9fd8a2a688ded914f347e04;p=lyx.git diff --git a/src/bufferview_funcs.h b/src/bufferview_funcs.h index ada69da5ea..8be453589c 100644 --- a/src/bufferview_funcs.h +++ b/src/bufferview_funcs.h @@ -1,4 +1,16 @@ // -*- C++ -*- +/** + * \file bufferview_funcs.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. + * + * \author Lars Gullik Bjønnes + * \author Jean-Marc Lasgouttes + * \author Angus Leeming + * + * Full author contact details are available in file CREDITS + */ + #ifndef BUFFERVIEW_FUNCS_H #define BUFFERVIEW_FUNCS_H @@ -6,49 +18,74 @@ class BufferView; class LyXFont; +class LyXText; + +namespace bv_funcs { + +/** 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); + +/// what type of depth change to make +enum DEPTH_CHANGE { + INC_DEPTH, + DEC_DEPTH +}; + +/** + * 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); /// -extern void Foot(BufferView *); -/// -extern void Emph(BufferView *); -/// -extern void Bold(BufferView *); -/// -extern void Noun(BufferView *); -/// -extern void Margin(BufferView *); -/// -extern void Figure(); -/// -extern void Table(); -/// -extern void Lang(BufferView *, string const &); -/// -extern void Melt(BufferView *); -/// -extern void Tex(BufferView *); +extern void emph(BufferView *); /// -extern void changeDepth(BufferView *, int); +extern void bold(BufferView *); /// -extern void Free(BufferView *); +extern void noun(BufferView *); /// -extern void ProhibitInput(BufferView *); +extern void lang(BufferView *, string const &); /// -extern void AllowInput(BufferView *); +extern void number(BufferView *); /// -extern void Code(BufferView *); +extern void tex(BufferView *); /// -extern void Sans(BufferView *); +extern void code(BufferView *); /// -extern void Roman(BufferView *); +extern void sans(BufferView *); /// -extern void StyleReset(BufferView *); +extern void roman(BufferView *); /// -extern void Underline(BufferView *); +extern void styleReset(BufferView *); /// -extern void FontSize(BufferView *, string const &); +extern void underline(BufferView *); /// -extern string CurrentState(BufferView *); +extern void fontSize(BufferView *, string const &); +/// Returns the current font and depth as a message. +extern string const currentState(BufferView *); /// -extern void ToggleAndShow(BufferView *, LyXFont const &); +extern void toggleAndShow(BufferView *, LyXFont const &, + bool toggleall = true); +/// replace selection with insertion +extern void replaceSelection(LyXText * lt); +}; // namespace bv_funcs + #endif