2002-07-21 15:51:07 +00:00
|
|
|
// -*- C++ -*-
|
2003-08-23 00:17:00 +00:00
|
|
|
/**
|
|
|
|
* \file toc.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-07-21 15:51:07 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* \author Jean-Marc Lasgouttes
|
|
|
|
* \author Angus Leeming
|
2002-07-21 15:51:07 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2003-10-08 11:31:51 +00:00
|
|
|
*
|
|
|
|
* Nice functions and objects to handle TOCs
|
2002-07-21 15:51:07 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef TOC_H
|
|
|
|
#define TOC_H
|
|
|
|
|
2006-04-22 18:48:28 +00:00
|
|
|
#include "TocBackend.h"
|
2002-07-21 15:51:07 +00:00
|
|
|
|
2006-04-19 14:48:22 +00:00
|
|
|
class LCursor;
|
2002-07-21 15:51:07 +00:00
|
|
|
|
2003-07-27 13:18:55 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace toc {
|
2002-07-21 15:51:07 +00:00
|
|
|
|
2006-04-22 18:48:28 +00:00
|
|
|
typedef TocBackend::Item TocItem;
|
|
|
|
typedef TocBackend::Toc::const_iterator TocIterator;
|
|
|
|
typedef TocBackend::Toc Toc;
|
|
|
|
typedef TocBackend::TocList TocList;
|
2002-07-21 15:51:07 +00:00
|
|
|
|
|
|
|
///
|
2006-04-22 18:48:28 +00:00
|
|
|
void updateToc(Buffer const &);
|
|
|
|
|
2002-07-21 15:51:07 +00:00
|
|
|
///
|
2006-04-22 18:48:28 +00:00
|
|
|
TocList const & getTocList(Buffer const &);
|
2002-07-21 15:51:07 +00:00
|
|
|
|
|
|
|
///
|
2006-04-22 18:48:28 +00:00
|
|
|
Toc const & getToc(Buffer const & buf, std::string const & type);
|
2002-07-21 15:51:07 +00:00
|
|
|
|
|
|
|
///
|
2006-04-22 18:48:28 +00:00
|
|
|
std::vector<std::string> const & getTypes(Buffer const &);
|
2002-07-21 15:51:07 +00:00
|
|
|
|
2006-04-19 14:48:22 +00:00
|
|
|
/// Return the first TocItem before the cursor
|
2006-04-22 18:48:28 +00:00
|
|
|
TocIterator const getCurrentTocItem(Buffer const &, LCursor const &,
|
|
|
|
std::string const & type);
|
2006-04-19 14:48:22 +00:00
|
|
|
|
2002-07-21 15:51:07 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
void asciiTocList(std::string const &, Buffer const &, std::ostream &);
|
2002-11-08 01:08:27 +00:00
|
|
|
|
2002-07-21 15:51:07 +00:00
|
|
|
/** Given the cmdName of the TOC param, returns the type used
|
|
|
|
by ControlToc::getContents() */
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string const getType(std::string const & cmdName);
|
2002-07-21 15:51:07 +00:00
|
|
|
|
2005-07-27 15:22:08 +00:00
|
|
|
/** Returns the guiname from a given @c type
|
|
|
|
The localization of the names will be done in the frontends */
|
|
|
|
std::string const getGuiName(std::string const & type, Buffer const &);
|
2005-07-04 13:05:03 +00:00
|
|
|
|
2006-03-29 05:08:42 +00:00
|
|
|
/// the type of outline operation
|
|
|
|
enum OutlineOp {
|
|
|
|
UP, // Move this header with text down
|
|
|
|
DOWN, // Move this header with text up
|
|
|
|
IN, // Make this header deeper
|
|
|
|
OUT // Make this header shallower
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-04-09 00:26:19 +00:00
|
|
|
void outline(OutlineOp, Buffer *, pit_type &);
|
2006-03-29 05:08:42 +00:00
|
|
|
|
|
|
|
|
2002-07-21 15:51:07 +00:00
|
|
|
} // namespace toc
|
2003-07-27 13:18:55 +00:00
|
|
|
} // namespace lyx
|
2002-07-21 15:51:07 +00:00
|
|
|
|
|
|
|
#endif // CONTROLTOC_H
|