mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 02:49:46 +00:00
9aed8cf115
* ControlToc::update(): get rid of the pure virutal method. * QToc::initialiseParams(): overload ControlToc method. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17708 a592a061-630c-0410-9148-cb99ea01b6c8
79 lines
1.6 KiB
C++
79 lines
1.6 KiB
C++
// -*- C++ -*-
|
|
/**
|
|
* \file ControlToc.h
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Angus Leeming
|
|
* \author Abdelrazak Younes
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#ifndef CONTROLTOC_H
|
|
#define CONTROLTOC_H
|
|
|
|
|
|
#include "ControlCommand.h"
|
|
#include "TocBackend.h"
|
|
|
|
#include <vector>
|
|
|
|
namespace lyx {
|
|
namespace frontend {
|
|
|
|
/** A controller for TOC dialogs.
|
|
*/
|
|
class ControlToc : public ControlCommand {
|
|
public:
|
|
///
|
|
ControlToc(Dialog &);
|
|
///
|
|
virtual ~ControlToc() {}
|
|
|
|
/// \c ControlCommand inherited method.
|
|
virtual bool initialiseParams(std::string const & data);
|
|
|
|
///
|
|
TocList const & tocs() const;
|
|
|
|
/// Goto this paragraph id
|
|
void goTo(TocItem const &);
|
|
|
|
/// Return the list of types available
|
|
std::vector<docstring> const & typeNames() const
|
|
{ return type_names_; }
|
|
|
|
///
|
|
int selectedType() { return selected_type_; }
|
|
|
|
/// Return the first TocItem before the cursor
|
|
TocIterator const getCurrentTocItem(size_t type) const;
|
|
|
|
/// Apply the selected outlining operation
|
|
void outlineUp();
|
|
///
|
|
void outlineDown();
|
|
///
|
|
void outlineIn();
|
|
///
|
|
void outlineOut();
|
|
/// Test if outlining operation is possible
|
|
bool canOutline(size_t type) const;
|
|
///
|
|
void updateBackend();
|
|
|
|
private:
|
|
/// Return the guiname from a given cmdName of the TOC param
|
|
docstring const getGuiName(std::string const & type) const;
|
|
|
|
std::vector<std::string> types_;
|
|
std::vector<docstring> type_names_;
|
|
int selected_type_;
|
|
};
|
|
|
|
} // namespace frontend
|
|
} // namespace lyx
|
|
|
|
#endif // CONTROLTOC_H
|