File indexing completed on 2024-05-19 05:01:59

0001 /*
0002     SPDX-FileCopyrightText: 2007 Joris Guisson <joris.guisson@gmail.com>
0003     SPDX-FileCopyrightText: 2007 Ivan Vasic <ivasic@gmail.com>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 #ifndef BTVERSION_H
0008 #define BTVERSION_H
0009 
0010 #include <ktorrent_export.h>
0011 #include <libktorrent_version.h>
0012 #include <util/constants.h>
0013 
0014 class QString;
0015 
0016 namespace bt
0017 {
0018 enum VersionType {
0019     ALPHA,
0020     BETA,
0021     RELEASE_CANDIDATE,
0022     DEVEL,
0023     NORMAL,
0024 };
0025 
0026 /**
0027  * Set the client info. This information is used to create
0028  * the PeerID and the version string (used in HTTP announces for example).
0029  * @param name Name of the client
0030  * @param major Major version
0031  * @param minor Minor version
0032  * @param release Release version
0033  * @param type Which version
0034  * @param peer_id_code Peer ID code (2 letters identifying the client, KT for KTorrent)
0035  */
0036 KTORRENT_EXPORT void SetClientInfo(const QString &name, int major, int minor, int release, VersionType type, const QString &peer_id_code);
0037 
0038 /**
0039  * Set the client info. This information is used to create
0040  * the PeerID and the version string (used in HTTP announces for example).
0041  * @param name Name of the client
0042  * @param version Version
0043  * @param peer_id_code Peer ID code (2 letters identifying the client, KT for KTorrent)
0044  */
0045 KTORRENT_EXPORT void SetClientInfo(const QString &name, const QString &version, const QString &peer_id_code);
0046 
0047 /**
0048  * Get the PeerID prefix set by SetClientInfo
0049  * @return The PeerID prefix
0050  */
0051 KTORRENT_EXPORT QString PeerIDPrefix();
0052 
0053 /**
0054  * Get the current client version string
0055  */
0056 KTORRENT_EXPORT QString GetVersionString();
0057 
0058 /// Major version number of the ktorrent library
0059 const Uint32 MAJOR = LIBKTORRENT_VERSION_MAJOR;
0060 /// Minor version number of the ktorrent library
0061 const Uint32 MINOR = LIBKTORRENT_VERSION_MINOR;
0062 /// Version type of the ktorrent library
0063 const VersionType VERSION_TYPE = NORMAL;
0064 /// Release version number of the ktorrent library (only for normal releases)
0065 const Uint32 RELEASE = LIBKTORRENT_VERSION_PATCH;
0066 }
0067 
0068 #endif