1/*
2 * Copyright 2008 by Aaron Seigo <aseigo@kde.org>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License as
6 * published by the Free Software Foundation; either version 2, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20#ifndef PLASMA_VERSION_H
21#define PLASMA_VERSION_H
22
23/** @file plasma/version.h <Plasma/Version> */
24
25#include <plasma/plasma_export.h>
26
27/**
28 * String version of libplasma version, suitable for use in
29 * file formats or network protocols
30 */
31#define PLASMA_VERSION_STRING "3.3.0"
32
33/// @brief Major version of libplasma, at compile time
34#define PLASMA_VERSION_MAJOR 3
35/// @brief Minor version of libplasma, at compile time
36#define PLASMA_VERSION_MINOR 3
37/// @brief Release version of libplasma, at compile time
38#define PLASMA_VERSION_RELEASE 0
39
40#define PLASMA_MAKE_VERSION(a,b,c) (((a) << 16) | ((b) << 8) | (c))
41
42/**
43 * Compile time macro for the version number of libplasma
44 */
45#define PLASMA_VERSION \
46 PLASMA_MAKE_VERSION(PLASMA_VERSION_MAJOR, PLASMA_VERSION_MINOR, PLASMA_VERSION_RELEASE)
47
48/**
49 * Compile-time macro for checking the plasma version. Not useful for
50 * detecting the version of libplasma at runtime.
51 */
52#define PLASMA_IS_VERSION(a,b,c) (PLASMA_VERSION >= PLASMA_MAKE_VERSION(a,b,c))
53
54/**
55 * Namespace for everything in libplasma
56 */
57namespace Plasma
58{
59
60/**
61 * The runtime version of libplasma
62 */
63PLASMA_EXPORT unsigned int version();
64
65/**
66 * The runtime major version of libplasma
67 */
68PLASMA_EXPORT unsigned int versionMajor();
69
70/**
71 * The runtime major version of libplasma
72 */
73PLASMA_EXPORT unsigned int versionMinor();
74
75/**
76 * The runtime major version of libplasma
77 */
78PLASMA_EXPORT unsigned int versionRelease();
79
80/**
81 * The runtime version string of libplasma
82 */
83PLASMA_EXPORT const char *versionString();
84
85/**
86 * Verifies that a plugin is compatible with plasma
87 */
88PLASMA_EXPORT bool isPluginVersionCompatible(unsigned int version);
89
90} // Plasma namespace
91
92#endif // multiple inclusion guard
93