annotate src/pngplayer.h @ 2:97d2c8869c39

First prototype implementation of table view and player
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 23 Mar 2015 16:34:42 +0100
parents
children 248d5d1cdb38
rev   line source
2
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
1 #ifndef PNGPLAYER_H
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
2 #define PNGPLAYER_H
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
3 /* Copyright (C) 2014 by Intevation GmbH
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
4 *
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
5 * This file is Free Software under the GNU GPL (v>=2)
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
6 * and comes with ABSOLUTELY NO WARRANTY!
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
7 * See LICENSE.txt for details.
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
8 */
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
9 #include <QWidget>
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
10 #include <QDir>
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
11 #include <QTimer>
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
12
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
13 class QLabel;
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
14
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
15 class PNGPlayer: public QWidget
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
16 {
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
17 Q_OBJECT
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
18
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
19 public:
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
20 PNGPlayer (QWidget * parent = 0, Qt::WindowFlags f = 0);
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
21
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
22 protected:
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
23 void setupGUI();
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
24
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
25 public slots:
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
26 /**@brief show a PNG in the viewer.
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
27 *
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
28 * @param fileName: The picture file to show.
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
29 * @param info: Additional meta data to show with the image.
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
30 */
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
31 void showPicture(const QString& fileName, const QString& info);
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
32
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
33 void setBaseDir(const QString& dirName) { mBaseDir.setPath(dirName); }
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
34
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
35 Q_SIGNALS:
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
36 /** @brief Emited if something went wrong. e.g. file not readable */
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
37 void error(const QString& msg);
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
38
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
39 /** @brief Emited if the player wants to advance to the next picture */
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
40 void advance();
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
41
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
42 protected:
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
43 QLabel * mPNGLabel;
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
44 QDir mBaseDir;
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
45 QTimer mAdvanceTimer;
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
46 };
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
47
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
48
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
49
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
50 #endif // PNGPLAYER_H
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)