// // This file is part of the Marble Desktop Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2007 Andrew Manson // #ifndef GPXFILEMODEL_H #define GPXFILEMODEL_H #include #include #include #include namespace Marble { class GpxFile; /** * @author Andrew Manson */ class GpxFileModel : public QAbstractItemModel { Q_OBJECT Q_SIGNALS : void modelChanged(); void enableActions( bool ); public Q_SLOTS: void saveFile(); void closeFile(); public: explicit GpxFileModel( QObject *parent = 0 ); ~GpxFileModel(); Qt::ItemFlags flags( const QModelIndex &item) const ; QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const; bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole ); QModelIndex index ( int row, int column, const QModelIndex &parent = QModelIndex() ) const; QModelIndex parent ( const QModelIndex & index ) const; int rowCount ( const QModelIndex & parent = QModelIndex() ) const; int columnCount ( const QModelIndex & parent = QModelIndex() ) const; void addFile( GpxFile *file); void setSelectedIndex( const QModelIndex &); QVector* allFiles(); private: QModelIndex m_selectedIndex; QVector *m_data; }; } #endif