andre@2: #ifndef METADATAVIEW_H andre@2: #define METADATAVIEW_H andre@24: /* Copyright (C) 2015 by ETH Zürich andre@24: * Software engineering by Intevation GmbH andre@2: * andre@2: * This file is Free Software under the GNU GPL (v>=2) andre@2: * and comes with ABSOLUTELY NO WARRANTY! andre@2: * See LICENSE.txt for details. andre@2: */ andre@2: #include andre@2: #include andre@3: #include andre@2: andre@2: class QTableView; andre@2: class QSortFilterProxyModel; andre@2: class QxtCsvModel; andre@2: class MetaDataView: public QWidget andre@2: { andre@2: Q_OBJECT andre@2: andre@2: public: andre@2: MetaDataView(QWidget * parent = 0, Qt::WindowFlags f = 0); andre@2: andre@2: protected: andre@2: void setupGUI(); andre@2: andre@2: public: andre@2: /**@brief parse a metadata file and set up the model accordingly. andre@2: * andre@2: * @returns a localized error message in case of parsing errors. Or andre@2: * an empty string on success. */ andre@2: QString parseMetaData(const QString& fileName); andre@2: andre@2: Q_SIGNALS: andre@2: /**@brief emited when the selection changed. andre@2: * andre@2: * @param pictureFile: The file that is now selected. andre@2: * @param info: Additional info to show with the file.*/ andre@3: void selectionChanged(const QString& pictureFile, int current, int max, andre@3: const QDateTime& timestamp); andre@2: andre@2: protected slots: andre@3: /** @brief internal slot to handle table view selection changes */ andre@2: void viewSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected); andre@2: andre@4: /** @brief the data has been changed. Could be filter. */ andre@4: void dataChanged(); andre@4: andre@2: public slots: andre@2: /**@brief selects the next row and emits a selection changed signal */ andre@2: void selectNextRow(); andre@2: andre@3: /**@brief selects the previous row and emits a selection changed signal */ andre@3: void selectPrevRow(); andre@3: andre@3: /**@brief select a specific row. */ andre@3: void selectRow(int row); andre@3: andre@28: /**@brief applies the default sort order from configuration */ andre@28: void applyDefaultSort(); andre@28: andre@2: protected: andre@2: QxtCsvModel *mCSVModel; andre@2: QSortFilterProxyModel *mSortModel; andre@2: QTableView *mView; andre@2: }; andre@2: andre@2: andre@2: #endif // METADATAVIEW_H