Warning, /office/calligra/libs/version/calligraversion.h.cmake is written in an unsupported language. File is not indexed.
0001 /* This file is part of the Calligra libraries 0002 Copyright (c) 2003 David Faure <faure@kde.org> 0003 Copyright (c) 2003 Lukas Tinkl <lukas@kde.org> 0004 Copyright (c) 2004 Nicolas Goutte <goutte@kde.org> 0005 Copyright (C) 2015 Jarosław Staniek <staniek@kde.org> 0006 0007 This library is free software; you can redistribute it and/or 0008 modify it under the terms of the GNU Library General Public 0009 License as published by the Free Software Foundation; either 0010 version 2 of the License, or (at your option) any later version. 0011 0012 This library is distributed in the hope that it will be useful, 0013 but WITHOUT ANY WARRANTY; without even the implied warranty of 0014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0015 Library General Public License for more details. 0016 0017 You should have received a copy of the GNU Library General Public License 0018 along with this library; see the file COPYING.LIB. If not, write to 0019 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0020 * Boston, MA 02110-1301, USA. 0021 */ 0022 0023 #ifndef _CALLIGRA_VERSION_H_ 0024 #define _CALLIGRA_VERSION_H_ 0025 0026 #include "koversion_export.h" 0027 0028 // -- WARNING: do not edit values below, instead edit CALLIGRA_* in /CMakeLists.txt -- 0029 0030 /** 0031 * @def CALLIGRA_VERSION_STRING 0032 * @ingroup CalligraMacros 0033 * @brief Version of Calligra as string, at compile time 0034 * 0035 * This macro contains the Calligra version in string form. As it is a macro, 0036 * it contains the version at compile time. See Calligra::versionString() if you need 0037 * the Calligra version used at runtime. 0038 * 0039 * @note The version string might contain spaces and special characters, 0040 * especially for development versions of Calligra. 0041 * If you use that macro directly for a file format (e.g. OASIS Open Document) 0042 * or for a protocol (e.g. http) be careful that it is appropriate. 0043 * (Fictional) example: "3.0 Alpha" 0044 */ 0045 #define CALLIGRA_VERSION_STRING "@CALLIGRA_VERSION_STRING@" 0046 0047 /** 0048 * @def CALLIGRA_STABLE_VERSION_MAJOR 0049 * @ingroup CalligraMacros 0050 * @brief Major version of stable Calligra, at compile time 0051 * CALLIGRA_VERSION_MAJOR is computed based on this value. 0052 */ 0053 #define CALLIGRA_STABLE_VERSION_MAJOR @CALLIGRA_STABLE_VERSION_MAJOR@ 0054 0055 /** 0056 * @def CALLIGRA_VERSION_MAJOR 0057 * @ingroup CalligraMacros 0058 * @brief Major version of Calligra, at compile time 0059 * 0060 * Generally it's the same as CALLIGRA_STABLE_VERSION_MAJOR but for unstable x.0 0061 * x is decreased by one, e.g. 3.0 Beta is 2.99. 0062 */ 0063 #if !defined CALLIGRA_STABLE && @CALLIGRA_STABLE_VERSION_MINOR@ == 0 0064 # define CALLIGRA_VERSION_MAJOR (CALLIGRA_STABLE_VERSION_MAJOR - 1) 0065 #else 0066 # define CALLIGRA_VERSION_MAJOR CALLIGRA_STABLE_VERSION_MAJOR 0067 #endif 0068 0069 /** 0070 * @def CALLIGRA_STABLE_VERSION_MINOR 0071 * @ingroup CalligraMacros 0072 * @brief Minor version of stable Calligra, at compile time 0073 * CALLIGRA_VERSION_MINOR is computed based on this value. 0074 */ 0075 #define CALLIGRA_STABLE_VERSION_MINOR @CALLIGRA_STABLE_VERSION_MINOR@ 0076 0077 /** 0078 * @def CALLIGRA_VERSION_MINOR 0079 * @ingroup CalligraMacros 0080 * @brief Minor version of Calligra, at compile time 0081 * 0082 * Generally it's equal to CALLIGRA_STABLE_VERSION_MINOR for stable releases, 0083 * equal to 99 for x.0 unstable releases (e.g. it's 3.0 Beta has minor version 99), 0084 * and equal to CALLIGRA_STABLE_VERSION_MINOR-1 for unstable releases other than x.0. 0085 */ 0086 #ifdef CALLIGRA_STABLE 0087 # define CALLIGRA_VERSION_MINOR CALLIGRA_STABLE_VERSION_MINOR 0088 #elif CALLIGRA_STABLE_VERSION_MINOR == 0 0089 # define CALLIGRA_VERSION_MINOR 99 0090 #else 0091 # define CALLIGRA_VERSION_MINOR (CALLIGRA_STABLE_VERSION_MINOR - 1) 0092 #endif 0093 0094 /** 0095 * @def CALLIGRA_VERSION_RELEASE 0096 * @ingroup CalligraMacros 0097 * @brief Release version of Calligra, at compile time. 0098 * 89 for Alpha. 0099 */ 0100 #define CALLIGRA_VERSION_RELEASE @CALLIGRA_VERSION_RELEASE@ 0101 0102 /** 0103 * @def CALLIGRA_STABLE_VERSION_RELEASE 0104 * @ingroup CalligraMacros 0105 * @brief Release version of Calligra, at compile time. 0106 * 0107 * Equal to CALLIGRA_VERSION_RELEASE for stable releases and 0 for unstable ones. 0108 */ 0109 #ifdef CALLIGRA_STABLE 0110 # define CALLIGRA_STABLE_VERSION_RELEASE 0 0111 #else 0112 # define CALLIGRA_STABLE_VERSION_RELEASE @CALLIGRA_VERSION_RELEASE@ 0113 #endif 0114 0115 /** 0116 * @def CALLIGRA_ALPHA 0117 * @ingroup CalligraMacros 0118 * @brief If defined (1..9), indicates at compile time that Calligra is in alpha stage 0119 */ 0120 #cmakedefine CALLIGRA_ALPHA @CALLIGRA_ALPHA@ 0121 0122 /** 0123 * @def CALLIGRA_BETA 0124 * @ingroup CalligraMacros 0125 * @brief If defined (1..9), indicates at compile time that Calligra is in beta stage 0126 */ 0127 #cmakedefine CALLIGRA_BETA @CALLIGRA_BETA@ 0128 0129 /** 0130 * @def CALLIGRA_RC 0131 * @ingroup CalligraMacros 0132 * @brief If defined (1..9), indicates at compile time that Calligra is in "release candidate" stage 0133 */ 0134 #cmakedefine CALLIGRA_RC @CALLIGRA_RC@ 0135 0136 /** 0137 * @def CALLIGRA_STABLE 0138 * @ingroup CalligraMacros 0139 * @brief If defined, indicates at compile time that Calligra is in stable stage 0140 */ 0141 #cmakedefine CALLIGRA_STABLE @CALLIGRA_STABLE@ 0142 0143 /** 0144 * @ingroup CalligraMacros 0145 * @brief Make a number from the major, minor and release number of a Calligra version 0146 * 0147 * This function can be used for preprocessing when CALLIGRA_IS_VERSION is not 0148 * appropriate. 0149 */ 0150 #define CALLIGRA_MAKE_VERSION( a,b,c ) (((a) << 16) | ((b) << 8) | (c)) 0151 0152 /** 0153 * @ingroup CalligraMacros 0154 * @brief Version of Calligra as number, at compile time 0155 * 0156 * This macro contains the Calligra version in number form. As it is a macro, 0157 * it contains the version at compile time. See version() if you need 0158 * the Calligra version used at runtime. 0159 */ 0160 #define CALLIGRA_VERSION \ 0161 CALLIGRA_MAKE_VERSION(CALLIGRA_VERSION_MAJOR,CALLIGRA_VERSION_MINOR,CALLIGRA_VERSION_RELEASE) 0162 0163 /** 0164 * @ingroup CalligraMacros 0165 * @brief Check if the Calligra version matches a certain version or is higher 0166 * 0167 * This macro is typically used to compile conditionally a part of code: 0168 * @code 0169 * #if CALLIGRA_IS_VERSION(2,3,0) 0170 * // Code for Calligra 2.3.0 0171 * #else 0172 * // Code for older Calligra 0173 * #endif 0174 * @endcode 0175 * 0176 * @warning Especially during development phases of Calligra, be careful 0177 * when choosing the version number that you are checking against. 0178 * Otherwise you might risk to break the next Calligra release. 0179 * Therefore be careful that development version have a 0180 * version number lower than the released version, so do not check 0181 * e.g. for Calligra 4.3 with CALLIGRA_IS_VERSION(4,3,0) 0182 * but with the actual version number at a time a needed feature was introduced, e.g. 4.3.2. 0183 */ 0184 #define CALLIGRA_IS_VERSION(a,b,c) ( CALLIGRA_VERSION >= CALLIGRA_MAKE_VERSION(a,b,c) ) 0185 0186 /** 0187 * @def CALLIGRA_YEAR 0188 * @ingroup CalligraMacros 0189 * @brief Year of the Calligra release, set at compile time 0190 * 0191 * This macro is used in "About application" dialog for strings such as "© 2012-..., The Author Team". 0192 */ 0193 #define CALLIGRA_YEAR "@CALLIGRA_YEAR@" 0194 0195 /** 0196 * Namespace for general Calligra functions. 0197 */ 0198 namespace Calligra 0199 { 0200 /** 0201 * Returns the encoded number of Calligra's version, see the CALLIGRA_VERSION macro. 0202 * In contrary to that macro this function returns the number of the actually 0203 * installed Calligra version, not the number of the Calligra version that was 0204 * installed when the program was compiled. 0205 * @return the version number, encoded in a single uint 0206 */ 0207 KOVERSION_EXPORT unsigned int version(); 0208 0209 /** 0210 * Returns the major number of Calligra's version, e.g. 0211 * 1 for Calligra 1.2.3. 0212 * @return the major version number 0213 */ 0214 KOVERSION_EXPORT unsigned int versionMajor(); 0215 0216 /** 0217 * Returns the minor number of Calligra's version, e.g. 0218 * 2 for Calligra 1.2.3. 0219 * @return the minor version number 0220 */ 0221 KOVERSION_EXPORT unsigned int versionMinor(); 0222 0223 /** 0224 * Returns the release of Calligra's version, e.g. 0225 * 3 for Calligra 1.2.3. 0226 * @return the release number 0227 */ 0228 KOVERSION_EXPORT unsigned int versionRelease(); 0229 0230 /** 0231 * Returns the Calligra version as string, e.g. "1.2.3". 0232 * @return the Calligra version. You can keep the string forever. 0233 */ 0234 KOVERSION_EXPORT const char *versionString(); 0235 } 0236 0237 #endif // _CALLIGRA_VERSION_H_