]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blob - src/helpers/UserAgentHelper.h
5c8286afdedccbf87577b6e309140a081e74f297
[PrivacyBrowserPC.git] / src / helpers / UserAgentHelper.h
1 /*
2  * Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
3  *
4  * This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc>.
5  *
6  * Privacy Browser PC is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Privacy Browser PC is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with Privacy Browser PC.  If not, see <http://www.gnu.org/licenses/>.
18  */
19
20 #ifndef USERAGENTHELPER_H
21 #define USERAGENTHELPER_H
22
23 // Qt framework headers.
24 #include <QString>
25
26 class UserAgentHelper
27 {
28 public:
29     // The default constructor.
30     UserAgentHelper();
31
32     // The public static constants.
33     static const QString CHROMIUM_LINUX_DATABASE;
34     static const QString CHROMIUM_LINUX_TRANSLATED;
35     static const QString CHROMIUM_LINUX_USER_AGENT;
36     static const QString CHROME_WINDOWS_DATABASE;
37     static const QString CHROME_WINDOWS_TRANSLATED;
38     static const QString CHROME_WINDOWS_USER_AGENT;
39     static const QString EDGE_WINDOWS_DATABASE;
40     static const QString EDGE_WINDOWS_TRANSLATED;
41     static const QString EDGE_WINDOWS_USER_AGENT;
42     static const QString FIREFOX_LINUX_DATABASE;
43     static const QString FIREFOX_LINUX_TRANSLATED;
44     static const QString FIREFOX_LINUX_USER_AGENT;
45     static const QString FIREFOX_WINDOWS_DATABASE;
46     static const QString FIREFOX_WINDOWS_TRANSLATED;
47     static const QString FIREFOX_WINDOWS_USER_AGENT;
48     static const QString PRIVACY_BROWSER_DATABASE;
49     static const QString PRIVACY_BROWSER_TRANSLATED;
50     static const QString PRIVACY_BROWSER_USER_AGENT;
51     static const QString SAFARI_MACOS_DATABASE;
52     static const QString SAFARI_MACOS_TRANSLATED;
53     static const QString SAFARI_MACOS_USER_AGENT;
54     static const QString SYSTEM_DEFAULT_DATABASE;
55     static const QString SYSTEM_DEFAULT_TRANSLATED;
56     static const QString WEB_ENGINE_DEFAULT_DATABASE;
57     static const QString WEB_ENGINE_DEFAULT_TRANSLATED;
58
59     // The public static functions.
60     static QString getDatabaseUserAgentNameFromTranslatedName(const QString &translatedUserAgentName);
61     static int getDomainSettingsUserAgentIndex(const QString &userAgentName);
62     static QString getUserAgentFromDatabaseName(const QString &userAgentDatabaseName);
63     static QString getUserAgentFromTranslatedName(const QString &userAgentTranslatedName);
64     static QString getResultingDomainSettingsUserAgent(const QString &rawUserAgent);
65     static QString getTranslatedUserAgentNameFromDatabaseName(const QString &userAgentName);
66 };
67 #endif