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@66: andre@66: /** andre@66: * @file metadataview.h andre@66: * @brief Table view of the meta data information andre@66: */ andre@66: andre@2: #include andre@2: #include andre@3: #include andre@2: andre@2: class QTableView; andre@2: class QSortFilterProxyModel; andre@2: class QxtCsvModel; andre@66: andre@66: /** andre@66: * @class MetaDataView andre@66: * @brief Table view of the meta data data information. andre@66: */ 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@66: /** andre@66: * @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@66: /** @brief emited when the selection changed. */ andre@3: void selectionChanged(const QString& pictureFile, int current, int max, andre@44: const QString& timestamp, int number); 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@81: /** @brief load the configured header tooltips */ andre@81: void setupHeaderTooltips(); andre@81: andre@2: public slots: andre@66: /** @brief selects the next row and emits a selection changed signal */ andre@2: void selectNextRow(); andre@2: andre@66: /** @brief selects the previous row and emits a selection changed signal */ andre@3: void selectPrevRow(); andre@3: andre@66: /** @brief select a specific row. */ andre@3: void selectRow(int row); andre@3: andre@66: /** @brief select the first row. */ andre@53: void selectFirstRow(); andre@53: andre@66: /** @brief applies the default sort order from configuration */ andre@28: void applyDefaultSort(); andre@28: andre@66: /** @brief resizes the columns to headers content */ andre@35: void resizeColsToHeaders(); andre@35: andre@2: protected: andre@2: QxtCsvModel *mCSVModel; andre@2: QSortFilterProxyModel *mSortModel; andre@2: QTableView *mView; andre@44: int mDateColIdx; andre@2: }; andre@2: andre@2: andre@2: #endif // METADATAVIEW_H