FileScheme.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_FILE_SCHEME_H
00020 #define RQT_MULTIPLOT_FILE_SCHEME_H
00021 
00022 #include <QDir>
00023 #include <QFileSystemModel>
00024 
00025 #include <rqt_multiplot/UrlScheme.h>
00026 
00027 namespace rqt_multiplot {
00028   class FileScheme :
00029     public UrlScheme {
00030   Q_OBJECT
00031   public:
00032     FileScheme(QObject* parent = 0, const QString& prefix = "file", const
00033       QString& rootPath = "/", QDir::Filters filter = QDir::NoFilter);
00034     virtual ~FileScheme();
00035 
00036     void setRootPath(const QString& rootPath);
00037     QString getRootPath() const;
00038     void setFilter(QDir::Filters filter);
00039     QDir::Filters getFilter() const;
00040 
00041     size_t getNumHosts() const;
00042     QModelIndex getHostIndex(size_t row) const;
00043     QVariant getHostData(const QModelIndex& index, int role) const;
00044       
00045     size_t getNumPaths(const QModelIndex& hostIndex, const QModelIndex&
00046       parent) const;
00047     QModelIndex getPathIndex(const QModelIndex& hostIndex, size_t row,
00048       const QModelIndex& parent = QModelIndex()) const;
00049     QVariant getPathData(const QModelIndex& index, int role) const;
00050       
00051     QString getHost(const QModelIndex& hostIndex) const;
00052     QString getPath(const QModelIndex& hostIndex, const QModelIndex&
00053       pathIndex) const;
00054     
00055     QString getFilePath(const QModelIndex& hostIndex, const QModelIndex&
00056       pathIndex) const;
00057     QString getFilePath(const QString& host, const QString& path) const;
00058       
00059   private:
00060     QFileSystemModel* model_;
00061     
00062   private slots:
00063     void modelDirectoryLoaded(const QString& path);
00064   };
00065 };
00066 
00067 #endif


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