]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/TocModel.h
enable Font cache only for MacOSX and inline width() for other platform.
[lyx.git] / src / frontends / qt4 / TocModel.h
index 7e2a8fb813baaae76db8a2cb9c2d0e2eeb7c38e8..8a97aebff7d2d54fe1ad957f052564ca137c6140 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef TOCMODEL_H
 #define TOCMODEL_H
 
-#include "toc.h"
+#include "TocBackend.h"
 
 #include "qt_helpers.h"
 
 namespace lyx {
 namespace frontend {
 
+typedef TocBackend::Toc::const_iterator TocIterator;
+
 class TocModel: public QStandardItemModel {
        Q_OBJECT
+
 public:
        ///
        TocModel() {}
        ///
-       TocModel(toc::Toc const & toc_list);
+       TocModel(TocBackend::Toc const & toc);
        ///
        ~TocModel() {}
        ///
-       TocModel const & operator=(toc::Toc const & toc_list);
+       TocModel const & operator=(TocBackend::Toc const & toc);
        ///
        void clear();
        ///
-       void populate(toc::Toc const & toc_list);
+       void populate(TocBackend::Toc const & toc);
        ///
-       toc::TocItem const item(QModelIndex const & index) const;
+       TocIterator const tocIterator(QModelIndex const & index) const;
        ///
-       QModelIndex const index(std::string const & toc_str) const;
+       QModelIndex const modelIndex(TocIterator const & it) const;
 
 private:
        ///
-       void populate(toc::Toc::const_iterator & iter,
-               toc::Toc::const_iterator const & end,
+       void populate(TocIterator & it,
+               TocIterator const & end,
                QModelIndex const & parent);
-
-       typedef std::map<QModelIndex, toc::TocItem> ItemMap;
        ///
-       typedef std::map<std::string, QModelIndex> IndexMap;
+       typedef std::map<QModelIndex, TocIterator> TocMap;
+       ///
+       typedef std::map<TocIterator, QModelIndex> ModelMap;
+       ///
+       TocMap toc_map_;
        ///
-       ItemMap item_map_;
-       IndexMap index_map_;
+       ModelMap model_map_;
 };
 
 } // namespace frontend