1 | /* This file is part of the KDE project |
2 | Copyright (c) 2003-2012 Kexi Team <kexi@kde.org> |
3 | |
4 | Version information based on calligraversion.h, |
5 | Copyright (c) 2003 David Faure <faure@kde.org> |
6 | Copyright (c) 2003 Lukas Tinkl <lukas@kde.org> |
7 | Copyright (c) 2004 Nicolas Goutte <goutte@kde.org> |
8 | |
9 | This library is free software; you can redistribute it and/or |
10 | modify it under the terms of the GNU Library General Public |
11 | License as published by the Free Software Foundation; either |
12 | version 2 of the License, or (at your option) any later version. |
13 | |
14 | This library is distributed in the hope that it will be useful, |
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 | Library General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Library General Public License |
20 | along with this library; see the file COPYING.LIB. If not, write to |
21 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
22 | * Boston, MA 02110-1301, USA. |
23 | */ |
24 | |
25 | #ifndef _KEXI_VERSION_ |
26 | #define _KEXI_VERSION_ |
27 | |
28 | #include "kexi_export.h" |
29 | #include <calligraversion.h> |
30 | |
31 | #define KEXI_APP_NAME "Kexi" |
32 | #define KEXI_VERSION_STRING CALLIGRA_VERSION_STRING |
33 | #define KEXI_VERSION_MAJOR CALLIGRA_VERSION_MAJOR |
34 | #define KEXI_VERSION_MINOR CALLIGRA_VERSION_MINOR |
35 | #define KEXI_VERSION_RELEASE CALLIGRA_VERSION_RELEASE |
36 | |
37 | #ifdef CALLIGRA_ALPHA |
38 | #define KEXI_ALPHA CALLIGRA_ALPHA |
39 | #endif |
40 | |
41 | #ifdef CALLIGRA_BETA |
42 | #define KEXI_BETA CALLIGRA_BETA |
43 | #endif |
44 | |
45 | #ifdef CALLIGRA_RC |
46 | #define KEXI_RC CALLIGRA_RC |
47 | #endif |
48 | |
49 | #define KEXI_VERSION \ |
50 | CALLIGRA_MAKE_VERSION(KEXI_VERSION_MAJOR,KEXI_VERSION_MINOR,KEXI_VERSION_RELEASE) |
51 | |
52 | #define KEXI_IS_VERSION(a,b,c) ( KEXI_VERSION >= CALLIGRA_MAKE_VERSION(a,b,c) ) |
53 | |
54 | /** |
55 | * Namespace for general Kexi functions. |
56 | */ |
57 | namespace Kexi |
58 | { |
59 | /** |
60 | * Returns the encoded number of Kexi's version, see the KEXI_VERSION macro. |
61 | * In contrary to that macro this function returns the number of the actually |
62 | * installed Kexi version, not the number of the Kexi version that was |
63 | * installed when the program was compiled. |
64 | * @return the version number, encoded in a single uint |
65 | */ |
66 | KEXICORE_EXPORT unsigned int version(); |
67 | /** |
68 | * Returns the major number of Kexi's version, e.g. |
69 | * 1 for Kexi 1.2.3. |
70 | * @return the major version number |
71 | */ |
72 | KEXICORE_EXPORT unsigned int versionMajor(); |
73 | /** |
74 | * Returns the minor number of Kexi's version, e.g. |
75 | * 2 for Kexi 1.2.3. |
76 | * @return the minor version number |
77 | */ |
78 | KEXICORE_EXPORT unsigned int versionMinor(); |
79 | /** |
80 | * Returns the release of Kexi's version, e.g. |
81 | * 3 for Kexi 1.2.3. |
82 | * @return the release number |
83 | */ |
84 | KEXICORE_EXPORT unsigned int versionRelease(); |
85 | /** |
86 | * Returns the Kexi version as string, e.g. "1.2.3" |
87 | * Sometimes it may be even something like "1.2.3 beta 2" |
88 | * @return the Kexi version. You can keep the string forever |
89 | */ |
90 | KEXICORE_EXPORT const char *versionString(); |
91 | /** |
92 | * Returns the encoded number of stable Kexi's version. |
93 | * For 2.3.1 it returns 2.3.1, for 2.5.70 returns 2.6.0, for 2.9.70 returns 3.0.0. |
94 | * In contrary to KEXI_STABLE_VERSION macro this function returns the number |
95 | * of the actually installed Kexi version, not the number of the Kexi version that was |
96 | * installed when the program was compiled. |
97 | * @return the version number, encoded in a single uint |
98 | * @see Kexi::version() |
99 | * @see KEXI_STABLE_VERSION |
100 | */ |
101 | KEXICORE_EXPORT unsigned int stableVersion(); |
102 | /** |
103 | * Returns the major number of stable Kexi's version, e.g. |
104 | * 1 for Kexi 1.2.3. |
105 | * @return the major stable version number |
106 | */ |
107 | KEXICORE_EXPORT unsigned int stableVersionMajor(); |
108 | /** |
109 | * Returns the minor number of stable Kexi's version, e.g. |
110 | * 2 for Kexi 1.2.3. |
111 | * @return the minor stable version number |
112 | */ |
113 | KEXICORE_EXPORT unsigned int stableVersionMinor(); |
114 | /** |
115 | * Returns the release of stable Kexi's version, e.g. |
116 | * 3 for Kexi 1.2.3. |
117 | * @return the release stable version number |
118 | */ |
119 | KEXICORE_EXPORT unsigned int stableVersionRelease(); |
120 | /** |
121 | * Returns the stable Kexi version as string, e.g. "1.2.3" |
122 | * It never contains alpha, beta or rc part. |
123 | * @return the stable Kexi version. |
124 | */ |
125 | KEXICORE_EXPORT QString stableVersionString(); |
126 | } |
127 | |
128 | /* |
129 | * This is the version a part has to be only increase it if the |
130 | * interface isn't binary compatible anymore. |
131 | * |
132 | * Note: update X-Kexi-PartVersion values in kexi*handler.desktop |
133 | * files every time you are increasing this value. |
134 | */ |
135 | |
136 | #define KEXI_PART_VERSION 2 |
137 | |
138 | #endif /* _KEXI_VERSION_ */ |
139 | |