1 /*************************************************************************** 2 File : globals.h 3 Project : SciDAVis 4 Description : Definition of global constants and enums 5 -------------------------------------------------------------------- 6 Copyright : (C) 2006-2009 Tilman Benkert (thzs*gmx.net) 7 Copyright : (C) 2006-2007 Ion Vasilief (ion_vasilief*yahoo.fr) 8 (replace * with @ in the email addresses) 9 10 ***************************************************************************/ 11 12 /*************************************************************************** 13 * * 14 * This program is free software; you can redistribute it and/or modify * 15 * it under the terms of the GNU General Public License as published by * 16 * the Free Software Foundation; either version 2 of the License, or * 17 * (at your option) any later version. * 18 * * 19 * This program is distributed in the hope that it will be useful, * 20 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 22 * GNU General Public License for more details. * 23 * * 24 * You should have received a copy of the GNU General Public License * 25 * along with this program; if not, write to the Free Software * 26 * Foundation, Inc., 51 Franklin Street, Fifth Floor, * 27 * Boston, MA 02110-1301 USA * 28 * * 29 ***************************************************************************/ 30 31 #ifndef SCIDAVIS_GLOBALS_H 32 #define SCIDAVIS_GLOBALS_H 33 34 #include <QObject> 35 #include <QString> 36 37 //! Definition of global constants and enums 38 /** 39 * This class must not be instanced. All members are static. 40 */ 41 class SciDAVis : public QObject 42 { 43 Q_OBJECT Q_ENUMS(PlotDesignation)44 Q_ENUMS(PlotDesignation) 45 Q_ENUMS(ColumnMode) 46 Q_ENUMS(ColumnDataType) 47 48 private: 49 SciDAVis() { } // don't allow instancing 50 51 public: ~SciDAVis()52 virtual ~SciDAVis() { } // avoid the warning message 53 //! Types of plot designations 54 enum PlotDesignation { 55 noDesignation = 0, //!< no plot designation 56 X = 1, //!< x values 57 Y = 2, //!< y values 58 Z = 3, //!< z values 59 xErr = 4, //!< x errors 60 yErr = 5 //!< y errors 61 }; 62 63 //! The column mode (defines output and input filter for table columns) 64 enum class ColumnMode : int { 65 Numeric = 0, //!< column contains doubles 66 Text = 1, //!< column contains strings 67 Month = 4, //!< column contains month names 68 Day = 5, //!< column containts day of week names 69 DateTime = 6, //!< column contains dates and/or times 70 // 2 and 3 are skipped to avoid problems with old obsolete values 71 }; 72 73 //! Column data type 74 enum ColumnDataType { TypeDouble = 1, TypeQString = 2, TypeQDateTime = 3 }; 75 76 //! Return the SciDAVis version number 77 static int version(); 78 79 static QString enumValueToString(int key, const QString &enum_name); 80 static int enumStringToValue(const QString &string, const QString &enum_name); 81 82 //! Return the SciDAVis version string ("SciDAVis x.y.z" without extra version) used in the project file 83 static QString schemaVersion(); 84 /// the user visible release version string (x.Dy usually) 85 static QString versionString(); 86 87 //! Return the extra version as a string 88 static QString extraVersion(); 89 90 //! Return the copyright string 91 static QString copyrightString(); 92 93 //! Return the release date as a string 94 static QString releaseDateString(); 95 96 //! Show about dialog 97 static void about(); 98 99 private: 100 // Don't forget to change the Doxyfile when changing these! 101 //! SciDAVis version number 102 /** 103 * 0xMMmmbb means MM.mm.bb with<br> 104 * MM = major version 105 * mm = minor version 106 * bb = bugfix version 107 */ 108 static const int scidavis_versionNo; 109 static const char *scidavis_version; 110 //! Extra version information string (like "-alpha", "-beta", "-rc1", etc...) 111 static const char *extra_version; 112 //! Copyright string containing the author names etc. 113 static const QString copyright_string; 114 //! Release date as a string 115 static const char *release_date; 116 }; 117 118 #endif 119