lyx_mirror/src/frontends/qt4/TocModel.h
Abdelrazak Younes c0f6f79cb0 Fix for bug 2975 (http://bugzilla.lyx.org/show_bug.cgi?id=2975) from Ozgur Ugras BARAN. Looks like a gcc bug with STL map.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15821 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-09 13:13:28 +00:00

71 lines
1.3 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>
#include <string>
namespace lyx {
namespace frontend {
typedef TocBackend::Toc::const_iterator TocIterator;
class TocModel: public QStandardItemModel {
Q_OBJECT
public:
///
TocModel() {}
///
TocModel(TocBackend::Toc const & toc);
///
~TocModel() {}
///
TocModel const & operator=(TocBackend::Toc const & toc);
///
void clear();
///
void populate(TocBackend::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