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
|
2007-03-16 14:14:55 +00:00
|
|
|
* \author Abdelrazak Younes
|
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.
|
2007-04-03 13:07:38 +00:00
|
|
|
virtual bool initialiseParams(std::string const & data);
|
2001-03-30 19:24:28 +00:00
|
|
|
|
2007-03-16 14:14:55 +00:00
|
|
|
///
|
|
|
|
TocList const & tocs() const;
|
|
|
|
|
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
|
2007-03-16 14:14:55 +00:00
|
|
|
std::vector<docstring> const & typeNames() const
|
|
|
|
{ return type_names_; }
|
2001-03-30 19:24:28 +00:00
|
|
|
|
2007-03-16 14:14:55 +00:00
|
|
|
///
|
|
|
|
int selectedType() { return selected_type_; }
|
2005-07-04 13:05:03 +00:00
|
|
|
|
2006-04-19 14:48:22 +00:00
|
|
|
/// Return the first TocItem before the cursor
|
2007-03-16 14:14:55 +00:00
|
|
|
TocIterator const getCurrentTocItem(size_t 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
|
2007-03-16 14:14:55 +00:00
|
|
|
bool canOutline(size_t type) const;
|
2007-03-12 14:23:44 +00:00
|
|
|
///
|
|
|
|
void updateBackend();
|
|
|
|
|
2007-03-16 14:14:55 +00:00
|
|
|
private:
|
|
|
|
std::vector<std::string> types_;
|
|
|
|
std::vector<docstring> type_names_;
|
|
|
|
int selected_type_;
|
2007-06-04 13:27:27 +00:00
|
|
|
|
|
|
|
/// Return the guiname from a given cmdName of the TOC param
|
|
|
|
docstring const getGuiName(std::string const & type) const;
|
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
|