]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/TocModel.h
Complete the removal of the embedding stuff. Maybe. It's hard to be sure we got every...
[lyx.git] / src / frontends / qt4 / TocModel.h
index 265999b1654e34ec32d510c3aab48d6b34e4cd88..2003fedbc81858114b32a20a15857e31929ec5c8 100644 (file)
 #include <QStandardItemModel>
 
 #include <map>
-#include <string>
 
 namespace lyx {
 namespace frontend {
 
-typedef TocBackend::Toc::const_iterator TocIterator;\r
-\r
-class TocModel: public QStandardItemModel {
+class TocModel : public QStandardItemModel
+{
        Q_OBJECT
-\r
+
 public:
        ///
        TocModel() {}
        ///
-       TocModel(TocBackend::Toc const & toc);
-       ///
-       ~TocModel() {}
-       ///
-       TocModel const & operator=(TocBackend::Toc const & toc);
+       TocModel(Toc const & toc) { populate(toc); }
        ///
        void clear();
        ///
-       void populate(TocBackend::Toc const & toc);
+       void populate(Toc const & toc);
        ///
-       TocIterator const tocIterator(QModelIndex const & index) const;
+       TocIterator tocIterator(QModelIndex const & index) const;
        ///
-       QModelIndex const modelIndex(TocIterator const & it) const;
+       QModelIndex modelIndex(TocIterator const & it) const;
+       ///
+       int modelDepth() const;
 
 private:
        ///
-       void populate(TocIterator & it,
-               TocIterator const & end,
-               QModelIndex const & parent);\r
+       void populate(TocIterator & it, TocIterator const & end,
+               QModelIndex const & parent);
        ///
        typedef std::map<QModelIndex, TocIterator> TocMap;
        ///
        typedef std::map<TocIterator, QModelIndex> ModelMap;
        ///
-       TocMap toc_map_;\r
+       TocMap toc_map_;
        ///
        ModelMap model_map_;
+       ///
+       int maxdepth_;
+       int mindepth_;
 };
 
 } // namespace frontend