File indexing completed on 2024-05-12 04:57:54
0001 /* ============================================================ 0002 * Falkon - Qt web browser 0003 * Copyright (C) 2010-2018 David Rosca <nowrep@gmail.com> 0004 * 0005 * This program is free software: you can redistribute it and/or modify 0006 * it under the terms of the GNU General Public License as published by 0007 * the Free Software Foundation, either version 3 of the License, or 0008 * (at your option) any later version. 0009 * 0010 * This program is distributed in the hope that it will be useful, 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0013 * GNU General Public License for more details. 0014 * 0015 * You should have received a copy of the GNU General Public License 0016 * along with this program. If not, see <http://www.gnu.org/licenses/>. 0017 * ============================================================ */ 0018 #ifndef QZCOMMON_H 0019 #define QZCOMMON_H 0020 0021 #include <QDebug> 0022 #include <QFlags> 0023 #include <QtWebEngineCore/QtWebEngineCoreVersion> 0024 0025 #ifdef FALKON_SHAREDLIBRARY 0026 #define FALKON_EXPORT Q_DECL_EXPORT 0027 #else 0028 #define FALKON_EXPORT Q_DECL_IMPORT 0029 #endif 0030 0031 #ifndef Q_UNLIKELY 0032 #define Q_UNLIKELY(x) x 0033 #endif 0034 0035 #ifndef Q_LIKELY 0036 #define Q_LIKELY(x) x 0037 #endif 0038 0039 #ifndef QSL 0040 #define QSL(x) QStringLiteral(x) 0041 #endif 0042 0043 #ifndef QL1S 0044 #define QL1S(x) QLatin1String(x) 0045 #endif 0046 0047 #ifndef QL1C 0048 #define QL1C(x) QLatin1Char(x) 0049 #endif 0050 0051 namespace Qz 0052 { 0053 // Version of session.dat file 0054 extern const int sessionVersion; 0055 0056 FALKON_EXPORT extern const char *APPNAME; 0057 FALKON_EXPORT extern const char *VERSION; 0058 FALKON_EXPORT extern const char *AUTHOR; 0059 FALKON_EXPORT extern const char *COPYRIGHT; 0060 FALKON_EXPORT extern const char *WWWADDRESS; 0061 FALKON_EXPORT extern const char *BUGSADDRESS; 0062 FALKON_EXPORT extern const char *WIKIADDRESS; 0063 0064 enum BrowserWindowType { 0065 BW_FirstAppWindow, 0066 BW_OtherRestoredWindow, 0067 BW_NewWindow, 0068 BW_MacFirstWindow 0069 }; 0070 0071 enum CommandLineAction { 0072 CL_NoAction, 0073 CL_OpenUrl, 0074 CL_OpenUrlInCurrentTab, 0075 CL_OpenUrlInNewWindow, 0076 CL_StartWithProfile, 0077 CL_StartWithoutAddons, 0078 CL_NewTab, 0079 CL_NewWindow, 0080 CL_ShowDownloadManager, 0081 CL_ToggleFullScreen, 0082 CL_StartPrivateBrowsing, 0083 CL_StartNewInstance, 0084 CL_StartPortable, 0085 CL_ExitAction, 0086 CL_WMClass 0087 }; 0088 0089 enum ObjectName { 0090 ON_WebView, 0091 ON_TabBar, 0092 ON_TabWidget, 0093 ON_BrowserWindow 0094 }; 0095 0096 enum NewTabPositionFlag { 0097 NT_SelectedTab = 1, 0098 NT_NotSelectedTab = 2, 0099 NT_CleanTab = 4, 0100 NT_TabAtTheEnd = 8, 0101 NT_NewEmptyTab = 16, 0102 0103 NT_SelectedNewEmptyTab = NT_SelectedTab | NT_TabAtTheEnd | NT_NewEmptyTab, 0104 NT_SelectedTabAtTheEnd = NT_SelectedTab | NT_TabAtTheEnd, 0105 NT_NotSelectedTabAtTheEnd = NT_NotSelectedTab | NT_TabAtTheEnd, 0106 NT_CleanSelectedTabAtTheEnd = NT_SelectedTab | NT_TabAtTheEnd | NT_CleanTab, 0107 NT_CleanSelectedTab = NT_CleanTab | NT_SelectedTab, 0108 NT_CleanNotSelectedTab = NT_CleanTab | NT_NotSelectedTab 0109 }; 0110 0111 Q_DECLARE_FLAGS(NewTabPositionFlags, NewTabPositionFlag) 0112 Q_DECLARE_OPERATORS_FOR_FLAGS(Qz::NewTabPositionFlags) 0113 0114 } 0115 0116 #if defined(Q_OS_WIN) || defined(Q_OS_OS2) 0117 #define DEFAULT_THEME_NAME QSL("windows") 0118 #elif defined(Q_OS_MACOS) 0119 #define DEFAULT_THEME_NAME QSL("mac") 0120 #elif defined(Q_OS_UNIX) 0121 #define DEFAULT_THEME_NAME QSL("linux") 0122 #else 0123 #define DEFAULT_THEME_NAME QSL("default") 0124 #endif 0125 0126 #ifdef Q_OS_WIN 0127 #define DISABLE_CHECK_UPDATES false 0128 #else 0129 #define DISABLE_CHECK_UPDATES true 0130 #endif 0131 0132 #define DEFAULT_CHECK_DEFAULTBROWSER false 0133 0134 #ifdef Q_OS_WIN 0135 #define DEFAULT_DOWNLOAD_USE_NATIVE_DIALOG false 0136 #else 0137 #define DEFAULT_DOWNLOAD_USE_NATIVE_DIALOG true 0138 #endif 0139 0140 #endif // QZCOMMON_H