PackageScheme.h
Go to the documentation of this file.
00001 /******************************************************************************
00002  * Copyright (C) 2015 by Ralf Kaestner                                        *
00003  * ralf.kaestner@gmail.com                                                    *
00004  *                                                                            *
00005  * This program is free software; you can redistribute it and/or modify       *
00006  * it under the terms of the Lesser GNU General Public License as published by*
00007  * the Free Software Foundation; either version 3 of the License, or          *
00008  * (at your option) any later version.                                        *
00009  *                                                                            *
00010  * This program is distributed in the hope that it will be useful,            *
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the               *
00013  * Lesser GNU General Public License for more details.                        *
00014  *                                                                            *
00015  * You should have received a copy of the Lesser GNU General Public License   *
00016  * along with this program. If not, see <http://www.gnu.org/licenses/>.       *
00017  ******************************************************************************/
00018 
00019 #ifndef RQT_MULTIPLOT_PACKAGE_SCHEME_H
00020 #define RQT_MULTIPLOT_PACKAGE_SCHEME_H
00021 
00022 #include <QDir>
00023 #include <QFileSystemModel>
00024 #include <QList>
00025 #include <QMap>
00026 #include <QStringListModel>
00027 
00028 #include <rqt_multiplot/PackageRegistry.h>
00029 #include <rqt_multiplot/UrlScheme.h>
00030 
00031 namespace rqt_multiplot {
00032   class PackageScheme :
00033     public UrlScheme {
00034   Q_OBJECT
00035   public:
00036     PackageScheme(QObject* parent = 0, const QString& prefix = "package",
00037       QDir::Filters filter = QDir::NoFilter);
00038     virtual ~PackageScheme();
00039 
00040     void setFilter(QDir::Filters filter);
00041     QDir::Filters getFilter() const;
00042 
00043     size_t getNumHosts() const;
00044     QModelIndex getHostIndex(size_t row) const;
00045     QVariant getHostData(const QModelIndex& index, int role) const;
00046       
00047     size_t getNumPaths(const QModelIndex& hostIndex, const QModelIndex&
00048       parent) const;
00049     QModelIndex getPathIndex(const QModelIndex& hostIndex, size_t row,
00050       const QModelIndex& parent = QModelIndex()) const;
00051     QVariant getPathData(const QModelIndex& index, int role) const;
00052       
00053     QString getHost(const QModelIndex& hostIndex) const;
00054     QString getPath(const QModelIndex& hostIndex, const QModelIndex&
00055       pathIndex) const;
00056     
00057     QString getFilePath(const QModelIndex& hostIndex, const QModelIndex&
00058       pathIndex) const;
00059     QString getFilePath(const QString& host, const QString& path) const;
00060       
00061   private:
00062     PackageRegistry* registry_;
00063     
00064     QFileSystemModel* fileSystemModel_;
00065     QStringListModel* packageListModel_;
00066     
00067     QList<QString> packages_;
00068     QMap<QString, QString> packagePaths_;    
00069     
00070   private slots:
00071     void registryUpdateStarted();
00072     void registryUpdateFinished();
00073     
00074     void modelDirectoryLoaded(const QString& path);
00075   };
00076 };
00077 
00078 #endif


rqt_multiplot
Author(s): Ralf Kaestner
autogenerated on Tue May 9 2017 02:16:02