mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 21:49:51 +00:00
2734cc1548
* src/buffer_funcs.h (updateLabels): Add bool childonly argument * src/insets/insetbase.h (addToToc): New virtual method * src/insets/insetinclude.[Ch] (addToToc): New virtual method (updateLabels): New method * src/TocBackend.h: reorganize classes so that we can forward declare TocList * src/insets/insetfloat.[Ch] * src/insets/insetwrap.[Ch] (addToToc): Adjust to type changes in TocBackend.h * src/frontends/qt4/TocModel.[Ch]: ditto * src/frontends/controllers/ControlToc.[Ch]: ditto * src/TocBackend.C: ditto (TocBackend::update) Remove test for float and wrap inset, call virtual method instead * src/BufferView.C (BufferView::dispatch): make LFUN_PARAGRAPH_GOTO work even if the target paragraph is in a different buffer * src/MenuBackend.C: Adjust to type changes in TocBackend.h (expandToc): Add an entry for the master doc in child docs * src/buffer_funcs.C (setLabel): Add text class parameter (updateLabels): handle included docs if requested by the caller git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15904 a592a061-630c-0410-9148-cb99ea01b6c8
68 lines
1.2 KiB
C++
68 lines
1.2 KiB
C++
// -*- C++ -*-
|
|
/**
|
|
* \file TocModel.h
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Abdelrazak Younes
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#ifndef TOCMODEL_H
|
|
#define TOCMODEL_H
|
|
|
|
#include "TocBackend.h"
|
|
|
|
#include "qt_helpers.h"
|
|
|
|
#include <QStandardItemModel>
|
|
|
|
#include <map>
|
|
|
|
namespace lyx {
|
|
namespace frontend {
|
|
|
|
class TocModel: public QStandardItemModel {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
///
|
|
TocModel() {}
|
|
///
|
|
TocModel(Toc const & toc);
|
|
///
|
|
~TocModel() {}
|
|
///
|
|
TocModel const & operator=(Toc const & toc);
|
|
///
|
|
void clear();
|
|
///
|
|
void populate(Toc const & toc);
|
|
///
|
|
TocIterator const tocIterator(QModelIndex const & index) const;
|
|
///
|
|
QModelIndex const modelIndex(TocIterator const & it) const;
|
|
|
|
private:
|
|
///
|
|
void populate(TocIterator & it,
|
|
TocIterator const & end,
|
|
QModelIndex const & parent);
|
|
///
|
|
typedef std::map<QModelIndex, TocIterator> TocMap;
|
|
///
|
|
typedef std::pair<QModelIndex, TocIterator> TocPair;
|
|
///
|
|
typedef std::map<TocIterator, QModelIndex> ModelMap;
|
|
///
|
|
TocMap toc_map_;
|
|
///
|
|
ModelMap model_map_;
|
|
};
|
|
|
|
} // namespace frontend
|
|
} // namespace lyx
|
|
|
|
#endif // TOCMODEL_H
|