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-08-23 00:17:00 +00:00
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
2003-03-12 22:17:50 +00:00
|
|
|
|
* \author Jean-Marc Lasgouttes
|
|
|
|
|
* \author Angus Leeming
|
2002-03-21 17:27:08 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2003-03-12 22:17:50 +00:00
|
|
|
|
*/
|
2000-07-24 13:53:19 +00:00
|
|
|
|
|
2000-04-12 15:11:29 +00:00
|
|
|
|
#ifndef BUFFERVIEW_FUNCS_H
|
|
|
|
|
#define BUFFERVIEW_FUNCS_H
|
|
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
|
#include <string>
|
2005-02-22 11:41:22 +00:00
|
|
|
|
#include <vector>
|
2003-10-06 15:43:21 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
|
|
class Point;
|
2004-11-30 01:59:49 +00:00
|
|
|
|
class BufferView;
|
2005-07-15 15:49:40 +00:00
|
|
|
|
class DocIterator;
|
2007-04-29 13:39:47 +00:00
|
|
|
|
class Inset_code;
|
2007-04-29 18:17:15 +00:00
|
|
|
|
class Font;
|
2006-10-15 22:32:56 +00:00
|
|
|
|
|
2003-04-03 00:36:31 +00:00
|
|
|
|
namespace bv_funcs {
|
|
|
|
|
|
2004-02-13 11:05:29 +00:00
|
|
|
|
/// Set \param data using \param font and \param toggle. Return success.
|
2007-04-29 18:17:15 +00:00
|
|
|
|
bool font2string(Font const & font, bool toggle, std::string & data);
|
2004-02-13 11:05:29 +00:00
|
|
|
|
|
|
|
|
|
/// Set \param font and \param toggle using \param data. Return success.
|
2007-04-29 18:17:15 +00:00
|
|
|
|
bool string2font(std::string const & data, Font & font, bool & toggle);
|
2004-02-13 11:05:29 +00:00
|
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
|
/** Returns the current freefont, encoded as a std::string to be passed to the
|
2003-03-12 22:17:50 +00:00
|
|
|
|
* frontends.
|
|
|
|
|
*/
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string const freefont2string();
|
2003-11-03 09:23:23 +00:00
|
|
|
|
|
2006-11-08 11:38:51 +00:00
|
|
|
|
Point getPos(BufferView const & bv, DocIterator const & dit, bool boundary);
|
2004-11-30 01:59:49 +00:00
|
|
|
|
|
|
|
|
|
enum CurStatus {
|
|
|
|
|
CUR_INSIDE,
|
|
|
|
|
CUR_ABOVE,
|
|
|
|
|
CUR_BELOW
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CurStatus status(BufferView const * bv, DocIterator const & dit);
|
|
|
|
|
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
Point coordOffset(BufferView const & bv, DocIterator const & dit, bool boundary);
|
2004-11-30 01:59:49 +00:00
|
|
|
|
|
2005-06-25 15:57:15 +00:00
|
|
|
|
/// Moves cursor to the next inset with one of the given codes.
|
2007-04-29 13:39:47 +00:00
|
|
|
|
void gotoInset(BufferView * bv, std::vector<Inset_code> const & codes,
|
2005-02-22 11:41:22 +00:00
|
|
|
|
bool same_content);
|
|
|
|
|
|
2005-06-25 15:57:15 +00:00
|
|
|
|
/// Moves cursor to the next inset with given code.
|
2007-04-29 13:39:47 +00:00
|
|
|
|
void gotoInset(BufferView * bv, Inset_code code, bool same_content);
|
2005-02-22 11:41:22 +00:00
|
|
|
|
|
2005-06-25 15:57:15 +00:00
|
|
|
|
/// Looks for next inset with one of the the given code
|
2007-04-29 13:39:47 +00:00
|
|
|
|
bool findInset(DocIterator & dit, std::vector<Inset_code> const & codes,
|
2005-06-25 15:57:15 +00:00
|
|
|
|
bool same_content);
|
|
|
|
|
|
|
|
|
|
/// Looks for next inset with the given code
|
2007-04-29 13:39:47 +00:00
|
|
|
|
void findInset(DocIterator & dit, Inset_code code, bool same_content);
|
2005-06-25 15:57:15 +00:00
|
|
|
|
|
2004-11-30 01:59:49 +00:00
|
|
|
|
|
2004-02-13 11:05:29 +00:00
|
|
|
|
} // namespace bv_funcs
|
2003-04-03 00:36:31 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
2000-04-12 15:11:29 +00:00
|
|
|
|
#endif
|