2001-05-04 10:36:36 +00:00
|
|
|
// -*- C++ -*-
|
2002-09-05 14:10:50 +00:00
|
|
|
/**
|
|
|
|
* \file ControlToc.h
|
2002-09-05 15:14:23 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2001-03-30 19:24:28 +00:00
|
|
|
*
|
2002-09-05 14:10:50 +00:00
|
|
|
* \author Angus Leeming
|
2001-03-30 19:24:28 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2001-03-30 19:24:28 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CONTROLTOC_H
|
|
|
|
#define CONTROLTOC_H
|
|
|
|
|
|
|
|
|
|
|
|
#include "ControlCommand.h"
|
2006-11-11 00:35:14 +00:00
|
|
|
#include "TocBackend.h"
|
|
|
|
|
2003-02-25 14:51:38 +00:00
|
|
|
#include <vector>
|
2001-03-30 19:24:28 +00:00
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2001-03-30 19:24:28 +00:00
|
|
|
/** A controller for TOC dialogs.
|
|
|
|
*/
|
2002-10-21 17:38:09 +00:00
|
|
|
class ControlToc : public ControlCommand {
|
2001-03-30 19:24:28 +00:00
|
|
|
public:
|
|
|
|
///
|
2003-02-25 14:51:38 +00:00
|
|
|
ControlToc(Dialog &);
|
2007-03-12 14:23:44 +00:00
|
|
|
///
|
|
|
|
virtual ~ControlToc() {}
|
|
|
|
|
|
|
|
/// \c ControlCommand inherited method.
|
|
|
|
bool initialiseParams(std::string const & data);
|
2001-03-30 19:24:28 +00:00
|
|
|
|
|
|
|
/// Goto this paragraph id
|
2006-11-13 16:53:49 +00:00
|
|
|
void goTo(TocItem const &);
|
2001-03-30 19:24:28 +00:00
|
|
|
|
2002-07-21 15:51:07 +00:00
|
|
|
/// Return the list of types available
|
2006-04-22 18:48:28 +00:00
|
|
|
std::vector<std::string> const & getTypes() const;
|
2001-03-30 19:24:28 +00:00
|
|
|
|
2005-07-04 13:05:03 +00:00
|
|
|
/// Return the guiname from a given cmdName of the TOC param
|
2006-12-22 10:06:40 +00:00
|
|
|
docstring const getGuiName(std::string const & type) const;
|
2005-07-04 13:05:03 +00:00
|
|
|
|
2006-04-19 14:48:22 +00:00
|
|
|
/// Return the first TocItem before the cursor
|
2006-11-13 16:53:49 +00:00
|
|
|
TocIterator const getCurrentTocItem(std::string const & type) const;
|
2006-04-19 14:48:22 +00:00
|
|
|
|
2001-03-30 19:24:28 +00:00
|
|
|
/// Given a type, returns the contents
|
2006-11-13 16:53:49 +00:00
|
|
|
Toc const & getContents(std::string const & type) const;
|
2006-03-29 05:08:42 +00:00
|
|
|
|
|
|
|
/// Apply the selected outlining operation
|
2006-04-28 07:45:37 +00:00
|
|
|
void outlineUp();
|
|
|
|
///
|
|
|
|
void outlineDown();
|
|
|
|
///
|
|
|
|
void outlineIn();
|
|
|
|
///
|
|
|
|
void outlineOut();
|
2006-04-18 09:57:47 +00:00
|
|
|
/// Test if outlining operation is possible
|
|
|
|
bool canOutline(std::string const & type);
|
2007-03-12 14:23:44 +00:00
|
|
|
///
|
|
|
|
void updateBackend();
|
|
|
|
|
|
|
|
public:
|
|
|
|
/// Update the model data if needed.
|
|
|
|
virtual void update() = 0;
|
2001-03-30 19:24:28 +00:00
|
|
|
};
|
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2001-03-30 19:24:28 +00:00
|
|
|
#endif // CONTROLTOC_H
|