QSapecNG
 All Classes Functions Enumerations Properties
sidebarmodel.h
00001 /*
00002     QSapecNG - Qt based SapecNG GUI front-end
00003     Copyright (C) 2009, Michele Caini
00004 
00005     This program is free software: you can redistribute it and/or modify
00006     it under the terms of the 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     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 
00019 
00020 #ifndef SIDEBARMODEL_H
00021 #define SIDEBARMODEL_H
00022 
00023 
00024 #include <QtCore/QAbstractListModel>
00025 
00026 #include <QtCore/QList>
00027 #include <QtCore/QMap>
00028 
00029 
00030 namespace qsapecng
00031 {
00032 
00033 
00034 class SideBarModel: public QAbstractListModel
00035 {
00036 
00037   Q_OBJECT
00038 
00039 public:
00040   SideBarModel(QObject* parent = 0);
00041 
00042   int rowCount(const QModelIndex& parent = QModelIndex()) const;
00043 
00044   QVariant data(
00045     const QModelIndex& index,
00046     int role = Qt::DisplayRole
00047   ) const;
00048 
00049   QVariant headerData(
00050     int section,
00051     Qt::Orientation orientation,
00052     int role = Qt::DisplayRole
00053   ) const;
00054 
00055   Qt::ItemFlags flags(const QModelIndex& index) const;
00056 
00057   Qt::DropActions supportedDropActions() const;
00058 
00059   QStringList mimeTypes() const;
00060   QMimeData* mimeData(const QModelIndexList& indexes) const;
00061 
00062 private:
00063   void setupSideBar();
00064 
00065   QList< QMap<int, QVariant> > componentList_;
00066 
00067 };
00068 
00069 
00070 }
00071 
00072 
00073 #endif // SIDEBARMODEL_H
 All Classes Functions Enumerations Properties