2 * Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
4 * This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc>.
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.
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.
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/>.
20 #ifndef USERAGENTHELPER_H
21 #define USERAGENTHELPER_H
23 // Qt framework headers.
29 // The default constructor.
35 // The public static constants.
36 static const QString CHROMIUM_LINUX_DATABASE;
37 static const QString CHROMIUM_LINUX_USER_AGENT;
38 static const QString CHROME_WINDOWS_DATABASE;
39 static const QString CHROME_WINDOWS_USER_AGENT;
40 static const QString EDGE_WINDOWS_DATABASE;
41 static const QString EDGE_WINDOWS_USER_AGENT;
42 static const QString FIREFOX_LINUX_DATABASE;
43 static const QString FIREFOX_LINUX_USER_AGENT;
44 static const QString FIREFOX_WINDOWS_DATABASE;
45 static const QString FIREFOX_WINDOWS_USER_AGENT;
46 static const QString PRIVACY_BROWSER_DATABASE;
47 static const QString PRIVACY_BROWSER_USER_AGENT;
48 static const QString SAFARI_MACOS_DATABASE;
49 static const QString SAFARI_MACOS_USER_AGENT;
50 static const QString SYSTEM_DEFAULT_DATABASE;
51 static const QString WEB_ENGINE_DEFAULT_DATABASE;
53 // The public static functions.
54 static int getDomainSettingsUserAgentIndex(const QString &userAgentName);
55 static QString getUserAgentFromDatabaseName(const QString &userAgentDatabaseName);
56 static QString getResultingDomainSettingsUserAgent(const QString &rawUserAgent);
58 // The public variables.
59 QString SYSTEM_DEFAULT_TRANSLATED;
60 QString PRIVACY_BROWSER_TRANSLATED;
61 QString WEB_ENGINE_DEFAULT_TRANSLATED;
62 QString FIREFOX_LINUX_TRANSLATED;
63 QString CHROMIUM_LINUX_TRANSLATED;
64 QString FIREFOX_WINDOWS_TRANSLATED;
65 QString CHROME_WINDOWS_TRANSLATED;
66 QString EDGE_WINDOWS_TRANSLATED;
67 QString SAFARI_MACOS_TRANSLATED;
69 // The public functions.
70 QString getDatabaseUserAgentNameFromTranslatedName(const QString &translatedUserAgentName);
71 QString getUserAgentFromTranslatedName(const QString &userAgentTranslatedName);
72 QString getTranslatedUserAgentNameFromDatabaseName(const QString &userAgentName);