1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-14 19:12:11 +01:00
falkonOfficial/src/lib/app/qzcommon.h

141 lines
3.4 KiB
C
Raw Normal View History

/* ============================================================
2017-08-25 17:11:29 +02:00
* Falkon - Qt web browser
* Copyright (C) 2010-2018 David Rosca <nowrep@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#ifndef QZCOMMON_H
#define QZCOMMON_H
#include <QDebug>
#include <QFlags>
2017-08-25 17:11:29 +02:00
#ifdef FALKON_SHAREDLIBRARY
#define FALKON_EXPORT Q_DECL_EXPORT
#else
2017-08-25 17:11:29 +02:00
#define FALKON_EXPORT Q_DECL_IMPORT
#endif
2013-05-10 13:12:02 +02:00
#ifndef Q_UNLIKELY
#define Q_UNLIKELY(x) x
#endif
#ifndef Q_LIKELY
#define Q_LIKELY(x) x
#endif
#ifndef QSL
#define QSL(x) QStringLiteral(x)
#endif
#ifndef QL1S
#define QL1S(x) QLatin1String(x)
#endif
#ifndef QL1C
#define QL1C(x) QLatin1Char(x)
#endif
namespace Qz
{
// Version of session.dat file
extern const int sessionVersion;
// Version of bookmarks.json file
extern const int bookmarksVersion;
2017-08-25 17:11:29 +02:00
FALKON_EXPORT extern const char* APPNAME;
FALKON_EXPORT extern const char* VERSION;
FALKON_EXPORT extern const char* AUTHOR;
FALKON_EXPORT extern const char* COPYRIGHT;
FALKON_EXPORT extern const char* WWWADDRESS;
FALKON_EXPORT extern const char* WIKIADDRESS;
enum BrowserWindowType {
BW_FirstAppWindow,
BW_OtherRestoredWindow,
BW_NewWindow,
BW_MacFirstWindow
};
enum CommandLineAction {
CL_NoAction,
CL_OpenUrl,
CL_OpenUrlInCurrentTab,
CL_OpenUrlInNewWindow,
CL_StartWithProfile,
CL_StartWithoutAddons,
CL_NewTab,
CL_NewWindow,
CL_ShowDownloadManager,
CL_ToggleFullScreen,
CL_StartPrivateBrowsing,
CL_StartNewInstance,
CL_StartPortable,
CL_ExitAction
};
enum ObjectName {
ON_WebView,
ON_TabBar,
2018-02-04 10:11:38 +01:00
ON_TabWidget,
ON_BrowserWindow
};
enum NewTabPositionFlag {
NT_SelectedTab = 1,
NT_NotSelectedTab = 2,
NT_CleanTab = 4,
NT_TabAtTheEnd = 8,
NT_NewEmptyTab = 16,
NT_SelectedNewEmptyTab = NT_SelectedTab | NT_TabAtTheEnd | NT_NewEmptyTab,
NT_SelectedTabAtTheEnd = NT_SelectedTab | NT_TabAtTheEnd,
NT_NotSelectedTabAtTheEnd = NT_NotSelectedTab | NT_TabAtTheEnd,
NT_CleanSelectedTabAtTheEnd = NT_SelectedTab | NT_TabAtTheEnd | NT_CleanTab,
NT_CleanSelectedTab = NT_CleanTab | NT_SelectedTab,
NT_CleanNotSelectedTab = NT_CleanTab | NT_NotSelectedTab
};
Q_DECLARE_FLAGS(NewTabPositionFlags, NewTabPositionFlag)
Q_DECLARE_OPERATORS_FOR_FLAGS(Qz::NewTabPositionFlags)
}
#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
#define DEFAULT_THEME_NAME "windows"
2017-02-10 19:00:58 +01:00
#elif defined(Q_OS_MACOS)
#define DEFAULT_THEME_NAME "mac"
#elif defined(Q_OS_UNIX)
#define DEFAULT_THEME_NAME "linux"
#else
#define DEFAULT_THEME_NAME "default"
#endif
#ifdef Q_OS_WIN
2016-04-05 10:18:49 +02:00
#define DISABLE_CHECK_UPDATES false
#else
2016-04-05 10:18:49 +02:00
#define DISABLE_CHECK_UPDATES true
#endif
#define DEFAULT_CHECK_DEFAULTBROWSER false
#ifdef Q_OS_WIN
#define DEFAULT_DOWNLOAD_USE_NATIVE_DIALOG false
#else
#define DEFAULT_DOWNLOAD_USE_NATIVE_DIALOG true
#endif
#endif // QZCOMMON_H