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.
32 // The public 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;
57 // The public functions.
58 static QString getUserAgentFromDatabaseName(const QString &userAgentDatabaseName);
59 static QString getUserAgentFromTranslatedName(const QString &userAgentTranslatedName);
60 static QString getDatabaseUserAgentName(const QString &translatedUserAgentName);
61 static int getDomainSettingsUserAgentIndex(const QString &userAgentName);
62 static QString getResultingDomainSettingsUserAgent(const QString &rawUserAgent);
63 static QString getTranslatedUserAgentName(const QString &userAgentName);