mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-13 14:32:04 +00:00
978c87fae7
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17753 a592a061-630c-0410-9148-cb99ea01b6c8
79 lines
1.3 KiB
C++
79 lines
1.3 KiB
C++
// -*- C++ -*-
|
|
/**
|
|
* \file QToc.h
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author John Levon
|
|
* \author Kalle Dalheimer
|
|
* \author Abdelrazak Younes
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#ifndef QTOC_H
|
|
#define QTOC_H
|
|
|
|
#include "ControlToc.h"
|
|
|
|
#include <QObject>
|
|
#include <QStandardItemModel>
|
|
#include <QStringListModel>
|
|
|
|
namespace lyx {
|
|
namespace frontend {
|
|
|
|
class ControlToc;
|
|
class TocModel;
|
|
|
|
class QToc : public QObject, public ControlToc
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
|
|
QToc(Dialog &, QObject * parent = 0);
|
|
virtual ~QToc() {}
|
|
|
|
/// \c ControlToc inherited method.
|
|
virtual bool initialiseParams(std::string const & data);
|
|
///
|
|
void update();
|
|
///
|
|
void updateToc();
|
|
///
|
|
void updateType();
|
|
|
|
bool canOutline(int type) const;
|
|
|
|
QStandardItemModel * tocModel(int type);
|
|
|
|
QStringListModel * typeModel()
|
|
{ return &type_model_; }
|
|
|
|
///
|
|
QModelIndex const getCurrentIndex(int type) const;
|
|
///
|
|
void goTo(int type, QModelIndex const & index);
|
|
///
|
|
int getType();
|
|
///
|
|
int getTocDepth(int type);
|
|
|
|
Q_SIGNALS:
|
|
/// Signal that the internal toc_models_ has been reset.
|
|
void modelReset();
|
|
|
|
private:
|
|
///
|
|
std::vector<TocModel *> toc_models_;
|
|
///
|
|
QStringListModel type_model_;
|
|
///
|
|
int type_;
|
|
};
|
|
|
|
} // namespace frontend
|
|
} // namespace lyx
|
|
|
|
#endif // QTOC_H
|