2011-03-15 23:14:39 +01:00
|
|
|
/* ============================================================
|
|
|
|
* QupZilla - WebKit based browser
|
2014-01-11 16:11:42 +01:00
|
|
|
* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
|
2011-03-15 23:14:39 +01:00
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
* ============================================================ */
|
2011-03-02 16:57:41 +01:00
|
|
|
/****************************************************************************
|
|
|
|
**
|
|
|
|
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
|
|
**
|
|
|
|
** Use, modification and distribution is allowed without limitation,
|
|
|
|
** warranty, liability or support of any kind.
|
|
|
|
**
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef QTWIN_H
|
|
|
|
#define QTWIN_H
|
|
|
|
|
2012-02-29 18:33:50 +01:00
|
|
|
#include "qz_namespace.h"
|
|
|
|
|
2011-03-02 16:57:41 +01:00
|
|
|
#include <QColor>
|
|
|
|
#include <QWidget>
|
2011-05-01 22:07:57 +02:00
|
|
|
#include <QSysInfo>
|
2011-03-02 16:57:41 +01:00
|
|
|
/**
|
|
|
|
* This is a helper class for using the Desktop Window Manager
|
|
|
|
* functionality on Windows 7 and Windows Vista. On other platforms
|
|
|
|
* these functions will simply not do anything.
|
|
|
|
*/
|
2012-09-03 22:48:52 +02:00
|
|
|
#ifdef Q_OS_WIN
|
2013-01-19 23:22:30 +01:00
|
|
|
// Qt5 compile issue: http://comments.gmane.org/gmane.comp.lib.qt.user/4711
|
|
|
|
#define NOMINMAX
|
2012-08-13 15:41:08 +02:00
|
|
|
#ifdef W7API
|
|
|
|
#include <ShlObj.h>
|
|
|
|
#include <shlwapi.h>
|
|
|
|
#include <Propvarutil.h>
|
|
|
|
#include "msvc2008.h"
|
|
|
|
|
|
|
|
DEFINE_PROPERTYKEY(PKEY_Title, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 2);
|
|
|
|
DEFINE_PROPERTYKEY(PKEY_AppUserModel_IsDestListSeparator, 0x9F4C2855, 0x9F79, 0x4B39, 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, 6);
|
|
|
|
#endif
|
2011-05-01 22:07:57 +02:00
|
|
|
#endif
|
|
|
|
class WindowNotifier;
|
2012-02-29 18:33:50 +01:00
|
|
|
class QT_QUPZILLA_EXPORT QtWin : public QObject
|
2011-03-02 16:57:41 +01:00
|
|
|
{
|
2011-05-01 22:07:57 +02:00
|
|
|
Q_OBJECT
|
2011-03-02 16:57:41 +01:00
|
|
|
public:
|
2011-03-15 23:14:39 +01:00
|
|
|
static bool isRunningWindows7();
|
2011-11-06 17:01:23 +01:00
|
|
|
static bool enableBlurBehindWindow(QWidget* widget, bool enable = true);
|
|
|
|
static bool extendFrameIntoClientArea(QWidget* widget,
|
2011-03-02 16:57:41 +01:00
|
|
|
int left = -1, int top = -1,
|
|
|
|
int right = -1, int bottom = -1);
|
|
|
|
static bool isCompositionEnabled();
|
2011-05-06 20:05:49 +02:00
|
|
|
static QColor colorizationColor();
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2011-05-01 22:07:57 +02:00
|
|
|
static void setupJumpList();
|
2013-01-19 23:22:30 +01:00
|
|
|
#ifdef Q_OS_WIN
|
|
|
|
static HWND hwndOfWidget(const QWidget* widget);
|
|
|
|
#endif
|
2011-05-01 22:07:57 +02:00
|
|
|
|
2011-03-02 16:57:41 +01:00
|
|
|
private:
|
2011-11-06 17:01:23 +01:00
|
|
|
static WindowNotifier* windowNotifier();
|
2011-05-06 20:05:49 +02:00
|
|
|
#ifdef W7API
|
|
|
|
static void populateFrequentSites(IObjectCollection* collection, const QString &appPath);
|
2011-05-01 22:07:57 +02:00
|
|
|
static void AddTasksToList(ICustomDestinationList* destinationList);
|
|
|
|
static IShellLink* CreateShellLink(const QString &title, const QString &description, const QString &app_path, const QString &app_args, const QString &icon_path, int app_index);
|
|
|
|
#endif
|
2011-03-02 16:57:41 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // QTWIN_H
|