2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
* \file GuiToc.h
|
2006-03-05 17:24:44 +00:00
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#ifndef GUITOC_H
|
|
|
|
#define GUITOC_H
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2006-04-18 09:57:47 +00:00
|
|
|
#include "ControlToc.h"
|
|
|
|
|
2007-03-12 14:23:44 +00:00
|
|
|
#include <QObject>
|
2006-04-18 09:57:47 +00:00
|
|
|
#include <QStandardItemModel>
|
|
|
|
#include <QStringListModel>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2006-04-18 09:57:47 +00:00
|
|
|
class TocModel;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-09-08 17:28:14 +00:00
|
|
|
class GuiToc : public QObject, public ControlToc
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2007-03-12 14:23:44 +00:00
|
|
|
Q_OBJECT
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
public:
|
|
|
|
///
|
2007-09-08 17:28:14 +00:00
|
|
|
GuiToc(Dialog &);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-04-03 13:07:38 +00:00
|
|
|
/// \c ControlToc inherited method.
|
|
|
|
virtual bool initialiseParams(std::string const & data);
|
|
|
|
///
|
2007-09-03 20:28:26 +00:00
|
|
|
void updateView();
|
2006-11-16 12:37:55 +00:00
|
|
|
///
|
2007-03-16 14:14:55 +00:00
|
|
|
bool canOutline(int type) const;
|
2007-05-28 22:27:45 +00:00
|
|
|
|
2007-03-16 14:14:55 +00:00
|
|
|
QStandardItemModel * tocModel(int type);
|
2006-04-19 14:48:22 +00:00
|
|
|
///
|
2007-03-16 14:14:55 +00:00
|
|
|
QModelIndex const getCurrentIndex(int type) const;
|
2006-04-19 14:48:22 +00:00
|
|
|
///
|
2007-03-16 14:14:55 +00:00
|
|
|
void goTo(int type, QModelIndex const & index);
|
2006-11-16 12:37:55 +00:00
|
|
|
///
|
|
|
|
int getType();
|
2006-11-25 22:16:22 +00:00
|
|
|
///
|
2007-03-16 14:14:55 +00:00
|
|
|
int getTocDepth(int type);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-03-12 14:23:44 +00:00
|
|
|
Q_SIGNALS:
|
|
|
|
/// Signal that the internal toc_models_ has been reset.
|
|
|
|
void modelReset();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-03-12 14:23:44 +00:00
|
|
|
private:
|
|
|
|
///
|
2006-04-18 09:57:47 +00:00
|
|
|
std::vector<TocModel *> toc_models_;
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#endif // GUITOC_H
|