diff options
Diffstat (limited to 'src')
90 files changed, 0 insertions, 11786 deletions
diff --git a/src/.prev_CMakeLists.txt b/src/.prev_CMakeLists.txt deleted file mode 100644 index 92346ae..0000000 --- a/src/.prev_CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -# Generated from src.pro. - -##################################################################### -## src Binary: -##################################################################### - -add_qt_executable(src - GUI - PUBLIC_LIBRARIES - Qt::Gui -) - -## Scopes: -##################################################################### - -#### Keys ignored in scope 2:.:.:src.pro:WIN32: -# SUBDIRS = "winextras" -# TEMPLATE = "subdirs" - -#### Keys ignored in scope 3:.:.:src.pro:TARGET Qt::Quick: -# SUBDIRS = "imports" - -#### Keys ignored in scope 4:.:.:src.pro:else: -# TEMPLATE = "aux" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt deleted file mode 100644 index 8107ccb..0000000 --- a/src/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# special case begin -# Generated from src.pro. - -if(NOT WIN32) - return() -endif() - -add_subdirectory(winextras) -if(TARGET Qt::Quick) - add_subdirectory(imports) -endif() -# special case end diff --git a/src/imports/CMakeLists.txt b/src/imports/CMakeLists.txt deleted file mode 100644 index fdad931..0000000 --- a/src/imports/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Generated from imports.pro. - -add_subdirectory(winextras) diff --git a/src/imports/imports.pro b/src/imports/imports.pro deleted file mode 100644 index b8e59ad..0000000 --- a/src/imports/imports.pro +++ /dev/null @@ -1,2 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS += winextras diff --git a/src/imports/winextras/CMakeLists.txt b/src/imports/winextras/CMakeLists.txt deleted file mode 100644 index f31a6f6..0000000 --- a/src/imports/winextras/CMakeLists.txt +++ /dev/null @@ -1,65 +0,0 @@ -# Generated from winextras.pro. - -##################################################################### -## qml_winextras Plugin: -##################################################################### - -qt_add_qml_module(qml_winextras - URI "QtWinExtras" - VERSION "1.${CMAKE_PROJECT_VERSION_MINOR}" - CLASSNAME QWinExtrasQmlPlugin - SOURCES - plugin.cpp - qquickdwmfeatures.cpp qquickdwmfeatures_p.h - qquickdwmfeatures_p_p.h - qquickiconloader.cpp qquickiconloader_p.h - qquickjumplist.cpp qquickjumplist_p.h - qquickjumplistcategory.cpp qquickjumplistcategory_p.h - qquickjumplistitem.cpp qquickjumplistitem_p.h - qquicktaskbarbutton.cpp qquicktaskbarbutton_p.h - qquickthumbnailtoolbar.cpp qquickthumbnailtoolbar_p.h - qquickthumbnailtoolbutton.cpp qquickthumbnailtoolbutton_p.h - qquickwin_p.h - PUBLIC_LIBRARIES - Qt::Core - Qt::Gui - Qt::Qml - Qt::Quick - Qt::WinExtras - Qt::WinExtrasPrivate -) - -#### Keys ignored in scope 1:.:.:winextras.pro:<TRUE>: -# CXX_MODULE = "qml" -# IMPORT_VERSION = "1.$$QT_MINOR_VERSION" -# OTHER_FILES = "qmldir" "JumpListLink.qml" "JumpListDestination.qml" "JumpListSeparator.qml" -# QML_FILES = "JumpListLink.qml" "JumpListDestination.qml" "JumpListSeparator.qml" -# TARGETPATH = "QtWinExtras" - -## Scopes: -##################################################################### - -qt_extend_target(qml_winextras CONDITION QT_FEATURE_dynamicgl OR NOT TARGET Qt::OpenGL - LIBRARIES - user32 -) - -set(qml_files - "JumpListLink.qml" - "JumpListDestination.qml" - "JumpListSeparator.qml" -) -set_source_files_properties(JumpListLink.qml PROPERTIES - QT_QML_SOURCE_VERSION "1.0" -) -set_source_files_properties(JumpListDestination.qml PROPERTIES - QT_QML_SOURCE_VERSION "1.0" -) -set_source_files_properties(JumpListSeparator.qml PROPERTIES - QT_QML_SOURCE_VERSION "1.0" -) - -qt6_target_qml_files(qml_winextras - FILES - ${qml_files} -) diff --git a/src/imports/winextras/JumpListDestination.qml b/src/imports/winextras/JumpListDestination.qml deleted file mode 100644 index 2a26719..0000000 --- a/src/imports/winextras/JumpListDestination.qml +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -import QtWinExtras 1.0 - -/*! - \qmltype JumpListDestination - \inherits JumpListItem - \inqmlmodule QtWinExtras - - \brief Represents a file that can be edited or viewed by an application. - - \since QtWinExtras 1.0 - - The JumpListDestination type contains a path to a file that users can select - from a Jump List to view or edit it with an application. - - */ - -JumpListItem { - __jumpListItemType: JumpListItem.ItemTypeDestination - - /*! - \qmlproperty string JumpListDestination::filePath - - The path to the file. - */ - property string filePath -} diff --git a/src/imports/winextras/JumpListLink.qml b/src/imports/winextras/JumpListLink.qml deleted file mode 100644 index fd27ad0..0000000 --- a/src/imports/winextras/JumpListLink.qml +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -import QtWinExtras 1.0 - -/*! - \qmltype JumpListLink - \inherits JumpListItem - \inqmlmodule QtWinExtras - - \brief Represents a command to execute an application. - - \since QtWinExtras 1.0 - - The JumpListLink type represents a command to execute an application. - - */ - -JumpListItem { - __jumpListItemType: JumpListItem.ItemTypeLink - - /*! - \qmlproperty string JumpListLink::iconPath - - The path to a link icon. - */ - property string iconPath - - /*! - \qmlproperty string JumpListLink::executablePath - - The path to an executable file. - */ - property string executablePath - - /*! - \qmlproperty string JumpListLink::arguments - - Command-line arguments. - */ - property string arguments - - /*! - \qmlproperty string JumpListLink::description - - The description of the link. - */ - property string description - - /*! - \qmlproperty string JumpListLink::title - - The title of the link. - */ - property string title -} diff --git a/src/imports/winextras/JumpListSeparator.qml b/src/imports/winextras/JumpListSeparator.qml deleted file mode 100644 index 3484afc..0000000 --- a/src/imports/winextras/JumpListSeparator.qml +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -import QtWinExtras 1.0 - -/*! - \qmltype JumpListSeparator - \inherits JumpListItem - \inqmlmodule QtWinExtras - - \brief Represents a task list separator. - - \since QtWinExtras 1.0 - - The JumpListSeparator type represents a separator in a Jump List. This value - is used only for task lists. - */ - -JumpListItem { - __jumpListItemType: JumpListItem.ItemTypeSeparator -} diff --git a/src/imports/winextras/plugin.cpp b/src/imports/winextras/plugin.cpp deleted file mode 100644 index eadf357..0000000 --- a/src/imports/winextras/plugin.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickdwmfeatures_p.h" -#include "qquicktaskbarbutton_p.h" -#include "qquickjumplist_p.h" -#include "qquickjumplistitem_p.h" -#include "qquickjumplistcategory_p.h" -#include "qquickthumbnailtoolbar_p.h" -#include "qquickthumbnailtoolbutton_p.h" -#include "qquickwin_p.h" - -#include <QtQml/qqmlextensionplugin.h> - -QT_BEGIN_NAMESPACE - -class QWinExtrasQmlPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) - -public: - QWinExtrasQmlPlugin(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) { } - void registerTypes(const char *uri) Q_DECL_OVERRIDE - { - Q_ASSERT(uri == QLatin1String("QtWinExtras")); - // The minor version used to be the current Qt 5 minor. For compatibility it is the last - // Qt 5 release. - qmlRegisterModule(uri, 1, 15); - qmlRegisterUncreatableType<QQuickWin>(uri, 1, 0, "QtWin", "Cannot create an instance of the QtWin namespace."); - qmlRegisterType<QQuickDwmFeatures>(uri, 1, 0, "DwmFeatures"); - qmlRegisterType<QQuickTaskbarButton>(uri, 1, 0, "TaskbarButton"); - qmlRegisterUncreatableType<QWinTaskbarProgress>(uri, 1, 0, "TaskbarProgress", "Cannot create TaskbarProgress - use TaskbarButton.progress instead."); - qmlRegisterUncreatableType<QQuickTaskbarOverlay>(uri, 1, 0, "TaskbarOverlay", "Cannot create TaskbarOverlay - use TaskbarButton.overlay instead."); - qmlRegisterType<QQuickJumpList>(uri, 1, 0, "JumpList"); - qmlRegisterType<QQuickJumpListItem>(uri, 1, 0, "JumpListItem"); - qmlRegisterType<QQuickJumpListCategory>(uri, 1, 0, "JumpListCategory"); - qmlRegisterType<QQuickThumbnailToolBar>(uri, 1, 0, "ThumbnailToolBar"); - qmlRegisterType<QQuickThumbnailToolButton>(uri, 1, 0, "ThumbnailToolButton"); - } -}; - -QT_END_NAMESPACE - -#include "plugin.moc" diff --git a/src/imports/winextras/plugins.qmltypes b/src/imports/winextras/plugins.qmltypes deleted file mode 100644 index fff1181..0000000 --- a/src/imports/winextras/plugins.qmltypes +++ /dev/null @@ -1,225 +0,0 @@ -import QtQuick.tooling 1.2 - -// This file describes the plugin-supplied types contained in the library. -// It is used for QML tooling purposes only. -// -// This file was auto-generated by: -// 'qmlplugindump -nonrelocatable QtWinExtras 1.13' - -Module { - dependencies: ["QtQuick 2.0"] - Component { - name: "QQuickDwmFeatures" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtWinExtras/DwmFeatures 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "compositionEnabled"; type: "bool" } - Property { name: "colorizationColor"; type: "QColor"; isReadonly: true } - Property { name: "realColorizationColor"; type: "QColor"; isReadonly: true } - Property { name: "colorizationOpaqueBlend"; type: "bool"; isReadonly: true } - Property { name: "topGlassMargin"; type: "int" } - Property { name: "rightGlassMargin"; type: "int" } - Property { name: "bottomGlassMargin"; type: "int" } - Property { name: "leftGlassMargin"; type: "int" } - Property { name: "blurBehindEnabled"; type: "bool" } - Property { name: "excludedFromPeek"; type: "bool" } - Property { name: "peekDisallowed"; type: "bool" } - Property { name: "flip3DPolicy"; type: "QQuickWin::WindowFlip3DPolicy" } - Property { name: "nonClientAreaRenderingPolicy"; type: "QQuickWin::WindowNonClientRenderingPolicy" } - } - Component { - name: "QQuickJumpList" - defaultProperty: "data" - prototype: "QObject" - exports: ["QtWinExtras/JumpList 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "recent"; type: "QQuickJumpListCategory"; isReadonly: true; isPointer: true } - Property { name: "frequent"; type: "QQuickJumpListCategory"; isReadonly: true; isPointer: true } - Property { name: "tasks"; type: "QQuickJumpListCategory"; isPointer: true } - Property { name: "categories"; type: "QQuickJumpListCategory"; isList: true; isReadonly: true } - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - } - Component { - name: "QQuickJumpListCategory" - defaultProperty: "data" - prototype: "QObject" - exports: ["QtWinExtras/JumpListCategory 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "items"; type: "QQuickJumpListItem"; isList: true; isReadonly: true } - Property { name: "title"; type: "string" } - Property { name: "visible"; type: "bool" } - Signal { name: "visibilityChanged" } - } - Component { - name: "QQuickJumpListItem" - prototype: "QObject" - exports: ["QtWinExtras/JumpListItem 1.0"] - exportMetaObjectRevisions: [0] - Enum { - name: "JumpListItemType" - values: { - "ItemTypeLink": 1, - "ItemTypeDestination": 2, - "ItemTypeSeparator": 3 - } - } - Property { name: "__jumpListItemType"; type: "int" } - } - Component { - name: "QQuickTaskbarButton" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtWinExtras/TaskbarButton 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "overlay"; type: "QQuickTaskbarOverlay"; isReadonly: true; isPointer: true } - Property { name: "progress"; type: "QWinTaskbarProgress"; isReadonly: true; isPointer: true } - } - Component { - name: "QQuickTaskbarOverlay" - prototype: "QObject" - exports: ["QtWinExtras/TaskbarOverlay 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Property { name: "iconSource"; type: "QUrl" } - Property { name: "accessibleDescription"; type: "string" } - } - Component { - name: "QQuickThumbnailToolBar" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtWinExtras/ThumbnailToolBar 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "count"; type: "int"; isReadonly: true } - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "buttons"; type: "QQuickThumbnailToolButton"; isList: true; isReadonly: true } - Property { name: "iconicNotificationsEnabled"; type: "bool" } - Property { name: "iconicThumbnailSource"; type: "QUrl" } - Property { name: "iconicLivePreviewSource"; type: "QUrl" } - Signal { name: "iconicThumbnailRequested" } - Signal { name: "iconicLivePreviewRequested" } - Method { name: "clear" } - Method { - name: "addButton" - Parameter { name: "button"; type: "QQuickThumbnailToolButton"; isPointer: true } - } - Method { - name: "removeButton" - Parameter { name: "button"; type: "QQuickThumbnailToolButton"; isPointer: true } - } - } - Component { - name: "QQuickThumbnailToolButton" - prototype: "QObject" - exports: ["QtWinExtras/ThumbnailToolButton 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "iconSource"; type: "QUrl" } - Property { name: "tooltip"; type: "string" } - Property { name: "enabled"; type: "bool" } - Property { name: "interactive"; type: "bool" } - Property { name: "visible"; type: "bool" } - Property { name: "dismissOnClick"; type: "bool" } - Property { name: "flat"; type: "bool" } - Signal { name: "clicked" } - } - Component { - name: "QQuickWin" - prototype: "QObject" - exports: ["QtWinExtras/QtWin 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "HBitmapFormat" - values: { - "HBitmapNoAlpha": 0, - "HBitmapPremultipliedAlpha": 1, - "HBitmapAlpha": 2 - } - } - Enum { - name: "WindowFlip3DPolicy" - values: { - "FlipDefault": 0, - "FlipExcludeBelow": 1, - "FlipExcludeAbove": 2 - } - } - Enum { - name: "WindowNonClientRenderingPolicy" - values: { - "NonClientRenderingUseWindowStyle": 0, - "NonClientRenderingDisabled": 1, - "NonClientRenderingEnabled": 2 - } - } - } - Component { - name: "QWinTaskbarProgress" - prototype: "QObject" - exports: ["QtWinExtras/TaskbarProgress 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Property { name: "value"; type: "int" } - Property { name: "minimum"; type: "int" } - Property { name: "maximum"; type: "int" } - Property { name: "visible"; type: "bool" } - Property { name: "paused"; type: "bool" } - Property { name: "stopped"; type: "bool"; isReadonly: true } - Signal { - name: "valueChanged" - Parameter { name: "value"; type: "int" } - } - Signal { - name: "minimumChanged" - Parameter { name: "minimum"; type: "int" } - } - Signal { - name: "maximumChanged" - Parameter { name: "maximum"; type: "int" } - } - Signal { - name: "visibilityChanged" - Parameter { name: "visible"; type: "bool" } - } - Signal { - name: "pausedChanged" - Parameter { name: "paused"; type: "bool" } - } - Signal { - name: "stoppedChanged" - Parameter { name: "stopped"; type: "bool" } - } - Method { - name: "setValue" - Parameter { name: "value"; type: "int" } - } - Method { - name: "setMinimum" - Parameter { name: "minimum"; type: "int" } - } - Method { - name: "setMaximum" - Parameter { name: "maximum"; type: "int" } - } - Method { - name: "setRange" - Parameter { name: "minimum"; type: "int" } - Parameter { name: "maximum"; type: "int" } - } - Method { name: "reset" } - Method { name: "show" } - Method { name: "hide" } - Method { - name: "setVisible" - Parameter { name: "visible"; type: "bool" } - } - Method { name: "pause" } - Method { name: "resume" } - Method { - name: "setPaused" - Parameter { name: "paused"; type: "bool" } - } - Method { name: "stop" } - } -} diff --git a/src/imports/winextras/qmldir b/src/imports/winextras/qmldir deleted file mode 100644 index f3c244c..0000000 --- a/src/imports/winextras/qmldir +++ /dev/null @@ -1,6 +0,0 @@ -module QtWinExtras -plugin qml_winextras -JumpListLink 1.0 JumpListLink.qml -JumpListDestination 1.0 JumpListDestination.qml -JumpListSeparator 1.0 JumpListSeparator.qml -classname QWinExtrasQmlPlugin diff --git a/src/imports/winextras/qquickdwmfeatures.cpp b/src/imports/winextras/qquickdwmfeatures.cpp deleted file mode 100644 index 124d957..0000000 --- a/src/imports/winextras/qquickdwmfeatures.cpp +++ /dev/null @@ -1,399 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickdwmfeatures_p.h" -#include "qquickdwmfeatures_p_p.h" - -#include <QtWinExtras/private/qwineventfilter_p.h> -#include <QWinEvent> -#include <QQuickWindow> - -QT_BEGIN_NAMESPACE - -/*! - \qmltype DwmFeatures - \instantiates QQuickDwmFeatures - \inqmlmodule QtWinExtras - - \brief Enables you to manage the Windows DWM features. - - \since QtWinExtras 1.0 - - The DwmFeatures type enables you to extend a glass frame into the client - area, as well as to control the behavior of Aero Peek and Flip3D. - */ - -/*! - \class QQuickDwmFeatures - \internal - */ - -QQuickDwmFeatures::QQuickDwmFeatures(QQuickItem *parent) : - QQuickItem(parent), d_ptr(new QQuickDwmFeaturesPrivate(this)) -{ - QWinEventFilter::setup(); -} - -QQuickDwmFeatures::~QQuickDwmFeatures() = default; - -void QQuickDwmFeatures::setCompositionEnabled(bool enabled) -{ - QtWin::setCompositionEnabled(enabled); -} - -bool QQuickDwmFeatures::isCompositionEnabled() const -{ - return QtWin::isCompositionEnabled(); -} - -QColor QQuickDwmFeatures::colorizationColor() const -{ - return QtWin::colorizationColor(); -} - -QColor QQuickDwmFeatures::realColorizationColor() const -{ - return QtWin::realColorizationColor(); -} - -bool QQuickDwmFeatures::colorizationOpaqueBlend() const -{ - bool opaque; - QtWin::colorizationColor(&opaque); - return opaque; -} - -/*! - \qmlproperty int DwmFeatures::topGlassMargin - - The top glass frame margin. The default value is 0. - */ -void QQuickDwmFeatures::setTopGlassMargin(int margin) -{ - Q_D(QQuickDwmFeatures); - if (d->topMargin == margin) - return; - - d->topMargin = margin; - if (window()) - QtWin::extendFrameIntoClientArea(window(), d->leftMargin, d->topMargin, d->rightMargin, d->bottomMargin); - emit topGlassMarginChanged(); -} - -/*! - \qmlproperty int DwmFeatures::rightGlassMargin - - The right glass frame margin. The default value is 0. - */ -void QQuickDwmFeatures::setRightGlassMargin(int margin) -{ - Q_D(QQuickDwmFeatures); - if (d->rightMargin == margin) - return; - - d->rightMargin = margin; - if (window()) - QtWin::extendFrameIntoClientArea(window(), d->leftMargin, d->topMargin, d->rightMargin, d->bottomMargin); - emit rightGlassMarginChanged(); -} - -/*! - \qmlproperty int DwmFeatures::bottomGlassMargin - - The bottom glass frame margin. The default value is 0. - */ -void QQuickDwmFeatures::setBottomGlassMargin(int margin) -{ - Q_D(QQuickDwmFeatures); - if (d->bottomMargin == margin) - return; - - d->bottomMargin = margin; - if (window()) - QtWin::extendFrameIntoClientArea(window(), d->leftMargin, d->topMargin, d->rightMargin, d->bottomMargin); - emit bottomGlassMarginChanged(); -} - -/*! - \qmlproperty int DwmFeatures::leftGlassMargin - - The left glass frame margin. The default value is 0. - */ -void QQuickDwmFeatures::setLeftGlassMargin(int margin) -{ - Q_D(QQuickDwmFeatures); - if (d->leftMargin == margin) - return; - - d->leftMargin = margin; - if (window()) - QtWin::extendFrameIntoClientArea(window(), d->leftMargin, d->topMargin, d->rightMargin, d->bottomMargin); - emit leftGlassMarginChanged(); -} - -int QQuickDwmFeatures::topGlassMargin() const -{ - Q_D(const QQuickDwmFeatures); - return d->topMargin; -} - -int QQuickDwmFeatures::rightGlassMargin() const -{ - Q_D(const QQuickDwmFeatures); - return d->rightMargin; -} - -int QQuickDwmFeatures::bottomGlassMargin() const -{ - Q_D(const QQuickDwmFeatures); - return d->bottomMargin; -} - -int QQuickDwmFeatures::leftGlassMargin() const -{ - Q_D(const QQuickDwmFeatures); - return d->leftMargin; -} - -/*! - \qmlproperty bool DwmFeatures::blurBehindEnabled - - Specifies whether the blur behind the window client area is enabled. - */ -bool QQuickDwmFeatures::isBlurBehindEnabled() const -{ - Q_D(const QQuickDwmFeatures); - return d->blurBehindEnabled; -} - -void QQuickDwmFeatures::setBlurBehindEnabled(bool enabled) -{ - Q_D(QQuickDwmFeatures); - if (d->blurBehindEnabled == enabled) - return; - - d->blurBehindEnabled = enabled; - if (window()) { - if (d->blurBehindEnabled) - QtWin::enableBlurBehindWindow(window()); - else - QtWin::disableBlurBehindWindow(window()); - } - emit blurBehindEnabledChanged(); -} - -/*! - \qmlproperty bool DwmFeatures::excludedFromPeek - - Specifies whether the window is excluded from Aero Peek. - The default value is false. - */ -bool QQuickDwmFeatures::isExcludedFromPeek() const -{ - Q_D(const QQuickDwmFeatures); - return window() ? QtWin::isWindowExcludedFromPeek(window()) : d->peekExcluded; -} - -void QQuickDwmFeatures::setExcludedFromPeek(bool exclude) -{ - Q_D(QQuickDwmFeatures); - if (d->peekExcluded == exclude) - return; - - d->peekExcluded = exclude; - if (window()) - QtWin::setWindowExcludedFromPeek(window(), d->peekExcluded); - emit excludedFromPeekChanged(); -} - -/*! - \qmlproperty bool DwmFeatures::peekDisallowed - - Set this value to true if you want to forbid Aero Peek when the user hovers - the mouse over the window thumbnail. The default value is false. -*/ -bool QQuickDwmFeatures::isPeekDisallowed() const -{ - Q_D(const QQuickDwmFeatures); - return window() ? QtWin::isWindowPeekDisallowed(window()) : d->peekDisallowed; -} - -void QQuickDwmFeatures::setPeekDisallowed(bool disallow) -{ - Q_D(QQuickDwmFeatures); - if (d->peekDisallowed == disallow) - return; - - d->peekDisallowed = disallow; - if (window()) - QtWin::setWindowDisallowPeek(window(), d->peekDisallowed); - emit peekDisallowedChanged(); -} - -/*! - \qmlproperty QtWin::WindowFlip3DPolicy DwmFeatures::flip3DPolicy - - The current Flip3D policy for the window. - */ -QQuickWin::WindowFlip3DPolicy QQuickDwmFeatures::flip3DPolicy() const -{ - Q_D(const QQuickDwmFeatures); - if (window()) - return static_cast<QQuickWin::WindowFlip3DPolicy>(QtWin::windowFlip3DPolicy(window())); - else - return d->flipPolicy; -} - -void QQuickDwmFeatures::setFlip3DPolicy(QQuickWin::WindowFlip3DPolicy policy) -{ - Q_D(QQuickDwmFeatures); - if (d->flipPolicy == policy) - return; - - d->flipPolicy = policy; - if (window()) - QtWin::setWindowFlip3DPolicy(window(), static_cast<QtWin::WindowFlip3DPolicy>(d->flipPolicy)); - emit flip3DPolicyChanged(); -} - -/*! - \qmlproperty QtWin::WindowNonClientRenderingPolicy DwmFeatures::nonClientAreaRenderingPolicy - - The current non-client area rendering policy for the window. - */ -QQuickWin::WindowNonClientRenderingPolicy QQuickDwmFeatures::nonClientAreaRenderingPolicy() const -{ - Q_D(const QQuickDwmFeatures); - if (window()) - return static_cast<QQuickWin::WindowNonClientRenderingPolicy>(QtWin::windowNonClientAreaRenderingPolicy(window())); - else - return d->nonClientRenderingPolicy; -} - -void QQuickDwmFeatures::setNonClientAreaRenderingPolicy(QQuickWin::WindowNonClientRenderingPolicy policy) -{ - Q_D(QQuickDwmFeatures); - if (d->nonClientRenderingPolicy == policy) - return; - - d->nonClientRenderingPolicy = policy; - if (window()) - QtWin::setWindowNonClientAreaRenderingPolicy(window(), static_cast<QtWin::WindowNonClientRenderingPolicy>(d->nonClientRenderingPolicy)); - emit nonClientAreaRenderingPolicyChanged(); -} - -bool QQuickDwmFeatures::eventFilter(QObject *object, QEvent *event) -{ - Q_D(QQuickDwmFeatures); - if (object == window()) { - if (event->type() == QWinEvent::CompositionChange) { - d->updateSurfaceFormat(); - if (static_cast<QWinCompositionChangeEvent *>(event)->isCompositionEnabled()) - d->updateAll(); - emit compositionEnabledChanged(); - } else if (event->type() == QWinEvent::ColorizationChange) { - emit colorizationColorChanged(); - emit realColorizationColorChanged(); - emit colorizationOpaqueBlendChanged(); - } - } - return QQuickItem::eventFilter(object, event); -} - -QQuickDwmFeatures *QQuickDwmFeatures::qmlAttachedProperties(QObject *parentObject) -{ - auto *featuresObj = new QQuickDwmFeatures(); - auto *parentItem = qobject_cast<QQuickItem *>(parentObject); - if (parentItem) - featuresObj->setParentItem(parentItem); - else - featuresObj->setParent(parentObject); - return featuresObj; -} - -void QQuickDwmFeatures::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) -{ - Q_D(QQuickDwmFeatures); - if (change == ItemSceneChange && data.window) { - d->updateAll(); - data.window->installEventFilter(this); - d->originalSurfaceColor = data.window->color(); - } - QQuickItem::itemChange(change, data); -} - - - -QQuickDwmFeaturesPrivate::QQuickDwmFeaturesPrivate(QQuickDwmFeatures *parent) : - q_ptr(parent) -{ -} - -void QQuickDwmFeaturesPrivate::updateAll() -{ - Q_Q(QQuickDwmFeatures); - QWindow *w = q->window(); - if (w) { - updateSurfaceFormat(); - QtWin::setWindowExcludedFromPeek(w, peekExcluded); - QtWin::setWindowDisallowPeek(w, peekDisallowed); - QtWin::setWindowFlip3DPolicy(w, static_cast<QtWin::WindowFlip3DPolicy>(flipPolicy)); - QtWin::setWindowNonClientAreaRenderingPolicy(w, static_cast<QtWin::WindowNonClientRenderingPolicy>(nonClientRenderingPolicy)); - if (blurBehindEnabled) - QtWin::enableBlurBehindWindow(w); - else - QtWin::disableBlurBehindWindow(w); - QtWin::extendFrameIntoClientArea(w, leftMargin, topMargin, rightMargin, bottomMargin); - } -} - -void QQuickDwmFeaturesPrivate::updateSurfaceFormat() -{ - Q_Q(QQuickDwmFeatures); - if (q->window()) { - const bool compositionEnabled = q->isCompositionEnabled(); - QSurfaceFormat format = q->window()->format(); - format.setAlphaBufferSize(compositionEnabled ? 8 : 0); - q->window()->setFormat(format); - q->window()->setColor(compositionEnabled ? QColor(Qt::transparent) : originalSurfaceColor); - } -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquickdwmfeatures_p.h b/src/imports/winextras/qquickdwmfeatures_p.h deleted file mode 100644 index 3887d24..0000000 --- a/src/imports/winextras/qquickdwmfeatures_p.h +++ /dev/null @@ -1,144 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKDWMFEATURES_P_H -#define QQUICKDWMFEATURES_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QQuickItem> -#include <QtWin> -#include <QColor> - -#include "qquickwin_p.h" - -QT_BEGIN_NAMESPACE - -class QQuickDwmFeaturesPrivate; - -class QQuickDwmFeatures : public QQuickItem -{ - Q_OBJECT - Q_PROPERTY(bool compositionEnabled READ isCompositionEnabled WRITE setCompositionEnabled NOTIFY compositionEnabledChanged) - Q_PROPERTY(QColor colorizationColor READ colorizationColor NOTIFY colorizationColorChanged) - Q_PROPERTY(QColor realColorizationColor READ realColorizationColor NOTIFY realColorizationColorChanged) - Q_PROPERTY(bool colorizationOpaqueBlend READ colorizationOpaqueBlend NOTIFY colorizationOpaqueBlendChanged) - Q_PROPERTY(int topGlassMargin READ topGlassMargin WRITE setTopGlassMargin NOTIFY topGlassMarginChanged) - Q_PROPERTY(int rightGlassMargin READ rightGlassMargin WRITE setRightGlassMargin NOTIFY rightGlassMarginChanged) - Q_PROPERTY(int bottomGlassMargin READ bottomGlassMargin WRITE setBottomGlassMargin NOTIFY bottomGlassMarginChanged) - Q_PROPERTY(int leftGlassMargin READ leftGlassMargin WRITE setLeftGlassMargin NOTIFY leftGlassMarginChanged) - Q_PROPERTY(bool blurBehindEnabled READ isBlurBehindEnabled WRITE setBlurBehindEnabled NOTIFY blurBehindEnabledChanged) - Q_PROPERTY(bool excludedFromPeek READ isExcludedFromPeek WRITE setExcludedFromPeek NOTIFY excludedFromPeekChanged) - Q_PROPERTY(bool peekDisallowed READ isPeekDisallowed WRITE setPeekDisallowed NOTIFY peekDisallowedChanged) - Q_PROPERTY(QQuickWin::WindowFlip3DPolicy flip3DPolicy READ flip3DPolicy WRITE setFlip3DPolicy NOTIFY flip3DPolicyChanged) - Q_PROPERTY(QQuickWin::WindowNonClientRenderingPolicy nonClientAreaRenderingPolicy READ nonClientAreaRenderingPolicy WRITE setNonClientAreaRenderingPolicy NOTIFY nonClientAreaRenderingPolicyChanged) - -public: - explicit QQuickDwmFeatures(QQuickItem *parent = nullptr); - ~QQuickDwmFeatures(); - - void setCompositionEnabled(bool enabled); - bool isCompositionEnabled() const; - QColor colorizationColor() const; - QColor realColorizationColor() const; - bool colorizationOpaqueBlend() const; - - void setTopGlassMargin(int margin); - void setRightGlassMargin(int margin); - void setBottomGlassMargin(int margin); - void setLeftGlassMargin(int margin); - int topGlassMargin() const; - int rightGlassMargin() const; - int bottomGlassMargin() const; - int leftGlassMargin() const; - bool isBlurBehindEnabled() const; - void setBlurBehindEnabled(bool enabled); - - bool isExcludedFromPeek() const; - void setExcludedFromPeek(bool exclude); - bool isPeekDisallowed() const; - void setPeekDisallowed(bool disallow); - QQuickWin::WindowFlip3DPolicy flip3DPolicy() const; - void setFlip3DPolicy(QQuickWin::WindowFlip3DPolicy policy); - QQuickWin::WindowNonClientRenderingPolicy nonClientAreaRenderingPolicy() const; - void setNonClientAreaRenderingPolicy(QQuickWin::WindowNonClientRenderingPolicy policy); - - bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE; - - static QQuickDwmFeatures *qmlAttachedProperties(QObject *object); - -Q_SIGNALS: - void colorizationColorChanged(); - void realColorizationColorChanged(); - void compositionEnabledChanged(); - void colorizationOpaqueBlendChanged(); - void topGlassMarginChanged(); - void rightGlassMarginChanged(); - void bottomGlassMarginChanged(); - void leftGlassMarginChanged(); - void blurBehindEnabledChanged(); - void excludedFromPeekChanged(); - void peekDisallowedChanged(); - void flip3DPolicyChanged(); - void nonClientAreaRenderingPolicyChanged(); - -protected: - void itemChange(ItemChange, const ItemChangeData &) Q_DECL_OVERRIDE; - -private: - QScopedPointer<QQuickDwmFeaturesPrivate> d_ptr; - - Q_DECLARE_PRIVATE(QQuickDwmFeatures) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPEINFO(QQuickDwmFeatures, QML_HAS_ATTACHED_PROPERTIES) - -#endif // QQUICKDWMFEATURES_P_H diff --git a/src/imports/winextras/qquickdwmfeatures_p_p.h b/src/imports/winextras/qquickdwmfeatures_p_p.h deleted file mode 100644 index acf9dd6..0000000 --- a/src/imports/winextras/qquickdwmfeatures_p_p.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKDWMFEATURES_P_P_H -#define QQUICKDWMFEATURES_P_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qquickdwmfeatures_p.h" - -QT_BEGIN_NAMESPACE - -class QQuickDwmFeaturesPrivate -{ -public: - QQuickDwmFeaturesPrivate(QQuickDwmFeatures *parent); - - int topMargin = 0; - int rightMargin = 0; - int bottomMargin = 0; - int leftMargin = 0; - bool blurBehindEnabled = false; - - bool peekDisallowed = false; - bool peekExcluded = false; - QQuickWin::WindowFlip3DPolicy flipPolicy = QQuickWin::FlipDefault; - QQuickWin::WindowNonClientRenderingPolicy nonClientRenderingPolicy = QQuickWin::NonClientRenderingUseWindowStyle; - QColor originalSurfaceColor; - - void updateAll(); - void updateSurfaceFormat(); - -private: - QQuickDwmFeatures *q_ptr; - - Q_DECLARE_PUBLIC(QQuickDwmFeatures) -}; - -QT_END_NAMESPACE - -#endif // QQUICKDWMFEATURES_P_P_H diff --git a/src/imports/winextras/qquickiconloader.cpp b/src/imports/winextras/qquickiconloader.cpp deleted file mode 100644 index b5b7e5b..0000000 --- a/src/imports/winextras/qquickiconloader.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickiconloader_p.h" - -#include <QQmlEngine> -#include <QNetworkAccessManager> -#include <QFileInfo> -#include <QNetworkRequest> -#include <QNetworkReply> -#include <QQuickImageProvider> -#include <QQmlFile> -#include <qt_windows.h> - -QT_BEGIN_NAMESPACE - -QVariant QQuickIconLoader::loadFromFile(const QUrl &url, QVariant::Type type) -{ - const QString path = QQmlFile::urlToLocalFileOrQrc(url); - if (QFileInfo::exists(path)) { - switch (type) { - case QMetaType::QIcon: - return QVariant(QIcon(path)); - case QMetaType::QPixmap: - return QVariant(QPixmap(path)); - default: - qWarning("%s: Unsupported type: %d", Q_FUNC_INFO, int(type)); - break; - } - } - return QVariant(); -} - -QNetworkReply *QQuickIconLoader::loadFromNetwork(const QUrl &url, const QQmlEngine *engine) -{ - return engine->networkAccessManager()->get(QNetworkRequest(url)); -} - -QVariant QQuickIconLoader::loadFromImageProvider(const QUrl &url, const QQmlEngine *engine, - QVariant::Type type, QSize requestedSize) -{ - const QString providerId = url.host(); - const QString imageId = url.toString(QUrl::RemoveScheme | QUrl::RemoveAuthority).mid(1); - QQuickImageProvider::ImageType imageType = QQuickImageProvider::Invalid; - auto *provider = static_cast<QQuickImageProvider *>(engine->imageProvider(providerId)); - QSize size; - if (!requestedSize.isValid()) - requestedSize = QSize(GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON)); - if (provider) - imageType = provider->imageType(); - QPixmap pixmap; - switch (imageType) { - case QQuickImageProvider::Image: { - QImage image = provider->requestImage(imageId, &size, requestedSize); - if (!image.isNull()) - pixmap = QPixmap::fromImage(image); - } - break; - case QQuickImageProvider::Pixmap: - pixmap = provider->requestPixmap(imageId, &size, requestedSize); - break; - default: - break; - } - if (!pixmap.isNull()) { - switch (type) { - case QMetaType::QIcon: - return QVariant(QIcon(pixmap)); - case QMetaType::QPixmap: - return QVariant(pixmap); - default: - qWarning("%s: Unsupported type: %d", Q_FUNC_INFO, int(type)); - break; - } - } - return QVariant(); -} - -QQuickIconLoaderNetworkReplyHandler::QQuickIconLoaderNetworkReplyHandler(QNetworkReply *reply, QVariant::Type type) - : QObject(reply) - , m_type(type) -{ - connect(reply, &QNetworkReply::finished, this, &QQuickIconLoaderNetworkReplyHandler::onRequestFinished); -} - -void QQuickIconLoaderNetworkReplyHandler::onRequestFinished() -{ - auto *reply = qobject_cast<QNetworkReply *>(sender()); - Q_ASSERT(reply); - if (reply->error() != QNetworkReply::NoError) { - qWarning() << Q_FUNC_INFO << reply->url() << "failed:" << reply->errorString(); - return; - } - const QByteArray data = reply->readAll(); - QPixmap pixmap; - if (pixmap.loadFromData(data)) { - switch (m_type) { - case QMetaType::QIcon: - emit finished(QVariant(QIcon(pixmap))); - break; - case QMetaType::QPixmap: - emit finished(QVariant(pixmap)); - break; - default: - qWarning("%s: Unsupported type: %d", Q_FUNC_INFO, int(m_type)); - break; - } - } - reply->deleteLater(); -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquickiconloader_p.h b/src/imports/winextras/qquickiconloader_p.h deleted file mode 100644 index 22aaae6..0000000 --- a/src/imports/winextras/qquickiconloader_p.h +++ /dev/null @@ -1,141 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKICONLOADER_P_H -#define QQUICKICONLOADER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QObject> -#include <QVariant> -#include <QUrl> -#include <QIcon> -#include <QPixmap> -#include <QDebug> - -QT_BEGIN_NAMESPACE - -class QIcon; -class QQmlEngine; -class QNetworkReply; - -class QQuickIconLoader -{ -public: - enum LoadResult { - LoadOk, - LoadError, - LoadNetworkRequestStarted, - }; - - // Load a QIcon (pass type = QMetaType::QIcon) or a QPixmap (pass type = - // QMetaType::QPixmap) from url. The function takes an object and member - // function pointer to a slot accepting a QVariant. For resources that can - // loaded synchronously ("file", "qrc" or "image"), the member function pointer - // will be invoked immediately with the result. For network resources, it will be - // connected to an object handling the network reply and invoked once it finishes. - template <typename Object> - static LoadResult load(const QUrl &url, const QQmlEngine *engine, - QVariant::Type type, const QSize &requestedSize, - Object *receiver, void (Object::*function)(const QVariant &)); - -private: - QQuickIconLoader() = default; - static QVariant loadFromFile(const QUrl &url, QVariant::Type type); - static QVariant loadFromImageProvider(const QUrl &url, const QQmlEngine *engine, - QVariant::Type type, QSize requestedSize); - static QNetworkReply *loadFromNetwork(const QUrl &url, const QQmlEngine *engine); -}; - -// Internal handler which loads the resource once QNetworkReply finishes -class QQuickIconLoaderNetworkReplyHandler : public QObject -{ - Q_OBJECT - -public: - explicit QQuickIconLoaderNetworkReplyHandler(QNetworkReply *reply, QVariant::Type); - -Q_SIGNALS: - void finished(const QVariant &); - -private Q_SLOTS: - void onRequestFinished(); - -private: - const QVariant::Type m_type; -}; - -template <typename Object> -QQuickIconLoader::LoadResult - QQuickIconLoader::load(const QUrl &url, const QQmlEngine *engine, - QVariant::Type type, const QSize &requestedSize, - Object *receiver, void (Object::*function)(const QVariant &)) -{ - const QString scheme = url.scheme(); - if (scheme.startsWith(u"http")) { - if (QNetworkReply *reply = QQuickIconLoader::loadFromNetwork(url, engine)) { - auto *handler = new QQuickIconLoaderNetworkReplyHandler(reply, type); - QObject::connect(handler, &QQuickIconLoaderNetworkReplyHandler::finished, receiver, function); - return LoadNetworkRequestStarted; - } - return LoadError; - } - const QVariant resource = scheme == u"image" - ? QQuickIconLoader::loadFromImageProvider(url, engine, type, requestedSize) - : QQuickIconLoader::loadFromFile(url, type); // qrc, file - if (resource.isValid()) { - (receiver->*function)(resource); - return LoadOk; - } - return LoadError; -} - -QT_END_NAMESPACE - -#endif // QQUICKICONLOADER_P_H diff --git a/src/imports/winextras/qquickjumplist.cpp b/src/imports/winextras/qquickjumplist.cpp deleted file mode 100644 index 615af08..0000000 --- a/src/imports/winextras/qquickjumplist.cpp +++ /dev/null @@ -1,201 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickjumplist_p.h" -#include "qquickjumplistcategory_p.h" -#include <QWinJumpList> - -QT_BEGIN_NAMESPACE - -/*! - \qmltype JumpList - \instantiates QQuickJumpList - \inqmlmodule QtWinExtras - - \brief Enables you to modify the application Jump List. - - \since QtWinExtras 1.0 - - The JumpList type enables you to modify Windows Jump Lists. - - An application can use Jump Lists to provide users with faster access to - files or to display shortcuts to tasks or commands. - */ - -/*! - \class QQuickJumpList - \internal - */ - -QQuickJumpList::QQuickJumpList(QObject *parent) : - QObject(parent) -{ -} - -QQuickJumpList::~QQuickJumpList() = default; - -/*! - \qmlproperty JumpListCategory JumpList::recent - \readonly - - The recent items category. - */ -QQuickJumpListCategory *QQuickJumpList::recent() const -{ - if (!m_recent) { - auto *that = const_cast<QQuickJumpList *>(this); - that->m_recent = new QQuickJumpListCategory(that); - connect(m_recent, &QQuickJumpListCategory::visibilityChanged, that, &QQuickJumpList::rebuild); - m_recent->setVisible(false); - } - return m_recent; -} - -/*! - \qmlproperty JumpListCategory JumpList::frequent - \readonly - - The frequent items category. - */ -QQuickJumpListCategory *QQuickJumpList::frequent() const -{ - if (!m_frequent) { - auto *that = const_cast<QQuickJumpList *>(this); - that->m_frequent = new QQuickJumpListCategory(that); - connect(m_frequent, &QQuickJumpListCategory::visibilityChanged, that, &QQuickJumpList::rebuild); - m_frequent->setVisible(false); - } - return m_frequent; -} - -/*! - \qmlproperty JumpListCategory JumpList::tasks - - The tasks category. - */ -QQuickJumpListCategory *QQuickJumpList::tasks() const -{ - if (!m_tasks) { - auto *that = const_cast<QQuickJumpList *>(this); - that->m_tasks = new QQuickJumpListCategory(that); - connect(m_tasks, &QQuickJumpListCategory::visibilityChanged, that, &QQuickJumpList::rebuild); - } - return m_tasks; -} - -void QQuickJumpList::setTasks(QQuickJumpListCategory *tasks) -{ - if (m_tasks != tasks) { - if (m_tasks) - disconnect(m_tasks, &QQuickJumpListCategory::visibilityChanged, this, &QQuickJumpList::rebuild); - delete m_tasks; - m_tasks = tasks; - if (m_tasks) - connect(m_tasks, &QQuickJumpListCategory::visibilityChanged, this, &QQuickJumpList::rebuild); - emit tasksChanged(); - } -} - -/*! - \qmlproperty list<QtObject> JumpList::data - \internal - */ -QQmlListProperty<QObject> QQuickJumpList::data() -{ - return QQmlListProperty<QObject>(this, this, &QQuickJumpList::data_append, nullptr, nullptr, nullptr); -} - -/*! - \qmlproperty list<JumpListCategory> JumpList::categories - - A list of custom categories. - */ -QQmlListProperty<QQuickJumpListCategory> QQuickJumpList::categories() -{ - return QQmlListProperty<QQuickJumpListCategory>(this, this, &QQuickJumpList::categories_count, &QQuickJumpList::categories_at); -} - -void QQuickJumpList::classBegin() -{ -} - -void QQuickJumpList::componentComplete() -{ - rebuild(); -} - -void QQuickJumpList::rebuild() -{ - QWinJumpList jumpList; - jumpList.recent()->setVisible(m_recent && m_recent->isVisible()); - jumpList.frequent()->setVisible(m_frequent && m_frequent->isVisible()); - if (m_tasks && m_tasks->isVisible()) { - jumpList.tasks()->setVisible(true); - const auto items = m_tasks->toItemList(); - for (QWinJumpListItem *item : items) - jumpList.tasks()->addItem(item); - } - for (QQuickJumpListCategory *category : qAsConst(m_categories)) { - if (category->isVisible()) - jumpList.addCategory(category->title(), category->toItemList())->setVisible(true); - } -} - -void QQuickJumpList::data_append(QQmlListProperty<QObject> *property, QObject *object) -{ - if (auto *category = qobject_cast<QQuickJumpListCategory *>(object)) { - auto *jumpList = static_cast<QQuickJumpList *>(property->object); - connect(category, &QQuickJumpListCategory::visibilityChanged, jumpList, &QQuickJumpList::rebuild); - jumpList->m_categories.append(category); - emit jumpList->categoriesChanged(); - } -} - -int QQuickJumpList::categories_count(QQmlListProperty<QQuickJumpListCategory> *property) -{ - return static_cast<QQuickJumpList *>(property->object)->m_categories.count(); -} - -QQuickJumpListCategory *QQuickJumpList::categories_at(QQmlListProperty<QQuickJumpListCategory> *property, int index) -{ - return static_cast<QQuickJumpList *>(property->object)->m_categories.value(index); -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquickjumplist_p.h b/src/imports/winextras/qquickjumplist_p.h deleted file mode 100644 index 25bf2e2..0000000 --- a/src/imports/winextras/qquickjumplist_p.h +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKJUMPLIST_P_H -#define QQUICKJUMPLIST_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qquickjumplistcategory_p.h" - -#include <QObject> -#include <QQmlParserStatus> -#include <QQmlListProperty> -#include <QList> - -QT_BEGIN_NAMESPACE - -class QQuickJumpListCategory; - -class QQuickJumpList : public QObject, public QQmlParserStatus -{ - Q_OBJECT - Q_PROPERTY(QQuickJumpListCategory *recent READ recent CONSTANT) - Q_PROPERTY(QQuickJumpListCategory *frequent READ frequent CONSTANT) - Q_PROPERTY(QQuickJumpListCategory *tasks READ tasks WRITE setTasks NOTIFY tasksChanged) - Q_PROPERTY(QQmlListProperty<QQuickJumpListCategory> categories READ categories NOTIFY categoriesChanged) - Q_PROPERTY(QQmlListProperty<QObject> data READ data) - Q_CLASSINFO("DefaultProperty", "data") - Q_INTERFACES(QQmlParserStatus) - -public: - explicit QQuickJumpList(QObject *parent = nullptr); - ~QQuickJumpList(); - - QQuickJumpListCategory *recent() const; - QQuickJumpListCategory *frequent() const; - - QQuickJumpListCategory *tasks() const; - void setTasks(QQuickJumpListCategory *tasks); - - QQmlListProperty<QObject> data(); - QQmlListProperty<QQuickJumpListCategory> categories(); - - void classBegin() override; - void componentComplete() override; - -Q_SIGNALS: - void tasksChanged(); - void categoriesChanged(); - -private Q_SLOTS: - void rebuild(); - -private: - static void data_append(QQmlListProperty<QObject> *property, QObject *object); - static int categories_count(QQmlListProperty<QQuickJumpListCategory> *property); - static QQuickJumpListCategory *categories_at(QQmlListProperty<QQuickJumpListCategory> *property, int index); - - QQuickJumpListCategory *m_recent = nullptr; - QQuickJumpListCategory *m_frequent = nullptr; - QQuickJumpListCategory *m_tasks = nullptr; - QList<QQuickJumpListCategory *> m_categories; -}; - -QT_END_NAMESPACE - -#endif // QQUICKJUMPLIST_P_H diff --git a/src/imports/winextras/qquickjumplistcategory.cpp b/src/imports/winextras/qquickjumplistcategory.cpp deleted file mode 100644 index 30183f4..0000000 --- a/src/imports/winextras/qquickjumplistcategory.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickjumplistcategory_p.h" - -QT_BEGIN_NAMESPACE - -/*! - \qmltype JumpListCategory - \instantiates QQuickJumpListCategory - \inqmlmodule QtWinExtras - - \brief Represents a jump list category. - - \since QtWinExtras 1.0 - - The JumpListCategory type represents a category that consists of several - Jump List destinations and has a title. - */ - -/*! - \class QQuickJumpListCategory - \internal - */ - -QQuickJumpListCategory::QQuickJumpListCategory(QObject *parent) : - QObject(parent) -{ -} - -QQuickJumpListCategory::~QQuickJumpListCategory() = default; - -/*! - \qmlproperty list<QtObject> JumpListCategory::data - \internal - */ -QQmlListProperty<QObject> QQuickJumpListCategory::data() -{ - return QQmlListProperty<QObject>(this, this, &QQuickJumpListCategory::data_append, nullptr, nullptr, nullptr); -} - -/*! - \qmlproperty list<JumpListItem> JumpListCategory::items - - A list of items. - */ -QQmlListProperty<QQuickJumpListItem> QQuickJumpListCategory::items() -{ - return QQmlListProperty<QQuickJumpListItem>(this, this, &QQuickJumpListCategory::items_count, &QQuickJumpListCategory::items_at); -} - -/*! - \qmlproperty string JumpListCategory::title - - The title of the category. - */ -QString QQuickJumpListCategory::title() const -{ - return m_title; -} - -void QQuickJumpListCategory::setTitle(const QString &title) -{ - if (m_title != title) { - m_title = title; - emit titleChanged(); - } -} - -/*! - \qmlproperty bool JumpListCategory::visible - - The visibility of the category. - */ -bool QQuickJumpListCategory::isVisible() const -{ - return m_visible; -} - -void QQuickJumpListCategory::setVisible(bool visible) -{ - if (m_visible != visible) { - m_visible = visible; - emit visibilityChanged(); - } -} - -QList<QWinJumpListItem *> QQuickJumpListCategory::toItemList() const -{ - QList<QWinJumpListItem *> items; - for (QQuickJumpListItem *item : m_items) - items.append(item->toJumpListItem()); - return items; -} - -void QQuickJumpListCategory::data_append(QQmlListProperty<QObject> *property, QObject *object) -{ - if (auto *item = qobject_cast<QQuickJumpListItem *>(object)) { - auto *category = static_cast<QQuickJumpListCategory *>(property->object); - category->m_items.append(item); - emit category->itemsChanged(); - } -} - -int QQuickJumpListCategory::items_count(QQmlListProperty<QQuickJumpListItem> *property) -{ - return static_cast<QQuickJumpListCategory *>(property->object)->m_items.count(); -} - -QQuickJumpListItem *QQuickJumpListCategory::items_at(QQmlListProperty<QQuickJumpListItem> *property, int index) -{ - return static_cast<QQuickJumpListCategory *>(property->object)->m_items.value(index); -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquickjumplistcategory_p.h b/src/imports/winextras/qquickjumplistcategory_p.h deleted file mode 100644 index 9e1fda7..0000000 --- a/src/imports/winextras/qquickjumplistcategory_p.h +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKJUMPLISTCATEGORY_P_H -#define QQUICKJUMPLISTCATEGORY_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qquickjumplistitem_p.h" - -#include <QObject> -#include <QList> -#include <QQmlListProperty> -#include <QWinJumpListCategory> -#include <QWinJumpListItem> - -QT_BEGIN_NAMESPACE - -class QQuickJumpListCategory : public QObject -{ - Q_OBJECT - Q_PROPERTY(QQmlListProperty<QObject> data READ data) - Q_PROPERTY(QQmlListProperty<QQuickJumpListItem> items READ items) - Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged) - Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibilityChanged) - Q_CLASSINFO("DefaultProperty", "data") - -public: - explicit QQuickJumpListCategory(QObject *parent = nullptr); - ~QQuickJumpListCategory(); - - QString title() const; - void setTitle(const QString &title); - - bool isVisible() const; - void setVisible(bool visible); - - QQmlListProperty<QObject> data(); - QQmlListProperty<QQuickJumpListItem> items(); - - QList<QWinJumpListItem *> toItemList() const; - -Q_SIGNALS: - void itemsChanged(); - void titleChanged(); - void visibilityChanged(); - -private: - static void data_append(QQmlListProperty<QObject> *property, QObject *object); - static int items_count(QQmlListProperty<QQuickJumpListItem> *property); - static QQuickJumpListItem *items_at(QQmlListProperty<QQuickJumpListItem> *property, int index); - - bool m_visible = true; - QString m_title; - QList<QQuickJumpListItem *> m_items; -}; - -QT_END_NAMESPACE - -#endif // QQUICKJUMPLISTCATEGORY_P_H diff --git a/src/imports/winextras/qquickjumplistitem.cpp b/src/imports/winextras/qquickjumplistitem.cpp deleted file mode 100644 index bfc9543..0000000 --- a/src/imports/winextras/qquickjumplistitem.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickjumplistitem_p.h" -#include <QVariant> - -QT_BEGIN_NAMESPACE - -QQuickJumpListItem::QQuickJumpListItem(QObject *parent) : - QObject(parent) -{ -} - -QQuickJumpListItem::~QQuickJumpListItem() = default; - -int QQuickJumpListItem::type() const -{ - return m_type; -} - -void QQuickJumpListItem::setType(int type) -{ - m_type = type; -} - -QWinJumpListItem *QQuickJumpListItem::toJumpListItem() const -{ - auto *item = new QWinJumpListItem(QWinJumpListItem::Separator); - switch (m_type) { - case ItemTypeDestination: - item->setType(QWinJumpListItem::Destination); - item->setFilePath(property("filePath").toString()); - break; - case ItemTypeLink: - item->setType(QWinJumpListItem::Link); - item->setFilePath(property("executablePath").toString()); - item->setArguments(QStringList(property("arguments").toStringList())); - item->setDescription(property("description").toString()); - item->setTitle(property("title").toString()); - item->setIcon(QIcon(property("iconPath").toString())); - break; - } - - return item; -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquickjumplistitem_p.h b/src/imports/winextras/qquickjumplistitem_p.h deleted file mode 100644 index 47d92d7..0000000 --- a/src/imports/winextras/qquickjumplistitem_p.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKJUMPLISTITEM_P_H -#define QQUICKJUMPLISTITEM_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QObject> -#include <QWinJumpListItem> - -QT_BEGIN_NAMESPACE - -class QQuickJumpListItem : public QObject -{ - Q_OBJECT - Q_PROPERTY(int __jumpListItemType READ type WRITE setType) -public: - enum JumpListItemType { - ItemTypeLink = 1, - ItemTypeDestination = 2, - ItemTypeSeparator = 3 - }; - Q_ENUM(JumpListItemType) - - explicit QQuickJumpListItem(QObject *p = nullptr); - ~QQuickJumpListItem(); - - int type() const; - void setType(int type); - - QWinJumpListItem *toJumpListItem() const; - -private: - int m_type; // 1 - link, 2 - destination -}; - -QT_END_NAMESPACE - -#endif // QQUICKJUMPLISTITEM_P_H diff --git a/src/imports/winextras/qquicktaskbarbutton.cpp b/src/imports/winextras/qquicktaskbarbutton.cpp deleted file mode 100644 index 688ef35..0000000 --- a/src/imports/winextras/qquicktaskbarbutton.cpp +++ /dev/null @@ -1,166 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquicktaskbarbutton_p.h" -#include "qquickiconloader_p.h" - -#include <QQuickWindow> -#include <QVariant> - -QT_BEGIN_NAMESPACE - -/*! - \qmltype TaskbarButton - \instantiates QQuickTaskbarButton - \inqmlmodule QtWinExtras - - \brief Manages Windows taskbar buttons. - - \since QtWinExtras 1.0 - - The TaskbarButton type enables you to set an overlay icon and to display - a progress indicator on a taskbar button. An overlay icon indicates change - in the state of the application. A progress indicator shows how time-consuming - tasks are progressing. - - \section3 Example - - The following example illustrates how to use TaskbarButton in QML: - - \snippet code/taskbar.qml taskbar_qml - - \image taskbar-button.png Taskbar Button - - \sa QWinTaskbarButton, QWinTaskbarProgress - */ - -QQuickTaskbarOverlay::QQuickTaskbarOverlay(QWinTaskbarButton *button, QObject *parent) : - QObject(parent), m_button(button) -{ -} - -QUrl QQuickTaskbarOverlay::iconSource() const -{ - return m_iconSource; -} - -void QQuickTaskbarOverlay::setIconSource(const QUrl &iconSource) -{ - if (m_iconSource == iconSource) - return; - - if (iconSource.isEmpty()) { - m_button->clearOverlayIcon(); - m_iconSource = iconSource; - emit iconSourceChanged(); - return; - } - - if (QQuickIconLoader::load(iconSource, qmlEngine(parent()), QVariant::Icon, QSize(), - this, &QQuickTaskbarOverlay::iconLoaded) != QQuickIconLoader::LoadError) { - m_iconSource = iconSource; - emit iconSourceChanged(); - } -} - -QString QQuickTaskbarOverlay::accessibleDescription() const -{ - return m_button->overlayAccessibleDescription(); -} - -void QQuickTaskbarOverlay::setAccessibleDescription(const QString &description) -{ - if (accessibleDescription() != description) { - m_button->setOverlayAccessibleDescription(description); - emit accessibleDescriptionChanged(); - } -} - -void QQuickTaskbarOverlay::iconLoaded(const QVariant &value) -{ - m_button->setOverlayIcon(value.value<QIcon>()); -} - -QQuickTaskbarButton::QQuickTaskbarButton(QQuickItem *parent) : QQuickItem(parent), - m_button(new QWinTaskbarButton(this)), m_overlay(new QQuickTaskbarOverlay(m_button, this)) -{ -} - -QQuickTaskbarButton::~QQuickTaskbarButton() = default; - -/*! - \qmlpropertygroup ::TaskbarButton::progress - \qmlproperty int TaskbarButton::progress.value - \qmlproperty int TaskbarButton::progress.minimum - \qmlproperty int TaskbarButton::progress.maximum - \qmlproperty bool TaskbarButton::progress.visible - \qmlproperty bool TaskbarButton::progress.paused - \qmlproperty bool TaskbarButton::progress.stopped - - The taskbar progress indicator. - - \sa QWinTaskbarProgress - */ -QWinTaskbarProgress *QQuickTaskbarButton::progress() const -{ - return m_button->progress(); -} - -/*! - \qmlpropertygroup ::TaskbarButton::overlay - \qmlproperty url TaskbarButton::overlay.iconSource - \qmlproperty string TaskbarButton::overlay.accessibleDescription - - The overlay icon and a description of the overlay for accessibility purposes. - */ -QQuickTaskbarOverlay *QQuickTaskbarButton::overlay() const -{ - return m_overlay; -} - -void QQuickTaskbarButton::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) -{ - if (change == ItemSceneChange) { - m_button->setWindow(data.window); - } - QQuickItem::itemChange(change, data); -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquicktaskbarbutton_p.h b/src/imports/winextras/qquicktaskbarbutton_p.h deleted file mode 100644 index a26fa67..0000000 --- a/src/imports/winextras/qquicktaskbarbutton_p.h +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKTASKBARBUTTON_P_H -#define QQUICKTASKBARBUTTON_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QQuickItem> -#include <QWinTaskbarButton> -#include <QWinTaskbarProgress> - -QT_BEGIN_NAMESPACE - -class QVariant; -class QQuickTaskbarButtonPrivate; - -class QQuickTaskbarOverlay : public QObject -{ - Q_OBJECT - Q_PROPERTY(QUrl iconSource READ iconSource WRITE setIconSource NOTIFY iconSourceChanged) - Q_PROPERTY(QString accessibleDescription READ accessibleDescription WRITE setAccessibleDescription NOTIFY accessibleDescriptionChanged) - -public: - explicit QQuickTaskbarOverlay(QWinTaskbarButton *button, QObject *parent = nullptr); - - QUrl iconSource() const; - void setIconSource(const QUrl &iconSource); - - QString accessibleDescription() const; - void setAccessibleDescription(const QString &description); - -Q_SIGNALS: - void iconSourceChanged(); - void accessibleDescriptionChanged(); - -private Q_SLOTS: - void iconLoaded(const QVariant &); - -private: - QUrl m_iconSource; - QWinTaskbarButton *m_button; -}; - -class QQuickTaskbarButton : public QQuickItem -{ - Q_OBJECT - Q_PROPERTY(QQuickTaskbarOverlay *overlay READ overlay CONSTANT) - Q_PROPERTY(QWinTaskbarProgress *progress READ progress CONSTANT) - -public: - explicit QQuickTaskbarButton(QQuickItem *parent = nullptr); - ~QQuickTaskbarButton(); - - QQuickTaskbarOverlay *overlay() const; - QWinTaskbarProgress *progress() const; - -protected: - void itemChange(ItemChange, const ItemChangeData &) Q_DECL_OVERRIDE; - -private: - QWinTaskbarButton *m_button; - QQuickTaskbarOverlay *m_overlay; -}; - -QT_END_NAMESPACE - -#endif // QQUICKTASKBARBUTTON_P_H diff --git a/src/imports/winextras/qquickthumbnailtoolbar.cpp b/src/imports/winextras/qquickthumbnailtoolbar.cpp deleted file mode 100644 index 7bdf112..0000000 --- a/src/imports/winextras/qquickthumbnailtoolbar.cpp +++ /dev/null @@ -1,246 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickthumbnailtoolbar_p.h" -#include "qquickthumbnailtoolbutton_p.h" -#include "qquickiconloader_p.h" - -#include <QQuickWindow> -#include <QQmlEngine> - -QT_BEGIN_NAMESPACE - -/*! - \qmltype ThumbnailToolBar - \instantiates QQuickThumbnailToolBar - \inqmlmodule QtWinExtras - - \brief Allows manipulating the window's thumbnail toolbar. - - This class allows an application to embed a toolbar in the thumbnail of a window, - which is shown when hovering over its taskbar icon. It provides quick access to - the window's commands without requiring the user to restore or activate the window. - - \image thumbbar.png Media player thumbnail toolbar - - \section3 Example - \snippet code/thumbbar.qml thumbbar_qml - \since QtWinExtras 1.0 - */ - -QQuickThumbnailToolBar::QQuickThumbnailToolBar(QQuickItem *parent) : - QQuickItem(parent) -{ - connect(&m_toolbar, &QWinThumbnailToolBar::iconicThumbnailPixmapRequested, - this, &QQuickThumbnailToolBar::iconicThumbnailRequested); - connect(&m_toolbar, &QWinThumbnailToolBar::iconicLivePreviewPixmapRequested, - this, &QQuickThumbnailToolBar::iconicLivePreviewRequested); -} - -QQuickThumbnailToolBar::~QQuickThumbnailToolBar() = default; - -int QQuickThumbnailToolBar::count() const -{ - return m_toolbar.count(); -} - -QQmlListProperty<QObject> QQuickThumbnailToolBar::data() -{ - return QQmlListProperty<QObject>(this, nullptr, &QQuickThumbnailToolBar::addData, nullptr, nullptr, nullptr); -} - -QQmlListProperty<QQuickThumbnailToolButton> QQuickThumbnailToolBar::buttons() -{ - return QQmlListProperty<QQuickThumbnailToolButton>(this, nullptr, &QQuickThumbnailToolBar::buttonCount, &QQuickThumbnailToolBar::buttonAt); -} - -void QQuickThumbnailToolBar::addButton(QQuickThumbnailToolButton *button) -{ - if (!m_buttons.contains(button)) { - m_toolbar.addButton(button->m_button); - m_buttons.append(button); - emit countChanged(); - emit buttonsChanged(); - } -} - -void QQuickThumbnailToolBar::removeButton(QQuickThumbnailToolButton *button) -{ - if (m_buttons.removeOne(button)) { - m_toolbar.removeButton(button->m_button); - emit countChanged(); - emit buttonsChanged(); - } -} - -void QQuickThumbnailToolBar::clear() -{ - m_toolbar.clear(); - for (QQuickThumbnailToolButton *button : qAsConst(m_buttons)) - button->deleteLater(); - m_buttons.clear(); - emit countChanged(); - emit buttonsChanged(); -} - -/*! - \qmlsignal ThumbnailToolBar::iconicThumbnailRequested() - - This signal is emitted when the operating system requests a new iconic thumbnail pixmap, - typically when the thumbnail is shown. - - \since 5.4 -*/ - -/*! - \qmlsignal ThumbnailToolBar::iconicLivePreviewRequested() - - This signal is emitted when the operating system requests a new iconic live preview pixmap, - typically when the user ALT-tabs to the application. - \since 5.4 -*/ - -/*! - \qmlproperty bool ThumbnailToolBar::iconicNotificationsEnabled - - This property holds whether the signals iconicThumbnailRequested() - or iconicLivePreviewRequested() will be emitted. - \since 5.4 - */ -bool QQuickThumbnailToolBar::iconicNotificationsEnabled() const -{ - return m_toolbar.iconicPixmapNotificationsEnabled(); -} - -void QQuickThumbnailToolBar::setIconicNotificationsEnabled(bool enabled) -{ - if (enabled != m_toolbar.iconicPixmapNotificationsEnabled()) { - m_toolbar.setIconicPixmapNotificationsEnabled(enabled); - emit iconicNotificationsEnabledChanged(); - } -} - -void QQuickThumbnailToolBar::iconicThumbnailLoaded(const QVariant &value) -{ - m_toolbar.setIconicThumbnailPixmap(value.value<QPixmap>()); -} - -/*! - \qmlproperty url ThumbnailToolBar::iconicThumbnailSource - - The pixmap for use as a thumbnail representation - \since 5.4 - */ -void QQuickThumbnailToolBar::setIconicThumbnailSource(const QUrl &source) -{ - if (source == m_iconicThumbnailSource) - return; - - if (source.isEmpty()) { - m_toolbar.setIconicThumbnailPixmap(QPixmap()); - m_iconicThumbnailSource = source; - emit iconicThumbnailSourceChanged(); - } - - if (QQuickIconLoader::load(source, qmlEngine(this), QVariant::Pixmap, QSize(), - this, &QQuickThumbnailToolBar::iconicThumbnailLoaded) != QQuickIconLoader::LoadError) { - m_iconicThumbnailSource = source; - emit iconicThumbnailSourceChanged(); - } -} - -void QQuickThumbnailToolBar::iconicLivePreviewLoaded(const QVariant &value) -{ - m_toolbar.setIconicLivePreviewPixmap(value.value<QPixmap>()); -} - -/*! - \qmlproperty url ThumbnailToolBar::iconicLivePreviewSource - - The pixmap for use as a live (peek) preview when tabbing into the application. - \since 5.4 - */ -void QQuickThumbnailToolBar::setIconicLivePreviewSource(const QUrl &source) -{ - if (source == m_iconicLivePreviewSource) - return; - - if (source.isEmpty()) { - m_toolbar.setIconicLivePreviewPixmap(QPixmap()); - m_iconicLivePreviewSource = source; - emit iconicLivePreviewSourceChanged(); - } - - if (QQuickIconLoader::load(source, qmlEngine(this), QVariant::Pixmap, QSize(), - this, &QQuickThumbnailToolBar::iconicLivePreviewLoaded) != QQuickIconLoader::LoadError) { - m_iconicLivePreviewSource = source; - emit iconicLivePreviewSourceChanged(); - } -} - -void QQuickThumbnailToolBar::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) -{ - if (change == ItemSceneChange) - m_toolbar.setWindow(data.window); - QQuickItem::itemChange(change, data); -} - -void QQuickThumbnailToolBar::addData(QQmlListProperty<QObject> *property, QObject *object) -{ - if (auto *button = qobject_cast<QQuickThumbnailToolButton *>(object)) { - auto *quickThumbbar = static_cast<QQuickThumbnailToolBar *>(property->object); - quickThumbbar->m_toolbar.addButton(button->m_button); - quickThumbbar->m_buttons.append(button); - emit quickThumbbar->countChanged(); - emit quickThumbbar->buttonsChanged(); - } -} - -int QQuickThumbnailToolBar::buttonCount(QQmlListProperty<QQuickThumbnailToolButton> *property) -{ - return static_cast<QQuickThumbnailToolBar *>(property->object)->count(); -} - -QQuickThumbnailToolButton *QQuickThumbnailToolBar::buttonAt(QQmlListProperty<QQuickThumbnailToolButton> *property, int index) -{ - return static_cast<QQuickThumbnailToolBar *>(property->object)->m_buttons.value(index); -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquickthumbnailtoolbar_p.h b/src/imports/winextras/qquickthumbnailtoolbar_p.h deleted file mode 100644 index fc1e67a..0000000 --- a/src/imports/winextras/qquickthumbnailtoolbar_p.h +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKTHUMBNAILTOOLBAR_P_H -#define QQUICKTHUMBNAILTOOLBAR_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QQuickItem> -#include <QWinThumbnailToolBar> -#include <QUrl> -#include <QList> - -QT_BEGIN_NAMESPACE - -class QVariant; - -class QQuickThumbnailToolButton; - -class QQuickThumbnailToolBar : public QQuickItem -{ - Q_OBJECT - Q_PROPERTY(int count READ count NOTIFY countChanged) - Q_PROPERTY(QQmlListProperty<QObject> data READ data) - Q_PROPERTY(QQmlListProperty<QQuickThumbnailToolButton> buttons READ buttons NOTIFY buttonsChanged) - Q_PROPERTY(bool iconicNotificationsEnabled READ iconicNotificationsEnabled WRITE setIconicNotificationsEnabled NOTIFY iconicNotificationsEnabledChanged) - Q_PROPERTY(QUrl iconicThumbnailSource READ iconicThumbnailSource WRITE setIconicThumbnailSource NOTIFY iconicThumbnailSourceChanged) - Q_PROPERTY(QUrl iconicLivePreviewSource READ iconicLivePreviewSource WRITE setIconicLivePreviewSource NOTIFY iconicLivePreviewSourceChanged) - Q_CLASSINFO("DefaultProperty", "data") - -public: - explicit QQuickThumbnailToolBar(QQuickItem *parent = nullptr); - ~QQuickThumbnailToolBar(); - - int count() const; - - QQmlListProperty<QObject> data(); - QQmlListProperty<QQuickThumbnailToolButton> buttons(); - - Q_INVOKABLE void addButton(QQuickThumbnailToolButton *button); - Q_INVOKABLE void removeButton(QQuickThumbnailToolButton *button); - - bool iconicNotificationsEnabled() const; - void setIconicNotificationsEnabled(bool); - QUrl iconicThumbnailSource() const { return m_iconicThumbnailSource; } - void setIconicThumbnailSource(const QUrl &); - QUrl iconicLivePreviewSource() const { return m_iconicLivePreviewSource; } - void setIconicLivePreviewSource(const QUrl &); - -public Q_SLOTS: - void clear(); - -Q_SIGNALS: - void countChanged(); - void buttonsChanged(); - void iconicNotificationsEnabledChanged(); - void iconicThumbnailSourceChanged(); - void iconicThumbnailRequested(); - void iconicLivePreviewSourceChanged(); - void iconicLivePreviewRequested(); - -private Q_SLOTS: - void iconicThumbnailLoaded(const QVariant &); - void iconicLivePreviewLoaded(const QVariant &); - -protected: - void itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) override; - -private: - static void addData(QQmlListProperty<QObject> *property, QObject *button); - static int buttonCount(QQmlListProperty<QQuickThumbnailToolButton> *property); - static QQuickThumbnailToolButton *buttonAt(QQmlListProperty<QQuickThumbnailToolButton> *property, int index); - - QWinThumbnailToolBar m_toolbar; - QList<QQuickThumbnailToolButton *> m_buttons; - QUrl m_iconicThumbnailSource; - QUrl m_iconicLivePreviewSource; -}; - -QT_END_NAMESPACE - -#endif // QQUICKTHUMBNAILTOOLBAR_P_H diff --git a/src/imports/winextras/qquickthumbnailtoolbutton.cpp b/src/imports/winextras/qquickthumbnailtoolbutton.cpp deleted file mode 100644 index e4a1f81..0000000 --- a/src/imports/winextras/qquickthumbnailtoolbutton.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickthumbnailtoolbutton_p.h" -#include "qquickiconloader_p.h" - -#include <QWinThumbnailToolButton> - -QT_BEGIN_NAMESPACE - -/*! - \qmltype ThumbnailToolButton - \instantiates QQuickThumbnailToolButton - \inqmlmodule QtWinExtras - - \brief Represents a button in a thumbnail toolbar. - - The ThumbnailToolButton represents a button in a thumbnail toolbar. - \since QtWinExtras 1.0 - */ - -/*! - \qmlsignal ThumbnailToolButton::clicked() - This signal is emitted when the user clicks the button. The corresponding handler is \c onClicked. -*/ - -QQuickThumbnailToolButton::QQuickThumbnailToolButton(QObject *parent) : - QObject(parent), m_button(new QWinThumbnailToolButton(this)) -{ - connect(m_button, &QWinThumbnailToolButton::clicked, this, &QQuickThumbnailToolButton::clicked); -} - -QQuickThumbnailToolButton::~QQuickThumbnailToolButton() = default; - -/*! - \qmlproperty url ThumbnailToolButton::iconSource - - The button icon path. - */ -void QQuickThumbnailToolButton::setIconSource(const QUrl &iconSource) -{ - if (m_iconSource == iconSource) - return; - - if (iconSource.isEmpty()) { - m_button->setIcon(QIcon()); - m_iconSource = iconSource; - emit iconSourceChanged(); - } - - if (QQuickIconLoader::load(iconSource, qmlEngine(this), QVariant::Icon, QSize(), - this, &QQuickThumbnailToolButton::iconLoaded) != QQuickIconLoader::LoadError) { - m_iconSource = iconSource; - emit iconSourceChanged(); - } -} - -QUrl QQuickThumbnailToolButton::iconSource() -{ - return m_iconSource; -} - -/*! - \qmlproperty string ThumbnailToolButton::tooltip - - The tooltip of the button. - */ -void QQuickThumbnailToolButton::setTooltip(const QString &tooltip) -{ - if (m_button->toolTip() != tooltip) { - m_button->setToolTip(tooltip); - emit tooltipChanged(); - } -} - -QString QQuickThumbnailToolButton::tooltip() const -{ - return m_button->toolTip(); -} - -/*! - \qmlproperty bool ThumbnailToolButton::enabled - - This property holds whether the button is enabled. - - By default, this property is set to true. - */ -void QQuickThumbnailToolButton::setEnabled(bool enabled) -{ - if (m_button->isEnabled() != enabled) { - m_button->setEnabled(enabled); - emit enabledChanged(); - } -} - -bool QQuickThumbnailToolButton::isEnabled() const -{ - return m_button->isEnabled(); -} - -/*! - \qmlproperty bool ThumbnailToolButton::interactive - - This property holds whether the button is interactive. - If not interactive, the button remains enabled, but no pressed or mouse-over - states are drawn. Set this property to false to use this button as a - notification icon. - - By default, this property is set to true. - */ -void QQuickThumbnailToolButton::setInteractive(bool interactive) -{ - if (m_button->isInteractive() != interactive) { - m_button->setInteractive(interactive); - emit interactiveChanged(); - } -} - -bool QQuickThumbnailToolButton::isInteractive() const -{ - return m_button->isInteractive(); -} - -/*! - \qmlproperty bool ThumbnailToolButton::visible - - This property holds whether the button is visible. - - By default, this property is set to true. - */ -void QQuickThumbnailToolButton::setVisible(bool visible) -{ - if (m_button->isVisible() != visible) { - m_button->setVisible(visible); - emit visibleChanged(); - } -} - -bool QQuickThumbnailToolButton::isVisible() const -{ - return m_button->isVisible(); -} - -/*! - \qmlproperty bool ThumbnailToolButton::dismissOnClick - - This property holds whether the window thumbnail is dismissed after a button click. - - By default, this property is set to false. - */ -void QQuickThumbnailToolButton::setDismissOnClick(bool dismiss) -{ - if (m_button->dismissOnClick() != dismiss) { - m_button->setDismissOnClick(dismiss); - emit dismissOnClickChanged(); - } -} - -bool QQuickThumbnailToolButton::dismissOnClick() const -{ - return m_button->dismissOnClick(); -} - -/*! - \qmlproperty bool ThumbnailToolButton::flat - - This property holds whether the button background and frame are not drawn. - - By default, this property is set to false. - */ -void QQuickThumbnailToolButton::setFlat(bool flat) -{ - if (m_button->isFlat() != flat) { - m_button->setFlat(flat); - emit flatChanged(); - } -} - -bool QQuickThumbnailToolButton::isFlat() const -{ - return m_button->isFlat(); -} - -void QQuickThumbnailToolButton::iconLoaded(const QVariant &value) -{ - if (value.isValid()) - m_button->setIcon(value.value<QIcon>()); -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquickthumbnailtoolbutton_p.h b/src/imports/winextras/qquickthumbnailtoolbutton_p.h deleted file mode 100644 index aca0e74..0000000 --- a/src/imports/winextras/qquickthumbnailtoolbutton_p.h +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKTHUMBNAILTOOLBUTTON_P_H -#define QQUICKTHUMBNAILTOOLBUTTON_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QQuickItem> -#include <QWinThumbnailToolBar> -#include <QUrl> - -QT_BEGIN_NAMESPACE - -class QQuickThumbnailToolButton : public QObject -{ - Q_OBJECT - Q_PROPERTY(QUrl iconSource READ iconSource WRITE setIconSource NOTIFY iconSourceChanged) - Q_PROPERTY(QString tooltip READ tooltip WRITE setTooltip NOTIFY tooltipChanged) - Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged) - Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactiveChanged) - Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) - Q_PROPERTY(bool dismissOnClick READ dismissOnClick WRITE setDismissOnClick NOTIFY dismissOnClickChanged) - Q_PROPERTY(bool flat READ isFlat WRITE setFlat NOTIFY flatChanged) - -public: - explicit QQuickThumbnailToolButton(QObject *parent = nullptr); - ~QQuickThumbnailToolButton(); - - void setIconSource(const QUrl &iconSource); - QUrl iconSource(); - void setTooltip(const QString &tooltip); - QString tooltip() const; - void setEnabled(bool isEnabled); - bool isEnabled() const; - void setInteractive(bool isInteractive); - bool isInteractive() const; - void setVisible(bool isVisible); - bool isVisible() const; - void setDismissOnClick(bool dismiss); - bool dismissOnClick() const; - void setFlat(bool flat); - bool isFlat() const; - -Q_SIGNALS: - void clicked(); - void iconSourceChanged(); - void tooltipChanged(); - void enabledChanged(); - void interactiveChanged(); - void visibleChanged(); - void dismissOnClickChanged(); - void flatChanged(); - -private Q_SLOTS: - void iconLoaded(const QVariant &); - -private: - QUrl m_iconSource; - QWinThumbnailToolButton *m_button; - - friend class QQuickThumbnailToolBar; -}; - -QT_END_NAMESPACE - -#endif // QQUICKTHUMBNAILTOOLBUTTON_P_H diff --git a/src/imports/winextras/qquickwin_p.h b/src/imports/winextras/qquickwin_p.h deleted file mode 100644 index 4ed9015..0000000 --- a/src/imports/winextras/qquickwin_p.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKWIN_P_H -#define QQUICKWIN_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QObject> -#include <QtWin> - -QT_BEGIN_NAMESPACE - -class QQuickWin : public QObject -{ - Q_OBJECT - -public: - enum HBitmapFormat - { - HBitmapNoAlpha = QtWin::HBitmapNoAlpha, - HBitmapPremultipliedAlpha = QtWin::HBitmapPremultipliedAlpha, - HBitmapAlpha = QtWin::HBitmapAlpha - }; - Q_ENUM(HBitmapFormat) - - enum WindowFlip3DPolicy - { - FlipDefault = QtWin::FlipDefault, - FlipExcludeBelow = QtWin::FlipExcludeBelow, - FlipExcludeAbove = QtWin::FlipExcludeAbove - }; - Q_ENUM(WindowFlip3DPolicy) - - enum WindowNonClientRenderingPolicy - { - NonClientRenderingUseWindowStyle = QtWin::NonClientRenderingUseWindowStyle, - NonClientRenderingDisabled = QtWin::NonClientRenderingDisabled, - NonClientRenderingEnabled = QtWin::NonClientRenderingEnabled - }; - Q_ENUM(WindowNonClientRenderingPolicy) -}; - -QT_END_NAMESPACE - -#endif // QQUICKWIN_P_H diff --git a/src/imports/winextras/winextras.pro b/src/imports/winextras/winextras.pro deleted file mode 100644 index dc778e6..0000000 --- a/src/imports/winextras/winextras.pro +++ /dev/null @@ -1,44 +0,0 @@ -CXX_MODULE = qml -TARGET = qml_winextras -TARGETPATH = QtWinExtras -IMPORT_VERSION = 1.$$QT_MINOR_VERSION - -QT += qml quick winextras winextras-private - -QML_FILES += \ - JumpListLink.qml \ - JumpListDestination.qml \ - JumpListSeparator.qml - -HEADERS += \ - qquickdwmfeatures_p.h \ - qquickdwmfeatures_p_p.h \ - qquicktaskbarbutton_p.h \ - qquickjumplist_p.h \ - qquickjumplistitem_p.h \ - qquickjumplistcategory_p.h \ - qquickthumbnailtoolbar_p.h \ - qquickthumbnailtoolbutton_p.h \ - qquickiconloader_p.h \ - qquickwin_p.h - -SOURCES += \ - plugin.cpp \ - qquickdwmfeatures.cpp \ - qquicktaskbarbutton.cpp \ - qquickjumplist.cpp \ - qquickjumplistitem.cpp \ - qquickjumplistcategory.cpp \ - qquickthumbnailtoolbar.cpp \ - qquickthumbnailtoolbutton.cpp \ - qquickiconloader.cpp - -OTHER_FILES += \ - qmldir \ - JumpListLink.qml \ - JumpListDestination.qml \ - JumpListSeparator.qml - -!qtHaveModule(opengl)|qtConfig(dynamicgl):LIBS_PRIVATE += -luser32 - -load(qml_plugin) diff --git a/src/src.pro b/src/src.pro deleted file mode 100644 index fceeb21..0000000 --- a/src/src.pro +++ /dev/null @@ -1,11 +0,0 @@ -win32 { - TEMPLATE = subdirs - CONFIG += ordered - SUBDIRS += winextras - qtHaveModule(quick): SUBDIRS += imports -} else { - # fake project for creating the documentation - TEMPLATE = aux - CONFIG += force_qt - QMAKE_DOCS = $$PWD/winextras/doc/qtwinextras.qdocconf -} diff --git a/src/winextras/CMakeLists.txt b/src/winextras/CMakeLists.txt deleted file mode 100644 index 47d6eac..0000000 --- a/src/winextras/CMakeLists.txt +++ /dev/null @@ -1,51 +0,0 @@ -# Generated from winextras.pro. - -##################################################################### -## WinExtras Module: -##################################################################### - -qt_add_module(WinExtras - SOURCES - qwinevent.cpp qwinevent.h - qwineventfilter.cpp qwineventfilter_p.h - qwinextrasglobal.h - qwinfunctions.cpp qwinfunctions.h qwinfunctions_p.h - qwinjumplist.cpp qwinjumplist.h qwinjumplist_p.h - qwinjumplistcategory.cpp qwinjumplistcategory.h qwinjumplistcategory_p.h - qwinjumplistitem.cpp qwinjumplistitem.h qwinjumplistitem_p.h - qwintaskbarbutton.cpp qwintaskbarbutton.h qwintaskbarbutton_p.h - qwintaskbarprogress.cpp qwintaskbarprogress.h - qwinthumbnailtoolbar.cpp qwinthumbnailtoolbar.h qwinthumbnailtoolbar_p.h - qwinthumbnailtoolbutton.cpp qwinthumbnailtoolbutton.h qwinthumbnailtoolbutton_p.h - windowsguidsdefs.cpp windowsguidsdefs_p.h - winpropkey_p.h - winshobjidl_p.h - LIBRARIES - Qt::CorePrivate - Qt::GuiPrivate - dwmapi - ole32 - shell32 - shlwapi - PUBLIC_LIBRARIES - Qt::Core - Qt::Gui - PRIVATE_MODULE_INTERFACE - Qt::CorePrivate - Qt::GuiPrivate -) - -#### Keys ignored in scope 1:.:.:winextras.pro:<TRUE>: -# OTHER_FILES = "doc/qtwinextras.qdocconf" "doc/src/qtwinextras-index.qdoc" "doc/src/qtwinextras-module-cpp.qdoc" "doc/src/qtwinextras-module-qml.qdoc" "doc/snippets/code/use-qtwinextras.pro" "doc/snippets/code/jumplist.cpp" "doc/snippets/code/use-qtwinextras.cpp" "doc/snippets/code/thumbbar.cpp" "doc/snippets/code/thumbbar.qml" - -## Scopes: -##################################################################### - -qt_extend_target(WinExtras CONDITION QT_FEATURE_dynamicgl OR (WIN32 AND NOT TARGET Qt::OpenGL) - LIBRARIES - gdi32 -) -qt_add_docs(WinExtras - doc/qtwinextras.qdocconf -) - diff --git a/src/winextras/doc/QtWinExtras/qwinextrasglobal.h b/src/winextras/doc/QtWinExtras/qwinextrasglobal.h deleted file mode 100644 index 2da776f..0000000 --- a/src/winextras/doc/QtWinExtras/qwinextrasglobal.h +++ /dev/null @@ -1 +0,0 @@ -#include "../../qwinextrasglobal.h" diff --git a/src/winextras/doc/QtWinExtrasDoc b/src/winextras/doc/QtWinExtrasDoc deleted file mode 100644 index 7d14c34..0000000 --- a/src/winextras/doc/QtWinExtrasDoc +++ /dev/null @@ -1,22 +0,0 @@ -#include "qwinevent.h" -#include "qwinjumplist_p.h" -#include "winpropkey_p.h" -#include "qwinfunctions_p.h" -#include "qwineventfilter_p.h" -#include "winshobjidl_p.h" -#include "qwintaskbarbutton.h" -#include "qwinmime.h" -#include "qwinextrasglobal.h" -#include "qwinthumbnailtoolbar.h" -#include "qwinthumbnailtoolbutton_p.h" -#include "qwinjumplistitem.h" -#include "qwinjumplist.h" -#include "qwinthumbnailtoolbar_p.h" -#include "qwinjumplistitem_p.h" -#include "windowsguidsdefs_p.h" -#include "qwinfunctions.h" -#include "qwinjumplistcategory_p.h" -#include "qwintaskbarbutton_p.h" -#include "qwinthumbnailtoolbutton.h" -#include "qwintaskbarprogress.h" -#include "qwinjumplistcategory.h" diff --git a/src/winextras/doc/images/glass.png b/src/winextras/doc/images/glass.png Binary files differdeleted file mode 100644 index a2a6326..0000000 --- a/src/winextras/doc/images/glass.png +++ /dev/null diff --git a/src/winextras/doc/images/jumplist.png b/src/winextras/doc/images/jumplist.png Binary files differdeleted file mode 100644 index dff2487..0000000 --- a/src/winextras/doc/images/jumplist.png +++ /dev/null diff --git a/src/winextras/doc/images/peek-on.png b/src/winextras/doc/images/peek-on.png Binary files differdeleted file mode 100644 index c655639..0000000 --- a/src/winextras/doc/images/peek-on.png +++ /dev/null diff --git a/src/winextras/doc/images/taskbar-button.png b/src/winextras/doc/images/taskbar-button.png Binary files differdeleted file mode 100644 index 8c585f4..0000000 --- a/src/winextras/doc/images/taskbar-button.png +++ /dev/null diff --git a/src/winextras/doc/images/taskbar-progress-indeterminate.png b/src/winextras/doc/images/taskbar-progress-indeterminate.png Binary files differdeleted file mode 100644 index 800cf51..0000000 --- a/src/winextras/doc/images/taskbar-progress-indeterminate.png +++ /dev/null diff --git a/src/winextras/doc/images/taskbar-progress-paused.png b/src/winextras/doc/images/taskbar-progress-paused.png Binary files differdeleted file mode 100644 index 55383fd..0000000 --- a/src/winextras/doc/images/taskbar-progress-paused.png +++ /dev/null diff --git a/src/winextras/doc/images/taskbar-progress-stopped.png b/src/winextras/doc/images/taskbar-progress-stopped.png Binary files differdeleted file mode 100644 index f4b6dc1..0000000 --- a/src/winextras/doc/images/taskbar-progress-stopped.png +++ /dev/null diff --git a/src/winextras/doc/images/taskbar-progress.png b/src/winextras/doc/images/taskbar-progress.png Binary files differdeleted file mode 100644 index 97bb286..0000000 --- a/src/winextras/doc/images/taskbar-progress.png +++ /dev/null diff --git a/src/winextras/doc/images/thumbbar.png b/src/winextras/doc/images/thumbbar.png Binary files differdeleted file mode 100644 index c53077d..0000000 --- a/src/winextras/doc/images/thumbbar.png +++ /dev/null diff --git a/src/winextras/doc/qtwinextras.qdocconf b/src/winextras/doc/qtwinextras.qdocconf deleted file mode 100644 index 95547db..0000000 --- a/src/winextras/doc/qtwinextras.qdocconf +++ /dev/null @@ -1,53 +0,0 @@ -include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) -include($QT_INSTALL_DOCS/config/exampleurl-qtwinextras.qdocconf) - -project = QtWinExtras -description = Qt Windows Extras Reference Documentation -version = $QT_VERSION - -exampledirs += ../../../examples/winextras \ - snippets - -examplesinstallpath = winextras - -moduleheader = QtWinExtrasDoc - -includepaths = -I . \ - -I .. - -headerdirs = .. ../../imports/winextras -sourcedirs = .. ../../imports/winextras -imagedirs += images - -depends += qtcore qtgui qtdoc qtwidgets - -qhp.projects = QtWinExtras - -qhp.QtWinExtras.file = qtwinextras.qhp - -qhp.QtWinExtras.namespace = org.qt-project.qtwinextras.$QT_VERSION_TAG - -qhp.QtWinExtras.indexTitle = Qt Windows Extras -qhp.QtWinExtras.indexRoot = - -qhp.QtWinExtras.filterAttributes = qtwinextras $QT_VERSION qtrefdoc -qhp.QtWinExtras.customFilters.Qt.name = QtWinExtras $QT_VERSION -qhp.QtWinExtras.customFilters.Qt.filterAttributes = qtwinextras $QT_VERSION - -qhp.QtWinExtras.virtualFolder = qtwinextras -qhp.QtWinExtras.subprojects = classes examples qmltypes -qhp.QtWinExtras.subprojects.classes.title = C++ Classes and Namespaces -qhp.QtWinExtras.subprojects.classes.indexTitle = Qt Windows Extras C++ Classes -qhp.QtWinExtras.subprojects.classes.selectors = class function namespace fake:headerfile -qhp.QtWinExtras.subprojects.classes.sortPages = true -qhp.QtWinExtras.subprojects.examples.title = Examples -qhp.QtWinExtras.subprojects.examples.indexTitle = Qt Windows Extras Examples -qhp.QtWinExtras.subprojects.examples.selectors = fake:example -qhp.QtWinExtras.subprojects.qmltypes.title = QML Types -qhp.QtWinExtras.subprojects.qmltypes.indexTitle = Qt Windows Extras QML Types -qhp.QtWinExtras.subprojects.qmltypes.selectors = qmlclass -qhp.QtWinExtras.subprojects.qmltypes.sortPages = true - -navigation.landingpage = "Qt Windows Extras" -navigation.qmltypespage = "Qt Windows Extras QML Types" -navigation.cppclassespage = "Qt Windows Extras C++ Classes" diff --git a/src/winextras/doc/snippets/code/CMakeLists.txt b/src/winextras/doc/snippets/code/CMakeLists.txt deleted file mode 100644 index 36ad466..0000000 --- a/src/winextras/doc/snippets/code/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# Generated from use-qtwinextras.pro. - -##################################################################### -## use-qtwinextras Binary: -##################################################################### - -qt_add_executable(use-qtwinextras - GUI - PUBLIC_LIBRARIES - Qt::Gui - Qt::WinExtras -) diff --git a/src/winextras/doc/snippets/code/jumplist.cpp b/src/winextras/doc/snippets/code/jumplist.cpp deleted file mode 100644 index 6f8221e..0000000 --- a/src/winextras/doc/snippets/code/jumplist.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com> -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QWinJumpList> - -void foo() -{ -//! [jumplist] - QWinJumpList jumplist; - - QWinJumpListCategory *tasks = jumplist.tasks(); - QWinJumpListItem *newProject = new QWinJumpListItem(QWinJumpListItem::Link); - newProject->setTitle(tr("Create new project")); - newProject->setFilePath(QDir::toNativeSeparators(QCoreApplication::applicationFilePath())); - newProject->setArguments(QStringList("--new-project")); - tasks->addItem(newProject); - - tasks->addLink(tr("Launch SDK Manager"), QDir::toNativeSeparators(QCoreApplication::applicationDirPath()) + "\\sdk-manager.exe"); - - tasks->setVisible(true); -//! [jumplist] -} diff --git a/src/winextras/doc/snippets/code/taskbar.cpp b/src/winextras/doc/snippets/code/taskbar.cpp deleted file mode 100644 index 5636174..0000000 --- a/src/winextras/doc/snippets/code/taskbar.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtWinExtras> - -void initializeTaskbarButton(QWidget *widget) -{ - Q_ASSERT(widget->windowHandle()); // Note: this requires the window to be shown. -//! [taskbar_cpp] - QWinTaskbarButton *button = new QWinTaskbarButton(widget); - button->setWindow(widget->windowHandle()); - button->setOverlayIcon(QIcon(":/loading.png")); - - QWinTaskbarProgress *progress = button->progress(); - progress->setVisible(true); - progress->setValue(50); -//! [taskbar_cpp] -} diff --git a/src/winextras/doc/snippets/code/taskbar.qml b/src/winextras/doc/snippets/code/taskbar.qml deleted file mode 100644 index e46a370..0000000 --- a/src/winextras/doc/snippets/code/taskbar.qml +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Window 2.0 -import QtWinExtras 1.0 - -//! [taskbar_qml] -Window { - TaskbarButton { - overlay.iconSource: "loading.png" - overlay.accessibleDescription: "Loading" - - progress.visible: true - progress.value: 50 - } -} -//! [taskbar_qml] diff --git a/src/winextras/doc/snippets/code/thumbbar.cpp b/src/winextras/doc/snippets/code/thumbbar.cpp deleted file mode 100644 index e5924ea..0000000 --- a/src/winextras/doc/snippets/code/thumbbar.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com> -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtWinExtras> - -void initializeThumbnailToolBar(QWidget *widget) -{ - Q_ASSERT(widget->windowHandle()); // Note: this requires the window to be shown. -//! [thumbbar_cpp] - QWinThumbnailToolBar *thumbbar = new QWinThumbnailToolBar(widget); - thumbbar->setWindow(widget->windowHandle()); - - QWinThumbnailToolButton *settings = new QWinThumbnailToolButton(thumbbar); - settings->setToolTip("Settings"); - settings->setIcon(":/settings.png"); - settings->setDismissOnClick(true); - connect(settings, SIGNAL(clicked()), settingsPage, SLOT(show())); - - QWinThumbnailToolButton *playPause = new QWinThumbnailToolButton(thumbbar); - playPause->setToolTip("Play/Pause"); - playPause->setIcon(":/play.png"); - connect(playPause, SIGNAL(clicked()), mediaPlayer, SLOT(play())); - - thumbbar->addButton(settings); - thumbbar->addButton(playPause); -//! [thumbbar_cpp] -} diff --git a/src/winextras/doc/snippets/code/thumbbar.qml b/src/winextras/doc/snippets/code/thumbbar.qml deleted file mode 100644 index d521a0a..0000000 --- a/src/winextras/doc/snippets/code/thumbbar.qml +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com> -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Window 2.0 -import QtWinExtras 1.0 - -//! [thumbbar_qml] -Window { - ThumbnailToolBar { - ThumbnailToolButton { iconSource: "qrc:///player_rew.png"; tooltip: "Rewind"; onClicked: player.rewind() } - ThumbnailToolButton { iconSource: "qrc:///player_pause.png"; tooltip: "Pause"; onClicked: player.togglePlay() } - ThumbnailToolButton { iconSource: "qrc:///player_fwd.png"; tooltip: "Forward"; onClicked: player.forward() } - ThumbnailToolButton { interactive: false; flat: true } - ThumbnailToolButton { iconSource: "qrc:///configure.png"; tooltip: "Settings"; onClicked: settingsWindow.show() } - ThumbnailToolButton { iconSource: "qrc:///document_open_folder.png"; tooltip: "Open"; onClicked: player.open() } - } -} -//! [thumbbar_qml] diff --git a/src/winextras/doc/snippets/code/use-qtwinextras.cpp b/src/winextras/doc/snippets/code/use-qtwinextras.cpp deleted file mode 100644 index 51f3718..0000000 --- a/src/winextras/doc/snippets/code/use-qtwinextras.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com> -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//! [include] -#include <QtWinExtras> -//! [include] diff --git a/src/winextras/doc/snippets/code/use-qtwinextras.pro b/src/winextras/doc/snippets/code/use-qtwinextras.pro deleted file mode 100644 index fd6cfdb..0000000 --- a/src/winextras/doc/snippets/code/use-qtwinextras.pro +++ /dev/null @@ -1,3 +0,0 @@ -#! [link] -QT += winextras -#! [link] diff --git a/src/winextras/doc/src/qtwinextras-examples.qdoc b/src/winextras/doc/src/qtwinextras-examples.qdoc deleted file mode 100644 index e51189c..0000000 --- a/src/winextras/doc/src/qtwinextras-examples.qdoc +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - -\group examples-qtwinextras -\title Qt Windows Extras Examples -\brief Examples for the Qt Windows Extras module. -\ingroup all-examples - -Here is a list of example applications demonstrating the functionality -provided by the \l{Qt Windows Extras} module. - -\note These examples work only on \l{Qt for Windows}{Windows} operating system. -*/
\ No newline at end of file diff --git a/src/winextras/doc/src/qtwinextras-index.qdoc b/src/winextras/doc/src/qtwinextras-index.qdoc deleted file mode 100644 index 00ab266..0000000 --- a/src/winextras/doc/src/qtwinextras-index.qdoc +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com> -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page qtwinextras-index.html - \title Qt Windows Extras - \brief Provides classes and functions for using some Windows APIs in a Qt way - - Qt Windows Extras provide classes and functions that enable you to use - miscellaneous Windows-specific functions. For example, you can convert Qt - objects to Windows object handles and manipulate DWM glass frames. - - In addition, you can use features introduced with Windows 7, such as Aero - Peek, Jump Lists, a progress indicator on a taskbar button, or a thumbnail - toolbar. - - \section1 Getting Started - - To include the definitions of the module's classes and functions, use the - following directive: - - \snippet code/use-qtwinextras.cpp include - - To link against the module, add this line to your qmake .pro file: - - \snippet code/use-qtwinextras.pro link - - \section1 Articles and Guides - - \list - \li \l {Qt Windows Extras Overview} - \endlist - - \section1 Examples - - \list - \li \l {Qt Windows Extras Examples} - \endlist - - \section1 API Reference - - These are links to the API reference materials. - - \list - \li \l {Qt Windows Extras C++ Classes}{C++ Classes and Namespaces} - \li \l {Qt Windows Extras QML Types}{QML Types} - \endlist -*/ diff --git a/src/winextras/doc/src/qtwinextras-module-cpp.qdoc b/src/winextras/doc/src/qtwinextras-module-cpp.qdoc deleted file mode 100644 index 92e74e0..0000000 --- a/src/winextras/doc/src/qtwinextras-module-cpp.qdoc +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com> -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \module QtWinExtras - \title Qt Windows Extras C++ Classes - \brief Provides classes and functions for using some Windows APIs in a Qt way. - - \ingroup modules - \ingroup technology-apis - \qtvariable winextras - - The QtWin namespace contains Windows-specific functions for type - conversions and DWM glass frame manipulation. - - The classes enable you to use features introduced with Windows 7, such as - Jump Lists, a progress indicator on a taskbar button, or a thumbnail - toolbar. -*/ diff --git a/src/winextras/doc/src/qtwinextras-module-qml.qdoc b/src/winextras/doc/src/qtwinextras-module-qml.qdoc deleted file mode 100644 index 62797ef..0000000 --- a/src/winextras/doc/src/qtwinextras-module-qml.qdoc +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com> -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \qmlmodule QtWinExtras 1.\QtMinorVersion - \title Qt Windows Extras QML Types - \ingroup qmlmodules - \brief Enables the use of Windows features with QML. - - \section1 QML Types - - The QML types can be imported into your application using the - following import statement in your .qml file. - - \qml \QtMinorVersion - import QtWinExtras 1.\1 - \endqml - */ diff --git a/src/winextras/doc/src/qtwinextras-overview.qdoc b/src/winextras/doc/src/qtwinextras-overview.qdoc deleted file mode 100644 index 39bdcd4..0000000 --- a/src/winextras/doc/src/qtwinextras-overview.qdoc +++ /dev/null @@ -1,153 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com> -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page qtwinextras-Overview.html - \title Qt Windows Extras Overview - \brief Qt Windows Extras provides classes and functions for using some - Windows APIs in a Qt way - - Qt Windows Extras provide classes and functions that enable you to use - miscellaneous Windows-specific functions. For example, you can convert Qt - objects to Windows object handles and manipulate DWM glass frames. - - In addition, you can use features introduced with Windows 7, such as Aero - Peek, Jump Lists, a progress indicator on a taskbar button, or a thumbnail - toolbar. - - \section1 Type Conversion - - The QtWin namespace provides functions to convert Qt objects of classes - such as QPixmap or QImage to Windows HBITMAP or HICON handles, and vice - versa. - - \section1 DWM and Glass Frame - - You can determine whether a window is included in the DWM Flip3D rendering. - - The glass frame that was first introduced with Windows Vista can be easily - manipulated using the QtWin::extendFrameIntoClientArea() and - QtWin::enableBlurBehindWindow() functions. Windows 8 lost the glass - effect, but applications can still integrate their windows into the system - frame to visually separate window controls from the rest of the window or to - focus the user's attention on window content. - - \image glass.png "Glass frame extended into client area of a window" - - \section1 Aero Peek - - The Windows 7 \b {Aero Peek} feature gives the users the powers of X-ray - vision that enable them to peek past all open windows straight at the - desktop and the gadgets placed there. They can view the contents of a window - without actually switching to it. You can enable Aero Peek for a - gadget-like window or for a window that constantly displays monitoring data. - - You can use the QtWin::setWindowExcludedFromPeek() function to exclude - an application window from Aero Peek. - - \note Aero Peek is disabled in Windows 8 by default but can be enabled - by the user. - - \image peek-on.png "A window excluded from Aero Peek" - - \section1 Taskbar - - The taskbar provides users with access to applications that are open on the - desktop. Windows automatically creates buttons on the taskbar for accessing - application windows. Windows 7 adds new features to the taskbar buttons - that are discussed in the following sections. - - \section2 Overlay Icons and Progress Indicators - - You can use the QWinTaskbarButton class to set an overlay icon and the - QWinTaskbarProgress class to display a progress indicator on a taskbar button. - An overlay icon indicates change in the state of the application. A progress - indicator shows how time-consuming tasks are progressing. - - \image taskbar-button.png Taskbar Button - - \section3 Taskbar Example - - The following example code illustrates how to use the QWinTaskbarButton - and QWinTaskbarProgress classes to adjust the look of the taskbar button: - - \snippet code/taskbar.cpp taskbar_cpp - - \section2 Jump Lists - - An application can use Jump Lists to provide users with faster access to - files or to display shortcuts to tasks or commands. - - \image jumplist.png Jump List - - \list - - \li \b Destinations — categorized shortcuts to files and URLs that the - application can handle and even links to other applications. - Windows provides two standard categories that can be added to the - custom Jump List, in addition to the ones that the application can - create itself. - \li \b Recent and \b Frequent — so called \e known categories that are - populated automatically by Windows when the application uses the - QFileDialog::getOpenFileName() function or when the application is - launched to open a file from the Windows shell. - - \li \b Tasks — shortcuts to application functionality. An application - can display its most frequently used context-independent functions - on task lists. - - \endlist - - \note To be able to add destinations to its Jump Lists, the application - should associate itself with the file types it can handle. - - \section3 Jump List Example - - The following example code illustrates how to use the classes in the - QWinJumpList and QWinJumpListItem classes to implement Jump Lists: - - \snippet code/jumplist.cpp jumplist - - \section2 Thumbnail Toolbar - - Applications can embed a toolbar in the thumbnail of a window, which is - shown when hovering over its taskbar icon. A thumbnail toolbar may provide - quick access to the window's commands without requiring the user to restore - or activate the window. - - \image thumbbar.png Media player thumbnail toolbar - - \section3 Thumbnail Toolbar Example - - The following example code illustrates how to use the functions in the - QWinThumbnailToolBar and QWinThumbnailToolButton class to implement a - thumbnail toolbar: - - \snippet code/thumbbar.cpp thumbbar_cpp - -*/ diff --git a/src/winextras/qwinevent.cpp b/src/winextras/qwinevent.cpp deleted file mode 100644 index a1e77b4..0000000 --- a/src/winextras/qwinevent.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qwinevent.h" - -const int QWinEvent::ColorizationChange = QEvent::registerEventType(); -const int QWinEvent::CompositionChange = QEvent::registerEventType(); -const int QWinEvent::TaskbarButtonCreated = QEvent::registerEventType(); -const int QWinEvent::ThemeChange = QEvent::registerEventType(); - -QWinEvent::QWinEvent(int type) : QEvent(static_cast<QEvent::Type>(type)) -{ -} - -QWinEvent::~QWinEvent() = default; - -QWinColorizationChangeEvent::QWinColorizationChangeEvent(QRgb color, bool opaque) - : QWinEvent(ColorizationChange), rgb(color), opaque(opaque) -{ -} - -QWinColorizationChangeEvent::~QWinColorizationChangeEvent() = default; - -QWinCompositionChangeEvent::QWinCompositionChangeEvent(bool enabled) - : QWinEvent(CompositionChange), enabled(enabled) -{ -} - -QWinCompositionChangeEvent::~QWinCompositionChangeEvent() = default; diff --git a/src/winextras/qwinevent.h b/src/winextras/qwinevent.h deleted file mode 100644 index ad77eb3..0000000 --- a/src/winextras/qwinevent.h +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINEVENT_H -#define QWINEVENT_H - -#include <QtGui/qrgb.h> -#include <QtCore/qcoreevent.h> -#include <QtWinExtras/qwinextrasglobal.h> - -QT_BEGIN_NAMESPACE - -class Q_WINEXTRAS_EXPORT QWinEvent : public QEvent -{ -public: - static const int ColorizationChange; - static const int CompositionChange; - static const int TaskbarButtonCreated; - static const int ThemeChange; - - explicit QWinEvent(int type); - ~QWinEvent(); -}; - -class Q_WINEXTRAS_EXPORT QWinColorizationChangeEvent : public QWinEvent -{ -public: - QWinColorizationChangeEvent(QRgb color, bool opaque); - ~QWinColorizationChangeEvent(); - - inline QRgb color() const { return rgb; } - inline bool opaqueBlend() const { return opaque; } - -private: - QRgb rgb; - bool opaque; -}; - -class Q_WINEXTRAS_EXPORT QWinCompositionChangeEvent : public QWinEvent -{ -public: - explicit QWinCompositionChangeEvent(bool enabled); - ~QWinCompositionChangeEvent(); - - inline bool isCompositionEnabled() const { return enabled; } - -private: - bool enabled; -}; - -QT_END_NAMESPACE - -#endif // QWINEVENT_H diff --git a/src/winextras/qwineventfilter.cpp b/src/winextras/qwineventfilter.cpp deleted file mode 100644 index 4b88f54..0000000 --- a/src/winextras/qwineventfilter.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qwineventfilter_p.h" -#include "qwinfunctions.h" -#include "qwinevent.h" -#include <QtGui/qguiapplication.h> -#include <QtGui/qwindow.h> - -#ifndef WM_DWMCOLORIZATIONCOLORCHANGED -# define WM_DWMCOLORIZATIONCOLORCHANGED 0x0320 -#endif - -#ifndef WM_DWMCOMPOSITIONCHANGED -# define WM_DWMCOMPOSITIONCHANGED 0x031E -#endif - -QWinEventFilter *QWinEventFilter::instance = nullptr; - -QWinEventFilter::QWinEventFilter() : - tbButtonCreatedMsgId(RegisterWindowMessageW(L"TaskbarButtonCreated")) -{ -} - -QWinEventFilter::~QWinEventFilter() -{ - instance = nullptr; -} - -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) -bool QWinEventFilter::nativeEventFilter(const QByteArray &, void *message, qintptr *result) -#else -bool QWinEventFilter::nativeEventFilter(const QByteArray &, void *message, long *result) -#endif -{ - MSG *msg = static_cast<MSG *>(message); - bool filterOut = false; - - QEvent *event = nullptr; - QWindow *window = nullptr; - switch (msg->message) { - case WM_DWMCOLORIZATIONCOLORCHANGED : - event = new QWinColorizationChangeEvent(QRgb(msg->wParam), msg->lParam); - break; - case WM_DWMCOMPOSITIONCHANGED : - event = new QWinCompositionChangeEvent(QtWin::isCompositionEnabled()); - break; - case WM_THEMECHANGED : - event = new QWinEvent(QWinEvent::ThemeChange); - break; - default : - if (tbButtonCreatedMsgId == msg->message) { - event = new QWinEvent(QWinEvent::TaskbarButtonCreated); - filterOut = true; - } - break; - } - - if (event) { - window = findWindow(msg->hwnd); - if (window) - QCoreApplication::sendEvent(window, event); - delete event; - } - - if (filterOut && result) { - *result = 0; - } - - return filterOut; -} - -void QWinEventFilter::setup() -{ - if (!instance) { - instance = new QWinEventFilter; - qApp->installNativeEventFilter(instance); - } -} - -QWindow *QWinEventFilter::findWindow(HWND handle) -{ - const WId wid = reinterpret_cast<WId>(handle); - const auto topLevels = QGuiApplication::topLevelWindows(); - for (QWindow *topLevel : topLevels) { - if (topLevel->handle() && topLevel->winId() == wid) - return topLevel; - } - return nullptr; -} diff --git a/src/winextras/qwineventfilter_p.h b/src/winextras/qwineventfilter_p.h deleted file mode 100644 index ad37177..0000000 --- a/src/winextras/qwineventfilter_p.h +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINEVENTFILTER_H -#define QWINEVENTFILTER_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QtWinExtras/qwinextrasglobal.h> -#include <QtCore/qabstractnativeeventfilter.h> -#include <QtCore/qt_windows.h> - -QT_BEGIN_NAMESPACE - -class QWindow; - -class Q_WINEXTRAS_EXPORT QWinEventFilter : public QAbstractNativeEventFilter -{ -public: - QWinEventFilter(); - ~QWinEventFilter(); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) override; -#else - bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override; -#endif - - static void setup(); - -private: - static QWinEventFilter *instance; - QWindow *findWindow(HWND); - UINT tbButtonCreatedMsgId; -}; - -QT_END_NAMESPACE - -#endif // QWINEVENTFILTER_H diff --git a/src/winextras/qwinextrasglobal.h b/src/winextras/qwinextrasglobal.h deleted file mode 100644 index e66326d..0000000 --- a/src/winextras/qwinextrasglobal.h +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWinExtras module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWINEXTRASGLOBAL_H -#define QWINEXTRASGLOBAL_H - -#include <QtCore/qglobal.h> - -QT_BEGIN_NAMESPACE - -#ifndef QT_STATIC -# if defined(QT_BUILD_WINEXTRAS_LIB) -# define Q_WINEXTRAS_EXPORT Q_DECL_EXPORT -# else -# define Q_WINEXTRAS_EXPORT Q_DECL_IMPORT -# endif -#else -# define Q_WINEXTRAS_EXPORT -#endif - -QT_END_NAMESPACE - -#endif // QWINEXTRASGLOBAL_H diff --git a/src/winextras/qwinfunctions.cpp b/src/winextras/qwinfunctions.cpp deleted file mode 100644 index b0e0ff4..0000000 --- a/src/winextras/qwinfunctions.cpp +++ /dev/null @@ -1,2111 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWinExtras module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#if defined(NTDDI_VERSION) && NTDDI_VERSION < 0x06010000 // NTDDI_WIN7 -# undef NTDDI_VERSION -#endif -#if !defined(NTDDI_VERSION) -# define NTDDI_VERSION 0x06010000 // Enable functions for MinGW -#endif - -#include "qwinfunctions.h" -#include "qwinfunctions_p.h" -#include "qwineventfilter_p.h" -#include "windowsguidsdefs_p.h" - -#include <QtGui/qguiapplication.h> -#include <QtGui/qwindow.h> -#include <QtGui/qpixmap.h> -#include <QtGui/qbitmap.h> -#include <QtGui/qimage.h> -#include <QtGui/qcolor.h> -#include <QtGui/qregion.h> -#include <QtCore/qmargins.h> -#include <QtCore/qsettings.h> - -#include <comdef.h> -#include "winshobjidl_p.h" - -QT_BEGIN_NAMESPACE - -Q_GUI_EXPORT HBITMAP qt_createIconMask(const QBitmap &bitmap); -Q_GUI_EXPORT HBITMAP qt_pixmapToWinHBITMAP(const QPixmap &p, int hbitmapFormat = 0); -Q_GUI_EXPORT QPixmap qt_pixmapFromWinHBITMAP(HBITMAP bitmap, int hbitmapFormat = 0); -Q_GUI_EXPORT HICON qt_pixmapToWinHICON(const QPixmap &p); -Q_GUI_EXPORT HBITMAP qt_imageToWinHBITMAP(const QImage &imageIn, int hbitmapFormat = 0); -Q_GUI_EXPORT QImage qt_imageFromWinHBITMAP(HBITMAP bitmap, int hbitmapFormat = 0); -Q_GUI_EXPORT QImage qt_imageFromWinHBITMAP(HDC hdc, HBITMAP bitmap, int w, int h); -Q_GUI_EXPORT QPixmap qt_pixmapFromWinHICON(HICON icon); - -/*! - \namespace QtWin - \inmodule QtWinExtras - \brief The QtWin namespace contains miscellaneous Windows-specific functions. - \inheaderfile QtWin - - */ - -/*! - \since 5.2 - - Creates a \c HBITMAP equivalent of the QBitmap \a bitmap. - - It is the caller's responsibility to free the \c HBITMAP data after use. - - \sa toHBITMAP() -*/ -HBITMAP QtWin::createMask(const QBitmap &bitmap) -{ - return qt_createIconMask(bitmap); -} - -/*! - \since 5.2 - - Creates a \c HBITMAP equivalent of the QPixmap \a p, - based on the given \a format. Returns the \c HBITMAP handle. - - It is the caller's responsibility to free the \c HBITMAP data - after use. - - \sa fromHBITMAP() -*/ -HBITMAP QtWin::toHBITMAP(const QPixmap &p, QtWin::HBitmapFormat format) -{ - return qt_pixmapToWinHBITMAP(p, format); -} - -/*! - \since 5.2 - - Returns a QPixmap that is equivalent to the - given \a bitmap. The conversion is based on the specified \a format. - - \sa toHBITMAP() -*/ -QPixmap QtWin::fromHBITMAP(HBITMAP bitmap, QtWin::HBitmapFormat format) -{ - return qt_pixmapFromWinHBITMAP(bitmap, format); -} - -/*! - \since 5.2 - - Creates a \c HICON equivalent of the QPixmap \a p. - Returns the \c HICON handle. - - It is the caller's responsibility to free the \c HICON data after use. - - \sa fromHICON() -*/ -HICON QtWin::toHICON(const QPixmap &p) -{ - return qt_pixmapToWinHICON(p); -} - -/*! - \since 5.12 - - Creates a \c HBITMAP equivalent of the QImage \a image, - based on the given \a format. Returns the \c HBITMAP handle. - - It is the caller's responsibility to free the \c HBITMAP data - after use. - - \sa imageFromHBITMAP() -*/ -HBITMAP QtWin::imageToHBITMAP(const QImage &image, QtWin::HBitmapFormat format) -{ - return qt_imageToWinHBITMAP(image, format); -} - -/*! - \since 5.2 - - Returns a QImage that is equivalent to the - given \a bitmap. The conversion is based on the specified \c HDC context \a hdc - using the specified \a width and \a height. - - \sa toHBITMAP() -*/ -QImage QtWin::imageFromHBITMAP(HDC hdc, HBITMAP bitmap, int width, int height) -{ - return qt_imageFromWinHBITMAP(hdc, bitmap, width, height); -} - -/*! - \since 5.12 - - Returns a QImage that is equivalent to the - given \a bitmap. The conversion is based on the specified \a format. - - \sa imageToHBITMAP() -*/ -QImage QtWin::imageFromHBITMAP(HBITMAP bitmap, QtWin::HBitmapFormat format) -{ - return qt_imageFromWinHBITMAP(bitmap, format); -} - -/*! - \since 5.2 - - Returns a QPixmap that is equivalent to the given \a icon. - - \sa toHICON() -*/ -QPixmap QtWin::fromHICON(HICON icon) -{ - return qt_pixmapFromWinHICON(icon); -} - -HRGN qt_RectToHRGN(const QRect &rc) -{ - return CreateRectRgn(rc.left(), rc.top(), rc.right()+1, rc.bottom()+1); -} - -/*! - \since 5.2 - \obsolete - - This function is equivalent to QRegion::toHRGN() - - \sa QRegion::toHRGN() - */ -HRGN QtWin::toHRGN(const QRegion ®ion) -{ - return region.toHRGN(); -} - -/*! - \since 5.2 - \obsolete - - This function is equivalent to QRegion::fromHRGN(). - - \sa QRegion::fromHRGN() - */ -QRegion QtWin::fromHRGN(HRGN hrgn) -{ - return QRegion::fromHRGN(hrgn); -} - -/*! - \since 5.2 - - Returns a message string that explains the \a hresult error id specified or - an empty string if the explanation cannot be found. - */ -QString QtWin::stringFromHresult(HRESULT hresult) -{ - _com_error error(hresult); - return QString::fromWCharArray(error.ErrorMessage()); -} - -/*! - \since 5.2 - - Returns the code name of the \a hresult error id specified (usually the name - of the WinAPI macro) or an empty string if the message is unknown. - */ -QString QtWin::errorStringFromHresult(HRESULT hresult) -{ - switch (hresult) { - case HRESULT(0x8000FFFF) : return QStringLiteral("E_UNEXPECTED"); - case HRESULT(0x80004001) : return QStringLiteral("E_NOTIMPL"); - case HRESULT(0x8007000E) : return QStringLiteral("E_OUTOFMEMORY"); - case HRESULT(0x80070057) : return QStringLiteral("E_INVALIDARG"); - case HRESULT(0x80004002) : return QStringLiteral("E_NOINTERFACE"); - case HRESULT(0x80004003) : return QStringLiteral("E_POINTER"); - case HRESULT(0x80070006) : return QStringLiteral("E_HANDLE"); - case HRESULT(0x80004004) : return QStringLiteral("E_ABORT"); - case HRESULT(0x80004005) : return QStringLiteral("E_FAIL"); - case HRESULT(0x80070005) : return QStringLiteral("E_ACCESSDENIED"); - case HRESULT(0x8000000A) : return QStringLiteral("E_PENDING"); - case HRESULT(0x80004006) : return QStringLiteral("CO_E_INIT_TLS"); - case HRESULT(0x80004007) : return QStringLiteral("CO_E_INIT_SHARED_ALLOCATOR"); - case HRESULT(0x80004008) : return QStringLiteral("CO_E_INIT_MEMORY_ALLOCATOR"); - case HRESULT(0x80004009) : return QStringLiteral("CO_E_INIT_CLASS_CACHE"); - case HRESULT(0x8000400A) : return QStringLiteral("CO_E_INIT_RPC_CHANNEL"); - case HRESULT(0x8000400B) : return QStringLiteral("CO_E_INIT_TLS_SET_CHANNEL_CONTROL"); - case HRESULT(0x8000400C) : return QStringLiteral("CO_E_INIT_TLS_CHANNEL_CONTROL"); - case HRESULT(0x8000400D) : return QStringLiteral("CO_E_INIT_UNACCEPTED_USER_ALLOCATOR"); - case HRESULT(0x8000400E) : return QStringLiteral("CO_E_INIT_SCM_MUTEX_EXISTS"); - case HRESULT(0x8000400F) : return QStringLiteral("CO_E_INIT_SCM_FILE_MAPPING_EXISTS"); - case HRESULT(0x80004010) : return QStringLiteral("CO_E_INIT_SCM_MAP_VIEW_OF_FILE"); - case HRESULT(0x80004011) : return QStringLiteral("CO_E_INIT_SCM_EXEC_FAILURE"); - case HRESULT(0x80004012) : return QStringLiteral("CO_E_INIT_ONLY_SINGLE_THREADED"); - case HRESULT(0x80004013) : return QStringLiteral("CO_E_CANT_REMOTE"); - case HRESULT(0x80004014) : return QStringLiteral("CO_E_BAD_SERVER_NAME"); - case HRESULT(0x80004015) : return QStringLiteral("CO_E_WRONG_SERVER_IDENTITY"); - case HRESULT(0x80004016) : return QStringLiteral("CO_E_OLE1DDE_DISABLED"); - case HRESULT(0x80004017) : return QStringLiteral("CO_E_RUNAS_SYNTAX"); - case HRESULT(0x80004018) : return QStringLiteral("CO_E_CREATEPROCESS_FAILURE"); - case HRESULT(0x80004019) : return QStringLiteral("CO_E_RUNAS_CREATEPROCESS_FAILURE"); - case HRESULT(0x8000401A) : return QStringLiteral("CO_E_RUNAS_LOGON_FAILURE"); - case HRESULT(0x8000401B) : return QStringLiteral("CO_E_LAUNCH_PERMSSION_DENIED"); - case HRESULT(0x8000401C) : return QStringLiteral("CO_E_START_SERVICE_FAILURE"); - case HRESULT(0x8000401D) : return QStringLiteral("CO_E_REMOTE_COMMUNICATION_FAILURE"); - case HRESULT(0x8000401E) : return QStringLiteral("CO_E_SERVER_START_TIMEOUT"); - case HRESULT(0x8000401F) : return QStringLiteral("CO_E_CLSREG_INCONSISTENT"); - case HRESULT(0x80004020) : return QStringLiteral("CO_E_IIDREG_INCONSISTENT"); - case HRESULT(0x80004021) : return QStringLiteral("CO_E_NOT_SUPPORTED"); - case HRESULT(0x80004022) : return QStringLiteral("CO_E_RELOAD_DLL"); - case HRESULT(0x80004023) : return QStringLiteral("CO_E_MSI_ERROR"); - case HRESULT(0x80004024) : return QStringLiteral("CO_E_ATTEMPT_TO_CREATE_OUTSIDE_CLIENT_CONTEXT"); - case HRESULT(0x80004025) : return QStringLiteral("CO_E_SERVER_PAUSED"); - case HRESULT(0x80004026) : return QStringLiteral("CO_E_SERVER_NOT_PAUSED"); - case HRESULT(0x80004027) : return QStringLiteral("CO_E_CLASS_DISABLED"); - case HRESULT(0x80004028) : return QStringLiteral("CO_E_CLRNOTAVAILABLE"); - case HRESULT(0x80004029) : return QStringLiteral("CO_E_ASYNC_WORK_REJECTED"); - case HRESULT(0x8000402A) : return QStringLiteral("CO_E_SERVER_INIT_TIMEOUT"); - case HRESULT(0x8000402B) : return QStringLiteral("CO_E_NO_SECCTX_IN_ACTIVATE"); - case HRESULT(0x80004030) : return QStringLiteral("CO_E_TRACKER_CONFIG"); - case HRESULT(0x80004031) : return QStringLiteral("CO_E_THREADPOOL_CONFIG"); - case HRESULT(0x80004032) : return QStringLiteral("CO_E_SXS_CONFIG"); - case HRESULT(0x80004033) : return QStringLiteral("CO_E_MALFORMED_SPN"); - case HRESULT(0x80040000) : return QStringLiteral("OLE_E_OLEVERB"); - case HRESULT(0x80040001) : return QStringLiteral("OLE_E_ADVF"); - case HRESULT(0x80040002) : return QStringLiteral("OLE_E_ENUM_NOMORE"); - case HRESULT(0x80040003) : return QStringLiteral("OLE_E_ADVISENOTSUPPORTED"); - case HRESULT(0x80040004) : return QStringLiteral("OLE_E_NOCONNECTION"); - case HRESULT(0x80040005) : return QStringLiteral("OLE_E_NOTRUNNING"); - case HRESULT(0x80040006) : return QStringLiteral("OLE_E_NOCACHE"); - case HRESULT(0x80040007) : return QStringLiteral("OLE_E_BLANK"); - case HRESULT(0x80040008) : return QStringLiteral("OLE_E_CLASSDIFF"); - case HRESULT(0x80040009) : return QStringLiteral("OLE_E_CANT_GETMONIKER"); - case HRESULT(0x8004000A) : return QStringLiteral("OLE_E_CANT_BINDTOSOURCE"); - case HRESULT(0x8004000B) : return QStringLiteral("OLE_E_STATIC"); - case HRESULT(0x8004000C) : return QStringLiteral("OLE_E_PROMPTSAVECANCELLED"); - case HRESULT(0x8004000D) : return QStringLiteral("OLE_E_INVALIDRECT"); - case HRESULT(0x8004000E) : return QStringLiteral("OLE_E_WRONGCOMPOBJ"); - case HRESULT(0x8004000F) : return QStringLiteral("OLE_E_INVALIDHWND"); - case HRESULT(0x80040010) : return QStringLiteral("OLE_E_NOT_INPLACEACTIVE"); - case HRESULT(0x80040011) : return QStringLiteral("OLE_E_CANTCONVERT"); - case HRESULT(0x80040012) : return QStringLiteral("OLE_E_NOSTORAGE"); - case HRESULT(0x80040064) : return QStringLiteral("DV_E_FORMATETC"); - case HRESULT(0x80040065) : return QStringLiteral("DV_E_DVTARGETDEVICE"); - case HRESULT(0x80040066) : return QStringLiteral("DV_E_STGMEDIUM"); - case HRESULT(0x80040067) : return QStringLiteral("DV_E_STATDATA"); - case HRESULT(0x80040068) : return QStringLiteral("DV_E_LINDEX"); - case HRESULT(0x80040069) : return QStringLiteral("DV_E_TYMED"); - case HRESULT(0x8004006A) : return QStringLiteral("DV_E_CLIPFORMAT"); - case HRESULT(0x8004006B) : return QStringLiteral("DV_E_DVASPECT"); - case HRESULT(0x8004006C) : return QStringLiteral("DV_E_DVTARGETDEVICE_SIZE"); - case HRESULT(0x8004006D) : return QStringLiteral("DV_E_NOIVIEWOBJECT"); - case HRESULT(0x80040100) : return QStringLiteral("DRAGDROP_E_NOTREGISTERED"); - case HRESULT(0x80040101) : return QStringLiteral("DRAGDROP_E_ALREADYREGISTERED"); - case HRESULT(0x80040102) : return QStringLiteral("DRAGDROP_E_INVALIDHWND"); - case HRESULT(0x80040110) : return QStringLiteral("CLASS_E_NOAGGREGATION"); - case HRESULT(0x80040111) : return QStringLiteral("CLASS_E_CLASSNOTAVAILABLE"); - case HRESULT(0x80040112) : return QStringLiteral("CLASS_E_NOTLICENSED"); - case HRESULT(0x80040140) : return QStringLiteral("VIEW_E_DRAW"); - case HRESULT(0x80040150) : return QStringLiteral("REGDB_E_READREGDB"); - case HRESULT(0x80040151) : return QStringLiteral("REGDB_E_WRITEREGDB"); - case HRESULT(0x80040152) : return QStringLiteral("REGDB_E_KEYMISSING"); - case HRESULT(0x80040153) : return QStringLiteral("REGDB_E_INVALIDVALUE"); - case HRESULT(0x80040154) : return QStringLiteral("REGDB_E_CLASSNOTREG"); - case HRESULT(0x80040155) : return QStringLiteral("REGDB_E_IIDNOTREG"); - case HRESULT(0x80040156) : return QStringLiteral("REGDB_E_BADTHREADINGMODEL"); - case HRESULT(0x80040160) : return QStringLiteral("CAT_E_CATIDNOEXIST"); - case HRESULT(0x80040161) : return QStringLiteral("CAT_E_NODESCRIPTION"); - case HRESULT(0x80040164) : return QStringLiteral("CS_E_PACKAGE_NOTFOUND"); - case HRESULT(0x80040165) : return QStringLiteral("CS_E_NOT_DELETABLE"); - case HRESULT(0x80040166) : return QStringLiteral("CS_E_CLASS_NOTFOUND"); - case HRESULT(0x80040167) : return QStringLiteral("CS_E_INVALID_VERSION"); - case HRESULT(0x80040168) : return QStringLiteral("CS_E_NO_CLASSSTORE"); - case HRESULT(0x80040169) : return QStringLiteral("CS_E_OBJECT_NOTFOUND"); - case HRESULT(0x8004016A) : return QStringLiteral("CS_E_OBJECT_ALREADY_EXISTS"); - case HRESULT(0x8004016B) : return QStringLiteral("CS_E_INVALID_PATH"); - case HRESULT(0x8004016C) : return QStringLiteral("CS_E_NETWORK_ERROR"); - case HRESULT(0x8004016D) : return QStringLiteral("CS_E_ADMIN_LIMIT_EXCEEDED"); - case HRESULT(0x8004016E) : return QStringLiteral("CS_E_SCHEMA_MISMATCH"); - case HRESULT(0x8004016F) : return QStringLiteral("CS_E_INTERNAL_ERROR"); - case HRESULT(0x80040170) : return QStringLiteral("CACHE_E_NOCACHE_UPDATED"); - case HRESULT(0x80040180) : return QStringLiteral("OLEOBJ_E_NOVERBS"); - case HRESULT(0x80040181) : return QStringLiteral("OLEOBJ_E_INVALIDVERB"); - case HRESULT(0x800401A0) : return QStringLiteral("INPLACE_E_NOTUNDOABLE"); - case HRESULT(0x800401A1) : return QStringLiteral("INPLACE_E_NOTOOLSPACE"); - case HRESULT(0x800401C0) : return QStringLiteral("CONVERT10_E_OLESTREAM_GET"); - case HRESULT(0x800401C1) : return QStringLiteral("CONVERT10_E_OLESTREAM_PUT"); - case HRESULT(0x800401C2) : return QStringLiteral("CONVERT10_E_OLESTREAM_FMT"); - case HRESULT(0x800401C3) : return QStringLiteral("CONVERT10_E_OLESTREAM_BITMAP_TO_DIB"); - case HRESULT(0x800401C4) : return QStringLiteral("CONVERT10_E_STG_FMT"); - case HRESULT(0x800401C5) : return QStringLiteral("CONVERT10_E_STG_NO_STD_STREAM"); - case HRESULT(0x800401C6) : return QStringLiteral("CONVERT10_E_STG_DIB_TO_BITMAP"); - case HRESULT(0x800401D0) : return QStringLiteral("CLIPBRD_E_CANT_OPEN"); - case HRESULT(0x800401D1) : return QStringLiteral("CLIPBRD_E_CANT_EMPTY"); - case HRESULT(0x800401D2) : return QStringLiteral("CLIPBRD_E_CANT_SET"); - case HRESULT(0x800401D3) : return QStringLiteral("CLIPBRD_E_BAD_DATA"); - case HRESULT(0x800401D4) : return QStringLiteral("CLIPBRD_E_CANT_CLOSE"); - case HRESULT(0x800401E0) : return QStringLiteral("MK_E_CONNECTMANUALLY"); - case HRESULT(0x800401E1) : return QStringLiteral("MK_E_EXCEEDEDDEADLINE"); - case HRESULT(0x800401E2) : return QStringLiteral("MK_E_NEEDGENERIC"); - case HRESULT(0x800401E3) : return QStringLiteral("MK_E_UNAVAILABLE"); - case HRESULT(0x800401E4) : return QStringLiteral("MK_E_SYNTAX"); - case HRESULT(0x800401E5) : return QStringLiteral("MK_E_NOOBJECT"); - case HRESULT(0x800401E6) : return QStringLiteral("MK_E_INVALIDEXTENSION"); - case HRESULT(0x800401E7) : return QStringLiteral("MK_E_INTERMEDIATEINTERFACENOTSUPPORTED"); - case HRESULT(0x800401E8) : return QStringLiteral("MK_E_NOTBINDABLE"); - case HRESULT(0x800401E9) : return QStringLiteral("MK_E_NOTBOUND"); - case HRESULT(0x800401EA) : return QStringLiteral("MK_E_CANTOPENFILE"); - case HRESULT(0x800401EB) : return QStringLiteral("MK_E_MUSTBOTHERUSER"); - case HRESULT(0x800401EC) : return QStringLiteral("MK_E_NOINVERSE"); - case HRESULT(0x800401ED) : return QStringLiteral("MK_E_NOSTORAGE"); - case HRESULT(0x800401EE) : return QStringLiteral("MK_E_NOPREFIX"); - case HRESULT(0x800401EF) : return QStringLiteral("MK_E_ENUMERATION_FAILED"); - case HRESULT(0x800401F0) : return QStringLiteral("CO_E_NOTINITIALIZED"); - case HRESULT(0x800401F1) : return QStringLiteral("CO_E_ALREADYINITIALIZED"); - case HRESULT(0x800401F2) : return QStringLiteral("CO_E_CANTDETERMINECLASS"); - case HRESULT(0x800401F3) : return QStringLiteral("CO_E_CLASSSTRING"); - case HRESULT(0x800401F4) : return QStringLiteral("CO_E_IIDSTRING"); - case HRESULT(0x800401F5) : return QStringLiteral("CO_E_APPNOTFOUND"); - case HRESULT(0x800401F6) : return QStringLiteral("CO_E_APPSINGLEUSE"); - case HRESULT(0x800401F7) : return QStringLiteral("CO_E_ERRORINAPP"); - case HRESULT(0x800401F8) : return QStringLiteral("CO_E_DLLNOTFOUND"); - case HRESULT(0x800401F9) : return QStringLiteral("CO_E_ERRORINDLL"); - case HRESULT(0x800401FA) : return QStringLiteral("CO_E_WRONGOSFORAPP"); - case HRESULT(0x800401FB) : return QStringLiteral("CO_E_OBJNOTREG"); - case HRESULT(0x800401FC) : return QStringLiteral("CO_E_OBJISREG"); - case HRESULT(0x800401FD) : return QStringLiteral("CO_E_OBJNOTCONNECTED"); - case HRESULT(0x800401FE) : return QStringLiteral("CO_E_APPDIDNTREG"); - case HRESULT(0x800401FF) : return QStringLiteral("CO_E_RELEASED"); - case HRESULT(0x00040200) : return QStringLiteral("EVENT_S_SOME_SUBSCRIBERS_FAILED"); - case HRESULT(0x80040201) : return QStringLiteral("EVENT_E_ALL_SUBSCRIBERS_FAILED"); - case HRESULT(0x00040202) : return QStringLiteral("EVENT_S_NOSUBSCRIBERS"); - case HRESULT(0x80040203) : return QStringLiteral("EVENT_E_QUERYSYNTAX"); - case HRESULT(0x80040204) : return QStringLiteral("EVENT_E_QUERYFIELD"); - case HRESULT(0x80040205) : return QStringLiteral("EVENT_E_INTERNALEXCEPTION"); - case HRESULT(0x80040206) : return QStringLiteral("EVENT_E_INTERNALERROR"); - case HRESULT(0x80040207) : return QStringLiteral("EVENT_E_INVALID_PER_USER_SID"); - case HRESULT(0x80040208) : return QStringLiteral("EVENT_E_USER_EXCEPTION"); - case HRESULT(0x80040209) : return QStringLiteral("EVENT_E_TOO_MANY_METHODS"); - case HRESULT(0x8004020A) : return QStringLiteral("EVENT_E_MISSING_EVENTCLASS"); - case HRESULT(0x8004020B) : return QStringLiteral("EVENT_E_NOT_ALL_REMOVED"); - case HRESULT(0x8004020C) : return QStringLiteral("EVENT_E_COMPLUS_NOT_INSTALLED"); - case HRESULT(0x8004020D) : return QStringLiteral("EVENT_E_CANT_MODIFY_OR_DELETE_UNCONFIGURED_OBJECT"); - case HRESULT(0x8004020E) : return QStringLiteral("EVENT_E_CANT_MODIFY_OR_DELETE_CONFIGURED_OBJECT"); - case HRESULT(0x8004020F) : return QStringLiteral("EVENT_E_INVALID_EVENT_CLASS_PARTITION"); - case HRESULT(0x80040210) : return QStringLiteral("EVENT_E_PER_USER_SID_NOT_LOGGED_ON"); - case HRESULT(0x8004D000) : return QStringLiteral("XACT_E_ALREADYOTHERSINGLEPHASE"); - case HRESULT(0x8004D001) : return QStringLiteral("XACT_E_CANTRETAIN"); - case HRESULT(0x8004D002) : return QStringLiteral("XACT_E_COMMITFAILED"); - case HRESULT(0x8004D003) : return QStringLiteral("XACT_E_COMMITPREVENTED"); - case HRESULT(0x8004D004) : return QStringLiteral("XACT_E_HEURISTICABORT"); - case HRESULT(0x8004D005) : return QStringLiteral("XACT_E_HEURISTICCOMMIT"); - case HRESULT(0x8004D006) : return QStringLiteral("XACT_E_HEURISTICDAMAGE"); - case HRESULT(0x8004D007) : return QStringLiteral("XACT_E_HEURISTICDANGER"); - case HRESULT(0x8004D008) : return QStringLiteral("XACT_E_ISOLATIONLEVEL"); - case HRESULT(0x8004D009) : return QStringLiteral("XACT_E_NOASYNC"); - case HRESULT(0x8004D00A) : return QStringLiteral("XACT_E_NOENLIST"); - case HRESULT(0x8004D00B) : return QStringLiteral("XACT_E_NOISORETAIN"); - case HRESULT(0x8004D00C) : return QStringLiteral("XACT_E_NORESOURCE"); - case HRESULT(0x8004D00D) : return QStringLiteral("XACT_E_NOTCURRENT"); - case HRESULT(0x8004D00E) : return QStringLiteral("XACT_E_NOTRANSACTION"); - case HRESULT(0x8004D00F) : return QStringLiteral("XACT_E_NOTSUPPORTED"); - case HRESULT(0x8004D010) : return QStringLiteral("XACT_E_UNKNOWNRMGRID"); - case HRESULT(0x8004D011) : return QStringLiteral("XACT_E_WRONGSTATE"); - case HRESULT(0x8004D012) : return QStringLiteral("XACT_E_WRONGUOW"); - case HRESULT(0x8004D013) : return QStringLiteral("XACT_E_XTIONEXISTS"); - case HRESULT(0x8004D014) : return QStringLiteral("XACT_E_NOIMPORTOBJECT"); - case HRESULT(0x8004D015) : return QStringLiteral("XACT_E_INVALIDCOOKIE"); - case HRESULT(0x8004D016) : return QStringLiteral("XACT_E_INDOUBT"); - case HRESULT(0x8004D017) : return QStringLiteral("XACT_E_NOTIMEOUT"); - case HRESULT(0x8004D018) : return QStringLiteral("XACT_E_ALREADYINPROGRESS"); - case HRESULT(0x8004D019) : return QStringLiteral("XACT_E_ABORTED"); - case HRESULT(0x8004D01A) : return QStringLiteral("XACT_E_LOGFULL"); - case HRESULT(0x8004D01B) : return QStringLiteral("XACT_E_TMNOTAVAILABLE"); - case HRESULT(0x8004D01C) : return QStringLiteral("XACT_E_CONNECTION_DOWN"); - case HRESULT(0x8004D01D) : return QStringLiteral("XACT_E_CONNECTION_DENIED"); - case HRESULT(0x8004D01E) : return QStringLiteral("XACT_E_REENLISTTIMEOUT"); - case HRESULT(0x8004D01F) : return QStringLiteral("XACT_E_TIP_CONNECT_FAILED"); - case HRESULT(0x8004D020) : return QStringLiteral("XACT_E_TIP_PROTOCOL_ERROR"); - case HRESULT(0x8004D021) : return QStringLiteral("XACT_E_TIP_PULL_FAILED"); - case HRESULT(0x8004D022) : return QStringLiteral("XACT_E_DEST_TMNOTAVAILABLE"); - case HRESULT(0x8004D023) : return QStringLiteral("XACT_E_TIP_DISABLED"); - case HRESULT(0x8004D024) : return QStringLiteral("XACT_E_NETWORK_TX_DISABLED"); - case HRESULT(0x8004D025) : return QStringLiteral("XACT_E_PARTNER_NETWORK_TX_DISABLED"); - case HRESULT(0x8004D026) : return QStringLiteral("XACT_E_XA_TX_DISABLED"); - case HRESULT(0x8004D027) : return QStringLiteral("XACT_E_UNABLE_TO_READ_DTC_CONFIG"); - case HRESULT(0x8004D028) : return QStringLiteral("XACT_E_UNABLE_TO_LOAD_DTC_PROXY"); - case HRESULT(0x8004D029) : return QStringLiteral("XACT_E_ABORTING"); - case HRESULT(0x8004D080) : return QStringLiteral("XACT_E_CLERKNOTFOUND"); - case HRESULT(0x8004D081) : return QStringLiteral("XACT_E_CLERKEXISTS"); - case HRESULT(0x8004D082) : return QStringLiteral("XACT_E_RECOVERYINPROGRESS"); - case HRESULT(0x8004D083) : return QStringLiteral("XACT_E_TRANSACTIONCLOSED"); - case HRESULT(0x8004D084) : return QStringLiteral("XACT_E_INVALIDLSN"); - case HRESULT(0x8004D085) : return QStringLiteral("XACT_E_REPLAYREQUEST"); - case HRESULT(0x0004D000) : return QStringLiteral("XACT_S_ASYNC"); - case HRESULT(0x0004D001) : return QStringLiteral("XACT_S_DEFECT"); - case HRESULT(0x0004D002) : return QStringLiteral("XACT_S_READONLY"); - case HRESULT(0x0004D003) : return QStringLiteral("XACT_S_SOMENORETAIN"); - case HRESULT(0x0004D004) : return QStringLiteral("XACT_S_OKINFORM"); - case HRESULT(0x0004D005) : return QStringLiteral("XACT_S_MADECHANGESCONTENT"); - case HRESULT(0x0004D006) : return QStringLiteral("XACT_S_MADECHANGESINFORM"); - case HRESULT(0x0004D007) : return QStringLiteral("XACT_S_ALLNORETAIN"); - case HRESULT(0x0004D008) : return QStringLiteral("XACT_S_ABORTING"); - case HRESULT(0x0004D009) : return QStringLiteral("XACT_S_SINGLEPHASE"); - case HRESULT(0x0004D00A) : return QStringLiteral("XACT_S_LOCALLY_OK"); - case HRESULT(0x0004D010) : return QStringLiteral("XACT_S_LASTRESOURCEMANAGER"); - case HRESULT(0x8004E002) : return QStringLiteral("CONTEXT_E_ABORTED"); - case HRESULT(0x8004E003) : return QStringLiteral("CONTEXT_E_ABORTING"); - case HRESULT(0x8004E004) : return QStringLiteral("CONTEXT_E_NOCONTEXT"); - case HRESULT(0x8004E005) : return QStringLiteral("CONTEXT_E_WOULD_DEADLOCK"); - case HRESULT(0x8004E006) : return QStringLiteral("CONTEXT_E_SYNCH_TIMEOUT"); - case HRESULT(0x8004E007) : return QStringLiteral("CONTEXT_E_OLDREF"); - case HRESULT(0x8004E00C) : return QStringLiteral("CONTEXT_E_ROLENOTFOUND"); - case HRESULT(0x8004E00F) : return QStringLiteral("CONTEXT_E_TMNOTAVAILABLE"); - case HRESULT(0x8004E021) : return QStringLiteral("CO_E_ACTIVATIONFAILED"); - case HRESULT(0x8004E022) : return QStringLiteral("CO_E_ACTIVATIONFAILED_EVENTLOGGED"); - case HRESULT(0x8004E023) : return QStringLiteral("CO_E_ACTIVATIONFAILED_CATALOGERROR"); - case HRESULT(0x8004E024) : return QStringLiteral("CO_E_ACTIVATIONFAILED_TIMEOUT"); - case HRESULT(0x8004E025) : return QStringLiteral("CO_E_INITIALIZATIONFAILED"); - case HRESULT(0x8004E026) : return QStringLiteral("CONTEXT_E_NOJIT"); - case HRESULT(0x8004E027) : return QStringLiteral("CONTEXT_E_NOTRANSACTION"); - case HRESULT(0x8004E028) : return QStringLiteral("CO_E_THREADINGMODEL_CHANGED"); - case HRESULT(0x8004E029) : return QStringLiteral("CO_E_NOIISINTRINSICS"); - case HRESULT(0x8004E02A) : return QStringLiteral("CO_E_NOCOOKIES"); - case HRESULT(0x8004E02B) : return QStringLiteral("CO_E_DBERROR"); - case HRESULT(0x8004E02C) : return QStringLiteral("CO_E_NOTPOOLED"); - case HRESULT(0x8004E02D) : return QStringLiteral("CO_E_NOTCONSTRUCTED"); - case HRESULT(0x8004E02E) : return QStringLiteral("CO_E_NOSYNCHRONIZATION"); - case HRESULT(0x8004E02F) : return QStringLiteral("CO_E_ISOLEVELMISMATCH"); - case HRESULT(0x00040000) : return QStringLiteral("OLE_S_USEREG"); - case HRESULT(0x00040001) : return QStringLiteral("OLE_S_STATIC"); - case HRESULT(0x00040002) : return QStringLiteral("OLE_S_MAC_CLIPFORMAT"); - case HRESULT(0x00040100) : return QStringLiteral("DRAGDROP_S_DROP"); - case HRESULT(0x00040101) : return QStringLiteral("DRAGDROP_S_CANCEL"); - case HRESULT(0x00040102) : return QStringLiteral("DRAGDROP_S_USEDEFAULTCURSORS"); - case HRESULT(0x00040130) : return QStringLiteral("DATA_S_SAMEFORMATETC"); - case HRESULT(0x00040140) : return QStringLiteral("VIEW_S_ALREADY_FROZEN"); - case HRESULT(0x00040170) : return QStringLiteral("CACHE_S_FORMATETC_NOTSUPPORTED"); - case HRESULT(0x00040171) : return QStringLiteral("CACHE_S_SAMECACHE"); - case HRESULT(0x00040172) : return QStringLiteral("CACHE_S_SOMECACHES_NOTUPDATED"); - case HRESULT(0x00040180) : return QStringLiteral("OLEOBJ_S_INVALIDVERB"); - case HRESULT(0x00040181) : return QStringLiteral("OLEOBJ_S_CANNOT_DOVERB_NOW"); - case HRESULT(0x00040182) : return QStringLiteral("OLEOBJ_S_INVALIDHWND"); - case HRESULT(0x000401A0) : return QStringLiteral("INPLACE_S_TRUNCATED"); - case HRESULT(0x000401C0) : return QStringLiteral("CONVERT10_S_NO_PRESENTATION"); - case HRESULT(0x000401E2) : return QStringLiteral("MK_S_REDUCED_TO_SELF"); - case HRESULT(0x000401E4) : return QStringLiteral("MK_S_ME"); - case HRESULT(0x000401E5) : return QStringLiteral("MK_S_HIM"); - case HRESULT(0x000401E6) : return QStringLiteral("MK_S_US"); - case HRESULT(0x000401E7) : return QStringLiteral("MK_S_MONIKERALREADYREGISTERED"); - case HRESULT(0x00041300) : return QStringLiteral("SCHED_S_TASK_READY"); - case HRESULT(0x00041301) : return QStringLiteral("SCHED_S_TASK_RUNNING"); - case HRESULT(0x00041302) : return QStringLiteral("SCHED_S_TASK_DISABLED"); - case HRESULT(0x00041303) : return QStringLiteral("SCHED_S_TASK_HAS_NOT_RUN"); - case HRESULT(0x00041304) : return QStringLiteral("SCHED_S_TASK_NO_MORE_RUNS"); - case HRESULT(0x00041305) : return QStringLiteral("SCHED_S_TASK_NOT_SCHEDULED"); - case HRESULT(0x00041306) : return QStringLiteral("SCHED_S_TASK_TERMINATED"); - case HRESULT(0x00041307) : return QStringLiteral("SCHED_S_TASK_NO_VALID_TRIGGERS"); - case HRESULT(0x00041308) : return QStringLiteral("SCHED_S_EVENT_TRIGGER"); - case HRESULT(0x80041309) : return QStringLiteral("SCHED_E_TRIGGER_NOT_FOUND"); - case HRESULT(0x8004130A) : return QStringLiteral("SCHED_E_TASK_NOT_READY"); - case HRESULT(0x8004130B) : return QStringLiteral("SCHED_E_TASK_NOT_RUNNING"); - case HRESULT(0x8004130C) : return QStringLiteral("SCHED_E_SERVICE_NOT_INSTALLED"); - case HRESULT(0x8004130D) : return QStringLiteral("SCHED_E_CANNOT_OPEN_TASK"); - case HRESULT(0x8004130E) : return QStringLiteral("SCHED_E_INVALID_TASK"); - case HRESULT(0x8004130F) : return QStringLiteral("SCHED_E_ACCOUNT_INFORMATION_NOT_SET"); - case HRESULT(0x80041310) : return QStringLiteral("SCHED_E_ACCOUNT_NAME_NOT_FOUND"); - case HRESULT(0x80041311) : return QStringLiteral("SCHED_E_ACCOUNT_DBASE_CORRUPT"); - case HRESULT(0x80041312) : return QStringLiteral("SCHED_E_NO_SECURITY_SERVICES"); - case HRESULT(0x80041313) : return QStringLiteral("SCHED_E_UNKNOWN_OBJECT_VERSION"); - case HRESULT(0x80041314) : return QStringLiteral("SCHED_E_UNSUPPORTED_ACCOUNT_OPTION"); - case HRESULT(0x80041315) : return QStringLiteral("SCHED_E_SERVICE_NOT_RUNNING"); - case HRESULT(0x80080001) : return QStringLiteral("CO_E_CLASS_CREATE_FAILED"); - case HRESULT(0x80080002) : return QStringLiteral("CO_E_SCM_ERROR"); - case HRESULT(0x80080003) : return QStringLiteral("CO_E_SCM_RPC_FAILURE"); - case HRESULT(0x80080004) : return QStringLiteral("CO_E_BAD_PATH"); - case HRESULT(0x80080005) : return QStringLiteral("CO_E_SERVER_EXEC_FAILURE"); - case HRESULT(0x80080006) : return QStringLiteral("CO_E_OBJSRV_RPC_FAILURE"); - case HRESULT(0x80080007) : return QStringLiteral("MK_E_NO_NORMALIZED"); - case HRESULT(0x80080008) : return QStringLiteral("CO_E_SERVER_STOPPING"); - case HRESULT(0x80080009) : return QStringLiteral("MEM_E_INVALID_ROOT"); - case HRESULT(0x80080010) : return QStringLiteral("MEM_E_INVALID_LINK"); - case HRESULT(0x80080011) : return QStringLiteral("MEM_E_INVALID_SIZE"); - case HRESULT(0x00080012) : return QStringLiteral("CO_S_NOTALLINTERFACES"); - case HRESULT(0x00080013) : return QStringLiteral("CO_S_MACHINENAMENOTFOUND"); - case HRESULT(0x80020001) : return QStringLiteral("DISP_E_UNKNOWNINTERFACE"); - case HRESULT(0x80020003) : return QStringLiteral("DISP_E_MEMBERNOTFOUND"); - case HRESULT(0x80020004) : return QStringLiteral("DISP_E_PARAMNOTFOUND"); - case HRESULT(0x80020005) : return QStringLiteral("DISP_E_TYPEMISMATCH"); - case HRESULT(0x80020006) : return QStringLiteral("DISP_E_UNKNOWNNAME"); - case HRESULT(0x80020007) : return QStringLiteral("DISP_E_NONAMEDARGS"); - case HRESULT(0x80020008) : return QStringLiteral("DISP_E_BADVARTYPE"); - case HRESULT(0x80020009) : return QStringLiteral("DISP_E_EXCEPTION"); - case HRESULT(0x8002000A) : return QStringLiteral("DISP_E_OVERFLOW"); - case HRESULT(0x8002000B) : return QStringLiteral("DISP_E_BADINDEX"); - case HRESULT(0x8002000C) : return QStringLiteral("DISP_E_UNKNOWNLCID"); - case HRESULT(0x8002000D) : return QStringLiteral("DISP_E_ARRAYISLOCKED"); - case HRESULT(0x8002000E) : return QStringLiteral("DISP_E_BADPARAMCOUNT"); - case HRESULT(0x8002000F) : return QStringLiteral("DISP_E_PARAMNOTOPTIONAL"); - case HRESULT(0x80020010) : return QStringLiteral("DISP_E_BADCALLEE"); - case HRESULT(0x80020011) : return QStringLiteral("DISP_E_NOTACOLLECTION"); - case HRESULT(0x80020012) : return QStringLiteral("DISP_E_DIVBYZERO"); - case HRESULT(0x80020013) : return QStringLiteral("DISP_E_BUFFERTOOSMALL"); - case HRESULT(0x80028016) : return QStringLiteral("TYPE_E_BUFFERTOOSMALL"); - case HRESULT(0x80028017) : return QStringLiteral("TYPE_E_FIELDNOTFOUND"); - case HRESULT(0x80028018) : return QStringLiteral("TYPE_E_INVDATAREAD"); - case HRESULT(0x80028019) : return QStringLiteral("TYPE_E_UNSUPFORMAT"); - case HRESULT(0x8002801C) : return QStringLiteral("TYPE_E_REGISTRYACCESS"); - case HRESULT(0x8002801D) : return QStringLiteral("TYPE_E_LIBNOTREGISTERED"); - case HRESULT(0x80028027) : return QStringLiteral("TYPE_E_UNDEFINEDTYPE"); - case HRESULT(0x80028028) : return QStringLiteral("TYPE_E_QUALIFIEDNAMEDISALLOWED"); - case HRESULT(0x80028029) : return QStringLiteral("TYPE_E_INVALIDSTATE"); - case HRESULT(0x8002802A) : return QStringLiteral("TYPE_E_WRONGTYPEKIND"); - case HRESULT(0x8002802B) : return QStringLiteral("TYPE_E_ELEMENTNOTFOUND"); - case HRESULT(0x8002802C) : return QStringLiteral("TYPE_E_AMBIGUOUSNAME"); - case HRESULT(0x8002802D) : return QStringLiteral("TYPE_E_NAMECONFLICT"); - case HRESULT(0x8002802E) : return QStringLiteral("TYPE_E_UNKNOWNLCID"); - case HRESULT(0x8002802F) : return QStringLiteral("TYPE_E_DLLFUNCTIONNOTFOUND"); - case HRESULT(0x800288BD) : return QStringLiteral("TYPE_E_BADMODULEKIND"); - case HRESULT(0x800288C5) : return QStringLiteral("TYPE_E_SIZETOOBIG"); - case HRESULT(0x800288C6) : return QStringLiteral("TYPE_E_DUPLICATEID"); - case HRESULT(0x800288CF) : return QStringLiteral("TYPE_E_INVALIDID"); - case HRESULT(0x80028CA0) : return QStringLiteral("TYPE_E_TYPEMISMATCH"); - case HRESULT(0x80028CA1) : return QStringLiteral("TYPE_E_OUTOFBOUNDS"); - case HRESULT(0x80028CA2) : return QStringLiteral("TYPE_E_IOERROR"); - case HRESULT(0x80028CA3) : return QStringLiteral("TYPE_E_CANTCREATETMPFILE"); - case HRESULT(0x80029C4A) : return QStringLiteral("TYPE_E_CANTLOADLIBRARY"); - case HRESULT(0x80029C83) : return QStringLiteral("TYPE_E_INCONSISTENTPROPFUNCS"); - case HRESULT(0x80029C84) : return QStringLiteral("TYPE_E_CIRCULARTYPE"); - case HRESULT(0x80030001) : return QStringLiteral("STG_E_INVALIDFUNCTION"); - case HRESULT(0x80030002) : return QStringLiteral("STG_E_FILENOTFOUND"); - case HRESULT(0x80030003) : return QStringLiteral("STG_E_PATHNOTFOUND"); - case HRESULT(0x80030004) : return QStringLiteral("STG_E_TOOMANYOPENFILES"); - case HRESULT(0x80030005) : return QStringLiteral("STG_E_ACCESSDENIED"); - case HRESULT(0x80030006) : return QStringLiteral("STG_E_INVALIDHANDLE"); - case HRESULT(0x80030008) : return QStringLiteral("STG_E_INSUFFICIENTMEMORY"); - case HRESULT(0x80030009) : return QStringLiteral("STG_E_INVALIDPOINTER"); - case HRESULT(0x80030012) : return QStringLiteral("STG_E_NOMOREFILES"); - case HRESULT(0x80030013) : return QStringLiteral("STG_E_DISKISWRITEPROTECTED"); - case HRESULT(0x80030019) : return QStringLiteral("STG_E_SEEKERROR"); - case HRESULT(0x8003001D) : return QStringLiteral("STG_E_WRITEFAULT"); - case HRESULT(0x8003001E) : return QStringLiteral("STG_E_READFAULT"); - case HRESULT(0x80030020) : return QStringLiteral("STG_E_SHAREVIOLATION"); - case HRESULT(0x80030021) : return QStringLiteral("STG_E_LOCKVIOLATION"); - case HRESULT(0x80030050) : return QStringLiteral("STG_E_FILEALREADYEXISTS"); - case HRESULT(0x80030057) : return QStringLiteral("STG_E_INVALIDPARAMETER"); - case HRESULT(0x80030070) : return QStringLiteral("STG_E_MEDIUMFULL"); - case HRESULT(0x800300F0) : return QStringLiteral("STG_E_PROPSETMISMATCHED"); - case HRESULT(0x800300FA) : return QStringLiteral("STG_E_ABNORMALAPIEXIT"); - case HRESULT(0x800300FB) : return QStringLiteral("STG_E_INVALIDHEADER"); - case HRESULT(0x800300FC) : return QStringLiteral("STG_E_INVALIDNAME"); - case HRESULT(0x800300FD) : return QStringLiteral("STG_E_UNKNOWN"); - case HRESULT(0x800300FE) : return QStringLiteral("STG_E_UNIMPLEMENTEDFUNCTION"); - case HRESULT(0x800300FF) : return QStringLiteral("STG_E_INVALIDFLAG"); - case HRESULT(0x80030100) : return QStringLiteral("STG_E_INUSE"); - case HRESULT(0x80030101) : return QStringLiteral("STG_E_NOTCURRENT"); - case HRESULT(0x80030102) : return QStringLiteral("STG_E_REVERTED"); - case HRESULT(0x80030103) : return QStringLiteral("STG_E_CANTSAVE"); - case HRESULT(0x80030104) : return QStringLiteral("STG_E_OLDFORMAT"); - case HRESULT(0x80030105) : return QStringLiteral("STG_E_OLDDLL"); - case HRESULT(0x80030106) : return QStringLiteral("STG_E_SHAREREQUIRED"); - case HRESULT(0x80030107) : return QStringLiteral("STG_E_NOTFILEBASEDSTORAGE"); - case HRESULT(0x80030108) : return QStringLiteral("STG_E_EXTANTMARSHALLINGS"); - case HRESULT(0x80030109) : return QStringLiteral("STG_E_DOCFILECORRUPT"); - case HRESULT(0x80030110) : return QStringLiteral("STG_E_BADBASEADDRESS"); - case HRESULT(0x80030111) : return QStringLiteral("STG_E_DOCFILETOOLARGE"); - case HRESULT(0x80030112) : return QStringLiteral("STG_E_NOTSIMPLEFORMAT"); - case HRESULT(0x80030201) : return QStringLiteral("STG_E_INCOMPLETE"); - case HRESULT(0x80030202) : return QStringLiteral("STG_E_TERMINATED"); - case HRESULT(0x00030200) : return QStringLiteral("STG_S_CONVERTED"); - case HRESULT(0x00030201) : return QStringLiteral("STG_S_BLOCK"); - case HRESULT(0x00030202) : return QStringLiteral("STG_S_RETRYNOW"); - case HRESULT(0x00030203) : return QStringLiteral("STG_S_MONITORING"); - case HRESULT(0x00030204) : return QStringLiteral("STG_S_MULTIPLEOPENS"); - case HRESULT(0x00030205) : return QStringLiteral("STG_S_CONSOLIDATIONFAILED"); - case HRESULT(0x00030206) : return QStringLiteral("STG_S_CANNOTCONSOLIDATE"); - case HRESULT(0x80030305) : return QStringLiteral("STG_E_STATUS_COPY_PROTECTION_FAILURE"); - case HRESULT(0x80030306) : return QStringLiteral("STG_E_CSS_AUTHENTICATION_FAILURE"); - case HRESULT(0x80030307) : return QStringLiteral("STG_E_CSS_KEY_NOT_PRESENT"); - case HRESULT(0x80030308) : return QStringLiteral("STG_E_CSS_KEY_NOT_ESTABLISHED"); - case HRESULT(0x80030309) : return QStringLiteral("STG_E_CSS_SCRAMBLED_SECTOR"); - case HRESULT(0x8003030A) : return QStringLiteral("STG_E_CSS_REGION_MISMATCH"); - case HRESULT(0x8003030B) : return QStringLiteral("STG_E_RESETS_EXHAUSTED"); - case HRESULT(0x80010001) : return QStringLiteral("RPC_E_CALL_REJECTED"); - case HRESULT(0x80010002) : return QStringLiteral("RPC_E_CALL_CANCELED"); - case HRESULT(0x80010003) : return QStringLiteral("RPC_E_CANTPOST_INSENDCALL"); - case HRESULT(0x80010004) : return QStringLiteral("RPC_E_CANTCALLOUT_INASYNCCALL"); - case HRESULT(0x80010005) : return QStringLiteral("RPC_E_CANTCALLOUT_INEXTERNALCALL"); - case HRESULT(0x80010006) : return QStringLiteral("RPC_E_CONNECTION_TERMINATED"); - case HRESULT(0x80010007) : return QStringLiteral("RPC_E_SERVER_DIED"); - case HRESULT(0x80010008) : return QStringLiteral("RPC_E_CLIENT_DIED"); - case HRESULT(0x80010009) : return QStringLiteral("RPC_E_INVALID_DATAPACKET"); - case HRESULT(0x8001000A) : return QStringLiteral("RPC_E_CANTTRANSMIT_CALL"); - case HRESULT(0x8001000B) : return QStringLiteral("RPC_E_CLIENT_CANTMARSHAL_DATA"); - case HRESULT(0x8001000C) : return QStringLiteral("RPC_E_CLIENT_CANTUNMARSHAL_DATA"); - case HRESULT(0x8001000D) : return QStringLiteral("RPC_E_SERVER_CANTMARSHAL_DATA"); - case HRESULT(0x8001000E) : return QStringLiteral("RPC_E_SERVER_CANTUNMARSHAL_DATA"); - case HRESULT(0x8001000F) : return QStringLiteral("RPC_E_INVALID_DATA"); - case HRESULT(0x80010010) : return QStringLiteral("RPC_E_INVALID_PARAMETER"); - case HRESULT(0x80010011) : return QStringLiteral("RPC_E_CANTCALLOUT_AGAIN"); - case HRESULT(0x80010012) : return QStringLiteral("RPC_E_SERVER_DIED_DNE"); - case HRESULT(0x80010100) : return QStringLiteral("RPC_E_SYS_CALL_FAILED"); - case HRESULT(0x80010101) : return QStringLiteral("RPC_E_OUT_OF_RESOURCES"); - case HRESULT(0x80010102) : return QStringLiteral("RPC_E_ATTEMPTED_MULTITHREAD"); - case HRESULT(0x80010103) : return QStringLiteral("RPC_E_NOT_REGISTERED"); - case HRESULT(0x80010104) : return QStringLiteral("RPC_E_FAULT"); - case HRESULT(0x80010105) : return QStringLiteral("RPC_E_SERVERFAULT"); - case HRESULT(0x80010106) : return QStringLiteral("RPC_E_CHANGED_MODE"); - case HRESULT(0x80010107) : return QStringLiteral("RPC_E_INVALIDMETHOD"); - case HRESULT(0x80010108) : return QStringLiteral("RPC_E_DISCONNECTED"); - case HRESULT(0x80010109) : return QStringLiteral("RPC_E_RETRY"); - case HRESULT(0x8001010A) : return QStringLiteral("RPC_E_SERVERCALL_RETRYLATER"); - case HRESULT(0x8001010B) : return QStringLiteral("RPC_E_SERVERCALL_REJECTED"); - case HRESULT(0x8001010C) : return QStringLiteral("RPC_E_INVALID_CALLDATA"); - case HRESULT(0x8001010D) : return QStringLiteral("RPC_E_CANTCALLOUT_ININPUTSYNCCALL"); - case HRESULT(0x8001010E) : return QStringLiteral("RPC_E_WRONG_THREAD"); - case HRESULT(0x8001010F) : return QStringLiteral("RPC_E_THREAD_NOT_INIT"); - case HRESULT(0x80010110) : return QStringLiteral("RPC_E_VERSION_MISMATCH"); - case HRESULT(0x80010111) : return QStringLiteral("RPC_E_INVALID_HEADER"); - case HRESULT(0x80010112) : return QStringLiteral("RPC_E_INVALID_EXTENSION"); - case HRESULT(0x80010113) : return QStringLiteral("RPC_E_INVALID_IPID"); - case HRESULT(0x80010114) : return QStringLiteral("RPC_E_INVALID_OBJECT"); - case HRESULT(0x80010115) : return QStringLiteral("RPC_S_CALLPENDING"); - case HRESULT(0x80010116) : return QStringLiteral("RPC_S_WAITONTIMER"); - case HRESULT(0x80010117) : return QStringLiteral("RPC_E_CALL_COMPLETE"); - case HRESULT(0x80010118) : return QStringLiteral("RPC_E_UNSECURE_CALL"); - case HRESULT(0x80010119) : return QStringLiteral("RPC_E_TOO_LATE"); - case HRESULT(0x8001011A) : return QStringLiteral("RPC_E_NO_GOOD_SECURITY_PACKAGES"); - case HRESULT(0x8001011B) : return QStringLiteral("RPC_E_ACCESS_DENIED"); - case HRESULT(0x8001011C) : return QStringLiteral("RPC_E_REMOTE_DISABLED"); - case HRESULT(0x8001011D) : return QStringLiteral("RPC_E_INVALID_OBJREF"); - case HRESULT(0x8001011E) : return QStringLiteral("RPC_E_NO_CONTEXT"); - case HRESULT(0x8001011F) : return QStringLiteral("RPC_E_TIMEOUT"); - case HRESULT(0x80010120) : return QStringLiteral("RPC_E_NO_SYNC"); - case HRESULT(0x80010121) : return QStringLiteral("RPC_E_FULLSIC_REQUIRED"); - case HRESULT(0x80010122) : return QStringLiteral("RPC_E_INVALID_STD_NAME"); - case HRESULT(0x80010123) : return QStringLiteral("CO_E_FAILEDTOIMPERSONATE"); - case HRESULT(0x80010124) : return QStringLiteral("CO_E_FAILEDTOGETSECCTX"); - case HRESULT(0x80010125) : return QStringLiteral("CO_E_FAILEDTOOPENTHREADTOKEN"); - case HRESULT(0x80010126) : return QStringLiteral("CO_E_FAILEDTOGETTOKENINFO"); - case HRESULT(0x80010127) : return QStringLiteral("CO_E_TRUSTEEDOESNTMATCHCLIENT"); - case HRESULT(0x80010128) : return QStringLiteral("CO_E_FAILEDTOQUERYCLIENTBLANKET"); - case HRESULT(0x80010129) : return QStringLiteral("CO_E_FAILEDTOSETDACL"); - case HRESULT(0x8001012A) : return QStringLiteral("CO_E_ACCESSCHECKFAILED"); - case HRESULT(0x8001012B) : return QStringLiteral("CO_E_NETACCESSAPIFAILED"); - case HRESULT(0x8001012C) : return QStringLiteral("CO_E_WRONGTRUSTEENAMESYNTAX"); - case HRESULT(0x8001012D) : return QStringLiteral("CO_E_INVALIDSID"); - case HRESULT(0x8001012E) : return QStringLiteral("CO_E_CONVERSIONFAILED"); - case HRESULT(0x8001012F) : return QStringLiteral("CO_E_NOMATCHINGSIDFOUND"); - case HRESULT(0x80010130) : return QStringLiteral("CO_E_LOOKUPACCSIDFAILED"); - case HRESULT(0x80010131) : return QStringLiteral("CO_E_NOMATCHINGNAMEFOUND"); - case HRESULT(0x80010132) : return QStringLiteral("CO_E_LOOKUPACCNAMEFAILED"); - case HRESULT(0x80010133) : return QStringLiteral("CO_E_SETSERLHNDLFAILED"); - case HRESULT(0x80010134) : return QStringLiteral("CO_E_FAILEDTOGETWINDIR"); - case HRESULT(0x80010135) : return QStringLiteral("CO_E_PATHTOOLONG"); - case HRESULT(0x80010136) : return QStringLiteral("CO_E_FAILEDTOGENUUID"); - case HRESULT(0x80010137) : return QStringLiteral("CO_E_FAILEDTOCREATEFILE"); - case HRESULT(0x80010138) : return QStringLiteral("CO_E_FAILEDTOCLOSEHANDLE"); - case HRESULT(0x80010139) : return QStringLiteral("CO_E_EXCEEDSYSACLLIMIT"); - case HRESULT(0x8001013A) : return QStringLiteral("CO_E_ACESINWRONGORDER"); - case HRESULT(0x8001013B) : return QStringLiteral("CO_E_INCOMPATIBLESTREAMVERSION"); - case HRESULT(0x8001013C) : return QStringLiteral("CO_E_FAILEDTOOPENPROCESSTOKEN"); - case HRESULT(0x8001013D) : return QStringLiteral("CO_E_DECODEFAILED"); - case HRESULT(0x8001013F) : return QStringLiteral("CO_E_ACNOTINITIALIZED"); - case HRESULT(0x80010140) : return QStringLiteral("CO_E_CANCEL_DISABLED"); - case HRESULT(0x8001FFFF) : return QStringLiteral("RPC_E_UNEXPECTED"); - case HRESULT(0xC0090001) : return QStringLiteral("ERROR_AUDITING_DISABLED"); - case HRESULT(0xC0090002) : return QStringLiteral("ERROR_ALL_SIDS_FILTERED"); - case HRESULT(0x80090001) : return QStringLiteral("NTE_BAD_UID"); - case HRESULT(0x80090002) : return QStringLiteral("NTE_BAD_HASH"); - case HRESULT(0x80090003) : return QStringLiteral("NTE_BAD_KEY"); - case HRESULT(0x80090004) : return QStringLiteral("NTE_BAD_LEN"); - case HRESULT(0x80090005) : return QStringLiteral("NTE_BAD_DATA"); - case HRESULT(0x80090006) : return QStringLiteral("NTE_BAD_SIGNATURE"); - case HRESULT(0x80090007) : return QStringLiteral("NTE_BAD_VER"); - case HRESULT(0x80090008) : return QStringLiteral("NTE_BAD_ALGID"); - case HRESULT(0x80090009) : return QStringLiteral("NTE_BAD_FLAGS"); - case HRESULT(0x8009000A) : return QStringLiteral("NTE_BAD_TYPE"); - case HRESULT(0x8009000B) : return QStringLiteral("NTE_BAD_KEY_STATE"); - case HRESULT(0x8009000C) : return QStringLiteral("NTE_BAD_HASH_STATE"); - case HRESULT(0x8009000D) : return QStringLiteral("NTE_NO_KEY"); - case HRESULT(0x8009000E) : return QStringLiteral("NTE_NO_MEMORY"); - case HRESULT(0x8009000F) : return QStringLiteral("NTE_EXISTS"); - case HRESULT(0x80090010) : return QStringLiteral("NTE_PERM"); - case HRESULT(0x80090011) : return QStringLiteral("NTE_NOT_FOUND"); - case HRESULT(0x80090012) : return QStringLiteral("NTE_DOUBLE_ENCRYPT"); - case HRESULT(0x80090013) : return QStringLiteral("NTE_BAD_PROVIDER"); - case HRESULT(0x80090014) : return QStringLiteral("NTE_BAD_PROV_TYPE"); - case HRESULT(0x80090015) : return QStringLiteral("NTE_BAD_PUBLIC_KEY"); - case HRESULT(0x80090016) : return QStringLiteral("NTE_BAD_KEYSET"); - case HRESULT(0x80090017) : return QStringLiteral("NTE_PROV_TYPE_NOT_DEF"); - case HRESULT(0x80090018) : return QStringLiteral("NTE_PROV_TYPE_ENTRY_BAD"); - case HRESULT(0x80090019) : return QStringLiteral("NTE_KEYSET_NOT_DEF"); - case HRESULT(0x8009001A) : return QStringLiteral("NTE_KEYSET_ENTRY_BAD"); - case HRESULT(0x8009001B) : return QStringLiteral("NTE_PROV_TYPE_NO_MATCH"); - case HRESULT(0x8009001C) : return QStringLiteral("NTE_SIGNATURE_FILE_BAD"); - case HRESULT(0x8009001D) : return QStringLiteral("NTE_PROVIDER_DLL_FAIL"); - case HRESULT(0x8009001E) : return QStringLiteral("NTE_PROV_DLL_NOT_FOUND"); - case HRESULT(0x8009001F) : return QStringLiteral("NTE_BAD_KEYSET_PARAM"); - case HRESULT(0x80090020) : return QStringLiteral("NTE_FAIL"); - case HRESULT(0x80090021) : return QStringLiteral("NTE_SYS_ERR"); - case HRESULT(0x80090022) : return QStringLiteral("NTE_SILENT_CONTEXT"); - case HRESULT(0x80090023) : return QStringLiteral("NTE_TOKEN_KEYSET_STORAGE_FULL"); - case HRESULT(0x80090024) : return QStringLiteral("NTE_TEMPORARY_PROFILE"); - case HRESULT(0x80090025) : return QStringLiteral("NTE_FIXEDPARAMETER"); - case HRESULT(0x80090300) : return QStringLiteral("SEC_E_INSUFFICIENT_MEMORY"); - case HRESULT(0x80090301) : return QStringLiteral("SEC_E_INVALID_HANDLE"); - case HRESULT(0x80090302) : return QStringLiteral("SEC_E_UNSUPPORTED_FUNCTION"); - case HRESULT(0x80090303) : return QStringLiteral("SEC_E_TARGET_UNKNOWN"); - case HRESULT(0x80090304) : return QStringLiteral("SEC_E_INTERNAL_ERROR"); - case HRESULT(0x80090305) : return QStringLiteral("SEC_E_SECPKG_NOT_FOUND"); - case HRESULT(0x80090306) : return QStringLiteral("SEC_E_NOT_OWNER"); - case HRESULT(0x80090307) : return QStringLiteral("SEC_E_CANNOT_INSTALL"); - case HRESULT(0x80090308) : return QStringLiteral("SEC_E_INVALID_TOKEN"); - case HRESULT(0x80090309) : return QStringLiteral("SEC_E_CANNOT_PACK"); - case HRESULT(0x8009030A) : return QStringLiteral("SEC_E_QOP_NOT_SUPPORTED"); - case HRESULT(0x8009030B) : return QStringLiteral("SEC_E_NO_IMPERSONATION"); - case HRESULT(0x8009030C) : return QStringLiteral("SEC_E_LOGON_DENIED"); - case HRESULT(0x8009030D) : return QStringLiteral("SEC_E_UNKNOWN_CREDENTIALS"); - case HRESULT(0x8009030E) : return QStringLiteral("SEC_E_NO_CREDENTIALS"); - case HRESULT(0x8009030F) : return QStringLiteral("SEC_E_MESSAGE_ALTERED"); - case HRESULT(0x80090310) : return QStringLiteral("SEC_E_OUT_OF_SEQUENCE"); - case HRESULT(0x80090311) : return QStringLiteral("SEC_E_NO_AUTHENTICATING_AUTHORITY"); - case HRESULT(0x00090312) : return QStringLiteral("SEC_I_CONTINUE_NEEDED"); - case HRESULT(0x00090313) : return QStringLiteral("SEC_I_COMPLETE_NEEDED"); - case HRESULT(0x00090314) : return QStringLiteral("SEC_I_COMPLETE_AND_CONTINUE"); - case HRESULT(0x00090315) : return QStringLiteral("SEC_I_LOCAL_LOGON"); - case HRESULT(0x80090316) : return QStringLiteral("SEC_E_BAD_PKGID"); - case HRESULT(0x80090317) : return QStringLiteral("SEC_E_CONTEXT_EXPIRED"); - case HRESULT(0x00090317) : return QStringLiteral("SEC_I_CONTEXT_EXPIRED"); - case HRESULT(0x80090318) : return QStringLiteral("SEC_E_INCOMPLETE_MESSAGE"); - case HRESULT(0x80090320) : return QStringLiteral("SEC_E_INCOMPLETE_CREDENTIALS"); - case HRESULT(0x80090321) : return QStringLiteral("SEC_E_BUFFER_TOO_SMALL"); - case HRESULT(0x00090320) : return QStringLiteral("SEC_I_INCOMPLETE_CREDENTIALS"); - case HRESULT(0x00090321) : return QStringLiteral("SEC_I_RENEGOTIATE"); - case HRESULT(0x80090322) : return QStringLiteral("SEC_E_WRONG_PRINCIPAL"); - case HRESULT(0x00090323) : return QStringLiteral("SEC_I_NO_LSA_CONTEXT"); - case HRESULT(0x80090324) : return QStringLiteral("SEC_E_TIME_SKEW"); - case HRESULT(0x80090325) : return QStringLiteral("SEC_E_UNTRUSTED_ROOT"); - case HRESULT(0x80090326) : return QStringLiteral("SEC_E_ILLEGAL_MESSAGE"); - case HRESULT(0x80090327) : return QStringLiteral("SEC_E_CERT_UNKNOWN"); - case HRESULT(0x80090328) : return QStringLiteral("SEC_E_CERT_EXPIRED"); - case HRESULT(0x80090329) : return QStringLiteral("SEC_E_ENCRYPT_FAILURE"); - case HRESULT(0x80090330) : return QStringLiteral("SEC_E_DECRYPT_FAILURE"); - case HRESULT(0x80090331) : return QStringLiteral("SEC_E_ALGORITHM_MISMATCH"); - case HRESULT(0x80090332) : return QStringLiteral("SEC_E_SECURITY_QOS_FAILED"); - case HRESULT(0x80090333) : return QStringLiteral("SEC_E_UNFINISHED_CONTEXT_DELETED"); - case HRESULT(0x80090334) : return QStringLiteral("SEC_E_NO_TGT_REPLY"); - case HRESULT(0x80090335) : return QStringLiteral("SEC_E_NO_IP_ADDRESSES"); - case HRESULT(0x80090336) : return QStringLiteral("SEC_E_WRONG_CREDENTIAL_HANDLE"); - case HRESULT(0x80090337) : return QStringLiteral("SEC_E_CRYPTO_SYSTEM_INVALID"); - case HRESULT(0x80090338) : return QStringLiteral("SEC_E_MAX_REFERRALS_EXCEEDED"); - case HRESULT(0x80090339) : return QStringLiteral("SEC_E_MUST_BE_KDC"); - case HRESULT(0x8009033A) : return QStringLiteral("SEC_E_STRONG_CRYPTO_NOT_SUPPORTED"); - case HRESULT(0x8009033B) : return QStringLiteral("SEC_E_TOO_MANY_PRINCIPALS"); - case HRESULT(0x8009033C) : return QStringLiteral("SEC_E_NO_PA_DATA"); - case HRESULT(0x8009033D) : return QStringLiteral("SEC_E_PKINIT_NAME_MISMATCH"); - case HRESULT(0x8009033E) : return QStringLiteral("SEC_E_SMARTCARD_LOGON_REQUIRED"); - case HRESULT(0x8009033F) : return QStringLiteral("SEC_E_SHUTDOWN_IN_PROGRESS"); - case HRESULT(0x80090340) : return QStringLiteral("SEC_E_KDC_INVALID_REQUEST"); - case HRESULT(0x80090341) : return QStringLiteral("SEC_E_KDC_UNABLE_TO_REFER"); - case HRESULT(0x80090342) : return QStringLiteral("SEC_E_KDC_UNKNOWN_ETYPE"); - case HRESULT(0x80090343) : return QStringLiteral("SEC_E_UNSUPPORTED_PREAUTH"); - case HRESULT(0x80090345) : return QStringLiteral("SEC_E_DELEGATION_REQUIRED"); - case HRESULT(0x80090346) : return QStringLiteral("SEC_E_BAD_BINDINGS"); - case HRESULT(0x80090347) : return QStringLiteral("SEC_E_MULTIPLE_ACCOUNTS"); - case HRESULT(0x80090348) : return QStringLiteral("SEC_E_NO_KERB_KEY"); - case HRESULT(0x80090349) : return QStringLiteral("SEC_E_CERT_WRONG_USAGE"); - case HRESULT(0x80090350) : return QStringLiteral("SEC_E_DOWNGRADE_DETECTED"); - case HRESULT(0x80090351) : return QStringLiteral("SEC_E_SMARTCARD_CERT_REVOKED"); - case HRESULT(0x80090352) : return QStringLiteral("SEC_E_ISSUING_CA_UNTRUSTED"); - case HRESULT(0x80090353) : return QStringLiteral("SEC_E_REVOCATION_OFFLINE_C"); - case HRESULT(0x80090354) : return QStringLiteral("SEC_E_PKINIT_CLIENT_FAILURE"); - case HRESULT(0x80090355) : return QStringLiteral("SEC_E_SMARTCARD_CERT_EXPIRED"); - case HRESULT(0x80090356) : return QStringLiteral("SEC_E_NO_S4U_PROT_SUPPORT"); - case HRESULT(0x80090357) : return QStringLiteral("SEC_E_CROSSREALM_DELEGATION_FAILURE"); - case HRESULT(0x80090358) : return QStringLiteral("SEC_E_REVOCATION_OFFLINE_KDC"); - case HRESULT(0x80090359) : return QStringLiteral("SEC_E_ISSUING_CA_UNTRUSTED_KDC"); - case HRESULT(0x8009035A) : return QStringLiteral("SEC_E_KDC_CERT_EXPIRED"); - case HRESULT(0x8009035B) : return QStringLiteral("SEC_E_KDC_CERT_REVOKED"); - case HRESULT(0x80091001) : return QStringLiteral("CRYPT_E_MSG_ERROR"); - case HRESULT(0x80091002) : return QStringLiteral("CRYPT_E_UNKNOWN_ALGO"); - case HRESULT(0x80091003) : return QStringLiteral("CRYPT_E_OID_FORMAT"); - case HRESULT(0x80091004) : return QStringLiteral("CRYPT_E_INVALID_MSG_TYPE"); - case HRESULT(0x80091005) : return QStringLiteral("CRYPT_E_UNEXPECTED_ENCODING"); - case HRESULT(0x80091006) : return QStringLiteral("CRYPT_E_AUTH_ATTR_MISSING"); - case HRESULT(0x80091007) : return QStringLiteral("CRYPT_E_HASH_VALUE"); - case HRESULT(0x80091008) : return QStringLiteral("CRYPT_E_INVALID_INDEX"); - case HRESULT(0x80091009) : return QStringLiteral("CRYPT_E_ALREADY_DECRYPTED"); - case HRESULT(0x8009100A) : return QStringLiteral("CRYPT_E_NOT_DECRYPTED"); - case HRESULT(0x8009100B) : return QStringLiteral("CRYPT_E_RECIPIENT_NOT_FOUND"); - case HRESULT(0x8009100C) : return QStringLiteral("CRYPT_E_CONTROL_TYPE"); - case HRESULT(0x8009100D) : return QStringLiteral("CRYPT_E_ISSUER_SERIALNUMBER"); - case HRESULT(0x8009100E) : return QStringLiteral("CRYPT_E_SIGNER_NOT_FOUND"); - case HRESULT(0x8009100F) : return QStringLiteral("CRYPT_E_ATTRIBUTES_MISSING"); - case HRESULT(0x80091010) : return QStringLiteral("CRYPT_E_STREAM_MSG_NOT_READY"); - case HRESULT(0x80091011) : return QStringLiteral("CRYPT_E_STREAM_INSUFFICIENT_DATA"); - case HRESULT(0x00091012) : return QStringLiteral("CRYPT_I_NEW_PROTECTION_REQUIRED"); - case HRESULT(0x80092001) : return QStringLiteral("CRYPT_E_BAD_LEN"); - case HRESULT(0x80092002) : return QStringLiteral("CRYPT_E_BAD_ENCODE"); - case HRESULT(0x80092003) : return QStringLiteral("CRYPT_E_FILE_ERROR"); - case HRESULT(0x80092004) : return QStringLiteral("CRYPT_E_NOT_FOUND"); - case HRESULT(0x80092005) : return QStringLiteral("CRYPT_E_EXISTS"); - case HRESULT(0x80092006) : return QStringLiteral("CRYPT_E_NO_PROVIDER"); - case HRESULT(0x80092007) : return QStringLiteral("CRYPT_E_SELF_SIGNED"); - case HRESULT(0x80092008) : return QStringLiteral("CRYPT_E_DELETED_PREV"); - case HRESULT(0x80092009) : return QStringLiteral("CRYPT_E_NO_MATCH"); - case HRESULT(0x8009200A) : return QStringLiteral("CRYPT_E_UNEXPECTED_MSG_TYPE"); - case HRESULT(0x8009200B) : return QStringLiteral("CRYPT_E_NO_KEY_PROPERTY"); - case HRESULT(0x8009200C) : return QStringLiteral("CRYPT_E_NO_DECRYPT_CERT"); - case HRESULT(0x8009200D) : return QStringLiteral("CRYPT_E_BAD_MSG"); - case HRESULT(0x8009200E) : return QStringLiteral("CRYPT_E_NO_SIGNER"); - case HRESULT(0x8009200F) : return QStringLiteral("CRYPT_E_PENDING_CLOSE"); - case HRESULT(0x80092010) : return QStringLiteral("CRYPT_E_REVOKED"); - case HRESULT(0x80092011) : return QStringLiteral("CRYPT_E_NO_REVOCATION_DLL"); - case HRESULT(0x80092012) : return QStringLiteral("CRYPT_E_NO_REVOCATION_CHECK"); - case HRESULT(0x80092013) : return QStringLiteral("CRYPT_E_REVOCATION_OFFLINE"); - case HRESULT(0x80092014) : return QStringLiteral("CRYPT_E_NOT_IN_REVOCATION_DATABASE"); - case HRESULT(0x80092020) : return QStringLiteral("CRYPT_E_INVALID_NUMERIC_STRING"); - case HRESULT(0x80092021) : return QStringLiteral("CRYPT_E_INVALID_PRINTABLE_STRING"); - case HRESULT(0x80092022) : return QStringLiteral("CRYPT_E_INVALID_IA5_STRING"); - case HRESULT(0x80092023) : return QStringLiteral("CRYPT_E_INVALID_X500_STRING"); - case HRESULT(0x80092024) : return QStringLiteral("CRYPT_E_NOT_CHAR_STRING"); - case HRESULT(0x80092025) : return QStringLiteral("CRYPT_E_FILERESIZED"); - case HRESULT(0x80092026) : return QStringLiteral("CRYPT_E_SECURITY_SETTINGS"); - case HRESULT(0x80092027) : return QStringLiteral("CRYPT_E_NO_VERIFY_USAGE_DLL"); - case HRESULT(0x80092028) : return QStringLiteral("CRYPT_E_NO_VERIFY_USAGE_CHECK"); - case HRESULT(0x80092029) : return QStringLiteral("CRYPT_E_VERIFY_USAGE_OFFLINE"); - case HRESULT(0x8009202A) : return QStringLiteral("CRYPT_E_NOT_IN_CTL"); - case HRESULT(0x8009202B) : return QStringLiteral("CRYPT_E_NO_TRUSTED_SIGNER"); - case HRESULT(0x8009202C) : return QStringLiteral("CRYPT_E_MISSING_PUBKEY_PARA"); - case HRESULT(0x80093000) : return QStringLiteral("CRYPT_E_OSS_ERROR"); - case HRESULT(0x80093001) : return QStringLiteral("OSS_MORE_BUF"); - case HRESULT(0x80093002) : return QStringLiteral("OSS_NEGATIVE_UINTEGER"); - case HRESULT(0x80093003) : return QStringLiteral("OSS_PDU_RANGE"); - case HRESULT(0x80093004) : return QStringLiteral("OSS_MORE_INPUT"); - case HRESULT(0x80093005) : return QStringLiteral("OSS_DATA_ERROR"); - case HRESULT(0x80093006) : return QStringLiteral("OSS_BAD_ARG"); - case HRESULT(0x80093007) : return QStringLiteral("OSS_BAD_VERSION"); - case HRESULT(0x80093008) : return QStringLiteral("OSS_OUT_MEMORY"); - case HRESULT(0x80093009) : return QStringLiteral("OSS_PDU_MISMATCH"); - case HRESULT(0x8009300A) : return QStringLiteral("OSS_LIMITED"); - case HRESULT(0x8009300B) : return QStringLiteral("OSS_BAD_PTR"); - case HRESULT(0x8009300C) : return QStringLiteral("OSS_BAD_TIME"); - case HRESULT(0x8009300D) : return QStringLiteral("OSS_INDEFINITE_NOT_SUPPORTED"); - case HRESULT(0x8009300E) : return QStringLiteral("OSS_MEM_ERROR"); - case HRESULT(0x8009300F) : return QStringLiteral("OSS_BAD_TABLE"); - case HRESULT(0x80093010) : return QStringLiteral("OSS_TOO_LONG"); - case HRESULT(0x80093011) : return QStringLiteral("OSS_CONSTRAINT_VIOLATED"); - case HRESULT(0x80093012) : return QStringLiteral("OSS_FATAL_ERROR"); - case HRESULT(0x80093013) : return QStringLiteral("OSS_ACCESS_SERIALIZATION_ERROR"); - case HRESULT(0x80093014) : return QStringLiteral("OSS_NULL_TBL"); - case HRESULT(0x80093015) : return QStringLiteral("OSS_NULL_FCN"); - case HRESULT(0x80093016) : return QStringLiteral("OSS_BAD_ENCRULES"); - case HRESULT(0x80093017) : return QStringLiteral("OSS_UNAVAIL_ENCRULES"); - case HRESULT(0x80093018) : return QStringLiteral("OSS_CANT_OPEN_TRACE_WINDOW"); - case HRESULT(0x80093019) : return QStringLiteral("OSS_UNIMPLEMENTED"); - case HRESULT(0x8009301A) : return QStringLiteral("OSS_OID_DLL_NOT_LINKED"); - case HRESULT(0x8009301B) : return QStringLiteral("OSS_CANT_OPEN_TRACE_FILE"); - case HRESULT(0x8009301C) : return QStringLiteral("OSS_TRACE_FILE_ALREADY_OPEN"); - case HRESULT(0x8009301D) : return QStringLiteral("OSS_TABLE_MISMATCH"); - case HRESULT(0x8009301E) : return QStringLiteral("OSS_TYPE_NOT_SUPPORTED"); - case HRESULT(0x8009301F) : return QStringLiteral("OSS_REAL_DLL_NOT_LINKED"); - case HRESULT(0x80093020) : return QStringLiteral("OSS_REAL_CODE_NOT_LINKED"); - case HRESULT(0x80093021) : return QStringLiteral("OSS_OUT_OF_RANGE"); - case HRESULT(0x80093022) : return QStringLiteral("OSS_COPIER_DLL_NOT_LINKED"); - case HRESULT(0x80093023) : return QStringLiteral("OSS_CONSTRAINT_DLL_NOT_LINKED"); - case HRESULT(0x80093024) : return QStringLiteral("OSS_COMPARATOR_DLL_NOT_LINKED"); - case HRESULT(0x80093025) : return QStringLiteral("OSS_COMPARATOR_CODE_NOT_LINKED"); - case HRESULT(0x80093026) : return QStringLiteral("OSS_MEM_MGR_DLL_NOT_LINKED"); - case HRESULT(0x80093027) : return QStringLiteral("OSS_PDV_DLL_NOT_LINKED"); - case HRESULT(0x80093028) : return QStringLiteral("OSS_PDV_CODE_NOT_LINKED"); - case HRESULT(0x80093029) : return QStringLiteral("OSS_API_DLL_NOT_LINKED"); - case HRESULT(0x8009302A) : return QStringLiteral("OSS_BERDER_DLL_NOT_LINKED"); - case HRESULT(0x8009302B) : return QStringLiteral("OSS_PER_DLL_NOT_LINKED"); - case HRESULT(0x8009302C) : return QStringLiteral("OSS_OPEN_TYPE_ERROR"); - case HRESULT(0x8009302D) : return QStringLiteral("OSS_MUTEX_NOT_CREATED"); - case HRESULT(0x8009302E) : return QStringLiteral("OSS_CANT_CLOSE_TRACE_FILE"); - case HRESULT(0x80093100) : return QStringLiteral("CRYPT_E_ASN1_ERROR"); - case HRESULT(0x80093101) : return QStringLiteral("CRYPT_E_ASN1_INTERNAL"); - case HRESULT(0x80093102) : return QStringLiteral("CRYPT_E_ASN1_EOD"); - case HRESULT(0x80093103) : return QStringLiteral("CRYPT_E_ASN1_CORRUPT"); - case HRESULT(0x80093104) : return QStringLiteral("CRYPT_E_ASN1_LARGE"); - case HRESULT(0x80093105) : return QStringLiteral("CRYPT_E_ASN1_CONSTRAINT"); - case HRESULT(0x80093106) : return QStringLiteral("CRYPT_E_ASN1_MEMORY"); - case HRESULT(0x80093107) : return QStringLiteral("CRYPT_E_ASN1_OVERFLOW"); - case HRESULT(0x80093108) : return QStringLiteral("CRYPT_E_ASN1_BADPDU"); - case HRESULT(0x80093109) : return QStringLiteral("CRYPT_E_ASN1_BADARGS"); - case HRESULT(0x8009310A) : return QStringLiteral("CRYPT_E_ASN1_BADREAL"); - case HRESULT(0x8009310B) : return QStringLiteral("CRYPT_E_ASN1_BADTAG"); - case HRESULT(0x8009310C) : return QStringLiteral("CRYPT_E_ASN1_CHOICE"); - case HRESULT(0x8009310D) : return QStringLiteral("CRYPT_E_ASN1_RULE"); - case HRESULT(0x8009310E) : return QStringLiteral("CRYPT_E_ASN1_UTF8"); - case HRESULT(0x80093133) : return QStringLiteral("CRYPT_E_ASN1_PDU_TYPE"); - case HRESULT(0x80093134) : return QStringLiteral("CRYPT_E_ASN1_NYI"); - case HRESULT(0x80093201) : return QStringLiteral("CRYPT_E_ASN1_EXTENDED"); - case HRESULT(0x80093202) : return QStringLiteral("CRYPT_E_ASN1_NOEOD"); - case HRESULT(0x80094001) : return QStringLiteral("CERTSRV_E_BAD_REQUESTSUBJECT"); - case HRESULT(0x80094002) : return QStringLiteral("CERTSRV_E_NO_REQUEST"); - case HRESULT(0x80094003) : return QStringLiteral("CERTSRV_E_BAD_REQUESTSTATUS"); - case HRESULT(0x80094004) : return QStringLiteral("CERTSRV_E_PROPERTY_EMPTY"); - case HRESULT(0x80094005) : return QStringLiteral("CERTSRV_E_INVALID_CA_CERTIFICATE"); - case HRESULT(0x80094006) : return QStringLiteral("CERTSRV_E_SERVER_SUSPENDED"); - case HRESULT(0x80094007) : return QStringLiteral("CERTSRV_E_ENCODING_LENGTH"); - case HRESULT(0x80094008) : return QStringLiteral("CERTSRV_E_ROLECONFLICT"); - case HRESULT(0x80094009) : return QStringLiteral("CERTSRV_E_RESTRICTEDOFFICER"); - case HRESULT(0x8009400A) : return QStringLiteral("CERTSRV_E_KEY_ARCHIVAL_NOT_CONFIGURED"); - case HRESULT(0x8009400B) : return QStringLiteral("CERTSRV_E_NO_VALID_KRA"); - case HRESULT(0x8009400C) : return QStringLiteral("CERTSRV_E_BAD_REQUEST_KEY_ARCHIVAL"); - case HRESULT(0x8009400D) : return QStringLiteral("CERTSRV_E_NO_CAADMIN_DEFINED"); - case HRESULT(0x8009400E) : return QStringLiteral("CERTSRV_E_BAD_RENEWAL_CERT_ATTRIBUTE"); - case HRESULT(0x8009400F) : return QStringLiteral("CERTSRV_E_NO_DB_SESSIONS"); - case HRESULT(0x80094010) : return QStringLiteral("CERTSRV_E_ALIGNMENT_FAULT"); - case HRESULT(0x80094011) : return QStringLiteral("CERTSRV_E_ENROLL_DENIED"); - case HRESULT(0x80094012) : return QStringLiteral("CERTSRV_E_TEMPLATE_DENIED"); - case HRESULT(0x80094013) : return QStringLiteral("CERTSRV_E_DOWNLEVEL_DC_SSL_OR_UPGRADE"); - case HRESULT(0x80094800) : return QStringLiteral("CERTSRV_E_UNSUPPORTED_CERT_TYPE"); - case HRESULT(0x80094801) : return QStringLiteral("CERTSRV_E_NO_CERT_TYPE"); - case HRESULT(0x80094802) : return QStringLiteral("CERTSRV_E_TEMPLATE_CONFLICT"); - case HRESULT(0x80094803) : return QStringLiteral("CERTSRV_E_SUBJECT_ALT_NAME_REQUIRED"); - case HRESULT(0x80094804) : return QStringLiteral("CERTSRV_E_ARCHIVED_KEY_REQUIRED"); - case HRESULT(0x80094805) : return QStringLiteral("CERTSRV_E_SMIME_REQUIRED"); - case HRESULT(0x80094806) : return QStringLiteral("CERTSRV_E_BAD_RENEWAL_SUBJECT"); - case HRESULT(0x80094807) : return QStringLiteral("CERTSRV_E_BAD_TEMPLATE_VERSION"); - case HRESULT(0x80094808) : return QStringLiteral("CERTSRV_E_TEMPLATE_POLICY_REQUIRED"); - case HRESULT(0x80094809) : return QStringLiteral("CERTSRV_E_SIGNATURE_POLICY_REQUIRED"); - case HRESULT(0x8009480A) : return QStringLiteral("CERTSRV_E_SIGNATURE_COUNT"); - case HRESULT(0x8009480B) : return QStringLiteral("CERTSRV_E_SIGNATURE_REJECTED"); - case HRESULT(0x8009480C) : return QStringLiteral("CERTSRV_E_ISSUANCE_POLICY_REQUIRED"); - case HRESULT(0x8009480D) : return QStringLiteral("CERTSRV_E_SUBJECT_UPN_REQUIRED"); - case HRESULT(0x8009480E) : return QStringLiteral("CERTSRV_E_SUBJECT_DIRECTORY_GUID_REQUIRED"); - case HRESULT(0x8009480F) : return QStringLiteral("CERTSRV_E_SUBJECT_DNS_REQUIRED"); - case HRESULT(0x80094810) : return QStringLiteral("CERTSRV_E_ARCHIVED_KEY_UNEXPECTED"); - case HRESULT(0x80094811) : return QStringLiteral("CERTSRV_E_KEY_LENGTH"); - case HRESULT(0x80094812) : return QStringLiteral("CERTSRV_E_SUBJECT_EMAIL_REQUIRED"); - case HRESULT(0x80094813) : return QStringLiteral("CERTSRV_E_UNKNOWN_CERT_TYPE"); - case HRESULT(0x80094814) : return QStringLiteral("CERTSRV_E_CERT_TYPE_OVERLAP"); - case HRESULT(0x80095000) : return QStringLiteral("XENROLL_E_KEY_NOT_EXPORTABLE"); - case HRESULT(0x80095001) : return QStringLiteral("XENROLL_E_CANNOT_ADD_ROOT_CERT"); - case HRESULT(0x80095002) : return QStringLiteral("XENROLL_E_RESPONSE_KA_HASH_NOT_FOUND"); - case HRESULT(0x80095003) : return QStringLiteral("XENROLL_E_RESPONSE_UNEXPECTED_KA_HASH"); - case HRESULT(0x80095004) : return QStringLiteral("XENROLL_E_RESPONSE_KA_HASH_MISMATCH"); - case HRESULT(0x80095005) : return QStringLiteral("XENROLL_E_KEYSPEC_SMIME_MISMATCH"); - case HRESULT(0x80096001) : return QStringLiteral("TRUST_E_SYSTEM_ERROR"); - case HRESULT(0x80096002) : return QStringLiteral("TRUST_E_NO_SIGNER_CERT"); - case HRESULT(0x80096003) : return QStringLiteral("TRUST_E_COUNTER_SIGNER"); - case HRESULT(0x80096004) : return QStringLiteral("TRUST_E_CERT_SIGNATURE"); - case HRESULT(0x80096005) : return QStringLiteral("TRUST_E_TIME_STAMP"); - case HRESULT(0x80096010) : return QStringLiteral("TRUST_E_BAD_DIGEST"); - case HRESULT(0x80096019) : return QStringLiteral("TRUST_E_BASIC_CONSTRAINTS"); - case HRESULT(0x8009601E) : return QStringLiteral("TRUST_E_FINANCIAL_CRITERIA"); - case HRESULT(0x80097001) : return QStringLiteral("MSSIPOTF_E_OUTOFMEMRANGE"); - case HRESULT(0x80097002) : return QStringLiteral("MSSIPOTF_E_CANTGETOBJECT"); - case HRESULT(0x80097003) : return QStringLiteral("MSSIPOTF_E_NOHEADTABLE"); - case HRESULT(0x80097004) : return QStringLiteral("MSSIPOTF_E_BAD_MAGICNUMBER"); - case HRESULT(0x80097005) : return QStringLiteral("MSSIPOTF_E_BAD_OFFSET_TABLE"); - case HRESULT(0x80097006) : return QStringLiteral("MSSIPOTF_E_TABLE_TAGORDER"); - case HRESULT(0x80097007) : return QStringLiteral("MSSIPOTF_E_TABLE_LONGWORD"); - case HRESULT(0x80097008) : return QStringLiteral("MSSIPOTF_E_BAD_FIRST_TABLE_PLACEMENT"); - case HRESULT(0x80097009) : return QStringLiteral("MSSIPOTF_E_TABLES_OVERLAP"); - case HRESULT(0x8009700A) : return QStringLiteral("MSSIPOTF_E_TABLE_PADBYTES"); - case HRESULT(0x8009700B) : return QStringLiteral("MSSIPOTF_E_FILETOOSMALL"); - case HRESULT(0x8009700C) : return QStringLiteral("MSSIPOTF_E_TABLE_CHECKSUM"); - case HRESULT(0x8009700D) : return QStringLiteral("MSSIPOTF_E_FILE_CHECKSUM"); - case HRESULT(0x80097010) : return QStringLiteral("MSSIPOTF_E_FAILED_POLICY"); - case HRESULT(0x80097011) : return QStringLiteral("MSSIPOTF_E_FAILED_HINTS_CHECK"); - case HRESULT(0x80097012) : return QStringLiteral("MSSIPOTF_E_NOT_OPENTYPE"); - case HRESULT(0x80097013) : return QStringLiteral("MSSIPOTF_E_FILE"); - case HRESULT(0x80097014) : return QStringLiteral("MSSIPOTF_E_CRYPT"); - case HRESULT(0x80097015) : return QStringLiteral("MSSIPOTF_E_BADVERSION"); - case HRESULT(0x80097016) : return QStringLiteral("MSSIPOTF_E_DSIG_STRUCTURE"); - case HRESULT(0x80097017) : return QStringLiteral("MSSIPOTF_E_PCONST_CHECK"); - case HRESULT(0x80097018) : return QStringLiteral("MSSIPOTF_E_STRUCTURE"); - case HRESULT(0x800B0001) : return QStringLiteral("TRUST_E_PROVIDER_UNKNOWN"); - case HRESULT(0x800B0002) : return QStringLiteral("TRUST_E_ACTION_UNKNOWN"); - case HRESULT(0x800B0003) : return QStringLiteral("TRUST_E_SUBJECT_FORM_UNKNOWN"); - case HRESULT(0x800B0004) : return QStringLiteral("TRUST_E_SUBJECT_NOT_TRUSTED"); - case HRESULT(0x800B0005) : return QStringLiteral("DIGSIG_E_ENCODE"); - case HRESULT(0x800B0006) : return QStringLiteral("DIGSIG_E_DECODE"); - case HRESULT(0x800B0007) : return QStringLiteral("DIGSIG_E_EXTENSIBILITY"); - case HRESULT(0x800B0008) : return QStringLiteral("DIGSIG_E_CRYPTO"); - case HRESULT(0x800B0009) : return QStringLiteral("PERSIST_E_SIZEDEFINITE"); - case HRESULT(0x800B000A) : return QStringLiteral("PERSIST_E_SIZEINDEFINITE"); - case HRESULT(0x800B000B) : return QStringLiteral("PERSIST_E_NOTSELFSIZING"); - case HRESULT(0x800B0100) : return QStringLiteral("TRUST_E_NOSIGNATURE"); - case HRESULT(0x800B0101) : return QStringLiteral("CERT_E_EXPIRED"); - case HRESULT(0x800B0102) : return QStringLiteral("CERT_E_VALIDITYPERIODNESTING"); - case HRESULT(0x800B0103) : return QStringLiteral("CERT_E_ROLE"); - case HRESULT(0x800B0104) : return QStringLiteral("CERT_E_PATHLENCONST"); - case HRESULT(0x800B0105) : return QStringLiteral("CERT_E_CRITICAL"); - case HRESULT(0x800B0106) : return QStringLiteral("CERT_E_PURPOSE"); - case HRESULT(0x800B0107) : return QStringLiteral("CERT_E_ISSUERCHAINING"); - case HRESULT(0x800B0108) : return QStringLiteral("CERT_E_MALFORMED"); - case HRESULT(0x800B0109) : return QStringLiteral("CERT_E_UNTRUSTEDROOT"); - case HRESULT(0x800B010A) : return QStringLiteral("CERT_E_CHAINING"); - case HRESULT(0x800B010B) : return QStringLiteral("TRUST_E_FAIL"); - case HRESULT(0x800B010C) : return QStringLiteral("CERT_E_REVOKED"); - case HRESULT(0x800B010D) : return QStringLiteral("CERT_E_UNTRUSTEDTESTROOT"); - case HRESULT(0x800B010E) : return QStringLiteral("CERT_E_REVOCATION_FAILURE"); - case HRESULT(0x800B010F) : return QStringLiteral("CERT_E_CN_NO_MATCH"); - case HRESULT(0x800B0110) : return QStringLiteral("CERT_E_WRONG_USAGE"); - case HRESULT(0x800B0111) : return QStringLiteral("TRUST_E_EXPLICIT_DISTRUST"); - case HRESULT(0x800B0112) : return QStringLiteral("CERT_E_UNTRUSTEDCA"); - case HRESULT(0x800B0113) : return QStringLiteral("CERT_E_INVALID_POLICY"); - case HRESULT(0x800B0114) : return QStringLiteral("CERT_E_INVALID_NAME"); - case HRESULT(0x800F0000) : return QStringLiteral("SPAPI_E_EXPECTED_SECTION_NAME"); - case HRESULT(0x800F0001) : return QStringLiteral("SPAPI_E_BAD_SECTION_NAME_LINE"); - case HRESULT(0x800F0002) : return QStringLiteral("SPAPI_E_SECTION_NAME_TOO_LONG"); - case HRESULT(0x800F0003) : return QStringLiteral("SPAPI_E_GENERAL_SYNTAX"); - case HRESULT(0x800F0100) : return QStringLiteral("SPAPI_E_WRONG_INF_STYLE"); - case HRESULT(0x800F0101) : return QStringLiteral("SPAPI_E_SECTION_NOT_FOUND"); - case HRESULT(0x800F0102) : return QStringLiteral("SPAPI_E_LINE_NOT_FOUND"); - case HRESULT(0x800F0103) : return QStringLiteral("SPAPI_E_NO_BACKUP"); - case HRESULT(0x800F0200) : return QStringLiteral("SPAPI_E_NO_ASSOCIATED_CLASS"); - case HRESULT(0x800F0201) : return QStringLiteral("SPAPI_E_CLASS_MISMATCH"); - case HRESULT(0x800F0202) : return QStringLiteral("SPAPI_E_DUPLICATE_FOUND"); - case HRESULT(0x800F0203) : return QStringLiteral("SPAPI_E_NO_DRIVER_SELECTED"); - case HRESULT(0x800F0204) : return QStringLiteral("SPAPI_E_KEY_DOES_NOT_EXIST"); - case HRESULT(0x800F0205) : return QStringLiteral("SPAPI_E_INVALID_DEVINST_NAME"); - case HRESULT(0x800F0206) : return QStringLiteral("SPAPI_E_INVALID_CLASS"); - case HRESULT(0x800F0207) : return QStringLiteral("SPAPI_E_DEVINST_ALREADY_EXISTS"); - case HRESULT(0x800F0208) : return QStringLiteral("SPAPI_E_DEVINFO_NOT_REGISTERED"); - case HRESULT(0x800F0209) : return QStringLiteral("SPAPI_E_INVALID_REG_PROPERTY"); - case HRESULT(0x800F020A) : return QStringLiteral("SPAPI_E_NO_INF"); - case HRESULT(0x800F020B) : return QStringLiteral("SPAPI_E_NO_SUCH_DEVINST"); - case HRESULT(0x800F020C) : return QStringLiteral("SPAPI_E_CANT_LOAD_CLASS_ICON"); - case HRESULT(0x800F020D) : return QStringLiteral("SPAPI_E_INVALID_CLASS_INSTALLER"); - case HRESULT(0x800F020E) : return QStringLiteral("SPAPI_E_DI_DO_DEFAULT"); - case HRESULT(0x800F020F) : return QStringLiteral("SPAPI_E_DI_NOFILECOPY"); - case HRESULT(0x800F0210) : return QStringLiteral("SPAPI_E_INVALID_HWPROFILE"); - case HRESULT(0x800F0211) : return QStringLiteral("SPAPI_E_NO_DEVICE_SELECTED"); - case HRESULT(0x800F0212) : return QStringLiteral("SPAPI_E_DEVINFO_LIST_LOCKED"); - case HRESULT(0x800F0213) : return QStringLiteral("SPAPI_E_DEVINFO_DATA_LOCKED"); - case HRESULT(0x800F0214) : return QStringLiteral("SPAPI_E_DI_BAD_PATH"); - case HRESULT(0x800F0215) : return QStringLiteral("SPAPI_E_NO_CLASSINSTALL_PARAMS"); - case HRESULT(0x800F0216) : return QStringLiteral("SPAPI_E_FILEQUEUE_LOCKED"); - case HRESULT(0x800F0217) : return QStringLiteral("SPAPI_E_BAD_SERVICE_INSTALLSECT"); - case HRESULT(0x800F0218) : return QStringLiteral("SPAPI_E_NO_CLASS_DRIVER_LIST"); - case HRESULT(0x800F0219) : return QStringLiteral("SPAPI_E_NO_ASSOCIATED_SERVICE"); - case HRESULT(0x800F021A) : return QStringLiteral("SPAPI_E_NO_DEFAULT_DEVICE_INTERFACE"); - case HRESULT(0x800F021B) : return QStringLiteral("SPAPI_E_DEVICE_INTERFACE_ACTIVE"); - case HRESULT(0x800F021C) : return QStringLiteral("SPAPI_E_DEVICE_INTERFACE_REMOVED"); - case HRESULT(0x800F021D) : return QStringLiteral("SPAPI_E_BAD_INTERFACE_INSTALLSECT"); - case HRESULT(0x800F021E) : return QStringLiteral("SPAPI_E_NO_SUCH_INTERFACE_CLASS"); - case HRESULT(0x800F021F) : return QStringLiteral("SPAPI_E_INVALID_REFERENCE_STRING"); - case HRESULT(0x800F0220) : return QStringLiteral("SPAPI_E_INVALID_MACHINENAME"); - case HRESULT(0x800F0221) : return QStringLiteral("SPAPI_E_REMOTE_COMM_FAILURE"); - case HRESULT(0x800F0222) : return QStringLiteral("SPAPI_E_MACHINE_UNAVAILABLE"); - case HRESULT(0x800F0223) : return QStringLiteral("SPAPI_E_NO_CONFIGMGR_SERVICES"); - case HRESULT(0x800F0224) : return QStringLiteral("SPAPI_E_INVALID_PROPPAGE_PROVIDER"); - case HRESULT(0x800F0225) : return QStringLiteral("SPAPI_E_NO_SUCH_DEVICE_INTERFACE"); - case HRESULT(0x800F0226) : return QStringLiteral("SPAPI_E_DI_POSTPROCESSING_REQUIRED"); - case HRESULT(0x800F0227) : return QStringLiteral("SPAPI_E_INVALID_COINSTALLER"); - case HRESULT(0x800F0228) : return QStringLiteral("SPAPI_E_NO_COMPAT_DRIVERS"); - case HRESULT(0x800F0229) : return QStringLiteral("SPAPI_E_NO_DEVICE_ICON"); - case HRESULT(0x800F022A) : return QStringLiteral("SPAPI_E_INVALID_INF_LOGCONFIG"); - case HRESULT(0x800F022B) : return QStringLiteral("SPAPI_E_DI_DONT_INSTALL"); - case HRESULT(0x800F022C) : return QStringLiteral("SPAPI_E_INVALID_FILTER_DRIVER"); - case HRESULT(0x800F022D) : return QStringLiteral("SPAPI_E_NON_WINDOWS_NT_DRIVER"); - case HRESULT(0x800F022E) : return QStringLiteral("SPAPI_E_NON_WINDOWS_DRIVER"); - case HRESULT(0x800F022F) : return QStringLiteral("SPAPI_E_NO_CATALOG_FOR_OEM_INF"); - case HRESULT(0x800F0230) : return QStringLiteral("SPAPI_E_DEVINSTALL_QUEUE_NONNATIVE"); - case HRESULT(0x800F0231) : return QStringLiteral("SPAPI_E_NOT_DISABLEABLE"); - case HRESULT(0x800F0232) : return QStringLiteral("SPAPI_E_CANT_REMOVE_DEVINST"); - case HRESULT(0x800F0233) : return QStringLiteral("SPAPI_E_INVALID_TARGET"); - case HRESULT(0x800F0234) : return QStringLiteral("SPAPI_E_DRIVER_NONNATIVE"); - case HRESULT(0x800F0235) : return QStringLiteral("SPAPI_E_IN_WOW64"); - case HRESULT(0x800F0236) : return QStringLiteral("SPAPI_E_SET_SYSTEM_RESTORE_POINT"); - case HRESULT(0x800F0237) : return QStringLiteral("SPAPI_E_INCORRECTLY_COPIED_INF"); - case HRESULT(0x800F0238) : return QStringLiteral("SPAPI_E_SCE_DISABLED"); - case HRESULT(0x800F0239) : return QStringLiteral("SPAPI_E_UNKNOWN_EXCEPTION"); - case HRESULT(0x800F023A) : return QStringLiteral("SPAPI_E_PNP_REGISTRY_ERROR"); - case HRESULT(0x800F023B) : return QStringLiteral("SPAPI_E_REMOTE_REQUEST_UNSUPPORTED"); - case HRESULT(0x800F023C) : return QStringLiteral("SPAPI_E_NOT_AN_INSTALLED_OEM_INF"); - case HRESULT(0x800F023D) : return QStringLiteral("SPAPI_E_INF_IN_USE_BY_DEVICES"); - case HRESULT(0x800F023E) : return QStringLiteral("SPAPI_E_DI_FUNCTION_OBSOLETE"); - case HRESULT(0x800F023F) : return QStringLiteral("SPAPI_E_NO_AUTHENTICODE_CATALOG"); - case HRESULT(0x800F0240) : return QStringLiteral("SPAPI_E_AUTHENTICODE_DISALLOWED"); - case HRESULT(0x800F0241) : return QStringLiteral("SPAPI_E_AUTHENTICODE_TRUSTED_PUBLISHER"); - case HRESULT(0x800F0242) : return QStringLiteral("SPAPI_E_AUTHENTICODE_TRUST_NOT_ESTABLISHED"); - case HRESULT(0x800F0243) : return QStringLiteral("SPAPI_E_AUTHENTICODE_PUBLISHER_NOT_TRUSTED"); - case HRESULT(0x800F0244) : return QStringLiteral("SPAPI_E_SIGNATURE_OSATTRIBUTE_MISMATCH"); - case HRESULT(0x800F0245) : return QStringLiteral("SPAPI_E_ONLY_VALIDATE_VIA_AUTHENTICODE"); - case HRESULT(0x800F0300) : return QStringLiteral("SPAPI_E_UNRECOVERABLE_STACK_OVERFLOW"); - case HRESULT(0x800F1000) : return QStringLiteral("SPAPI_E_ERROR_NOT_INSTALLED"); - case HRESULT(0x80100001) : return QStringLiteral("SCARD_F_INTERNAL_ERROR"); - case HRESULT(0x80100002) : return QStringLiteral("SCARD_E_CANCELLED"); - case HRESULT(0x80100003) : return QStringLiteral("SCARD_E_INVALID_HANDLE"); - case HRESULT(0x80100004) : return QStringLiteral("SCARD_E_INVALID_PARAMETER"); - case HRESULT(0x80100005) : return QStringLiteral("SCARD_E_INVALID_TARGET"); - case HRESULT(0x80100006) : return QStringLiteral("SCARD_E_NO_MEMORY"); - case HRESULT(0x80100007) : return QStringLiteral("SCARD_F_WAITED_TOO_LONG"); - case HRESULT(0x80100008) : return QStringLiteral("SCARD_E_INSUFFICIENT_BUFFER"); - case HRESULT(0x80100009) : return QStringLiteral("SCARD_E_UNKNOWN_READER"); - case HRESULT(0x8010000A) : return QStringLiteral("SCARD_E_TIMEOUT"); - case HRESULT(0x8010000B) : return QStringLiteral("SCARD_E_SHARING_VIOLATION"); - case HRESULT(0x8010000C) : return QStringLiteral("SCARD_E_NO_SMARTCARD"); - case HRESULT(0x8010000D) : return QStringLiteral("SCARD_E_UNKNOWN_CARD"); - case HRESULT(0x8010000E) : return QStringLiteral("SCARD_E_CANT_DISPOSE"); - case HRESULT(0x8010000F) : return QStringLiteral("SCARD_E_PROTO_MISMATCH"); - case HRESULT(0x80100010) : return QStringLiteral("SCARD_E_NOT_READY"); - case HRESULT(0x80100011) : return QStringLiteral("SCARD_E_INVALID_VALUE"); - case HRESULT(0x80100012) : return QStringLiteral("SCARD_E_SYSTEM_CANCELLED"); - case HRESULT(0x80100013) : return QStringLiteral("SCARD_F_COMM_ERROR"); - case HRESULT(0x80100014) : return QStringLiteral("SCARD_F_UNKNOWN_ERROR"); - case HRESULT(0x80100015) : return QStringLiteral("SCARD_E_INVALID_ATR"); - case HRESULT(0x80100016) : return QStringLiteral("SCARD_E_NOT_TRANSACTED"); - case HRESULT(0x80100017) : return QStringLiteral("SCARD_E_READER_UNAVAILABLE"); - case HRESULT(0x80100018) : return QStringLiteral("SCARD_P_SHUTDOWN"); - case HRESULT(0x80100019) : return QStringLiteral("SCARD_E_PCI_TOO_SMALL"); - case HRESULT(0x8010001A) : return QStringLiteral("SCARD_E_READER_UNSUPPORTED"); - case HRESULT(0x8010001B) : return QStringLiteral("SCARD_E_DUPLICATE_READER"); - case HRESULT(0x8010001C) : return QStringLiteral("SCARD_E_CARD_UNSUPPORTED"); - case HRESULT(0x8010001D) : return QStringLiteral("SCARD_E_NO_SERVICE"); - case HRESULT(0x8010001E) : return QStringLiteral("SCARD_E_SERVICE_STOPPED"); - case HRESULT(0x8010001F) : return QStringLiteral("SCARD_E_UNEXPECTED"); - case HRESULT(0x80100020) : return QStringLiteral("SCARD_E_ICC_INSTALLATION"); - case HRESULT(0x80100021) : return QStringLiteral("SCARD_E_ICC_CREATEORDER"); - case HRESULT(0x80100022) : return QStringLiteral("SCARD_E_UNSUPPORTED_FEATURE"); - case HRESULT(0x80100023) : return QStringLiteral("SCARD_E_DIR_NOT_FOUND"); - case HRESULT(0x80100024) : return QStringLiteral("SCARD_E_FILE_NOT_FOUND"); - case HRESULT(0x80100025) : return QStringLiteral("SCARD_E_NO_DIR"); - case HRESULT(0x80100026) : return QStringLiteral("SCARD_E_NO_FILE"); - case HRESULT(0x80100027) : return QStringLiteral("SCARD_E_NO_ACCESS"); - case HRESULT(0x80100028) : return QStringLiteral("SCARD_E_WRITE_TOO_MANY"); - case HRESULT(0x80100029) : return QStringLiteral("SCARD_E_BAD_SEEK"); - case HRESULT(0x8010002A) : return QStringLiteral("SCARD_E_INVALID_CHV"); - case HRESULT(0x8010002B) : return QStringLiteral("SCARD_E_UNKNOWN_RES_MNG"); - case HRESULT(0x8010002C) : return QStringLiteral("SCARD_E_NO_SUCH_CERTIFICATE"); - case HRESULT(0x8010002D) : return QStringLiteral("SCARD_E_CERTIFICATE_UNAVAILABLE"); - case HRESULT(0x8010002E) : return QStringLiteral("SCARD_E_NO_READERS_AVAILABLE"); - case HRESULT(0x8010002F) : return QStringLiteral("SCARD_E_COMM_DATA_LOST"); - case HRESULT(0x80100030) : return QStringLiteral("SCARD_E_NO_KEY_CONTAINER"); - case HRESULT(0x80100031) : return QStringLiteral("SCARD_E_SERVER_TOO_BUSY"); - case HRESULT(0x80100065) : return QStringLiteral("SCARD_W_UNSUPPORTED_CARD"); - case HRESULT(0x80100066) : return QStringLiteral("SCARD_W_UNRESPONSIVE_CARD"); - case HRESULT(0x80100067) : return QStringLiteral("SCARD_W_UNPOWERED_CARD"); - case HRESULT(0x80100068) : return QStringLiteral("SCARD_W_RESET_CARD"); - case HRESULT(0x80100069) : return QStringLiteral("SCARD_W_REMOVED_CARD"); - case HRESULT(0x8010006A) : return QStringLiteral("SCARD_W_SECURITY_VIOLATION"); - case HRESULT(0x8010006B) : return QStringLiteral("SCARD_W_WRONG_CHV"); - case HRESULT(0x8010006C) : return QStringLiteral("SCARD_W_CHV_BLOCKED"); - case HRESULT(0x8010006D) : return QStringLiteral("SCARD_W_EOF"); - case HRESULT(0x8010006E) : return QStringLiteral("SCARD_W_CANCELLED_BY_USER"); - case HRESULT(0x8010006F) : return QStringLiteral("SCARD_W_CARD_NOT_AUTHENTICATED"); - case HRESULT(0x80100070) : return QStringLiteral("SCARD_W_CACHE_ITEM_NOT_FOUND"); - case HRESULT(0x80100071) : return QStringLiteral("SCARD_W_CACHE_ITEM_STALE"); - case HRESULT(0x80110401) : return QStringLiteral("COMADMIN_E_OBJECTERRORS"); - case HRESULT(0x80110402) : return QStringLiteral("COMADMIN_E_OBJECTINVALID"); - case HRESULT(0x80110403) : return QStringLiteral("COMADMIN_E_KEYMISSING"); - case HRESULT(0x80110404) : return QStringLiteral("COMADMIN_E_ALREADYINSTALLED"); - case HRESULT(0x80110407) : return QStringLiteral("COMADMIN_E_APP_FILE_WRITEFAIL"); - case HRESULT(0x80110408) : return QStringLiteral("COMADMIN_E_APP_FILE_READFAIL"); - case HRESULT(0x80110409) : return QStringLiteral("COMADMIN_E_APP_FILE_VERSION"); - case HRESULT(0x8011040A) : return QStringLiteral("COMADMIN_E_BADPATH"); - case HRESULT(0x8011040B) : return QStringLiteral("COMADMIN_E_APPLICATIONEXISTS"); - case HRESULT(0x8011040C) : return QStringLiteral("COMADMIN_E_ROLEEXISTS"); - case HRESULT(0x8011040D) : return QStringLiteral("COMADMIN_E_CANTCOPYFILE"); - case HRESULT(0x8011040F) : return QStringLiteral("COMADMIN_E_NOUSER"); - case HRESULT(0x80110410) : return QStringLiteral("COMADMIN_E_INVALIDUSERIDS"); - case HRESULT(0x80110411) : return QStringLiteral("COMADMIN_E_NOREGISTRYCLSID"); - case HRESULT(0x80110412) : return QStringLiteral("COMADMIN_E_BADREGISTRYPROGID"); - case HRESULT(0x80110413) : return QStringLiteral("COMADMIN_E_AUTHENTICATIONLEVEL"); - case HRESULT(0x80110414) : return QStringLiteral("COMADMIN_E_USERPASSWDNOTVALID"); - case HRESULT(0x80110418) : return QStringLiteral("COMADMIN_E_CLSIDORIIDMISMATCH"); - case HRESULT(0x80110419) : return QStringLiteral("COMADMIN_E_REMOTEINTERFACE"); - case HRESULT(0x8011041A) : return QStringLiteral("COMADMIN_E_DLLREGISTERSERVER"); - case HRESULT(0x8011041B) : return QStringLiteral("COMADMIN_E_NOSERVERSHARE"); - case HRESULT(0x8011041D) : return QStringLiteral("COMADMIN_E_DLLLOADFAILED"); - case HRESULT(0x8011041E) : return QStringLiteral("COMADMIN_E_BADREGISTRYLIBID"); - case HRESULT(0x8011041F) : return QStringLiteral("COMADMIN_E_APPDIRNOTFOUND"); - case HRESULT(0x80110423) : return QStringLiteral("COMADMIN_E_REGISTRARFAILED"); - case HRESULT(0x80110424) : return QStringLiteral("COMADMIN_E_COMPFILE_DOESNOTEXIST"); - case HRESULT(0x80110425) : return QStringLiteral("COMADMIN_E_COMPFILE_LOADDLLFAIL"); - case HRESULT(0x80110426) : return QStringLiteral("COMADMIN_E_COMPFILE_GETCLASSOBJ"); - case HRESULT(0x80110427) : return QStringLiteral("COMADMIN_E_COMPFILE_CLASSNOTAVAIL"); - case HRESULT(0x80110428) : return QStringLiteral("COMADMIN_E_COMPFILE_BADTLB"); - case HRESULT(0x80110429) : return QStringLiteral("COMADMIN_E_COMPFILE_NOTINSTALLABLE"); - case HRESULT(0x8011042A) : return QStringLiteral("COMADMIN_E_NOTCHANGEABLE"); - case HRESULT(0x8011042B) : return QStringLiteral("COMADMIN_E_NOTDELETEABLE"); - case HRESULT(0x8011042C) : return QStringLiteral("COMADMIN_E_SESSION"); - case HRESULT(0x8011042D) : return QStringLiteral("COMADMIN_E_COMP_MOVE_LOCKED"); - case HRESULT(0x8011042E) : return QStringLiteral("COMADMIN_E_COMP_MOVE_BAD_DEST"); - case HRESULT(0x80110430) : return QStringLiteral("COMADMIN_E_REGISTERTLB"); - case HRESULT(0x80110433) : return QStringLiteral("COMADMIN_E_SYSTEMAPP"); - case HRESULT(0x80110434) : return QStringLiteral("COMADMIN_E_COMPFILE_NOREGISTRAR"); - case HRESULT(0x80110435) : return QStringLiteral("COMADMIN_E_COREQCOMPINSTALLED"); - case HRESULT(0x80110436) : return QStringLiteral("COMADMIN_E_SERVICENOTINSTALLED"); - case HRESULT(0x80110437) : return QStringLiteral("COMADMIN_E_PROPERTYSAVEFAILED"); - case HRESULT(0x80110438) : return QStringLiteral("COMADMIN_E_OBJECTEXISTS"); - case HRESULT(0x80110439) : return QStringLiteral("COMADMIN_E_COMPONENTEXISTS"); - case HRESULT(0x8011043B) : return QStringLiteral("COMADMIN_E_REGFILE_CORRUPT"); - case HRESULT(0x8011043C) : return QStringLiteral("COMADMIN_E_PROPERTY_OVERFLOW"); - case HRESULT(0x8011043E) : return QStringLiteral("COMADMIN_E_NOTINREGISTRY"); - case HRESULT(0x8011043F) : return QStringLiteral("COMADMIN_E_OBJECTNOTPOOLABLE"); - case HRESULT(0x80110446) : return QStringLiteral("COMADMIN_E_APPLID_MATCHES_CLSID"); - case HRESULT(0x80110447) : return QStringLiteral("COMADMIN_E_ROLE_DOES_NOT_EXIST"); - case HRESULT(0x80110448) : return QStringLiteral("COMADMIN_E_START_APP_NEEDS_COMPONENTS"); - case HRESULT(0x80110449) : return QStringLiteral("COMADMIN_E_REQUIRES_DIFFERENT_PLATFORM"); - case HRESULT(0x8011044A) : return QStringLiteral("COMADMIN_E_CAN_NOT_EXPORT_APP_PROXY"); - case HRESULT(0x8011044B) : return QStringLiteral("COMADMIN_E_CAN_NOT_START_APP"); - case HRESULT(0x8011044C) : return QStringLiteral("COMADMIN_E_CAN_NOT_EXPORT_SYS_APP"); - case HRESULT(0x8011044D) : return QStringLiteral("COMADMIN_E_CANT_SUBSCRIBE_TO_COMPONENT"); - case HRESULT(0x8011044E) : return QStringLiteral("COMADMIN_E_EVENTCLASS_CANT_BE_SUBSCRIBER"); - case HRESULT(0x8011044F) : return QStringLiteral("COMADMIN_E_LIB_APP_PROXY_INCOMPATIBLE"); - case HRESULT(0x80110450) : return QStringLiteral("COMADMIN_E_BASE_PARTITION_ONLY"); - case HRESULT(0x80110451) : return QStringLiteral("COMADMIN_E_START_APP_DISABLED"); - case HRESULT(0x80110457) : return QStringLiteral("COMADMIN_E_CAT_DUPLICATE_PARTITION_NAME"); - case HRESULT(0x80110458) : return QStringLiteral("COMADMIN_E_CAT_INVALID_PARTITION_NAME"); - case HRESULT(0x80110459) : return QStringLiteral("COMADMIN_E_CAT_PARTITION_IN_USE"); - case HRESULT(0x8011045A) : return QStringLiteral("COMADMIN_E_FILE_PARTITION_DUPLICATE_FILES"); - case HRESULT(0x8011045B) : return QStringLiteral("COMADMIN_E_CAT_IMPORTED_COMPONENTS_NOT_ALLOWED"); - case HRESULT(0x8011045C) : return QStringLiteral("COMADMIN_E_AMBIGUOUS_APPLICATION_NAME"); - case HRESULT(0x8011045D) : return QStringLiteral("COMADMIN_E_AMBIGUOUS_PARTITION_NAME"); - case HRESULT(0x80110472) : return QStringLiteral("COMADMIN_E_REGDB_NOTINITIALIZED"); - case HRESULT(0x80110473) : return QStringLiteral("COMADMIN_E_REGDB_NOTOPEN"); - case HRESULT(0x80110474) : return QStringLiteral("COMADMIN_E_REGDB_SYSTEMERR"); - case HRESULT(0x80110475) : return QStringLiteral("COMADMIN_E_REGDB_ALREADYRUNNING"); - case HRESULT(0x80110480) : return QStringLiteral("COMADMIN_E_MIG_VERSIONNOTSUPPORTED"); - case HRESULT(0x80110481) : return QStringLiteral("COMADMIN_E_MIG_SCHEMANOTFOUND"); - case HRESULT(0x80110482) : return QStringLiteral("COMADMIN_E_CAT_BITNESSMISMATCH"); - case HRESULT(0x80110483) : return QStringLiteral("COMADMIN_E_CAT_UNACCEPTABLEBITNESS"); - case HRESULT(0x80110484) : return QStringLiteral("COMADMIN_E_CAT_WRONGAPPBITNESS"); - case HRESULT(0x80110485) : return QStringLiteral("COMADMIN_E_CAT_PAUSE_RESUME_NOT_SUPPORTED"); - case HRESULT(0x80110486) : return QStringLiteral("COMADMIN_E_CAT_SERVERFAULT"); - case HRESULT(0x80110600) : return QStringLiteral("COMQC_E_APPLICATION_NOT_QUEUED"); - case HRESULT(0x80110601) : return QStringLiteral("COMQC_E_NO_QUEUEABLE_INTERFACES"); - case HRESULT(0x80110602) : return QStringLiteral("COMQC_E_QUEUING_SERVICE_NOT_AVAILABLE"); - case HRESULT(0x80110603) : return QStringLiteral("COMQC_E_NO_IPERSISTSTREAM"); - case HRESULT(0x80110604) : return QStringLiteral("COMQC_E_BAD_MESSAGE"); - case HRESULT(0x80110605) : return QStringLiteral("COMQC_E_UNAUTHENTICATED"); - case HRESULT(0x80110606) : return QStringLiteral("COMQC_E_UNTRUSTED_ENQUEUER"); - case HRESULT(0x80110701) : return QStringLiteral("MSDTC_E_DUPLICATE_RESOURCE"); - case HRESULT(0x80110808) : return QStringLiteral("COMADMIN_E_OBJECT_PARENT_MISSING"); - case HRESULT(0x80110809) : return QStringLiteral("COMADMIN_E_OBJECT_DOES_NOT_EXIST"); - case HRESULT(0x8011080A) : return QStringLiteral("COMADMIN_E_APP_NOT_RUNNING"); - case HRESULT(0x8011080B) : return QStringLiteral("COMADMIN_E_INVALID_PARTITION"); - case HRESULT(0x8011080D) : return QStringLiteral("COMADMIN_E_SVCAPP_NOT_POOLABLE_OR_RECYCLABLE"); - case HRESULT(0x8011080E) : return QStringLiteral("COMADMIN_E_USER_IN_SET"); - case HRESULT(0x8011080F) : return QStringLiteral("COMADMIN_E_CANTRECYCLELIBRARYAPPS"); - case HRESULT(0x80110811) : return QStringLiteral("COMADMIN_E_CANTRECYCLESERVICEAPPS"); - case HRESULT(0x80110812) : return QStringLiteral("COMADMIN_E_PROCESSALREADYRECYCLED"); - case HRESULT(0x80110813) : return QStringLiteral("COMADMIN_E_PAUSEDPROCESSMAYNOTBERECYCLED"); - case HRESULT(0x80110814) : return QStringLiteral("COMADMIN_E_CANTMAKEINPROCSERVICE"); - case HRESULT(0x80110815) : return QStringLiteral("COMADMIN_E_PROGIDINUSEBYCLSID"); - case HRESULT(0x80110816) : return QStringLiteral("COMADMIN_E_DEFAULT_PARTITION_NOT_IN_SET"); - case HRESULT(0x80110817) : return QStringLiteral("COMADMIN_E_RECYCLEDPROCESSMAYNOTBEPAUSED"); - case HRESULT(0x80110818) : return QStringLiteral("COMADMIN_E_PARTITION_ACCESSDENIED"); - case HRESULT(0x80110819) : return QStringLiteral("COMADMIN_E_PARTITION_MSI_ONLY"); - case HRESULT(0x8011081A) : return QStringLiteral("COMADMIN_E_LEGACYCOMPS_NOT_ALLOWED_IN_1_0_FORMAT"); - case HRESULT(0x8011081B) : return QStringLiteral("COMADMIN_E_LEGACYCOMPS_NOT_ALLOWED_IN_NONBASE_PARTITIONS"); - case HRESULT(0x8011081C) : return QStringLiteral("COMADMIN_E_COMP_MOVE_SOURCE"); - case HRESULT(0x8011081D) : return QStringLiteral("COMADMIN_E_COMP_MOVE_DEST"); - case HRESULT(0x8011081E) : return QStringLiteral("COMADMIN_E_COMP_MOVE_PRIVATE"); - case HRESULT(0x8011081F) : return QStringLiteral("COMADMIN_E_BASEPARTITION_REQUIRED_IN_SET"); - case HRESULT(0x80110820) : return QStringLiteral("COMADMIN_E_CANNOT_ALIAS_EVENTCLASS"); - case HRESULT(0x80110821) : return QStringLiteral("COMADMIN_E_PRIVATE_ACCESSDENIED"); - case HRESULT(0x80110822) : return QStringLiteral("COMADMIN_E_SAFERINVALID"); - case HRESULT(0x80110823) : return QStringLiteral("COMADMIN_E_REGISTRY_ACCESSDENIED"); - case HRESULT(0x80110824) : return QStringLiteral("COMADMIN_E_PARTITIONS_DISABLED"); - case HRESULT(0x80042301) : return QStringLiteral("VSS_E_BAD_STATE"); - case HRESULT(0x800423F7) : return QStringLiteral("VSS_E_LEGACY_PROVIDER"); - case HRESULT(0x800423FF) : return QStringLiteral("VSS_E_RESYNC_IN_PROGRESS"); - case HRESULT(0x8004232B) : return QStringLiteral("VSS_E_SNAPSHOT_NOT_IN_SET"); - case HRESULT(0x80042312) : return QStringLiteral("VSS_E_MAXIMUM_NUMBER_OF_VOLUMES_REACHED"); - case HRESULT(0x80042317) : return QStringLiteral("VSS_E_MAXIMUM_NUMBER_OF_SNAPSHOTS_REACHED"); - case HRESULT(0x8004232C) : return QStringLiteral("VSS_E_NESTED_VOLUME_LIMIT"); - case HRESULT(0x80042308) : return QStringLiteral("VSS_E_OBJECT_NOT_FOUND"); - case HRESULT(0x80042304) : return QStringLiteral("VSS_E_PROVIDER_NOT_REGISTERED"); - case HRESULT(0x80042306) : return QStringLiteral("VSS_E_PROVIDER_VETO"); - case HRESULT(0x8004230C) : return QStringLiteral("VSS_E_VOLUME_NOT_SUPPORTED"); - case HRESULT(0x8004230E) : return QStringLiteral("VSS_E_VOLUME_NOT_SUPPORTED_BY_PROVIDER"); - case HRESULT(0x80042302) : return QStringLiteral("VSS_E_UNEXPECTED"); - case HRESULT(0x8004230F) : return QStringLiteral("VSS_E_UNEXPECTED_PROVIDER_ERROR"); - case HRESULT(0x8004232A) : return QStringLiteral("VSS_E_UNSELECTED_VOLUME"); - case HRESULT(0x800423FE) : return QStringLiteral("VSS_E_CANNOT_REVERT_DISKID"); - case HRESULT(0x80042311) : return QStringLiteral("VSS_E_INVALID_XML_DOCUMENT"); - case HRESULT(0x8004230D) : return QStringLiteral("VSS_E_OBJECT_ALREADY_EXISTS"); - case HRESULT(0x80284001) : return QStringLiteral("TBS_E_INTERNAL_ERROR"); - case HRESULT(0x80284002) : return QStringLiteral("TBS_E_BAD_PARAMETER"); - case HRESULT(0x80284003) : return QStringLiteral("TBS_E_INVALID_OUTPUT_POINTER"); - case HRESULT(0x80284005) : return QStringLiteral("TBS_E_INSUFFICIENT_BUFFER"); - case HRESULT(0x80284006) : return QStringLiteral("TBS_E_IOERROR"); - case HRESULT(0x80284007) : return QStringLiteral("TBS_E_INVALID_CONTEXT_PARAM"); - case HRESULT(0x80284008) : return QStringLiteral("TBS_E_SERVICE_NOT_RUNNING"); - case HRESULT(0x80284009) : return QStringLiteral("TBS_E_TOO_MANY_TBS_CONTEXTS"); - case HRESULT(0x8028400B) : return QStringLiteral("TBS_E_SERVICE_START_PENDING"); - case HRESULT(0x8028400E) : return QStringLiteral("TBS_E_BUFFER_TOO_LARGE"); - case HRESULT(0x8028400F) : return QStringLiteral("TBS_E_TPM_NOT_FOUND"); - case HRESULT(0x80284010) : return QStringLiteral("TBS_E_SERVICE_DISABLED"); - case HRESULT(0x80284016) : return QStringLiteral("TBS_E_DEACTIVATED"); - case HRESULT(0x80320001) : return QStringLiteral("FWP_E_CALLOUT_NOT_FOUND"); - case HRESULT(0x80320002) : return QStringLiteral("FWP_E_CONDITION_NOT_FOUND"); - case HRESULT(0x80320003) : return QStringLiteral("FWP_E_FILTER_NOT_FOUND"); - case HRESULT(0x80320004) : return QStringLiteral("FWP_E_LAYER_NOT_FOUND"); - case HRESULT(0x80320005) : return QStringLiteral("FWP_E_PROVIDER_NOT_FOUND"); - case HRESULT(0x80320006) : return QStringLiteral("FWP_E_PROVIDER_CONTEXT_NOT_FOUND"); - case HRESULT(0x80320007) : return QStringLiteral("FWP_E_SUBLAYER_NOT_FOUND"); - case HRESULT(0x80320008) : return QStringLiteral("FWP_E_NOT_FOUND"); - case HRESULT(0x80320009) : return QStringLiteral("FWP_E_ALREADY_EXISTS"); - case HRESULT(0x8032000A) : return QStringLiteral("FWP_E_IN_USE"); - case HRESULT(0x8032000B) : return QStringLiteral("FWP_E_DYNAMIC_SESSION_IN_PROGRESS"); - case HRESULT(0x8032000C) : return QStringLiteral("FWP_E_WRONG_SESSION"); - case HRESULT(0x8032000D) : return QStringLiteral("FWP_E_NO_TXN_IN_PROGRESS"); - case HRESULT(0x8032000E) : return QStringLiteral("FWP_E_TXN_IN_PROGRESS"); - case HRESULT(0x8032000F) : return QStringLiteral("FWP_E_TXN_ABORTED"); - case HRESULT(0x80320010) : return QStringLiteral("FWP_E_SESSION_ABORTED"); - case HRESULT(0x80320011) : return QStringLiteral("FWP_E_INCOMPATIBLE_TXN"); - case HRESULT(0x80320012) : return QStringLiteral("FWP_E_TIMEOUT"); - case HRESULT(0x80320013) : return QStringLiteral("FWP_E_NET_EVENTS_DISABLED"); - case HRESULT(0x80320014) : return QStringLiteral("FWP_E_INCOMPATIBLE_LAYER"); - case HRESULT(0x80320015) : return QStringLiteral("FWP_E_KM_CLIENTS_ONLY"); - case HRESULT(0x80320016) : return QStringLiteral("FWP_E_LIFETIME_MISMATCH"); - case HRESULT(0x80320017) : return QStringLiteral("FWP_E_BUILTIN_OBJECT"); - case HRESULT(0x80320018) : return QStringLiteral("FWP_E_TOO_MANY_CALLOUTS"); - case HRESULT(0x80320019) : return QStringLiteral("FWP_E_NOTIFICATION_DROPPED"); - case HRESULT(0x8032001A) : return QStringLiteral("FWP_E_TRAFFIC_MISMATCH"); - case HRESULT(0x8032001B) : return QStringLiteral("FWP_E_INCOMPATIBLE_SA_STATE"); - case HRESULT(0x8032001C) : return QStringLiteral("FWP_E_NULL_POINTER"); - case HRESULT(0x8032001D) : return QStringLiteral("FWP_E_INVALID_ENUMERATOR"); - case HRESULT(0x8032001E) : return QStringLiteral("FWP_E_INVALID_FLAGS"); - case HRESULT(0x8032001F) : return QStringLiteral("FWP_E_INVALID_NET_MASK"); - case HRESULT(0x80320020) : return QStringLiteral("FWP_E_INVALID_RANGE"); - case HRESULT(0x80320021) : return QStringLiteral("FWP_E_INVALID_INTERVAL"); - case HRESULT(0x80320022) : return QStringLiteral("FWP_E_ZERO_LENGTH_ARRAY"); - case HRESULT(0x80320023) : return QStringLiteral("FWP_E_NULL_DISPLAY_NAME"); - case HRESULT(0x80320024) : return QStringLiteral("FWP_E_INVALID_ACTION_TYPE"); - case HRESULT(0x80320025) : return QStringLiteral("FWP_E_INVALID_WEIGHT"); - case HRESULT(0x80320026) : return QStringLiteral("FWP_E_MATCH_TYPE_MISMATCH"); - case HRESULT(0x80320027) : return QStringLiteral("FWP_E_TYPE_MISMATCH"); - case HRESULT(0x80320028) : return QStringLiteral("FWP_E_OUT_OF_BOUNDS"); - case HRESULT(0x80320029) : return QStringLiteral("FWP_E_RESERVED"); - case HRESULT(0x8032002A) : return QStringLiteral("FWP_E_DUPLICATE_CONDITION"); - case HRESULT(0x8032002B) : return QStringLiteral("FWP_E_DUPLICATE_KEYMOD"); - case HRESULT(0x8032002C) : return QStringLiteral("FWP_E_ACTION_INCOMPATIBLE_WITH_LAYER"); - case HRESULT(0x8032002D) : return QStringLiteral("FWP_E_ACTION_INCOMPATIBLE_WITH_SUBLAYER"); - case HRESULT(0x8032002E) : return QStringLiteral("FWP_E_CONTEXT_INCOMPATIBLE_WITH_LAYER"); - case HRESULT(0x8032002F) : return QStringLiteral("FWP_E_CONTEXT_INCOMPATIBLE_WITH_CALLOUT"); - case HRESULT(0x80320030) : return QStringLiteral("FWP_E_INCOMPATIBLE_AUTH_METHOD"); - case HRESULT(0x80320031) : return QStringLiteral("FWP_E_INCOMPATIBLE_DH_GROUP"); - case HRESULT(0x80320032) : return QStringLiteral("FWP_E_EM_NOT_SUPPORTED"); - case HRESULT(0x80320033) : return QStringLiteral("FWP_E_NEVER_MATCH"); - case HRESULT(0x80320034) : return QStringLiteral("FWP_E_PROVIDER_CONTEXT_MISMATCH"); - case HRESULT(0x80320035) : return QStringLiteral("FWP_E_INVALID_PARAMETER"); - case HRESULT(0x80320036) : return QStringLiteral("FWP_E_TOO_MANY_SUBLAYERS"); - case HRESULT(0x80320037) : return QStringLiteral("FWP_E_CALLOUT_NOTIFICATION_FAILED"); - case HRESULT(0x80320038) : return QStringLiteral("FWP_E_INVALID_AUTH_TRANSFORM"); - case HRESULT(0x80320039) : return QStringLiteral("FWP_E_INVALID_CIPHER_TRANSFORM"); - default : return QString(); - } -} - -/*! - \since 5.2 - - Returns the DWM colorization color. After the function returns, the optional - \a opaqueBlend will contain true if the color is an opaque blend and false - otherwise. - */ -QColor QtWin::colorizationColor(bool *opaqueBlend) -{ - QWinEventFilter::setup(); - - DWORD colorization = 0; - BOOL dummy = false; - DwmGetColorizationColor(&colorization, &dummy); - if (opaqueBlend) - *opaqueBlend = dummy; - return QColor::fromRgba(colorization); -} - -/*! - \since 5.2 - - Returns the real colorization color, set by the user, using an undocumented - registry key. The API-based function \c getColorizationColor() returns an - alpha-blended color which often turns out a semitransparent gray rather - than something similar to what is chosen by the user. - - \sa colorizationColor() - */ -QColor QtWin::realColorizationColor() -{ - QWinEventFilter::setup(); - - bool ok = false; - const QLatin1String path("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\DWM"); - QSettings registry(path, QSettings::NativeFormat); - QRgb color = registry.value(QLatin1String("ColorizationColor")).toUInt(&ok); - if (!ok) - qDebug("Failed to read colorization color."); - return ok ? QColor::fromRgba(color) : QColor(); -} - -/*! - \fn QtWin::setWindowExcludedFromPeek(QWidget *window, bool exclude) - \since 5.2 - \overload QtWin::setWindowExcludedFromPeek() -*/ - -/*! - \since 5.2 - - Excludes the specified \a window from Aero Peek if \a exclude is true. - */ -void QtWin::setWindowExcludedFromPeek(QWindow *window, bool exclude) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - QtDwmApiDll::setBooleanWindowAttribute(reinterpret_cast<HWND>(window->winId()), qt_DWMWA_EXCLUDED_FROM_PEEK, exclude); -} - -/*! - \fn bool QtWin::isWindowExcludedFromPeek(QWidget *window) - \since 5.2 - \overload QtWin::isWindowExcludedFromPeek() -*/ - -/*! - \since 5.2 - - Returns true if the specified \a window is excluded from Aero Peek. - */ -bool QtWin::isWindowExcludedFromPeek(QWindow *window) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - return QtDwmApiDll::booleanWindowAttribute(reinterpret_cast<HWND>(window->winId()), qt_DWMWA_EXCLUDED_FROM_PEEK); -} - -/*! - \fn void QtWin::setWindowDisallowPeek(QWidget *window, bool disallow) - \since 5.2 - \overload QtWin::setWindowDisallowPeek() -*/ - -/*! - \since 5.2 - - Disables Aero Peek for the specified \a window when hovering over the - taskbar thumbnail of the window with the mouse pointer if \a disallow is - true; otherwise allows it. - - The default is false. - */ -void QtWin::setWindowDisallowPeek(QWindow *window, bool disallow) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - QtDwmApiDll::setBooleanWindowAttribute(reinterpret_cast<HWND>(window->winId()), qt_DWMWA_DISALLOW_PEEK, disallow); -} - -/*! - \fn bool QtWin::isWindowPeekDisallowed(QWidget *window) - \since 5.2 - \overload QtWin::isWindowPeekDisallowed() -*/ - -/*! - \since 5.2 - - Returns true if Aero Peek is disallowed on the thumbnail of the specified - \a window. - */ -bool QtWin::isWindowPeekDisallowed(QWindow *window) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - return QtDwmApiDll::booleanWindowAttribute(reinterpret_cast<HWND>(window->winId()), qt_DWMWA_DISALLOW_PEEK); -} - -/*! - \fn void QtWin::setWindowFlip3DPolicy(QWidget *window, QtWin::WindowFlip3DPolicy policy) - \since 5.2 - \overload QtWin::setWindowFlip3DPolicy() -*/ - -/*! - \since 5.2 - - Sets the Flip3D policy \a policy for the specified \a window. - */ -void QtWin::setWindowFlip3DPolicy(QWindow *window, QtWin::WindowFlip3DPolicy policy) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - - HWND handle = reinterpret_cast<HWND>(window->winId()); - - // Policy should be defaulted first, bug or smth. - DWORD value = DWMFLIP3D_DEFAULT; - QtDwmApiDll::setWindowAttribute(handle, DWMWA_FLIP3D_POLICY, value); - - switch (policy) { - default : - case FlipDefault : - value = -1; - break; - case FlipExcludeBelow : - value = DWMFLIP3D_EXCLUDEBELOW; - break; - case FlipExcludeAbove : - value = DWMFLIP3D_EXCLUDEABOVE; - break; - } - - if (DWMFLIP3D_DEFAULT != value) - QtDwmApiDll::setWindowAttribute(handle, DWMWA_FLIP3D_POLICY, value); -} - -/*! - \fn QtWin::WindowFlip3DPolicy QtWin::windowFlip3DPolicy(QWidget *window) - \since 5.2 - \overload QtWin::windowFlip3DPolicy() - */ - -/*! - \since 5.2 - - Returns the current Flip3D policy for the specified \a window. - */ -QtWin::WindowFlip3DPolicy QtWin::windowFlip3DPolicy(QWindow *window) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - - const auto value = - QtDwmApiDll::windowAttribute<DWORD>(reinterpret_cast<HWND>(window->winId()), - DWMWA_FLIP3D_POLICY, DWORD(DWMFLIP3D_DEFAULT)); - QtWin::WindowFlip3DPolicy policy = QtWin::FlipDefault; - switch (value) { - case DWMFLIP3D_EXCLUDEABOVE : - policy = QtWin::FlipExcludeAbove; - break; - case DWMFLIP3D_EXCLUDEBELOW : - policy = QtWin::FlipExcludeBelow; - break; - default : - break; - } - return policy; -} - -/*! - \since 6.0 - - Sets the non-client area rendering policy \a policy for the specified \a window. - - \note Disabling non-client area rendering will cause any previous calls to - QtWin::enableBlurBehindWindow() or to QtWin::extendFrameIntoClientArea() to be disabled. - */ -void QtWin::setWindowNonClientAreaRenderingPolicy(QWindow *window, QtWin::WindowNonClientRenderingPolicy policy) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - - HWND handle = reinterpret_cast<HWND>(window->winId()); - - DWORD value = DWMNCRP_USEWINDOWSTYLE; - - switch (policy) { - default : - case NonClientRenderingUseWindowStyle : - break; - case NonClientRenderingDisabled : - value = DWMNCRP_DISABLED; - break; - case NonClientRenderingEnabled : - value = DWMNCRP_ENABLED; - break; - } - - QtDwmApiDll::setWindowAttribute(handle, DWMWA_NCRENDERING_POLICY, value); -} - -/*! - \fn QtWin::WindowNonClientRenderingPolicy QtWin::windowNonClientAreaRenderingPolicy(QWidget *window) - \since 6.0 - \overload QtWin::windowNonClientAreaRenderingPolicy() - */ - -/*! - \since 6.0 - - Returns the current non-client area rendering policy for the specified \a window. - */ -QtWin::WindowNonClientRenderingPolicy QtWin::windowNonClientAreaRenderingPolicy(QWindow *window) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - - const auto value = - QtDwmApiDll::windowAttribute<DWORD>(reinterpret_cast<HWND>(window->winId()), - DWMWA_NCRENDERING_POLICY, DWORD(DWMNCRP_USEWINDOWSTYLE)); - WindowNonClientRenderingPolicy policy = NonClientRenderingUseWindowStyle; - switch (value) { - case DWMNCRP_DISABLED : - policy = NonClientRenderingDisabled; - break; - case DWMNCRP_ENABLED : - policy = NonClientRenderingEnabled; - break; - default : - break; - } - return policy; -} - -void qt_ExtendFrameIntoClientArea(QWindow *window, int left, int top, int right, int bottom) -{ - QWinEventFilter::setup(); - MARGINS margins = {left, right, top, bottom}; - DwmExtendFrameIntoClientArea(reinterpret_cast<HWND>(window->winId()), &margins); -} - -/*! \fn void QtWin::extendFrameIntoClientArea(QWidget *window, int left, int top, int right, int bottom) - \since 5.2 - \overload QtWin::extendFrameIntoClientArea() - */ - -/*! - \since 5.2 - - Extends the glass frame into the client area of the specified \a window - using the \a left, \a top, \a right, and \a bottom margin values. - - Pass -1 as values for any of the four margins to fully extend the frame, - creating a \e {sheet of glass} effect. If it doesn't work, change - non-client area rendering policy to QtWin::NonClientRenderingEnabled and - try again. - - If you want the extended frame to act like a standard window border, you - should handle that yourself. - - \note Qt::WA_NoSystemBackground must not be set on widgets for - extendFrameIntoClientArea() to work. - - \sa resetExtendedFrame(), setWindowNonClientAreaRenderingPolicy() - */ -void QtWin::extendFrameIntoClientArea(QWindow *window, int left, int top, int right, int bottom) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - qt_ExtendFrameIntoClientArea(window, left, top, right, bottom); -} - -/*! \fn void QtWin::extendFrameIntoClientArea(QWidget *window, const QMargins &margins) - \since 5.2 - \overload QtWin::extendFrameIntoClientArea() - - Convenience overload that allows passing frame sizes in a \a margins - structure. - */ - -/*! - \since 5.2 - \overload QtWin::extendFrameIntoClientArea() - - Extends the glass frame into the client area of the specified \a window - using the specified \a margins. - */ -void QtWin::extendFrameIntoClientArea(QWindow *window, const QMargins &margins) -{ - QtWin::extendFrameIntoClientArea(window, margins.left(), margins.top(), margins.right(), margins.bottom()); -} - -/*! - \fn void QtWin::resetExtendedFrame(QWidget *window) - \since 5.2 - \overload QtWin::resetExtendedFrame() - */ - -/*! - \since 5.2 - - Resets the glass frame and restores the \a window attributes. - - This convenience function calls extendFrameIntoClientArea() with margins set - to 0. - - \note Qt::WA_NoSystemBackground must not be set on widgets for - extendFrameIntoClientArea() to work. - - \sa extendFrameIntoClientArea() - */ -void QtWin::resetExtendedFrame(QWindow *window) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - qt_ExtendFrameIntoClientArea(window, 0, 0, 0, 0); -} - -/*! - \fn void QtWin::enableBlurBehindWindow(QWidget *window, const QRegion ®ion) - \since 5.2 - \overload QtWin::enableBlurBehindWindow() - */ - -/*! - \since 5.2 - - Enables the blur effect for the specified \a region of the specified - \a window. - - \sa disableBlurBehindWindow() - */ -void QtWin::enableBlurBehindWindow(QWindow *window, const QRegion ®ion) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - - DWM_BLURBEHIND dwmbb = {0, 0, nullptr, 0}; - dwmbb.dwFlags = DWM_BB_ENABLE; - dwmbb.fEnable = TRUE; - HRGN rgn = nullptr; - if (!region.isNull()) { - rgn = toHRGN(region); - if (rgn) { - dwmbb.hRgnBlur = rgn; - dwmbb.dwFlags |= DWM_BB_BLURREGION; - } - } - DwmEnableBlurBehindWindow(reinterpret_cast<HWND>(window->winId()), &dwmbb); - if (rgn) - DeleteObject(rgn); -} - -/*! - \fn void QtWin::enableBlurBehindWindow(QWidget *window) - \since 5.2 - \overload QtWin::enableBlurBehindWindow() - */ - -/*! - \since 5.2 - - Enables the blur effect for the specified \a window. - - \sa disableBlurBehindWindow() - */ -void QtWin::enableBlurBehindWindow(QWindow *window) -{ - QtWin::enableBlurBehindWindow(window, QRegion()); -} - -/*! - \fn void QtWin::disableBlurBehindWindow(QWidget *window) - \since 5.2 - \overload QtWin::disableBlurBehindWindow() - */ - -/*! - \since 5.2 - - Disables the previously enabled blur effect for the specified \a window. - - \sa enableBlurBehindWindow() - */ -void QtWin::disableBlurBehindWindow(QWindow *window) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - DWM_BLURBEHIND dwmbb = {0, 0, nullptr, 0}; - dwmbb.dwFlags = DWM_BB_ENABLE; - DwmEnableBlurBehindWindow(reinterpret_cast<HWND>(window->winId()), &dwmbb); -} - -/*! - \since 5.2 - - Returns the DWM composition state. - */ -bool QtWin::isCompositionEnabled() -{ - QWinEventFilter::setup(); - - BOOL enabled = FALSE; - DwmIsCompositionEnabled(&enabled); - return enabled; -} - -/*! - \since 5.2 - - Sets whether the Windows Desktop composition is \a enabled. - - \note The underlying function was declared deprecated as of Windows 8 and - takes no effect. - */ - -QT_WARNING_PUSH -QT_WARNING_DISABLE_MSVC(4995) -void QtWin::setCompositionEnabled(bool enabled) -{ - QWinEventFilter::setup(); - - UINT compositionEnabled = enabled; - DwmEnableComposition(compositionEnabled); -} -QT_WARNING_POP - -/*! - \since 5.2 - - Returns whether the colorization color is an opaque blend. - */ -bool QtWin::isCompositionOpaque() -{ - bool opaque; - colorizationColor(&opaque); - return opaque; -} - -/*! - \since 5.2 - - Sets the Application User Model ID \a id. - - For more information, see - \l{http://msdn.microsoft.com/en-us/library/windows/desktop/dd378459.aspx} - {Application User Model IDs}. - */ -void QtWin::setCurrentProcessExplicitAppUserModelID(const QString &id) -{ - QScopedArrayPointer<wchar_t> wid(qt_qstringToNullTerminated(id)); - SetCurrentProcessExplicitAppUserModelID(wid.data()); -} - -/*! - \internal - */ -ITaskbarList3 *qt_createITaskbarList3() -{ - ITaskbarList3 *pTbList = nullptr; - HRESULT result = CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_INPROC_SERVER, qIID_ITaskbarList3, reinterpret_cast<void **>(&pTbList)); - if (SUCCEEDED(result)) { - if (FAILED(pTbList->HrInit())) { - pTbList->Release(); - pTbList = nullptr; - } - } - return pTbList; -} - -/*! - \internal - */ -ITaskbarList2 *qt_createITaskbarList2() -{ - ITaskbarList3 *pTbList = nullptr; - HRESULT result = CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_INPROC_SERVER, qIID_ITaskbarList2, reinterpret_cast<void **>(&pTbList)); - if (SUCCEEDED(result)) { - if (FAILED(pTbList->HrInit())) { - pTbList->Release(); - pTbList = nullptr; - } - } - return pTbList; -} - -/*! - \fn void QtWin::markFullscreenWindow(QWidget *window, bool fullscreen) - \since 5.2 - \overload QtWin::markFullscreenWindow() - */ - -/*! - \since 5.2 - - Marks the specified \a window as running in the full-screen mode if - \a fullscreen is true, so that the shell handles it correctly. Otherwise, - removes the mark. - - \note You do not usually need to call this function, because the Windows - taskbar always tries to determine whether a window is running in the - full-screen mode. - */ -void QtWin::markFullscreenWindow(QWindow *window, bool fullscreen) -{ - ITaskbarList2 *pTbList = qt_createITaskbarList2(); - if (pTbList) { - pTbList->MarkFullscreenWindow(reinterpret_cast<HWND>(window->winId()), fullscreen); - pTbList->Release(); - } -} - -/*! - \fn void QtWin::taskbarActivateTab(QWidget *window) - \since 5.2 - \overload QtWin::taskbarActivateTab() - */ - -/*! - \since 5.2 - - Activates an item on the taskbar without activating the \a window itself. - */ -void QtWin::taskbarActivateTab(QWindow *window) -{ - ITaskbarList *pTbList = qt_createITaskbarList2(); - if (pTbList) { - pTbList->ActivateTab(reinterpret_cast<HWND>(window->winId())); - pTbList->Release(); - } -} - -/*! - \fn void QtWin::taskbarActivateTabAlt(QWidget *window) - \since 5.2 - \overload QtWin::taskbarActivateTabAlt() - */ - -/*! - \since 5.2 - - Marks the item that represents the specified \a window on the taskbar - as active, but does not activate it visually. - */ -void QtWin::taskbarActivateTabAlt(QWindow *window) -{ - ITaskbarList *pTbList = qt_createITaskbarList2(); - if (pTbList) { - pTbList->SetActiveAlt(reinterpret_cast<HWND>(window->winId())); - pTbList->Release(); - } -} - -/*! - \fn void QtWin::taskbarAddTab(QWidget *window) - \since 5.2 - \overload QtWin::taskbarAddTab() - */ - -/*! - \since 5.2 - - Adds an item for the specified \a window to the taskbar. - */ -void QtWin::taskbarAddTab(QWindow *window) -{ - ITaskbarList *pTbList = qt_createITaskbarList2(); - if (pTbList) { - pTbList->AddTab(reinterpret_cast<HWND>(window->winId())); - pTbList->Release(); - } -} - -/*! - \fn void QtWin::taskbarDeleteTab(QWidget *window) - \since 5.2 - \overload QtWin::taskbarDeleteTab() - */ - -/*! - \since 5.2 - - Removes the specified \a window from the taskbar. - */ -void QtWin::taskbarDeleteTab(QWindow *window) -{ - ITaskbarList *pTbList = qt_createITaskbarList3(); - if (pTbList) { - pTbList->DeleteTab(reinterpret_cast<HWND>(window->winId())); - pTbList->Release(); - } -} - -/*! - \enum QtWin::HBitmapFormat - - \since 5.2 - - This enum defines how the conversion between \c - HBITMAP and QPixmap is performed. - - \value HBitmapNoAlpha - The alpha channel is ignored and always treated as - being set to fully opaque. This is preferred if the \c HBITMAP is - used with standard GDI calls, such as \c BitBlt(). - - \value HBitmapPremultipliedAlpha - The \c HBITMAP is treated as having an - alpha channel and premultiplied colors. This is preferred if the - \c HBITMAP is accessed through the \c AlphaBlend() GDI function. - - \value HBitmapAlpha - The \c HBITMAP is treated as having a plain alpha - channel. This is the preferred format if the \c HBITMAP is going - to be used as an application icon or a systray icon. - - \sa fromHBITMAP(), toHBITMAP() -*/ - -/*! - \enum QtWin::WindowFlip3DPolicy - - \since 5.2 - - This enum type specifies the Flip3D window policy. - - \value FlipDefault - Let the OS decide whether to include the window in the Flip3D - rendering. - - \value FlipExcludeAbove - Exclude the window from Flip3D and display it above the Flip3D - rendering. - - \value FlipExcludeBelow - Exclude the window from Flip3D and display it below the Flip3D - rendering. - - \sa setWindowFlip3DPolicy() - */ - -/*! - \enum QtWin::WindowNonClientRenderingPolicy - - \since 6.0 - - This enum type specifies the non-client area rendering policy. - - \value NonClientRenderingUseWindowStyle - The non-client rendering area is rendered based on the window - style. - - \value NonClientRenderingDisabled - The non-client area rendering is disabled and the window style - is ignored. - Note that disabling non-client area rendering will cause any - previous calls to QtWin::enableBlurBehindWindow() or to - QtWin::extendFrameIntoClientArea() to be disabled. - - \value NonClientRenderingEnabled - The non-client area rendering is enabled and the window style - is ignored. - If you want to bring frame shadow back to a frameless window, - enable this policy and call QtWin::extendFrameIntoClientArea() - with a negative height. - - \sa setWindowNonClientAreaRenderingPolicy() - */ - -QT_END_NAMESPACE diff --git a/src/winextras/qwinfunctions.h b/src/winextras/qwinfunctions.h deleted file mode 100644 index 8f27a6f..0000000 --- a/src/winextras/qwinfunctions.h +++ /dev/null @@ -1,253 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWinExtras module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWINFUNCTIONS_H -#define QWINFUNCTIONS_H - -#if 0 -#pragma qt_class(QtWin) -#endif - -#include <QtCore/qobject.h> -#include <QtCore/qt_windows.h> -#include <QtWinExtras/qwinextrasglobal.h> -#ifdef QT_WIDGETS_LIB -#include <QtWidgets/qwidget.h> -#endif - -QT_BEGIN_NAMESPACE - -class QPixmap; -class QImage; -class QBitmap; -class QColor; -class QWindow; -class QString; -class QMargins; - -namespace QtWin -{ - enum HBitmapFormat - { - HBitmapNoAlpha, - HBitmapPremultipliedAlpha, - HBitmapAlpha - }; - - enum WindowFlip3DPolicy - { - FlipDefault, - FlipExcludeBelow, - FlipExcludeAbove - }; - - enum WindowNonClientRenderingPolicy - { - NonClientRenderingUseWindowStyle, - NonClientRenderingDisabled, - NonClientRenderingEnabled - }; - - Q_WINEXTRAS_EXPORT HBITMAP createMask(const QBitmap &bitmap); - Q_WINEXTRAS_EXPORT HBITMAP toHBITMAP(const QPixmap &p, HBitmapFormat format = HBitmapNoAlpha); - Q_WINEXTRAS_EXPORT QPixmap fromHBITMAP(HBITMAP bitmap, HBitmapFormat format = HBitmapNoAlpha); - Q_WINEXTRAS_EXPORT HICON toHICON(const QPixmap &p); - Q_WINEXTRAS_EXPORT HBITMAP imageToHBITMAP(const QImage &image, QtWin::HBitmapFormat format = HBitmapNoAlpha); - Q_WINEXTRAS_EXPORT QImage imageFromHBITMAP(HDC hdc, HBITMAP bitmap, int width, int height); - Q_WINEXTRAS_EXPORT QImage imageFromHBITMAP(HBITMAP bitmap, QtWin::HBitmapFormat format = HBitmapNoAlpha); - Q_WINEXTRAS_EXPORT QPixmap fromHICON(HICON icon); - Q_WINEXTRAS_EXPORT HRGN toHRGN(const QRegion ®ion); - Q_WINEXTRAS_EXPORT QRegion fromHRGN(HRGN hrgn); - - Q_WINEXTRAS_EXPORT QString stringFromHresult(HRESULT hresult); - Q_WINEXTRAS_EXPORT QString errorStringFromHresult(HRESULT hresult); - - Q_WINEXTRAS_EXPORT QColor colorizationColor(bool *opaqueBlend = nullptr); - Q_WINEXTRAS_EXPORT QColor realColorizationColor(); - - Q_WINEXTRAS_EXPORT void setWindowExcludedFromPeek(QWindow *window, bool exclude); - Q_WINEXTRAS_EXPORT bool isWindowExcludedFromPeek(QWindow *window); - Q_WINEXTRAS_EXPORT void setWindowDisallowPeek(QWindow *window, bool disallow); - Q_WINEXTRAS_EXPORT bool isWindowPeekDisallowed(QWindow *window); - Q_WINEXTRAS_EXPORT void setWindowFlip3DPolicy(QWindow *window, WindowFlip3DPolicy policy); - Q_WINEXTRAS_EXPORT WindowFlip3DPolicy windowFlip3DPolicy(QWindow *); - Q_WINEXTRAS_EXPORT void setWindowNonClientAreaRenderingPolicy(QWindow *window, WindowNonClientRenderingPolicy policy); - Q_WINEXTRAS_EXPORT WindowNonClientRenderingPolicy windowNonClientAreaRenderingPolicy(QWindow *); - - Q_WINEXTRAS_EXPORT void extendFrameIntoClientArea(QWindow *window, int left, int top, int right, int bottom); - Q_WINEXTRAS_EXPORT void extendFrameIntoClientArea(QWindow *window, const QMargins &margins); - Q_WINEXTRAS_EXPORT void resetExtendedFrame(QWindow *window); - - Q_WINEXTRAS_EXPORT void enableBlurBehindWindow(QWindow *window, const QRegion ®ion); - Q_WINEXTRAS_EXPORT void enableBlurBehindWindow(QWindow *window); - Q_WINEXTRAS_EXPORT void disableBlurBehindWindow(QWindow *window); - - Q_WINEXTRAS_EXPORT bool isCompositionEnabled(); - Q_WINEXTRAS_EXPORT void setCompositionEnabled(bool enabled); - Q_WINEXTRAS_EXPORT bool isCompositionOpaque(); - - Q_WINEXTRAS_EXPORT void setCurrentProcessExplicitAppUserModelID(const QString &id); - - Q_WINEXTRAS_EXPORT void markFullscreenWindow(QWindow *, bool fullscreen = true); - - Q_WINEXTRAS_EXPORT void taskbarActivateTab(QWindow *); - Q_WINEXTRAS_EXPORT void taskbarActivateTabAlt(QWindow *); - Q_WINEXTRAS_EXPORT void taskbarAddTab(QWindow *); - Q_WINEXTRAS_EXPORT void taskbarDeleteTab(QWindow *); - -#ifdef QT_WIDGETS_LIB - inline void setWindowExcludedFromPeek(QWidget *window, bool exclude) - { - window->createWinId(); - setWindowExcludedFromPeek(window->windowHandle(), exclude); - } - - inline bool isWindowExcludedFromPeek(QWidget *window) - { - auto handle = window->windowHandle(); - return handle && isWindowExcludedFromPeek(handle); - } - - inline void setWindowDisallowPeek(QWidget *window, bool disallow) - { - window->createWinId(); - setWindowDisallowPeek(window->windowHandle(), disallow); - } - - inline bool isWindowPeekDisallowed(QWidget *window) - { - auto handle = window->windowHandle(); - return handle && isWindowPeekDisallowed(handle); - } - - inline void setWindowFlip3DPolicy(QWidget *window, WindowFlip3DPolicy policy) - { - window->createWinId(); - setWindowFlip3DPolicy(window->windowHandle(), policy); - } - - inline WindowFlip3DPolicy windowFlip3DPolicy(QWidget *window) - { - auto handle = window->windowHandle(); - return handle ? windowFlip3DPolicy(handle) : FlipDefault; - } - - inline void setWindowNonClientAreaRenderingPolicy(QWidget *window, WindowNonClientRenderingPolicy policy) - { - window->createWinId(); - setWindowNonClientAreaRenderingPolicy(window->windowHandle(), policy); - } - - inline WindowNonClientRenderingPolicy windowNonClientAreaRenderingPolicy(QWidget *window) - { - auto handle = window->windowHandle(); - return handle ? windowNonClientAreaRenderingPolicy(handle) : NonClientRenderingUseWindowStyle; - } - - inline void extendFrameIntoClientArea(QWidget *window, const QMargins &margins) - { - window->createWinId(); - extendFrameIntoClientArea(window->windowHandle(), margins); - } - - inline void extendFrameIntoClientArea(QWidget *window, int left, int top, int right, int bottom) - { - window->createWinId(); - extendFrameIntoClientArea(window->windowHandle(), left, top, right, bottom); - } - - inline void resetExtendedFrame(QWidget *window) - { - if (window->windowHandle()) - resetExtendedFrame(window->windowHandle()); - } - - inline void enableBlurBehindWindow(QWidget *window, const QRegion ®ion) - { - window->createWinId(); - enableBlurBehindWindow(window->windowHandle(), region); - } - - inline void enableBlurBehindWindow(QWidget *window) - { - window->createWinId(); - enableBlurBehindWindow(window->windowHandle()); - } - - inline void disableBlurBehindWindow(QWidget *window) - { - if (window->windowHandle()) - disableBlurBehindWindow(window->windowHandle()); - } - - inline void markFullscreenWindow(QWidget *window, bool fullscreen = true) - { - window->createWinId(); - markFullscreenWindow(window->windowHandle(), fullscreen); - } - - inline void taskbarActivateTab(QWidget *window) - { - window->createWinId(); - taskbarActivateTab(window->windowHandle()); - } - - inline void taskbarActivateTabAlt(QWidget *window) - { - window->createWinId(); - taskbarActivateTabAlt(window->windowHandle()); - } - - inline void taskbarAddTab(QWidget *window) - { - window->createWinId(); - taskbarAddTab(window->windowHandle()); - } - - inline void taskbarDeleteTab(QWidget *window) - { - window->createWinId(); - taskbarDeleteTab(window->windowHandle()); - } -#endif // QT_WIDGETS_LIB -} - -QT_END_NAMESPACE - -#endif // QWINFUNCTIONS_H diff --git a/src/winextras/qwinfunctions_p.h b/src/winextras/qwinfunctions_p.h deleted file mode 100644 index 0ee73cb..0000000 --- a/src/winextras/qwinfunctions_p.h +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINFUNCTIONS_P_H -#define QWINFUNCTIONS_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QtCore/qstring.h> -#include <QtCore/qt_windows.h> -#include <uxtheme.h> -#include <dwmapi.h> - -QT_BEGIN_NAMESPACE - -enum qt_DWMWINDOWATTRIBUTE // Not present in MinGW 4.9 -{ - qt_DWMWA_DISALLOW_PEEK = 11, - qt_DWMWA_EXCLUDED_FROM_PEEK = 12, -}; - -namespace QtDwmApiDll -{ - template <class T> static T windowAttribute(HWND hwnd, DWORD attribute, T defaultValue); - template <class T> static void setWindowAttribute(HWND hwnd, DWORD attribute, T value); - - inline bool booleanWindowAttribute(HWND hwnd, DWORD attribute) - { return QtDwmApiDll::windowAttribute<BOOL>(hwnd, attribute, FALSE) != FALSE; } - - inline void setBooleanWindowAttribute(HWND hwnd, DWORD attribute, bool value) - { setWindowAttribute<BOOL>(hwnd, attribute, BOOL(value ? TRUE : FALSE)); } -}; - -inline void qt_qstringToNullTerminated(const QString &src, wchar_t *dst) -{ - dst[src.toWCharArray(dst)] = 0; -} - -inline wchar_t *qt_qstringToNullTerminated(const QString &src) -{ - auto *buffer = new wchar_t[src.length() + 1]; - qt_qstringToNullTerminated(src, buffer); - return buffer; -} - -template <class T> -T QtDwmApiDll::windowAttribute(HWND hwnd, DWORD attribute, T defaultValue) -{ - T value; - if (FAILED(DwmGetWindowAttribute(hwnd, attribute, &value, sizeof(value)))) - value = defaultValue; - return value; -} - -template <class T> -void QtDwmApiDll::setWindowAttribute(HWND hwnd, DWORD attribute, T value) -{ - DwmSetWindowAttribute(hwnd, attribute, &value, sizeof(value)); -} - -QT_END_NAMESPACE - -#endif // QWINFUNCTIONS_P_H diff --git a/src/winextras/qwinjumplist.cpp b/src/winextras/qwinjumplist.cpp deleted file mode 100644 index f479096..0000000 --- a/src/winextras/qwinjumplist.cpp +++ /dev/null @@ -1,608 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include <QtCore/qglobal.h> - -#ifdef Q_CC_MINGW // MinGW: Enable SHCreateItemFromParsingName() -# if defined(_WIN32_IE) && _WIN32_IE < 0x0700 // _WIN32_IE_IE70 -# undef _WIN32_IE -# endif -# ifndef _WIN32_IE -# define _WIN32_IE 0x0700 -# endif -#endif // Q_CC_MINGW - -#include "qwinjumplist.h" -#include "qwinjumplist_p.h" -#include "qwinjumplistitem.h" -#include "qwinjumplistcategory.h" -#include "qwinjumplistcategory_p.h" -#include "windowsguidsdefs_p.h" -#include "winpropkey_p.h" - -#include <QtCore/qdir.h> -#include <QtCore/qdebug.h> -#include <QtCore/qcoreapplication.h> -#include <QtCore/qregularexpression.h> -#include <QtCore/qt_windows.h> -#include <propvarutil.h> - -#include "qwinfunctions.h" -#include "qwinfunctions_p.h" -#include "winpropkey_p.h" - -#include <shobjidl.h> - -QT_BEGIN_NAMESPACE - -/*! - \class QWinJumpList - \inmodule QtWinExtras - \brief The QWinJumpList class represents a transparent wrapper around Windows - Jump Lists. - - \since 5.2 - - An application can use Jump Lists to provide users with faster access to - files or to display shortcuts to tasks or commands. - */ - -/*! - \title Application User Model IDs - \externalpage http://msdn.microsoft.com/en-us/library/windows/desktop/dd378459%28v=vs.85%29.aspx - */ - -// partial copy of qprocess_win.cpp:qt_create_commandline() -static QString createArguments(const QStringList &arguments) -{ - QString args; - for (int i=0; i<arguments.size(); ++i) { - QString tmp = arguments.at(i); - // Quotes are escaped and their preceding backslashes are doubled. - tmp.replace(QRegularExpression(QLatin1String("(\\\\*)\"")), QLatin1String("\\1\\1\\\"")); - if (tmp.isEmpty() || tmp.contains(u' ') || tmp.contains(u'\t')) { - // The argument must not end with a \ since this would be interpreted - // as escaping the quote -- rather put the \ behind the quote: e.g. - // rather use "foo"\ than "foo\" - int i = tmp.length(); - while (i > 0 && tmp.at(i - 1) == u'\\') - --i; - tmp.insert(i, u'"'); - tmp.prepend(u'"'); - } - args += u' ' + tmp; - } - return args; -} - -void QWinJumpListPrivate::warning(const char *function, HRESULT hresult) -{ - const QString err = QtWin::errorStringFromHresult(hresult); - qWarning("QWinJumpList: %s() failed: %#010x, %s.", function, unsigned(hresult), qPrintable(err)); -} - -QString QWinJumpListPrivate::iconsDirPath() -{ - QString iconDirPath = QDir::tempPath() + u'/' - + QCoreApplication::applicationName() + QLatin1String("/qt-jl-icons/"); - QDir().mkpath(iconDirPath); - return iconDirPath; -} - -void QWinJumpListPrivate::invalidate() -{ - Q_Q(QWinJumpList); - if (!pDestList) - return; - - if (!dirty) { - dirty = true; - QMetaObject::invokeMethod(q, "_q_rebuild", Qt::QueuedConnection); - } -} - -void QWinJumpListPrivate::_q_rebuild() -{ - if (beginList()) { - if (recent && recent->isVisible()) - appendKnownCategory(KDC_RECENT); - if (frequent && frequent->isVisible()) - appendKnownCategory(KDC_FREQUENT); - for (QWinJumpListCategory *category : qAsConst(categories)) { - if (category->isVisible()) - appendCustomCategory(category); - } - if (tasks && tasks->isVisible()) - appendTasks(tasks->items()); - commitList(); - } - dirty = false; -} - -void QWinJumpListPrivate::destroy() -{ - delete recent; - recent = nullptr; - delete frequent; - frequent = nullptr; - delete tasks; - tasks = nullptr; - qDeleteAll(categories); - categories.clear(); - invalidate(); -} - -bool QWinJumpListPrivate::beginList() -{ - HRESULT hresult = S_OK; - if (!identifier.isEmpty()) { - wchar_t *id = qt_qstringToNullTerminated(identifier); - hresult = pDestList->SetAppID(id); - delete[] id; - } - if (SUCCEEDED(hresult)) { - UINT maxSlots = 0; - IUnknown *array = nullptr; - hresult = pDestList->BeginList(&maxSlots, qIID_IUnknown, reinterpret_cast<void **>(&array)); - if (array) - array->Release(); - } - if (FAILED(hresult)) - QWinJumpListPrivate::warning("BeginList", hresult); - return SUCCEEDED(hresult); -} - -bool QWinJumpListPrivate::commitList() -{ - HRESULT hresult = pDestList->CommitList(); - if (FAILED(hresult)) - QWinJumpListPrivate::warning("CommitList", hresult); - return SUCCEEDED(hresult); -} - -void QWinJumpListPrivate::appendKnownCategory(KNOWNDESTCATEGORY category) -{ - HRESULT hresult = pDestList->AppendKnownCategory(category); - if (FAILED(hresult)) - QWinJumpListPrivate::warning("AppendKnownCategory", hresult); -} - -void QWinJumpListPrivate::appendCustomCategory(QWinJumpListCategory *category) -{ - IObjectCollection *collection = toComCollection(category->items()); - if (collection) { - wchar_t *title = qt_qstringToNullTerminated(category->title()); - HRESULT hresult = pDestList->AppendCategory(title, collection); - if (FAILED(hresult)) - QWinJumpListPrivate::warning("AppendCategory", hresult); - delete[] title; - collection->Release(); - } -} - -void QWinJumpListPrivate::appendTasks(const QList<QWinJumpListItem *> &items) -{ - IObjectCollection *collection = toComCollection(items); - if (collection) { - HRESULT hresult = pDestList->AddUserTasks(collection); - if (FAILED(hresult)) - QWinJumpListPrivate::warning("AddUserTasks", hresult); - collection->Release(); - } -} - -QList<QWinJumpListItem *> QWinJumpListPrivate::fromComCollection(IObjectArray *array) -{ - QList<QWinJumpListItem *> list; - UINT count = 0; - array->GetCount(&count); - for (UINT i = 0; i < count; ++i) { - IUnknown *collectionItem = nullptr; - HRESULT hresult = array->GetAt(i, qIID_IUnknown, reinterpret_cast<void **>(&collectionItem)); - if (FAILED(hresult)) { - QWinJumpListPrivate::warning("GetAt", hresult); - continue; - } - IShellItem2 *shellItem = nullptr; - IShellLinkW *shellLink = nullptr; - QWinJumpListItem *jumplistItem = nullptr; - if (SUCCEEDED(collectionItem->QueryInterface(qIID_IShellItem2, reinterpret_cast<void **>(&shellItem)))) { - jumplistItem = fromIShellItem(shellItem); - shellItem->Release(); - } else if (SUCCEEDED(collectionItem->QueryInterface(qIID_IShellLinkW, reinterpret_cast<void **>(&shellLink)))) { - jumplistItem = fromIShellLink(shellLink); - shellLink->Release(); - } else { - qWarning("QWinJumpList: object of unexpected class found"); - } - collectionItem->Release(); - if (jumplistItem) - list.append(jumplistItem); - } - return list; -} - -IObjectCollection *QWinJumpListPrivate::toComCollection(const QList<QWinJumpListItem *> &list) -{ - if (list.isEmpty()) - return nullptr; - IObjectCollection *collection = nullptr; - HRESULT hresult = CoCreateInstance(qCLSID_EnumerableObjectCollection, nullptr, CLSCTX_INPROC_SERVER, qIID_IObjectCollection, reinterpret_cast<void **>(&collection)); - if (FAILED(hresult)) { - QWinJumpListPrivate::warning("QWinJumpList: failed to instantiate IObjectCollection", hresult); - return nullptr; - } - for (QWinJumpListItem *item : list) { - IUnknown *iitem = toICustomDestinationListItem(item); - if (iitem) { - collection->AddObject(iitem); - iitem->Release(); - } - } - return collection; -} - -QWinJumpListItem *QWinJumpListPrivate::fromIShellLink(IShellLinkW *link) -{ - auto *item = new QWinJumpListItem(QWinJumpListItem::Link); - - IPropertyStore *linkProps; - link->QueryInterface(qIID_IPropertyStore, reinterpret_cast<void **>(&linkProps)); - PROPVARIANT var; - linkProps->GetValue(qPKEY_Link_Arguments, &var); - item->setArguments(QStringList(QString::fromWCharArray(var.pwszVal))); - PropVariantClear(&var); - linkProps->Release(); - - const int buffersize = 2048; - wchar_t buffer[buffersize]; - - link->GetDescription(buffer, INFOTIPSIZE); - item->setDescription(QString::fromWCharArray(buffer)); - - int dummyindex; - link->GetIconLocation(buffer, buffersize-1, &dummyindex); - item->setIcon(QIcon(QString::fromWCharArray(buffer))); - - link->GetPath(buffer, buffersize-1, 0, 0); - item->setFilePath(QDir::fromNativeSeparators(QString::fromWCharArray(buffer))); - - return item; -} - -QWinJumpListItem *QWinJumpListPrivate::fromIShellItem(IShellItem2 *shellitem) -{ - auto *item = new QWinJumpListItem(QWinJumpListItem::Destination); - wchar_t *strPtr; - shellitem->GetDisplayName(SIGDN_FILESYSPATH, &strPtr); - item->setFilePath(QDir::fromNativeSeparators(QString::fromWCharArray(strPtr))); - CoTaskMemFree(strPtr); - return item; -} - -IUnknown *QWinJumpListPrivate::toICustomDestinationListItem(const QWinJumpListItem *item) -{ - switch (item->type()) { - case QWinJumpListItem::Destination : - return toIShellItem(item); - case QWinJumpListItem::Link : - return toIShellLink(item); - case QWinJumpListItem::Separator : - return makeSeparatorShellItem(); - default: - return nullptr; - } -} - -IShellLinkW *QWinJumpListPrivate::toIShellLink(const QWinJumpListItem *item) -{ - IShellLinkW *link = nullptr; - HRESULT hresult = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, qIID_IShellLinkW, reinterpret_cast<void **>(&link)); - if (FAILED(hresult)) { - QWinJumpListPrivate::warning("QWinJumpList: failed to instantiate IShellLinkW", hresult); - return nullptr; - } - - const QString args = createArguments(item->arguments()); - const int iconPathSize = QWinJumpListPrivate::iconsDirPath().size() - + int(sizeof(void *)) * 2 + 4; // path + ptr-name-in-hex + .ico - const int bufferSize = qMax(args.size(), - qMax(item->workingDirectory().size(), - qMax(item->description().size(), - qMax(item->title().size(), - qMax(item->filePath().size(), iconPathSize))))) + 1; - auto *buffer = new wchar_t[bufferSize]; - - if (!item->description().isEmpty()) { - qt_qstringToNullTerminated(item->description(), buffer); - link->SetDescription(buffer); - } - - qt_qstringToNullTerminated(item->filePath(), buffer); - link->SetPath(buffer); - - if (!item->workingDirectory().isEmpty()) { - qt_qstringToNullTerminated(item->workingDirectory(), buffer); - link->SetWorkingDirectory(buffer); - } - - qt_qstringToNullTerminated(args, buffer); - link->SetArguments(buffer); - - if (!item->icon().isNull()) { - QString iconPath = QWinJumpListPrivate::iconsDirPath() + QString::number(reinterpret_cast<quintptr>(item), 16) + QLatin1String(".ico"); - bool iconSaved = item->icon().pixmap(GetSystemMetrics(SM_CXICON)).save(iconPath, "ico"); - if (iconSaved) { - qt_qstringToNullTerminated(iconPath, buffer); - link->SetIconLocation(buffer, 0); - } - } - - IPropertyStore *properties; - PROPVARIANT titlepv; - hresult = link->QueryInterface(qIID_IPropertyStore, reinterpret_cast<void **>(&properties)); - if (FAILED(hresult)) { - link->Release(); - return nullptr; - } - - qt_qstringToNullTerminated(item->title(), buffer); - InitPropVariantFromString(buffer, &titlepv); - properties->SetValue(qPKEY_Title, titlepv); - properties->Commit(); - properties->Release(); - PropVariantClear(&titlepv); - - delete[] buffer; - return link; -} - -IShellItem2 *QWinJumpListPrivate::toIShellItem(const QWinJumpListItem *item) -{ - IShellItem2 *shellitem = nullptr; - QScopedArrayPointer<wchar_t> buffer(qt_qstringToNullTerminated(item->filePath())); - SHCreateItemFromParsingName(buffer.data(), nullptr, qIID_IShellItem2, reinterpret_cast<void **>(&shellitem)); - return shellitem; -} - -IShellLinkW *QWinJumpListPrivate::makeSeparatorShellItem() -{ - IShellLinkW *separator; - HRESULT res = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, qIID_IShellLinkW, reinterpret_cast<void **>(&separator)); - if (FAILED(res)) - return nullptr; - - IPropertyStore *properties; - res = separator->QueryInterface(qIID_IPropertyStore, reinterpret_cast<void **>(&properties)); - if (FAILED(res)) { - separator->Release(); - return nullptr; - } - - PROPVARIANT isSeparator; - InitPropVariantFromBoolean(TRUE, &isSeparator); - properties->SetValue(qPKEY_AppUserModel_IsDestListSeparator, isSeparator); - properties->Commit(); - properties->Release(); - PropVariantClear(&isSeparator); - - return separator; -} - -/*! - Constructs a QWinJumpList with the parent object \a parent. - */ -QWinJumpList::QWinJumpList(QObject *parent) : - QObject(parent), d_ptr(new QWinJumpListPrivate) -{ - Q_D(QWinJumpList); - d->q_ptr = this; - HRESULT hresult = CoCreateInstance(qCLSID_DestinationList, nullptr, CLSCTX_INPROC_SERVER, qIID_ICustomDestinationList, reinterpret_cast<void **>(&d_ptr->pDestList)); - if (FAILED(hresult)) - QWinJumpListPrivate::warning("CoCreateInstance", hresult); - d->invalidate(); -} - -/*! - Destroys the QWinJumpList. - */ -QWinJumpList::~QWinJumpList() -{ - Q_D(QWinJumpList); - if (d->dirty) - d->_q_rebuild(); - if (d->pDestList) { - d->pDestList->Release(); - d->pDestList = nullptr; - } - d->destroy(); -} - -/*! - \property QWinJumpList::identifier - \brief the jump list identifier - - Specifies an optional explicit unique identifier for the - application jump list. - - The default value is empty; a system-defined internal identifier - is used instead. See \l {Application User Model IDs} on MSDN for - further details. - - \note The identifier cannot have more than \c 128 characters and - cannot contain spaces. A too long identifier is automatically truncated - to \c 128 characters, and spaces are replaced by underscores. - */ -QString QWinJumpList::identifier() const -{ - Q_D(const QWinJumpList); - return d->identifier; -} - -void QWinJumpList::setIdentifier(const QString &identifier) -{ - Q_D(QWinJumpList); - QString id = identifier; - id.replace(u' ', u'_'); - if (id.size() > 128) - id.truncate(128); - if (d->identifier != id) { - d->identifier = id; - d->invalidate(); - } -} - -/*! - Returns the recent items category in the jump list. - */ -QWinJumpListCategory *QWinJumpList::recent() const -{ - Q_D(const QWinJumpList); - if (!d->recent) { - auto *that = const_cast<QWinJumpList *>(this); - that->d_func()->recent = QWinJumpListCategoryPrivate::create(QWinJumpListCategory::Recent, that); - } - return d->recent; -} - -/*! - Returns the frequent items category in the jump list. - */ -QWinJumpListCategory *QWinJumpList::frequent() const -{ - Q_D(const QWinJumpList); - if (!d->frequent) { - auto *that = const_cast<QWinJumpList *>(this); - that->d_func()->frequent = QWinJumpListCategoryPrivate::create(QWinJumpListCategory::Frequent, that); - } - return d->frequent; -} - -/*! - Returns the tasks category in the jump list. - */ -QWinJumpListCategory *QWinJumpList::tasks() const -{ - Q_D(const QWinJumpList); - if (!d->tasks) { - auto *that = const_cast<QWinJumpList *>(this); - that->d_func()->tasks = QWinJumpListCategoryPrivate::create(QWinJumpListCategory::Tasks, that); - } - return d->tasks; -} - -/*! - Returns the custom categories in the jump list. - */ -QList<QWinJumpListCategory *> QWinJumpList::categories() const -{ - Q_D(const QWinJumpList); - return d->categories; -} - -/*! - Adds a custom \a category to the jump list. - */ -void QWinJumpList::addCategory(QWinJumpListCategory *category) -{ - Q_D(QWinJumpList); - if (!category) - return; - - QWinJumpListCategoryPrivate::get(category)->jumpList = this; - d->categories.append(category); - d->invalidate(); -} - -/*! - \overload addCategory() - Creates a custom category with provided \a title and optional \a items, - and adds it to the jump list. - */ -QWinJumpListCategory *QWinJumpList::addCategory(const QString &title, const QList<QWinJumpListItem *> items) -{ - auto *category = new QWinJumpListCategory(title); - for (QWinJumpListItem *item : items) - category->addItem(item); - addCategory(category); - return category; -} - -/*! - Clears the jump list. - - \sa QWinJumpListCategory::clear() - */ -void QWinJumpList::clear() -{ - Q_D(QWinJumpList); - recent()->clear(); - frequent()->clear(); - if (d->tasks) - d->tasks->clear(); - for (QWinJumpListCategory *category : qAsConst(d->categories)) - category->clear(); - d->destroy(); -} - -#ifndef QT_NO_DEBUG_STREAM - -QDebug operator<<(QDebug debug, const QWinJumpList *jumplist) -{ - QDebugStateSaver saver(debug); - debug.nospace(); - debug.noquote(); - debug << "QWinJumpList("; - if (jumplist) { - debug << "(identifier=\"" << jumplist->identifier() << "\", recent=" - << jumplist->recent() << ", frequent=" << jumplist->frequent() - << ", tasks=" << jumplist->tasks() - << ", categories=" << jumplist->categories(); - } else { - debug << '0'; - } - debug << ')'; - return debug; -} -#endif // !QT_NO_DEBUG_STREAM - -QT_END_NAMESPACE - -#include "moc_qwinjumplist.cpp" diff --git a/src/winextras/qwinjumplist.h b/src/winextras/qwinjumplist.h deleted file mode 100644 index b4807dd..0000000 --- a/src/winextras/qwinjumplist.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINJUMPLIST_H -#define QWINJUMPLIST_H - -#include <QtCore/qobject.h> -#include <QtCore/qstringlist.h> -#include <QtCore/qscopedpointer.h> -#include <QtWinExtras/qwinextrasglobal.h> - -QT_BEGIN_NAMESPACE - -class QWinJumpListItem; -class QWinJumpListPrivate; -class QWinJumpListCategory; - -class Q_WINEXTRAS_EXPORT QWinJumpList : public QObject -{ - Q_OBJECT - Q_PROPERTY(QString identifier READ identifier WRITE setIdentifier) - -public: - explicit QWinJumpList(QObject *parent = nullptr); - ~QWinJumpList(); - - QString identifier() const; - void setIdentifier(const QString &identifier); - - QWinJumpListCategory *recent() const; - QWinJumpListCategory *frequent() const; - QWinJumpListCategory *tasks() const; - - QList<QWinJumpListCategory *> categories() const; - void addCategory(QWinJumpListCategory *category); - QWinJumpListCategory *addCategory(const QString &title, const QList<QWinJumpListItem *> items = QList<QWinJumpListItem *>()); - -public Q_SLOTS: - void clear(); - -private: - Q_DISABLE_COPY(QWinJumpList) - Q_DECLARE_PRIVATE(QWinJumpList) - QScopedPointer<QWinJumpListPrivate> d_ptr; - - Q_PRIVATE_SLOT(d_func(), void _q_rebuild()) -}; - -#ifndef QT_NO_DEBUG_STREAM -Q_WINEXTRAS_EXPORT QDebug operator<<(QDebug, const QWinJumpList *); -#endif - -QT_END_NAMESPACE - -#endif // QWINJUMPLIST_H diff --git a/src/winextras/qwinjumplist_p.h b/src/winextras/qwinjumplist_p.h deleted file mode 100644 index ff54f96..0000000 --- a/src/winextras/qwinjumplist_p.h +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINJUMPLIST_P_H -#define QWINJUMPLIST_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qwinjumplist.h" -#include "winshobjidl_p.h" - -QT_BEGIN_NAMESPACE - -class QWinJumpListPrivate -{ - Q_DECLARE_PUBLIC(QWinJumpList) - -public: - static QWinJumpListPrivate *get(QWinJumpList *list) - { - return list->d_func(); - } - - static void warning(const char *function, HRESULT hresult); - static QString iconsDirPath(); - - void invalidate(); - void _q_rebuild(); - void destroy(); - - bool beginList(); - bool commitList(); - - void appendKnownCategory(KNOWNDESTCATEGORY category); - void appendCustomCategory(QWinJumpListCategory *category); - void appendTasks(const QList<QWinJumpListItem *> &items); - - static QList<QWinJumpListItem *> fromComCollection(IObjectArray *array); - static IObjectCollection *toComCollection(const QList<QWinJumpListItem *> &list); - static QWinJumpListItem *fromIShellLink(IShellLinkW *link); - static QWinJumpListItem *fromIShellItem(IShellItem2 *shellitem); - static IUnknown *toICustomDestinationListItem(const QWinJumpListItem *item); - static IShellLinkW *toIShellLink(const QWinJumpListItem *item); - static IShellItem2 *toIShellItem(const QWinJumpListItem *item); - static IShellLinkW *makeSeparatorShellItem(); - - QWinJumpList *q_ptr = nullptr; - ICustomDestinationList *pDestList = nullptr; - QWinJumpListCategory *recent = nullptr; - QWinJumpListCategory *frequent = nullptr; - QWinJumpListCategory *tasks = nullptr; - QList<QWinJumpListCategory *> categories; - QString identifier; - bool dirty = false; -}; - -QT_END_NAMESPACE - -#endif // QWINJUMPLIST_P_H diff --git a/src/winextras/qwinjumplistcategory.cpp b/src/winextras/qwinjumplistcategory.cpp deleted file mode 100644 index a29c37e..0000000 --- a/src/winextras/qwinjumplistcategory.cpp +++ /dev/null @@ -1,380 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include <QtCore/qglobal.h> - -#ifdef Q_CC_MINGW // MinGW: Include the correct definition of SHARDAPPIDINFOLINK -# if defined(NTDDI_VERSION) && NTDDI_VERSION < 0x06010000 -# undef NTDDI_VERSION -# endif -# ifndef NTDDI_VERSION -# define NTDDI_VERSION 0x06010000 -# endif -#endif // Q_CC_MINGW - -#include "qwinjumplistcategory.h" -#include "qwinjumplistcategory_p.h" -#include "qwinjumplistitem_p.h" -#include "qwinfunctions_p.h" -#include "qwinjumplist_p.h" -#include "winshobjidl_p.h" -#include "windowsguidsdefs_p.h" - -#include <QtCore/qdebug.h> - -#include <shlobj.h> - -QT_BEGIN_NAMESPACE - -/*! - \class QWinJumpListCategory - \inmodule QtWinExtras - \since 5.2 - \brief The QWinJumpListCategory class represents a jump list category. - */ - -/*! - \enum QWinJumpListCategory::Type - - This enum describes the available QWinJumpListCategory types. - - \value Custom - A custom jump list category. - \value Recent - A jump list category of "recent" items. - \value Frequent - A jump list category of "frequent" items. - \value Tasks - A jump list category of tasks. - */ - -QWinJumpListCategory *QWinJumpListCategoryPrivate::create(QWinJumpListCategory::Type type, QWinJumpList *jumpList) -{ - QWinJumpListCategory *category = new QWinJumpListCategory; - category->d_func()->type = type; - category->d_func()->jumpList = jumpList; - if (type == QWinJumpListCategory::Recent || type == QWinJumpListCategory::Frequent) - category->d_func()->loadRecents(); - return category; -} - -void QWinJumpListCategoryPrivate::invalidate() -{ - if (jumpList) - QWinJumpListPrivate::get(jumpList)->invalidate(); -} - -void QWinJumpListCategoryPrivate::loadRecents() -{ - Q_ASSERT(jumpList); - IApplicationDocumentLists *pDocList = nullptr; - HRESULT hresult = CoCreateInstance(qCLSID_ApplicationDocumentLists, nullptr, CLSCTX_INPROC_SERVER, qIID_IApplicationDocumentLists, reinterpret_cast<void **>(&pDocList)); - if (SUCCEEDED(hresult)) { - if (!jumpList->identifier().isEmpty()) { - wchar_t *id = qt_qstringToNullTerminated(jumpList->identifier()); - hresult = pDocList->SetAppID(id); - delete[] id; - } - if (SUCCEEDED(hresult)) { - IObjectArray *array = nullptr; - hresult = pDocList->GetList(type == QWinJumpListCategory::Recent ? ADLT_RECENT : ADLT_FREQUENT, - 0, qIID_IObjectArray, reinterpret_cast<void **>(&array)); - if (SUCCEEDED(hresult)) { - items = QWinJumpListPrivate::fromComCollection(array); - array->Release(); - } - } - pDocList->Release(); - } - if (FAILED(hresult)) - QWinJumpListPrivate::warning("loadRecents", hresult); -} - -void QWinJumpListCategoryPrivate::addRecent(QWinJumpListItem *item) -{ - Q_ASSERT(item->type() == QWinJumpListItem::Link); - wchar_t *id = nullptr; - if (jumpList && !jumpList->identifier().isEmpty()) - id = qt_qstringToNullTerminated(jumpList->identifier()); - - SHARDAPPIDINFOLINK info; - info.pszAppID = id; - info.psl = QWinJumpListPrivate::toIShellLink(item); - if (info.psl) { - SHAddToRecentDocs(SHARD_APPIDINFOLINK, &info); - info.psl->Release(); - } - delete[] id; -} - -void QWinJumpListCategoryPrivate::clearRecents() -{ - IApplicationDestinations *pDest = nullptr; - HRESULT hresult = CoCreateInstance(qCLSID_ApplicationDestinations, nullptr, CLSCTX_INPROC_SERVER, qIID_IApplicationDestinations, reinterpret_cast<void **>(&pDest)); - if (SUCCEEDED(hresult)) { - const QString identifier = jumpList ? jumpList->identifier() : QString(); - if (!identifier.isEmpty()) { - wchar_t *id = qt_qstringToNullTerminated(identifier); - hresult = pDest->SetAppID(id); - delete[] id; - } - hresult = pDest->RemoveAllDestinations(); - pDest->Release(); - } - if (FAILED(hresult)) - QWinJumpListPrivate::warning("clearRecents", hresult); -} - -/*! - Constructs a custom QWinJumpListCategory with the specified \a title. - */ -QWinJumpListCategory::QWinJumpListCategory(const QString &title) : - d_ptr(new QWinJumpListCategoryPrivate) -{ - d_ptr->title = title; -} - -/*! - Destroys the QWinJumpListCategory. - */ -QWinJumpListCategory::~QWinJumpListCategory() -{ - Q_D(QWinJumpListCategory); - qDeleteAll(d->items); - d->items.clear(); -} - -/*! - Returns the category type. - */ -QWinJumpListCategory::Type QWinJumpListCategory::type() const -{ - Q_D(const QWinJumpListCategory); - return d->type; -} - -/*! - Returns whether the category is visible. - */ -bool QWinJumpListCategory::isVisible() const -{ - Q_D(const QWinJumpListCategory); - return d->visible; -} - -/*! - Sets the category \a visible. - */ -void QWinJumpListCategory::setVisible(bool visible) -{ - Q_D(QWinJumpListCategory); - if (d->visible != visible) { - d->visible = visible; - d->invalidate(); - } -} - -/*! - Returns the category title. - */ -QString QWinJumpListCategory::title() const -{ - Q_D(const QWinJumpListCategory); - return d->title; -} - -/*! - Sets the category \a title. - */ -void QWinJumpListCategory::setTitle(const QString &title) -{ - Q_D(QWinJumpListCategory); - if (d->title != title) { - d->title = title; - d->invalidate(); - } -} - -/*! - Returns the amount of items in the category. - */ -int QWinJumpListCategory::count() const -{ - Q_D(const QWinJumpListCategory); - return d->items.count(); -} - -/*! - Returns whether the category is empty. - */ -bool QWinJumpListCategory::isEmpty() const -{ - Q_D(const QWinJumpListCategory); - return d->items.isEmpty(); -} - -/*! - Returns the list of items in the category. - */ -QList<QWinJumpListItem *> QWinJumpListCategory::items() const -{ - Q_D(const QWinJumpListCategory); - return d->items; -} - -/*! - Adds an \a item to the category. - */ -void QWinJumpListCategory::addItem(QWinJumpListItem *item) -{ - Q_D(QWinJumpListCategory); - if (!item) - return; - - if (d->type == Recent || d->type == Frequent) { - if (item->type() == QWinJumpListItem::Separator) { - qWarning("QWinJumpListCategory::addItem(): only tasks/custom categories support separators."); - return; - } - if (item->type() == QWinJumpListItem::Destination) { - qWarning("QWinJumpListCategory::addItem(): only tasks/custom categories support destinations."); - return; - } - } - - QWinJumpListItemPrivate *p = QWinJumpListItemPrivate::get(item); - if (p->category != this) { - p->category = this; - d->items.append(item); - if (d->type == QWinJumpListCategory::Recent || d->type == QWinJumpListCategory::Frequent) - d->addRecent(item); - d->invalidate(); - } -} - -/*! - Adds a destination to the category pointing to \a filePath. - */ -QWinJumpListItem *QWinJumpListCategory::addDestination(const QString &filePath) -{ - auto *item = new QWinJumpListItem(QWinJumpListItem::Destination); - item->setFilePath(filePath); - addItem(item); - return item; -} - -/*! - Adds a link to the category using \a title, \a executablePath, and - optionally \a arguments. - */ -QWinJumpListItem *QWinJumpListCategory::addLink(const QString &title, const QString &executablePath, const QStringList &arguments) -{ - return addLink(QIcon(), title, executablePath, arguments); -} - -/*! - \overload addLink() - - Adds a link to the category using \a icon, \a title, \a executablePath, - and optionally \a arguments. - */ -QWinJumpListItem *QWinJumpListCategory::addLink(const QIcon &icon, const QString &title, const QString &executablePath, const QStringList &arguments) -{ - auto *item = new QWinJumpListItem(QWinJumpListItem::Link); - item->setFilePath(executablePath); - item->setTitle(title); - item->setArguments(arguments); - item->setIcon(icon); - addItem(item); - return item; -} - -/*! - Adds a separator to the category. - - \note Only tasks category supports separators. - */ -QWinJumpListItem *QWinJumpListCategory::addSeparator() -{ - auto *item = new QWinJumpListItem(QWinJumpListItem::Separator); - addItem(item); - return item; -} - -/*! - Clears the category. - */ -void QWinJumpListCategory::clear() -{ - Q_D(QWinJumpListCategory); - if (!d->items.isEmpty()) { - qDeleteAll(d->items); - d->items.clear(); - if (d->type == QWinJumpListCategory::Recent || d->type == QWinJumpListCategory::Frequent) - d->clearRecents(); - d->invalidate(); - } -} - -#ifndef QT_NO_DEBUG_STREAM - -QDebug operator<<(QDebug debug, const QWinJumpListCategory *category) -{ - QDebugStateSaver saver(debug); - debug.nospace(); - debug.noquote(); - debug << "QWinJumpListCategory("; - if (category) { - debug << "type=" << category->type() << ", isVisible=" - << category->isVisible() << ", title=\"" << category->title() - << "\", items=" << category->items(); - } else { - debug << '0'; - } - debug << ')'; - return debug; - - - return debug; -} - -#endif // !QT_NO_DEBUG_STREAM - -QT_END_NAMESPACE diff --git a/src/winextras/qwinjumplistcategory.h b/src/winextras/qwinjumplistcategory.h deleted file mode 100644 index d063cc2..0000000 --- a/src/winextras/qwinjumplistcategory.h +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINJUMPLISTCATEGORY_H -#define QWINJUMPLISTCATEGORY_H - -#include <QtGui/qicon.h> -#include <QtCore/qstring.h> -#include <QtCore/qstringlist.h> -#include <QtCore/qscopedpointer.h> -#include <QtWinExtras/qwinextrasglobal.h> - -QT_BEGIN_NAMESPACE - -class QWinJumpListItem; -class QWinJumpListCategoryPrivate; - -class Q_WINEXTRAS_EXPORT QWinJumpListCategory -{ -public: - enum Type { - Custom, - Recent, - Frequent, - Tasks - }; - explicit QWinJumpListCategory(const QString &title = QString()); - ~QWinJumpListCategory(); - - Type type() const; - - bool isVisible() const; - void setVisible(bool visible); - - QString title() const; - void setTitle(const QString &title); - - int count() const; - bool isEmpty() const; - QList<QWinJumpListItem *> items() const; - - void addItem(QWinJumpListItem *item); - QWinJumpListItem *addDestination(const QString &filePath); - QWinJumpListItem *addLink(const QString &title, const QString &executablePath, const QStringList &arguments = QStringList()); - QWinJumpListItem *addLink(const QIcon &icon, const QString &title, const QString &executablePath, const QStringList &arguments = QStringList()); - QWinJumpListItem *addSeparator(); - - void clear(); - -private: - Q_DISABLE_COPY(QWinJumpListCategory) - Q_DECLARE_PRIVATE(QWinJumpListCategory) - QScopedPointer<QWinJumpListCategoryPrivate> d_ptr; -}; - -#ifndef QT_NO_DEBUG_STREAM -Q_WINEXTRAS_EXPORT QDebug operator<<(QDebug d, const QWinJumpListCategory *); -#endif - -QT_END_NAMESPACE - -#endif // QWINJUMPLISTCATEGORY_H diff --git a/src/winextras/qwinjumplistcategory_p.h b/src/winextras/qwinjumplistcategory_p.h deleted file mode 100644 index eee17b4..0000000 --- a/src/winextras/qwinjumplistcategory_p.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINJUMPLISTCATEGORY_P_H -#define QWINJUMPLISTCATEGORY_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qwinjumplistcategory.h" - -QT_BEGIN_NAMESPACE - -class QWinJumpList; - -class QWinJumpListCategoryPrivate -{ -public: - static QWinJumpListCategoryPrivate *get(QWinJumpListCategory *category) - { - return category->d_func(); - } - - static QWinJumpListCategory *create(QWinJumpListCategory::Type type, QWinJumpList *jumpList); - - void invalidate(); - void loadRecents(); - void addRecent(QWinJumpListItem *item); - void clearRecents(); - - bool visible = false; - QString title; - QWinJumpList *jumpList = nullptr; - QWinJumpListCategory::Type type = QWinJumpListCategory::Custom; - QList<QWinJumpListItem *> items; -}; - -QT_END_NAMESPACE - -#endif // QWINJUMPLISTCATEGORY_P_H diff --git a/src/winextras/qwinjumplistitem.cpp b/src/winextras/qwinjumplistitem.cpp deleted file mode 100644 index ee117bc..0000000 --- a/src/winextras/qwinjumplistitem.cpp +++ /dev/null @@ -1,293 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qwinjumplistitem.h" -#include "qwinjumplistitem_p.h" -#include "qwinjumplistcategory_p.h" - -#include <QtCore/qdebug.h> -#include <QtCore/qdir.h> - -QT_BEGIN_NAMESPACE - -/*! - \class QWinJumpListItem - \inmodule QtWinExtras - \since 5.2 - \brief The QWinJumpListItem class represents a jump list item. - */ - -/*! - \enum QWinJumpListItem::Type - - This enum describes the available QWinJumpListItem types. - - \value Destination - Item acts as a link to a file that the application can open. - \value Link - Item represents a link to an application. - \value Separator - Item is a separator. Only tasks category supports separators. - */ - -void QWinJumpListItemPrivate::invalidate() -{ - if (category) - QWinJumpListCategoryPrivate::get(category)->invalidate(); -} - -/*! - Constructs a QWinJumpListItem with the specified \a type. - */ -QWinJumpListItem::QWinJumpListItem(QWinJumpListItem::Type type) : - d_ptr(new QWinJumpListItemPrivate) -{ - d_ptr->type = type; - d_ptr->category = nullptr; -} - -/*! - Destroys the QWinJumpListItem. - */ -QWinJumpListItem::~QWinJumpListItem() = default; - -/*! - Sets the item \a type. - */ -void QWinJumpListItem::setType(QWinJumpListItem::Type type) -{ - Q_D(QWinJumpListItem); - if (d->type != type) { - d->type = type; - d->invalidate(); - } -} - -/*! - Returns the item type. - */ -QWinJumpListItem::Type QWinJumpListItem::type() const -{ - Q_D(const QWinJumpListItem); - return d->type; -} - -/*! - Sets the item \a filePath, the meaning of which depends on the type of this - item: - - \list - - \li If the item type is QWinJumpListItem::Destination, \a filePath is the - path to a file that can be opened by an application. - - \li If the item type is QWinJumpListItem::Link, \a filePath is the path to - an executable that is executed when this item is clicked by the - user. - - \endlist - - \sa setWorkingDirectory(), setArguments() - */ -void QWinJumpListItem::setFilePath(const QString &filePath) -{ - Q_D(QWinJumpListItem); - if (d->filePath != filePath) { - d->filePath = filePath; - d->invalidate(); - } -} - -/*! - Returns the file path set by setFilePath(). - */ -QString QWinJumpListItem::filePath() const -{ - Q_D(const QWinJumpListItem); - return d->filePath; -} - -/*! - Sets the path to the working directory of this item to \a workingDirectory. - - This value is used only if the type of this item is QWinJumpListItem::Link. - - \sa setFilePath() - */ -void QWinJumpListItem::setWorkingDirectory(const QString &workingDirectory) -{ - Q_D(QWinJumpListItem); - if (d->workingDirectory != workingDirectory) { - d->workingDirectory = workingDirectory; - d->invalidate(); - } -} - -/*! - Returns the working directory path. - */ -QString QWinJumpListItem::workingDirectory() const -{ - Q_D(const QWinJumpListItem); - return d->workingDirectory; -} - -/*! - Sets the \a icon of this item. - - This value is used only if the type of this item is QWinJumpListItem::Link. - */ -void QWinJumpListItem::setIcon(const QIcon &icon) -{ - Q_D(QWinJumpListItem); - if (d->icon.cacheKey() != icon.cacheKey()) { - d->icon = icon; - d->invalidate(); - } -} - -/*! - Returns the icon set for this item. - */ -QIcon QWinJumpListItem::icon() const -{ - Q_D(const QWinJumpListItem); - return d->icon; -} - -/*! - Sets the \a title of this item. - - This value is used only if the type of this item is QWinJumpListItem::Link. - */ -void QWinJumpListItem::setTitle(const QString &title) -{ - Q_D(QWinJumpListItem); - if (d->title != title) { - d->title = title; - d->invalidate(); - } -} - -/*! - Returns the title of this item. - */ -QString QWinJumpListItem::title() const -{ - Q_D(const QWinJumpListItem); - return d->title; -} - -/*! - Sets a \a description for this item. - - This value is used only if the type of this item is QWinJumpListItem::Link. - */ -void QWinJumpListItem::setDescription(const QString &description) -{ - Q_D(QWinJumpListItem); - if (d->description != description) { - d->description = description; - d->invalidate(); - } -} - -/*! - Returns the description of this item. - */ -QString QWinJumpListItem::description() const -{ - Q_D(const QWinJumpListItem); - return d->description; -} - -/*! - Sets command-line \a arguments for this item. - - This value is used only if the type of this item is QWinJumpListItem::Link. - - \sa setFilePath() - */ -void QWinJumpListItem::setArguments(const QStringList &arguments) -{ - Q_D(QWinJumpListItem); - if (d->arguments != arguments) { - d->arguments = arguments; - d->invalidate(); - } -} - -/*! - Returns the command-line arguments of this item. - */ -QStringList QWinJumpListItem::arguments() const -{ - Q_D(const QWinJumpListItem); - return d->arguments; -} - -#ifndef QT_NO_DEBUG_STREAM - -QDebug operator<<(QDebug debug, const QWinJumpListItem *item) -{ - QDebugStateSaver saver(debug); - debug.nospace(); - debug.noquote(); - debug << "QWinJumpListItem("; - if (item) { - debug << "type=" << item->type() << ", title=\"" << item->title() - << "\", description=\"" << item->description() - << "\", filePath=\"" << QDir::toNativeSeparators(item->filePath()) - << "\", arguments="; - debug.quote(); - debug << item->arguments(); - debug.noquote(); - debug << ", workingDirectory=\"" << QDir::toNativeSeparators(item->workingDirectory()) - << "\", icon=" << item->icon(); - } else { - debug << '0'; - } - debug << ')'; - return debug; -} - -#endif // !QT_NO_DEBUG_STREAM - -QT_END_NAMESPACE diff --git a/src/winextras/qwinjumplistitem.h b/src/winextras/qwinjumplistitem.h deleted file mode 100644 index 391546f..0000000 --- a/src/winextras/qwinjumplistitem.h +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINJUMPLISTITEM_H -#define QWINJUMPLISTITEM_H - -#include <QtGui/qicon.h> -#include <QtCore/qobject.h> -#include <QtCore/qstringlist.h> -#include <QtCore/qscopedpointer.h> -#include <QtWinExtras/qwinextrasglobal.h> - -QT_BEGIN_NAMESPACE - -class QWinJumpListItemPrivate; - -class Q_WINEXTRAS_EXPORT QWinJumpListItem -{ -public: - enum Type { - Destination, - Link, - Separator - }; - - explicit QWinJumpListItem(Type type); - ~QWinJumpListItem(); - - void setType(Type type); - Type type() const; - void setFilePath(const QString &filePath); - QString filePath() const; - void setWorkingDirectory(const QString &workingDirectory); - QString workingDirectory() const; - void setIcon(const QIcon &icon); - QIcon icon() const; - void setTitle(const QString &title); - QString title() const; - void setDescription(const QString &description); - QString description() const; - void setArguments(const QStringList &arguments); - QStringList arguments() const; - -private: - Q_DISABLE_COPY(QWinJumpListItem) - Q_DECLARE_PRIVATE(QWinJumpListItem) - QScopedPointer<QWinJumpListItemPrivate> d_ptr; -}; - -#ifndef QT_NO_DEBUG_STREAM -Q_WINEXTRAS_EXPORT QDebug operator<<(QDebug, const QWinJumpListItem *); -#endif - -QT_END_NAMESPACE - -#endif // QWINJUMPLISTITEM_H diff --git a/src/winextras/qwinjumplistitem_p.h b/src/winextras/qwinjumplistitem_p.h deleted file mode 100644 index 3857ea7..0000000 --- a/src/winextras/qwinjumplistitem_p.h +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINJUMPLISTITEM_P_H -#define QWINJUMPLISTITEM_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qwinjumplistitem.h" - -QT_BEGIN_NAMESPACE - -class QWinJumpListCategory; - -class QWinJumpListItemPrivate -{ -public: - static QWinJumpListItemPrivate *get(QWinJumpListItem *item) - { - return item->d_func(); - } - - void invalidate(); - - QString filePath; - QString workingDirectory; - QString title; - QString description; - QIcon icon; - QStringList arguments; - QWinJumpListItem::Type type = QWinJumpListItem::Destination; - QWinJumpListCategory *category = nullptr; -}; - -QT_END_NAMESPACE - -#endif // QWINJUMPLISTITEM_P_H diff --git a/src/winextras/qwintaskbarbutton.cpp b/src/winextras/qwintaskbarbutton.cpp deleted file mode 100644 index 9df4c30..0000000 --- a/src/winextras/qwintaskbarbutton.cpp +++ /dev/null @@ -1,303 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qwintaskbarbutton.h" -#include "qwintaskbarbutton_p.h" -#include "qwintaskbarprogress.h" -#include "qwinfunctions.h" -#include "qwinfunctions_p.h" -#include "qwineventfilter_p.h" -#include "qwinevent.h" -#include "winshobjidl_p.h" -#include "windowsguidsdefs_p.h" - -#include <QtGui/qwindow.h> -#include <QtGui/qicon.h> -#include <QtCore/qpair.h> -#include <dwmapi.h> -#include <shobjidl.h> - -QT_BEGIN_NAMESPACE - -/*! - \class QWinTaskbarButton - \inmodule QtWinExtras - \brief The QWinTaskbarButton class represents the Windows taskbar button for - a top-level window (Windows 7 and newer). - - \since 5.2 - - The QWinTaskbarButton class enables you to set overlay icons on a taskbar - button, and provides access to its progress indicator. - - An overlay icon indicates change in the state of an application, whereas - a progress indicator shows how time-consuming tasks are progressing. - - \image taskbar-button.png Taskbar Button - - The following example code illustrates how to use the QWinTaskbarButton - and QWinTaskbarProgress classes to adjust the look of the taskbar button: - - \snippet code/taskbar.cpp taskbar_cpp - - \note QWidget::windowHandle() returns a valid instance of a QWindow only - after the widget has been shown. It is therefore recommended to delay the - initialization of the QWinTaskbarButton instances until QWidget::showEvent(). - - \note The class wraps API only available since Windows 7. Instantiating it - on Windows XP or Windows Vista causes a runtime warning. - - \sa QWinTaskbarProgress - */ - -static TBPFLAG nativeProgressState(QWinTaskbarProgress *progress) -{ - if (!progress || !progress->isVisible()) - return TBPF_NOPROGRESS; - if (progress->isStopped()) - return TBPF_ERROR; - if (progress->isPaused()) - return TBPF_PAUSED; - if (progress->minimum() == 0 && progress->maximum() == 0) - return TBPF_INDETERMINATE; - return TBPF_NORMAL; -} - -QWinTaskbarButtonPrivate::QWinTaskbarButtonPrivate() -{ - HRESULT hresult = CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_INPROC_SERVER, qIID_ITaskbarList4, reinterpret_cast<void **>(&pTbList)); - if (FAILED(hresult)) { - pTbList = nullptr; - const QString err = QtWin::errorStringFromHresult(hresult); - qWarning("QWinTaskbarButton: qIID_ITaskbarList4 was not created: %#010x, %s.", unsigned(hresult), qPrintable(err)); - } else if (FAILED(pTbList->HrInit())) { - pTbList->Release(); - pTbList = nullptr; - const QString err = QtWin::errorStringFromHresult(hresult); - qWarning("QWinTaskbarButton: qIID_ITaskbarList4 was not initialized: %#010x, %s.", unsigned(hresult), qPrintable(err)); - } -} - -QWinTaskbarButtonPrivate::~QWinTaskbarButtonPrivate() -{ - if (pTbList) - pTbList->Release(); -} - -HWND QWinTaskbarButtonPrivate::handle() -{ - return reinterpret_cast<HWND>(window->winId()); -} - -int QWinTaskbarButtonPrivate::iconSize() const -{ - return GetSystemMetrics(SM_CXSMICON); -} - -void QWinTaskbarButtonPrivate::updateOverlayIcon() -{ - if (!pTbList || !window) - return; - - wchar_t *descrPtr = nullptr; - HICON hicon = nullptr; - if (!overlayAccessibleDescription.isEmpty()) - descrPtr = qt_qstringToNullTerminated(overlayAccessibleDescription); - if (!overlayIcon.isNull()) - hicon = QtWin::toHICON(overlayIcon.pixmap(iconSize())); - - if (hicon) - pTbList->SetOverlayIcon(handle(), hicon, descrPtr); - else if (!hicon && !overlayIcon.isNull()) - pTbList->SetOverlayIcon(handle(), static_cast<HICON>(LoadImage(nullptr, IDI_APPLICATION, IMAGE_ICON, SM_CXSMICON, SM_CYSMICON, LR_SHARED)), descrPtr); - else - pTbList->SetOverlayIcon(handle(), nullptr, descrPtr); - - if (hicon) - DestroyIcon(hicon); - delete[] descrPtr; -} - -void QWinTaskbarButtonPrivate::_q_updateProgress() -{ - if (!pTbList || !window) - return; - - if (progressBar) { - const int min = progressBar->minimum(); - const int max = progressBar->maximum(); - const int range = max - min; - if (range > 0) { - const int value = qRound(double(100) * (double(progressBar->value() - min)) / double(range)); - pTbList->SetProgressValue(handle(), ULONGLONG(value), 100); - } - } - pTbList->SetProgressState(handle(), nativeProgressState(progressBar)); -} - -/*! - Constructs a QWinTaskbarButton with the specified \a parent. - - If \a parent is an instance of QWindow, it is automatically - assigned as the taskbar button's \l window. - */ -QWinTaskbarButton::QWinTaskbarButton(QObject *parent) : - QObject(parent), d_ptr(new QWinTaskbarButtonPrivate) -{ - QWinEventFilter::setup(); - setWindow(qobject_cast<QWindow *>(parent)); -} - -/*! - Destroys the QWinTaskbarButton. - */ -QWinTaskbarButton::~QWinTaskbarButton() = default; - -/*! - \property QWinTaskbarButton::window - \brief the window whose taskbar button is manipulated - */ -void QWinTaskbarButton::setWindow(QWindow *window) -{ - Q_D(QWinTaskbarButton); - if (d->window) - d->window->removeEventFilter(this); - d->window = window; - if (d->window) { - d->window->installEventFilter(this); - if (d->window->isVisible()) { - d->_q_updateProgress(); - d->updateOverlayIcon(); - } - } -} - -QWindow *QWinTaskbarButton::window() const -{ - Q_D(const QWinTaskbarButton); - return d->window; -} - -/*! - \property QWinTaskbarButton::overlayIcon - \brief the overlay icon of the taskbar button - */ -QIcon QWinTaskbarButton::overlayIcon() const -{ - Q_D(const QWinTaskbarButton); - return d->overlayIcon; -} - -void QWinTaskbarButton::setOverlayIcon(const QIcon &icon) -{ - Q_D(QWinTaskbarButton); - - d->overlayIcon = icon; - d->updateOverlayIcon(); -} - -void QWinTaskbarButton::clearOverlayIcon() -{ - setOverlayAccessibleDescription(QString()); - setOverlayIcon(QIcon()); -} - -/*! - \property QWinTaskbarButton::overlayAccessibleDescription - \brief the description of the overlay for accessibility purposes - - \sa overlayIcon - */ -QString QWinTaskbarButton::overlayAccessibleDescription() const -{ - Q_D(const QWinTaskbarButton); - return d->overlayAccessibleDescription; -} - -void QWinTaskbarButton::setOverlayAccessibleDescription(const QString &description) -{ - Q_D(QWinTaskbarButton); - - d->overlayAccessibleDescription = description; - d->updateOverlayIcon(); -} - -/*! - \property QWinTaskbarButton::progress - \brief the progress indicator of the taskbar button - - \note The progress indicator is not \l{QWinTaskbarProgress::visible}{visible} by default. - */ -QWinTaskbarProgress *QWinTaskbarButton::progress() const -{ - Q_D(const QWinTaskbarButton); - if (!d->progressBar) { - auto *that = const_cast<QWinTaskbarButton *>(this); - auto *pbar = new QWinTaskbarProgress(that); - connect(pbar, SIGNAL(destroyed()), this, SLOT(_q_updateProgress())); - connect(pbar, SIGNAL(valueChanged(int)), this, SLOT(_q_updateProgress())); - connect(pbar, SIGNAL(minimumChanged(int)), this, SLOT(_q_updateProgress())); - connect(pbar, SIGNAL(maximumChanged(int)), this, SLOT(_q_updateProgress())); - connect(pbar, SIGNAL(visibilityChanged(bool)), this, SLOT(_q_updateProgress())); - connect(pbar, SIGNAL(pausedChanged(bool)), this, SLOT(_q_updateProgress())); - connect(pbar, SIGNAL(stoppedChanged(bool)), this, SLOT(_q_updateProgress())); - that->d_func()->progressBar = pbar; - that->d_func()->_q_updateProgress(); - } - return d->progressBar; -} - -/*! - \internal - Intercepts TaskbarButtonCreated messages. - */ -bool QWinTaskbarButton::eventFilter(QObject *object, QEvent *event) -{ - Q_D(QWinTaskbarButton); - if (object == d->window && event->type() == QWinEvent::TaskbarButtonCreated) { - d->_q_updateProgress(); - d->updateOverlayIcon(); - } - return false; -} - -QT_END_NAMESPACE - -#include "moc_qwintaskbarbutton.cpp" diff --git a/src/winextras/qwintaskbarbutton.h b/src/winextras/qwintaskbarbutton.h deleted file mode 100644 index 627beee..0000000 --- a/src/winextras/qwintaskbarbutton.h +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINTASKBARBUTTON_H -#define QWINTASKBARBUTTON_H - -#include <QtGui/qicon.h> -#include <QtCore/qobject.h> -#include <QtWinExtras/qwinextrasglobal.h> - -QT_BEGIN_NAMESPACE - -class QWindow; -class QWinTaskbarProgress; -class QWinTaskbarButtonPrivate; - -class Q_WINEXTRAS_EXPORT QWinTaskbarButton : public QObject -{ - Q_OBJECT - Q_PROPERTY(QIcon overlayIcon READ overlayIcon WRITE setOverlayIcon RESET clearOverlayIcon) - Q_PROPERTY(QString overlayAccessibleDescription READ overlayAccessibleDescription WRITE setOverlayAccessibleDescription) - Q_PROPERTY(QWinTaskbarProgress *progress READ progress) - Q_PROPERTY(QWindow *window READ window WRITE setWindow) - -public: - explicit QWinTaskbarButton(QObject *parent = nullptr); - ~QWinTaskbarButton(); - - void setWindow(QWindow *window); - QWindow *window() const; - - QIcon overlayIcon() const; - QString overlayAccessibleDescription() const; - - QWinTaskbarProgress *progress() const; - - bool eventFilter(QObject *, QEvent *) override; - -public Q_SLOTS: - void setOverlayIcon(const QIcon &icon); - void setOverlayAccessibleDescription(const QString &description); - - void clearOverlayIcon(); - -private: - Q_DISABLE_COPY(QWinTaskbarButton) - Q_DECLARE_PRIVATE(QWinTaskbarButton) - QScopedPointer<QWinTaskbarButtonPrivate> d_ptr; - - Q_PRIVATE_SLOT(d_func(), void _q_updateProgress()) -}; - -QT_END_NAMESPACE - -#endif // QWINTASKBARBUTTON_H diff --git a/src/winextras/qwintaskbarbutton_p.h b/src/winextras/qwintaskbarbutton_p.h deleted file mode 100644 index e5445b2..0000000 --- a/src/winextras/qwintaskbarbutton_p.h +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINTASKBARBUTTON_P_H -#define QWINTASKBARBUTTON_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qwintaskbarbutton.h" - -#include <QtGui/qwindow.h> -#include <QtCore/qpointer.h> -#include <QtCore/qt_windows.h> - -struct ITaskbarList4; - -QT_BEGIN_NAMESPACE - -class QWinTaskbarProgress; - -class QWinTaskbarButtonPrivate -{ -public: - QWinTaskbarButtonPrivate(); - ~QWinTaskbarButtonPrivate(); - - QPointer<QWinTaskbarProgress> progressBar; - QIcon overlayIcon; - QString overlayAccessibleDescription; - - HWND handle(); - int iconSize() const; - - void updateOverlayIcon(); - - void _q_updateProgress(); - - ITaskbarList4 *pTbList = nullptr; - QWindow *window = nullptr; -}; - -QT_END_NAMESPACE - -#endif // QWINTASKBARBUTTON_P_H diff --git a/src/winextras/qwintaskbarprogress.cpp b/src/winextras/qwintaskbarprogress.cpp deleted file mode 100644 index de77a40..0000000 --- a/src/winextras/qwintaskbarprogress.cpp +++ /dev/null @@ -1,336 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qwintaskbarprogress.h" - -QT_BEGIN_NAMESPACE - -/*! - \class QWinTaskbarProgress - \inmodule QtWinExtras - \brief The QWinTaskbarProgress class represents a progress indicator in the Windows taskbar. - - \since 5.2 - - A progress indicator is used to give the user an indication of the progress - of an operation and to reassure them that the application is still running. - - The progress indicator uses the concept of \e steps. It is set up by specifying - the minimum and maximum possible step values, and it will display the percentage - of steps that have been completed when you later give it the current step value. - The percentage is calculated by dividing the progress (value() - minimum()) - divided by maximum() - minimum(). - - The minimum and maximum number of steps can be specified by calling setMinimum() - and setMaximum(). The current number of steps is set with setValue(). The progress - indicator can be rewound to the beginning with reset(). - - If minimum and maximum both are set to \c 0, the indicator shows up as a busy - (indeterminate) indicator instead of a percentage of steps. This is useful when - it is not possible to determine the number of steps. - - \table - \row \li \inlineimage taskbar-progress.png Screenshot of a progress indicator - \li A progress indicator at 50%. - \row \li \inlineimage taskbar-progress-paused.png Screenshot of a paused progress indicator - \li A paused progress indicator at 50%. - \row \li \inlineimage taskbar-progress-stopped.png Screenshot of a stopped progress indicator - \li A stopped progress indicator at 50%. - \row \li \inlineimage taskbar-progress-indeterminate.png Screenshot of an indeterminate progress indicator - \li An indeterminate progress indicator. - \endtable - - \note The final appearance of the progress indicator varies depending on the active Windows theme. - - \sa QWinTaskbarButton - */ - -/*! - \fn void QWinTaskbarProgress::pausedChanged(bool paused) - \internal (for QWinTaskbarButton and QML compatibility) - */ - -/*! - \fn void QWinTaskbarProgress::stoppedChanged(bool stopped) - \internal (for QWinTaskbarButton and QML compatibility) - */ - -class QWinTaskbarProgressPrivate -{ -public: - int value = 0; - int minimum = 0; - int maximum = 100; - bool visible = false; - bool paused = false; - bool stopped = false; -}; - -/*! - Constructs a QWinTaskbarProgress with the parent object \a parent. - */ -QWinTaskbarProgress::QWinTaskbarProgress(QObject *parent) : - QObject(parent), d_ptr(new QWinTaskbarProgressPrivate) -{ -} - -/*! - Destroys the QWinTaskbarProgress. - */ -QWinTaskbarProgress::~QWinTaskbarProgress() -{ -} - -/*! - \property QWinTaskbarProgress::value - \brief the current value of the progress indicator - - The default value is \c 0. - */ -int QWinTaskbarProgress::value() const -{ - Q_D(const QWinTaskbarProgress); - return d->value; -} - -void QWinTaskbarProgress::setValue(int value) -{ - Q_D(QWinTaskbarProgress); - if ((value == d->value) || value < d->minimum || value > d->maximum) - return; - - d->value = value; - emit valueChanged(d->value); -} - -/*! - \property QWinTaskbarProgress::minimum - \brief the minimum value of the progress indicator - - The default value is \c 0. - */ -int QWinTaskbarProgress::minimum() const -{ - Q_D(const QWinTaskbarProgress); - return d->minimum; -} - -void QWinTaskbarProgress::setMinimum(int minimum) -{ - Q_D(QWinTaskbarProgress); - setRange(minimum, qMax(minimum, d->maximum)); -} - -/*! - \property QWinTaskbarProgress::maximum - \brief the maximum value of the progress indicator - - The default value is \c 100. - */ -int QWinTaskbarProgress::maximum() const -{ - Q_D(const QWinTaskbarProgress); - return d->maximum; -} - -void QWinTaskbarProgress::setMaximum(int maximum) -{ - Q_D(QWinTaskbarProgress); - setRange(qMin(d->minimum, maximum), maximum); -} - -/*! - \property QWinTaskbarProgress::visible - \brief whether the progress indicator is visible. - - The default value is \c false. - */ -bool QWinTaskbarProgress::isVisible() const -{ - Q_D(const QWinTaskbarProgress); - return d->visible; -} - -void QWinTaskbarProgress::setVisible(bool visible) -{ - Q_D(QWinTaskbarProgress); - if (visible == d->visible) - return; - - d->visible = visible; - emit visibilityChanged(d->visible); -} - -/*! - Shows the progress indicator. - */ -void QWinTaskbarProgress::show() -{ - setVisible(true); -} - -/*! - Hides the progress indicator. - */ -void QWinTaskbarProgress::hide() -{ - setVisible(false); -} - -/*! - Sets both the \a minimum and \a maximum values. - */ -void QWinTaskbarProgress::setRange(int minimum, int maximum) -{ - Q_D(QWinTaskbarProgress); - const bool minChanged = minimum != d->minimum; - const bool maxChanged = maximum != d->maximum; - if (minChanged || maxChanged) { - d->minimum = minimum; - d->maximum = qMax(minimum, maximum); - - if (d->value < d->minimum || d->value > d->maximum) - reset(); - - if (minChanged) - emit minimumChanged(d->minimum); - if (maxChanged) - emit maximumChanged(d->maximum); - } -} - -/*! - Resets the progress indicator. - - This function rewinds the value to the minimum value. - */ -void QWinTaskbarProgress::reset() -{ - setValue(minimum()); -} - -/*! - \property QWinTaskbarProgress::paused - \brief whether the progress indicator is paused. - - The default value is \c false. - - The final appearance of a paused progress indicator depends on the active - Windows theme. Typically, a paused progress indicator turns yellow to indicate - that the progress is currently paused. Unlike a \l stopped progress indicator, - a paused progress should not be used to indicate an error. - - \sa pause(), resume() - */ -bool QWinTaskbarProgress::isPaused() const -{ - Q_D(const QWinTaskbarProgress); - return d->paused; -} - -void QWinTaskbarProgress::setPaused(bool paused) -{ - Q_D(QWinTaskbarProgress); - if (paused == d->paused || d->stopped) - return; - - d->paused = paused; - emit pausedChanged(d->paused); -} - -/*! - Pauses the progress indicator. - - \sa paused - */ -void QWinTaskbarProgress::pause() -{ - setPaused(true); -} - -/*! - Resumes a paused or stopped progress indicator. - - \sa paused, stopped - */ -void QWinTaskbarProgress::resume() -{ - Q_D(QWinTaskbarProgress); - setPaused(false); - if (d->stopped) { - d->stopped = false; - emit stoppedChanged(false); - } -} - -/*! - \property QWinTaskbarProgress::stopped - \brief whether the progress indicator is stopped. - - The default value is \c false. - - The final appearance of a stopped progress indicator depends on the active - Windows theme. Typically, a stopped progress indicator turns red to indicate - that the progress is currently stopped. Unlike a \l paused progress indicator, - a stopped progress may be used to indicate an error. - - \sa stop(), resume() - */ -bool QWinTaskbarProgress::isStopped() const -{ - Q_D(const QWinTaskbarProgress); - return d->stopped; -} - -/*! - Stops the progress indicator. - - \sa stopped - */ -void QWinTaskbarProgress::stop() -{ - Q_D(QWinTaskbarProgress); - setPaused(false); - if (!d->stopped) { - d->stopped = true; - emit stoppedChanged(true); - } -} - -QT_END_NAMESPACE diff --git a/src/winextras/qwintaskbarprogress.h b/src/winextras/qwintaskbarprogress.h deleted file mode 100644 index ca64046..0000000 --- a/src/winextras/qwintaskbarprogress.h +++ /dev/null @@ -1,102 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINTASKBARPROGRESS_H -#define QWINTASKBARPROGRESS_H - -#include <QtCore/qobject.h> -#include <QtCore/qscopedpointer.h> -#include <QtWinExtras/qwinextrasglobal.h> - -QT_BEGIN_NAMESPACE - -class QWinTaskbarProgressPrivate; - -class Q_WINEXTRAS_EXPORT QWinTaskbarProgress : public QObject -{ - Q_OBJECT - Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged) - Q_PROPERTY(int minimum READ minimum WRITE setMinimum NOTIFY minimumChanged) - Q_PROPERTY(int maximum READ maximum WRITE setMaximum NOTIFY maximumChanged) - Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibilityChanged) - Q_PROPERTY(bool paused READ isPaused WRITE setPaused NOTIFY pausedChanged) - Q_PROPERTY(bool stopped READ isStopped NOTIFY stoppedChanged) - -public: - explicit QWinTaskbarProgress(QObject *parent = nullptr); - ~QWinTaskbarProgress(); - - int value() const; - int minimum() const; - int maximum() const; - bool isVisible() const; - bool isPaused() const; - bool isStopped() const; - -public Q_SLOTS: - void setValue(int value); - void setMinimum(int minimum); - void setMaximum(int maximum); - void setRange(int minimum, int maximum); - void reset(); - void show(); - void hide(); - void setVisible(bool visible); - void pause(); - void resume(); - void setPaused(bool paused); - void stop(); - -Q_SIGNALS: - void valueChanged(int value); - void minimumChanged(int minimum); - void maximumChanged(int maximum); - void visibilityChanged(bool visible); - void pausedChanged(bool paused); - void stoppedChanged(bool stopped); - -private: - Q_DISABLE_COPY(QWinTaskbarProgress) - Q_DECLARE_PRIVATE(QWinTaskbarProgress) - QScopedPointer<QWinTaskbarProgressPrivate> d_ptr; -}; - -QT_END_NAMESPACE - -#endif // QWINTASKBARPROGRESS_H diff --git a/src/winextras/qwinthumbnailtoolbar.cpp b/src/winextras/qwinthumbnailtoolbar.cpp deleted file mode 100644 index fc8d76e..0000000 --- a/src/winextras/qwinthumbnailtoolbar.cpp +++ /dev/null @@ -1,629 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0601 -# undef _WIN32_WINNT -#endif -#if !defined(_WIN32_WINNT) -# define _WIN32_WINNT 0x0601 // Enable functions for MinGW -#endif - -#include "qwinthumbnailtoolbar.h" -#include "qwinthumbnailtoolbar_p.h" -#include "qwinthumbnailtoolbutton.h" -#include "qwinthumbnailtoolbutton_p.h" -#include "windowsguidsdefs_p.h" -#include "qwinfunctions.h" - -#include <QtGui/qwindow.h> -#include <QtCore/qcoreapplication.h> -#include <QtCore/qtimer.h> -#include <QtCore/qdebug.h> - -#include "qwinevent.h" -#include "qwinfunctions_p.h" -#include "qwineventfilter_p.h" - -#ifndef THBN_CLICKED -# define THBN_CLICKED 0x1800 -#endif - -#ifndef WM_DWMSENDICONICLIVEPREVIEWBITMAP -# define WM_DWMSENDICONICLIVEPREVIEWBITMAP 0x0326 -#endif - -#ifndef WM_DWMSENDICONICTHUMBNAIL -# define WM_DWMSENDICONICTHUMBNAIL 0x0323 -#endif - -QT_BEGIN_NAMESPACE - -enum { dWM_SIT_DISPLAYFRAME = 1 , dWMWA_FORCE_ICONIC_REPRESENTATION = 7, dWMWA_HAS_ICONIC_BITMAP = 10 }; - -static const int windowsLimitedThumbbarSize = 7; - -/*! - \class QWinThumbnailToolBar - \inmodule QtWinExtras - \since 5.2 - \brief The QWinThumbnailToolBar class allows manipulating the thumbnail toolbar of a window. - - Applications can embed a toolbar in the thumbnail of a window, which is - shown when hovering over its taskbar icon. A thumbnail toolbar may provide - quick access to the commands of a window without requiring the user to restore - or activate the window. - - \image thumbbar.png Media player thumbnail toolbar - - The following example code illustrates how to use the functions in the - QWinThumbnailToolBar and QWinThumbnailToolButton class to implement a - thumbnail toolbar: - - \snippet code/thumbbar.cpp thumbbar_cpp - - \sa QWinThumbnailToolButton - */ - -/*! - Constructs a QWinThumbnailToolBar with the specified \a parent. - - If \a parent is an instance of QWindow, it is automatically - assigned as the thumbnail toolbar's \l window. - */ -QWinThumbnailToolBar::QWinThumbnailToolBar(QObject *parent) : - QObject(parent), d_ptr(new QWinThumbnailToolBarPrivate) -{ - Q_D(QWinThumbnailToolBar); - d->q_ptr = this; - QWinEventFilter::setup(); - setWindow(qobject_cast<QWindow *>(parent)); -} - -/*! - Destroys and clears the QWinThumbnailToolBar. - */ -QWinThumbnailToolBar::~QWinThumbnailToolBar() = default; - -/*! - \property QWinThumbnailToolBar::window - \brief the window whose thumbnail toolbar is manipulated - */ -void QWinThumbnailToolBar::setWindow(QWindow *window) -{ - Q_D(QWinThumbnailToolBar); - if (d->window != window) { - if (d->window) { - d->window->removeEventFilter(d); - if (d->window->handle()) { - d->clearToolbar(); - setIconicPixmapNotificationsEnabled(false); - } - } - d->window = window; - if (d->window) { - d->window->installEventFilter(d); - if (d->window->isVisible()) { - d->initToolbar(); - d->_q_scheduleUpdate(); - } - } - } -} - -QWindow *QWinThumbnailToolBar::window() const -{ - Q_D(const QWinThumbnailToolBar); - return d->window; -} - -/*! - Adds a \a button to the thumbnail toolbar. - - \note The number of buttons is limited to \c 7. - */ -void QWinThumbnailToolBar::addButton(QWinThumbnailToolButton *button) -{ - Q_D(QWinThumbnailToolBar); - if (d->buttonList.size() >= windowsLimitedThumbbarSize) { - qWarning() << "Cannot add " << button << " maximum number of buttons (" - << windowsLimitedThumbbarSize << ") reached."; - return; - } - if (button && button->d_func()->toolbar != this) { - if (button->d_func()->toolbar) { - button->d_func()->toolbar->removeButton(button); - } - button->d_func()->toolbar = this; - connect(button, &QWinThumbnailToolButton::changed, - d, &QWinThumbnailToolBarPrivate::_q_scheduleUpdate); - d->buttonList.append(button); - d->_q_scheduleUpdate(); - } -} - -/*! - Removes the \a button from the thumbnail toolbar. - */ -void QWinThumbnailToolBar::removeButton(QWinThumbnailToolButton *button) -{ - Q_D(QWinThumbnailToolBar); - if (button && d->buttonList.contains(button)) { - button->d_func()->toolbar = nullptr; - disconnect(button, &QWinThumbnailToolButton::changed, - d, &QWinThumbnailToolBarPrivate::_q_scheduleUpdate); - - d->buttonList.removeAll(button); - d->_q_scheduleUpdate(); - } -} - -/*! - Sets the list of \a buttons in the thumbnail toolbar. - - \note Any existing buttons are replaced. - */ -void QWinThumbnailToolBar::setButtons(const QList<QWinThumbnailToolButton *> &buttons) -{ - Q_D(QWinThumbnailToolBar); - d->buttonList.clear(); - for (QWinThumbnailToolButton *button : buttons) - addButton(button); - d->_q_updateToolbar(); -} - -/*! - Returns the list of buttons in the thumbnail toolbar. - */ -QList<QWinThumbnailToolButton *> QWinThumbnailToolBar::buttons() const -{ - Q_D(const QWinThumbnailToolBar); - return d->buttonList; -} - -/*! - \property QWinThumbnailToolBar::count - \brief the number of buttons in the thumbnail toolbar - - \note The number of buttons is limited to \c 7. - */ -int QWinThumbnailToolBar::count() const -{ - Q_D(const QWinThumbnailToolBar); - return d->buttonList.size(); -} - -void QWinThumbnailToolBarPrivate::updateIconicPixmapsEnabled(bool invalidate) -{ - Q_Q(QWinThumbnailToolBar); - const HWND hwnd = handle(); - if (!hwnd) { - qWarning() << Q_FUNC_INFO << "invoked with hwnd=0"; - return; - } - const bool enabled = iconicThumbnail || iconicLivePreview; - q->setIconicPixmapNotificationsEnabled(enabled); - if (enabled && invalidate) { - const HRESULT hr = DwmInvalidateIconicBitmaps(hwnd); - if (FAILED(hr)) - qWarning() << QWinThumbnailToolBarPrivate::msgComFailed("DwmInvalidateIconicBitmaps", hr); - } -} - -/* - QWinThumbnailToolBarPrivate::IconicPixmapCache caches a HBITMAP of for one of - the iconic thumbnail or live preview pixmaps. When the messages - WM_DWMSENDICONICLIVEPREVIEWBITMAP or WM_DWMSENDICONICTHUMBNAIL are received - (after setting the DWM window attributes accordingly), the bitmap matching the - maximum size is constructed on demand. - */ - -void QWinThumbnailToolBarPrivate::IconicPixmapCache::deleteBitmap() -{ - if (m_bitmap) { - DeleteObject(m_bitmap); - m_size = QSize(); - m_bitmap = nullptr; - } -} - -bool QWinThumbnailToolBarPrivate::IconicPixmapCache::setPixmap(const QPixmap &pixmap) -{ - if (pixmap.cacheKey() == m_pixmap.cacheKey()) - return false; - deleteBitmap(); - m_pixmap = pixmap; - return true; -} - -HBITMAP QWinThumbnailToolBarPrivate::IconicPixmapCache::bitmap(const QSize &maxSize) -{ - if (m_pixmap.isNull()) - return nullptr; - if (m_bitmap && m_size.width() <= maxSize.width() && m_size.height() <= maxSize.height()) - return m_bitmap; - deleteBitmap(); - QPixmap pixmap = m_pixmap; - if (pixmap.width() >= maxSize.width() || pixmap.height() >= maxSize.width()) - pixmap = pixmap.scaled(maxSize, Qt::KeepAspectRatio, Qt::SmoothTransformation); - if (const HBITMAP bitmap = QtWin::toHBITMAP(pixmap, QtWin::HBitmapAlpha)) { - m_size = pixmap.size(); - m_bitmap = bitmap; - } - return m_bitmap; -} - -/*! - \fn QWinThumbnailToolBar::iconicThumbnailPixmapRequested() - - This signal is emitted when the operating system requests a new iconic thumbnail pixmap, - typically when the thumbnail is shown. - - \since 5.4 - \sa iconicThumbnailPixmap -*/ - -/*! - \fn QWinThumbnailToolBar::iconicLivePreviewPixmapRequested() - - This signal is emitted when the operating system requests a new iconic live preview pixmap, - typically when the user ALT-tabs to the application. - - \since 5.4 - \sa iconicLivePreviewPixmap -*/ - -/*! - \property QWinThumbnailToolBar::iconicPixmapNotificationsEnabled - \brief whether signals iconicThumbnailPixmapRequested() and iconicLivePreviewPixmapRequested() - will be emitted - - \since 5.4 - \sa QWinThumbnailToolBar::iconicThumbnailPixmap, QWinThumbnailToolBar::iconicLivePreviewPixmap - */ - -bool QWinThumbnailToolBar::iconicPixmapNotificationsEnabled() const -{ - Q_D(const QWinThumbnailToolBar); - const HWND hwnd = d->handle(); - if (!hwnd) - return false; - return QtDwmApiDll::booleanWindowAttribute(hwnd, dWMWA_FORCE_ICONIC_REPRESENTATION); -} - -void QWinThumbnailToolBar::setIconicPixmapNotificationsEnabled(bool enabled) -{ - Q_D(const QWinThumbnailToolBar); - const HWND hwnd = d->handle(); - if (!hwnd) { - qWarning() << Q_FUNC_INFO << "invoked with hwnd=0"; - return; - } - if (iconicPixmapNotificationsEnabled() == enabled) - return; - QtDwmApiDll::setBooleanWindowAttribute(hwnd, dWMWA_FORCE_ICONIC_REPRESENTATION, enabled); - QtDwmApiDll::setBooleanWindowAttribute(hwnd, dWMWA_HAS_ICONIC_BITMAP, enabled); -} - -/*! - \property QWinThumbnailToolBar::iconicThumbnailPixmap - \brief the pixmap for use as a thumbnail representation - - \since 5.4 - \sa QWinThumbnailToolBar::iconicPixmapNotificationsEnabled - */ - -void QWinThumbnailToolBar::setIconicThumbnailPixmap(const QPixmap &pixmap) -{ - Q_D(QWinThumbnailToolBar); - const bool changed = d->iconicThumbnail.setPixmap(pixmap); - if (d->hasHandle()) // Potentially 0 when invoked from QML loading, see _q_updateToolbar() - d->updateIconicPixmapsEnabled(changed && !d->withinIconicThumbnailRequest); -} - -QPixmap QWinThumbnailToolBar::iconicThumbnailPixmap() const -{ - Q_D(const QWinThumbnailToolBar); - return d->iconicThumbnail.pixmap(); -} - -/*! - \property QWinThumbnailToolBar::iconicLivePreviewPixmap - \brief the pixmap for use as a live (peek) preview when tabbing into the application - - \since 5.4 - */ - -void QWinThumbnailToolBar::setIconicLivePreviewPixmap(const QPixmap &pixmap) -{ - Q_D(QWinThumbnailToolBar); - const bool changed = d->iconicLivePreview.setPixmap(pixmap); - if (d->hasHandle()) // Potentially 0 when invoked from QML loading, see _q_updateToolbar() - d->updateIconicPixmapsEnabled(changed && !d->withinIconicLivePreviewRequest); -} - -QPixmap QWinThumbnailToolBar::iconicLivePreviewPixmap() const -{ - Q_D(const QWinThumbnailToolBar); - return d->iconicLivePreview.pixmap(); -} - -inline void QWinThumbnailToolBarPrivate::updateIconicThumbnail(const MSG *message) -{ - if (!iconicThumbnail) - return; - const QSize maxSize(HIWORD(message->lParam), LOWORD(message->lParam)); - if (const HBITMAP bitmap = iconicThumbnail.bitmap(maxSize)) { - const HRESULT hr = DwmSetIconicThumbnail(message->hwnd, bitmap, dWM_SIT_DISPLAYFRAME); - if (FAILED(hr)) - qWarning() << QWinThumbnailToolBarPrivate::msgComFailed("DwmSetIconicThumbnail", hr); - } -} - -inline void QWinThumbnailToolBarPrivate::updateIconicLivePreview(const MSG *message) -{ - if (!iconicLivePreview) - return; - RECT rect; - GetClientRect(message->hwnd, &rect); - const QSize maxSize(rect.right, rect.bottom); - POINT offset = {0, 0}; - if (const HBITMAP bitmap = iconicLivePreview.bitmap(maxSize)) { - const HRESULT hr = DwmSetIconicLivePreviewBitmap(message->hwnd, bitmap, &offset, dWM_SIT_DISPLAYFRAME); - if (FAILED(hr)) - qWarning() << QWinThumbnailToolBarPrivate::msgComFailed("DwmSetIconicLivePreviewBitmap", hr); - } -} - -/*! - Removes all buttons from the thumbnail toolbar. - */ -void QWinThumbnailToolBar::clear() -{ - setButtons(QList<QWinThumbnailToolButton *>()); -} - -static inline ITaskbarList4 *createTaskbarList() -{ - ITaskbarList4 *result = nullptr; - HRESULT hresult = CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_INPROC_SERVER, qIID_ITaskbarList4, reinterpret_cast<void **>(&result)); - if (FAILED(hresult)) { - const QString err = QtWin::errorStringFromHresult(hresult); - qWarning("QWinThumbnailToolBar: qIID_ITaskbarList4 was not created: %#010x, %s.", - unsigned(hresult), qPrintable(err)); - return nullptr; - } - hresult = result->HrInit(); - if (FAILED(hresult)) { - result->Release(); - const QString err = QtWin::errorStringFromHresult(hresult); - qWarning("QWinThumbnailToolBar: qIID_ITaskbarList4 was not initialized: %#010x, %s.", - unsigned(hresult), qPrintable(err)); - return nullptr; - } - return result; -} - -QWinThumbnailToolBarPrivate::QWinThumbnailToolBarPrivate() : - QObject(nullptr), pTbList(createTaskbarList()) -{ - buttonList.reserve(windowsLimitedThumbbarSize); - QCoreApplication::instance()->installNativeEventFilter(this); -} - -QWinThumbnailToolBarPrivate::~QWinThumbnailToolBarPrivate() -{ - if (pTbList) - pTbList->Release(); - QCoreApplication::instance()->removeNativeEventFilter(this); -} - -inline bool QWinThumbnailToolBarPrivate::hasHandle() const -{ - return window && window->handle(); -} - -inline HWND QWinThumbnailToolBarPrivate::handle() const -{ - return hasHandle() ? reinterpret_cast<HWND>(window->winId()) : nullptr; -} - -void QWinThumbnailToolBarPrivate::initToolbar() -{ - if (!pTbList || !window) - return; - THUMBBUTTON buttons[windowsLimitedThumbbarSize]; - initButtons(buttons); - HRESULT hresult = pTbList->ThumbBarAddButtons(handle(), windowsLimitedThumbbarSize, buttons); - if (FAILED(hresult)) - qWarning() << msgComFailed("ThumbBarAddButtons", hresult); -} - -void QWinThumbnailToolBarPrivate::clearToolbar() -{ - if (!pTbList || !window) - return; - THUMBBUTTON buttons[windowsLimitedThumbbarSize]; - initButtons(buttons); - HRESULT hresult = pTbList->ThumbBarUpdateButtons(handle(), windowsLimitedThumbbarSize, buttons); - if (FAILED(hresult)) - qWarning() << msgComFailed("ThumbBarUpdateButtons", hresult); -} - -void QWinThumbnailToolBarPrivate::_q_updateToolbar() -{ - updateScheduled = false; - if (!pTbList || !window) - return; - THUMBBUTTON buttons[windowsLimitedThumbbarSize]; - QList<HICON> createdIcons; - initButtons(buttons); - const int thumbbarSize = qMin(buttonList.size(), windowsLimitedThumbbarSize); - // filling from the right fixes some strange bug which makes last button bg look like first btn bg - for (int i = (windowsLimitedThumbbarSize - thumbbarSize); i < windowsLimitedThumbbarSize; i++) { - QWinThumbnailToolButton *button = buttonList.at(i - (windowsLimitedThumbbarSize - thumbbarSize)); - buttons[i].dwFlags = static_cast<THUMBBUTTONFLAGS>(makeNativeButtonFlags(button)); - buttons[i].dwMask = static_cast<THUMBBUTTONMASK>(makeButtonMask(button)); - if (!button->icon().isNull()) {; - buttons[i].hIcon = QtWin::toHICON(button->icon().pixmap(GetSystemMetrics(SM_CXSMICON))); - if (!buttons[i].hIcon) - buttons[i].hIcon = static_cast<HICON>(LoadImage(nullptr, IDI_APPLICATION, IMAGE_ICON, SM_CXSMICON, SM_CYSMICON, LR_SHARED)); - else - createdIcons << buttons[i].hIcon; - } - if (!button->toolTip().isEmpty()) { - buttons[i].szTip[button->toolTip().left(sizeof(buttons[i].szTip)/sizeof(buttons[i].szTip[0]) - 1).toWCharArray(buttons[i].szTip)] = 0; - } - } - HRESULT hresult = pTbList->ThumbBarUpdateButtons(handle(), windowsLimitedThumbbarSize, buttons); - if (FAILED(hresult)) - qWarning() << msgComFailed("ThumbBarUpdateButtons", hresult); - updateIconicPixmapsEnabled(false); - for (auto & button : buttons) { - if (button.hIcon) { - if (createdIcons.contains(button.hIcon)) - DestroyIcon(button.hIcon); - else - DeleteObject(button.hIcon); - } - } -} - -void QWinThumbnailToolBarPrivate::_q_scheduleUpdate() -{ - if (updateScheduled) - return; - updateScheduled = true; - QTimer::singleShot(0, this, &QWinThumbnailToolBarPrivate::_q_updateToolbar); -} - -bool QWinThumbnailToolBarPrivate::eventFilter(QObject *object, QEvent *event) -{ - if (object == window && event->type() == QWinEvent::TaskbarButtonCreated) { - initToolbar(); - _q_scheduleUpdate(); - } - return QObject::eventFilter(object, event); -} - -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) -bool QWinThumbnailToolBarPrivate::nativeEventFilter(const QByteArray &, void *message, qintptr *result) -#else -bool QWinThumbnailToolBarPrivate::nativeEventFilter(const QByteArray &, void *message, long *result) -#endif -{ - const MSG *msg = static_cast<const MSG *>(message); - if (handle() != msg->hwnd) - return false; - switch (msg->message) { - case WM_COMMAND: - if (HIWORD(msg->wParam) == THBN_CLICKED) { - const int buttonId = LOWORD(msg->wParam) - (windowsLimitedThumbbarSize - qMin(windowsLimitedThumbbarSize, buttonList.size())); - buttonList.at(buttonId)->click(); - if (result) - *result = 0; - return true; - } - break; - case WM_DWMSENDICONICTHUMBNAIL: - withinIconicThumbnailRequest = true; - emit q_func()->iconicThumbnailPixmapRequested(); - withinIconicThumbnailRequest = false; - updateIconicThumbnail(msg); - return true; - case WM_DWMSENDICONICLIVEPREVIEWBITMAP: - withinIconicLivePreviewRequest = true; - emit q_func()->iconicLivePreviewPixmapRequested(); - withinIconicLivePreviewRequest = false; - updateIconicLivePreview(msg); - return true; - } - return false; -} - -void QWinThumbnailToolBarPrivate::initButtons(THUMBBUTTON *buttons) -{ - for (int i = 0; i < windowsLimitedThumbbarSize; i++) { - memset(&buttons[i], 0, sizeof buttons[i]); - buttons[i].iId = UINT(i); - buttons[i].dwFlags = THBF_HIDDEN; - buttons[i].dwMask = THB_FLAGS; - } -} - -int QWinThumbnailToolBarPrivate::makeNativeButtonFlags(const QWinThumbnailToolButton *button) -{ - int nativeFlags = 0; - if (button->isEnabled()) - nativeFlags |= THBF_ENABLED; - else - nativeFlags |= THBF_DISABLED; - if (button->dismissOnClick()) - nativeFlags |= THBF_DISMISSONCLICK; - if (button->isFlat()) - nativeFlags |= THBF_NOBACKGROUND; - if (!button->isVisible()) - nativeFlags |= THBF_HIDDEN; - if (!button->isInteractive()) - nativeFlags |= THBF_NONINTERACTIVE; - return nativeFlags; -} - -int QWinThumbnailToolBarPrivate::makeButtonMask(const QWinThumbnailToolButton *button) -{ - int mask = 0; - mask |= THB_FLAGS; - if (!button->icon().isNull()) - mask |= THB_ICON; - if (!button->toolTip().isEmpty()) - mask |= THB_TOOLTIP; - return mask; -} - -QString QWinThumbnailToolBarPrivate::msgComFailed(const char *function, HRESULT hresult) -{ - return QString::fromLatin1("QWinThumbnailToolBar: %1() failed: #%2: %3") - .arg(QLatin1String(function)) - .arg(unsigned(hresult), 10, 16, QLatin1Char('0')) - .arg(QtWin::errorStringFromHresult(hresult)); -} - -QT_END_NAMESPACE - -#include "moc_qwinthumbnailtoolbar.cpp" diff --git a/src/winextras/qwinthumbnailtoolbar.h b/src/winextras/qwinthumbnailtoolbar.h deleted file mode 100644 index 83e2f2b..0000000 --- a/src/winextras/qwinthumbnailtoolbar.h +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINTHUMBNAILTOOLBAR_H -#define QWINTHUMBNAILTOOLBAR_H - -#include <QtCore/qobject.h> -#include <QtCore/qscopedpointer.h> -#include <QtWinExtras/qwinextrasglobal.h> - -QT_BEGIN_NAMESPACE - -class QPixmap; -class QWindow; -class QWinThumbnailToolButton; -class QWinThumbnailToolBarPrivate; - -class Q_WINEXTRAS_EXPORT QWinThumbnailToolBar : public QObject -{ - Q_OBJECT - Q_PROPERTY(int count READ count STORED false) - Q_PROPERTY(QWindow *window READ window WRITE setWindow) - Q_PROPERTY(bool iconicPixmapNotificationsEnabled READ iconicPixmapNotificationsEnabled WRITE setIconicPixmapNotificationsEnabled) - Q_PROPERTY(QPixmap iconicThumbnailPixmap READ iconicThumbnailPixmap WRITE setIconicThumbnailPixmap) - Q_PROPERTY(QPixmap iconicLivePreviewPixmap READ iconicLivePreviewPixmap WRITE setIconicLivePreviewPixmap) - -public: - explicit QWinThumbnailToolBar(QObject *parent = nullptr); - ~QWinThumbnailToolBar(); - - void setWindow(QWindow *window); - QWindow *window() const; - - void addButton(QWinThumbnailToolButton *button); - void removeButton(QWinThumbnailToolButton *button); - void setButtons(const QList<QWinThumbnailToolButton *> &buttons); - QList<QWinThumbnailToolButton *> buttons() const; - int count() const; - - bool iconicPixmapNotificationsEnabled() const; - void setIconicPixmapNotificationsEnabled(bool enabled); - - QPixmap iconicThumbnailPixmap() const; - QPixmap iconicLivePreviewPixmap() const; - -public Q_SLOTS: - void clear(); - void setIconicThumbnailPixmap(const QPixmap &); - void setIconicLivePreviewPixmap(const QPixmap &); - -Q_SIGNALS: - void iconicThumbnailPixmapRequested(); - void iconicLivePreviewPixmapRequested(); - -private: - Q_DISABLE_COPY(QWinThumbnailToolBar) - Q_DECLARE_PRIVATE(QWinThumbnailToolBar) - QScopedPointer<QWinThumbnailToolBarPrivate> d_ptr; - friend class QWinThumbnailToolButton; -}; - -QT_END_NAMESPACE - -#endif // QWINTHUMBNAILTOOLBAR_H diff --git a/src/winextras/qwinthumbnailtoolbar_p.h b/src/winextras/qwinthumbnailtoolbar_p.h deleted file mode 100644 index c3180f3..0000000 --- a/src/winextras/qwinthumbnailtoolbar_p.h +++ /dev/null @@ -1,132 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINTHUMBNAILTOOLBAR_P_H -#define QWINTHUMBNAILTOOLBAR_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qwinthumbnailtoolbar.h" - -#include <QtCore/qhash.h> -#include <QtCore/qlist.h> -#include <QtGui/qicon.h> -#include <QtGui/qpixmap.h> -#include <QtCore/qabstractnativeeventfilter.h> - -#include "winshobjidl_p.h" - -QT_BEGIN_NAMESPACE - -class QWinThumbnailToolBarPrivate : public QObject, QAbstractNativeEventFilter -{ -public: - class IconicPixmapCache - { - public: - IconicPixmapCache() = default; - ~IconicPixmapCache() { deleteBitmap(); } - - operator bool() const { return !m_pixmap.isNull(); } - - QPixmap pixmap() const { return m_pixmap; } - bool setPixmap(const QPixmap &p); - - HBITMAP bitmap(const QSize &maxSize); - - private: - void deleteBitmap(); - - QPixmap m_pixmap; - QSize m_size; - HBITMAP m_bitmap = nullptr; - }; - - QWinThumbnailToolBarPrivate(); - ~QWinThumbnailToolBarPrivate(); - void initToolbar(); - void clearToolbar(); - void _q_updateToolbar(); - void _q_scheduleUpdate(); - bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE; - -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) override; -#else - bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override; -#endif - - static void initButtons(THUMBBUTTON *buttons); - static int makeNativeButtonFlags(const QWinThumbnailToolButton *button); - static int makeButtonMask(const QWinThumbnailToolButton *button); - static QString msgComFailed(const char *function, HRESULT hresult); - - bool updateScheduled = false; - QList<QWinThumbnailToolButton *> buttonList; - QWindow *window = nullptr; - ITaskbarList4 * const pTbList; - - IconicPixmapCache iconicThumbnail; - IconicPixmapCache iconicLivePreview; - -private: - bool hasHandle() const; - HWND handle() const; - void updateIconicPixmapsEnabled(bool invalidate); - void updateIconicThumbnail(const MSG *message); - void updateIconicLivePreview(const MSG *message); - - QWinThumbnailToolBar *q_ptr = nullptr; - Q_DECLARE_PUBLIC(QWinThumbnailToolBar) - bool withinIconicThumbnailRequest = false; - bool withinIconicLivePreviewRequest = false; -}; - -QT_END_NAMESPACE - -#endif // QWINTHUMBNAILTOOLBAR_P_H diff --git a/src/winextras/qwinthumbnailtoolbutton.cpp b/src/winextras/qwinthumbnailtoolbutton.cpp deleted file mode 100644 index 9d04324..0000000 --- a/src/winextras/qwinthumbnailtoolbutton.cpp +++ /dev/null @@ -1,254 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qwinthumbnailtoolbutton.h" -#include "qwinthumbnailtoolbutton_p.h" - -QT_BEGIN_NAMESPACE - -/*! - \class QWinThumbnailToolButton - \inmodule QtWinExtras - \since 5.2 - \brief The QWinThumbnailToolButton class represents a button in a thumbnail toolbar. - - Buttons in a QWinThumbnailToolBar are instances of QWinThumbnailToolButton. - It provides a set of properties for specifying the attributes of a thumbnail - toolbar button. It also provides a signal that is emitted whenever the button - is \l{clicked()}{clicked}, and a slot to perform \l{click()}{clicks} - programmatically. - - \sa QWinThumbnailToolBar - */ - -/*! - \fn void QWinThumbnailToolButton::clicked() - - This signal is emitted when the button is clicked. - */ - -/*! - \internal - \fn void QWinThumbnailToolButton::changed() - */ - -/*! - Constructs a QWinThumbnailToolButton with the specified \a parent. - */ -QWinThumbnailToolButton::QWinThumbnailToolButton(QObject *parent) : - QObject(parent), d_ptr(new QWinThumbnailToolButtonPrivate) -{ -} - -/*! - Destroys the QWinThumbnailToolButton. - */ -QWinThumbnailToolButton::~QWinThumbnailToolButton() = default; - -/*! - \property QWinThumbnailToolButton::toolTip - \brief the tooltip of the button - */ -void QWinThumbnailToolButton::setToolTip(const QString &toolTip) -{ - Q_D(QWinThumbnailToolButton); - if (d->toolTip != toolTip) { - d->toolTip = toolTip; - emit changed(); - } -} - -QString QWinThumbnailToolButton::toolTip() const -{ - Q_D(const QWinThumbnailToolButton); - return d->toolTip; -} - -/*! - \property QWinThumbnailToolButton::icon - \brief the icon of the button - */ -void QWinThumbnailToolButton::setIcon(const QIcon &icon) -{ - Q_D(QWinThumbnailToolButton); - if (d->icon.cacheKey() != icon.cacheKey()) { - d->icon = icon; - emit changed(); - } -} - -QIcon QWinThumbnailToolButton::icon() const -{ - Q_D(const QWinThumbnailToolButton); - return d->icon; -} - -/*! - \property QWinThumbnailToolButton::enabled - \brief whether the button is enabled - - The default value is \c true. - - A disabled button does not react to user interaction, - and is also visually disabled. - - \sa interactive - */ -void QWinThumbnailToolButton::setEnabled(bool enabled) -{ - Q_D(QWinThumbnailToolButton); - if (d->enabled != enabled) { - d->enabled = enabled; - emit changed(); - } -} - -bool QWinThumbnailToolButton::isEnabled() const -{ - Q_D(const QWinThumbnailToolButton); - return d->enabled; -} - -/*! - \property QWinThumbnailToolButton::interactive - \brief whether the button is interactive - - The default value is \c true. - - A non-interactive button does not react to user interaction, - but is still visually enabled. A typical use case for non- - interactive buttons are notification icons. - - \sa enabled - */ -void QWinThumbnailToolButton::setInteractive(bool interactive) -{ - Q_D(QWinThumbnailToolButton); - if (d->interactive != interactive) { - d->interactive = interactive; - emit changed(); - } -} - -bool QWinThumbnailToolButton::isInteractive() const -{ - Q_D(const QWinThumbnailToolButton); - return d->interactive; -} - -/*! - \property QWinThumbnailToolButton::visible - \brief whether the button is visible - - The default value is \c true. - */ -void QWinThumbnailToolButton::setVisible(bool visible) -{ - Q_D(QWinThumbnailToolButton); - if (d->visible != visible) { - d->visible = visible; - emit changed(); - } -} - -bool QWinThumbnailToolButton::isVisible() const -{ - Q_D(const QWinThumbnailToolButton); - return d->visible; -} - -/*! - \property QWinThumbnailToolButton::dismissOnClick - \brief whether the window thumbnail is dismissed after a button click - - The default value is \c false. - */ -void QWinThumbnailToolButton::setDismissOnClick(bool dismiss) -{ - Q_D(QWinThumbnailToolButton); - if (d->dismiss != dismiss) { - d->dismiss = dismiss; - emit changed(); - } -} - -bool QWinThumbnailToolButton::dismissOnClick() const -{ - Q_D(const QWinThumbnailToolButton); - return d->dismiss; -} - -/*! - \property QWinThumbnailToolButton::flat - \brief whether the button is flat - - The default value is \c false. - - A flat button does not draw a background nor a frame - only an icon. - */ -void QWinThumbnailToolButton::setFlat(bool flat) -{ - Q_D(QWinThumbnailToolButton); - if (d->flat != flat) { - d->flat = flat; - emit changed(); - } -} - -bool QWinThumbnailToolButton::isFlat() const -{ - Q_D(const QWinThumbnailToolButton); - return d->flat; -} - -/*! - Performs a click. The clicked() signal is emitted as appropriate. - - This function does nothing if the button is \l{enabled}{disabled} - or \l{interactive}{non-interactive}. - */ -void QWinThumbnailToolButton::click() -{ - Q_D(QWinThumbnailToolButton); - if (d->enabled && d->interactive) - emit clicked(); -} - -QT_END_NAMESPACE diff --git a/src/winextras/qwinthumbnailtoolbutton.h b/src/winextras/qwinthumbnailtoolbutton.h deleted file mode 100644 index 0ab970f..0000000 --- a/src/winextras/qwinthumbnailtoolbutton.h +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINTHUMBNAILTOOLBUTTON_H -#define QWINTHUMBNAILTOOLBUTTON_H - -#include <QtGui/qicon.h> -#include <QtCore/qobject.h> -#include <QtCore/qscopedpointer.h> -#include <QtWinExtras/qwinextrasglobal.h> - -QT_BEGIN_NAMESPACE - -class QWinThumbnailToolButtonPrivate; - -class Q_WINEXTRAS_EXPORT QWinThumbnailToolButton : public QObject -{ - Q_OBJECT - Q_PROPERTY(QString toolTip READ toolTip WRITE setToolTip) - Q_PROPERTY(QIcon icon READ icon WRITE setIcon) - Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled) - Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive) - Q_PROPERTY(bool visible READ isVisible WRITE setVisible) - Q_PROPERTY(bool dismissOnClick READ dismissOnClick WRITE setDismissOnClick) - Q_PROPERTY(bool flat READ isFlat WRITE setFlat) - -public: - explicit QWinThumbnailToolButton(QObject *parent = nullptr); - ~QWinThumbnailToolButton(); - - void setToolTip(const QString &toolTip); - QString toolTip() const; - void setIcon(const QIcon &icon); - QIcon icon() const; - void setEnabled(bool enabled); - bool isEnabled() const; - void setInteractive(bool interactive); - bool isInteractive() const; - void setVisible(bool visible); - bool isVisible() const; - void setDismissOnClick(bool dismiss); - bool dismissOnClick() const; - void setFlat(bool flat); - bool isFlat() const; - -public Q_SLOTS: - void click(); - -Q_SIGNALS: - void clicked(); - void changed(); - -private: - Q_DISABLE_COPY(QWinThumbnailToolButton) - Q_DECLARE_PRIVATE(QWinThumbnailToolButton) - QScopedPointer<QWinThumbnailToolButtonPrivate> d_ptr; - friend class QWinThumbnailToolBar; -}; - -QT_END_NAMESPACE - -#endif // QWINTHUMBNAILTOOLBUTTON_H diff --git a/src/winextras/qwinthumbnailtoolbutton_p.h b/src/winextras/qwinthumbnailtoolbutton_p.h deleted file mode 100644 index 9ff02d6..0000000 --- a/src/winextras/qwinthumbnailtoolbutton_p.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINTHUMBNAILTOOLBUTTON_P_H -#define QWINTHUMBNAILTOOLBUTTON_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QtGui/qicon.h> -#include <QtCore/qstring.h> - -QT_BEGIN_NAMESPACE - -class QWinThumbnailToolBar; - -class QWinThumbnailToolButtonPrivate -{ -public: - QString toolTip; - QIcon icon; - bool enabled = true; - bool interactive = true; - bool dismiss = false; - bool visible = true; - bool flat = false; - - QWinThumbnailToolBar *toolbar = nullptr; -}; - -QT_END_NAMESPACE - -#endif // QWINTHUMBNAILTOOLBUTTON_P_H diff --git a/src/winextras/windowsguidsdefs.cpp b/src/winextras/windowsguidsdefs.cpp deleted file mode 100644 index dd4284d..0000000 --- a/src/winextras/windowsguidsdefs.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "windowsguidsdefs_p.h" -#include "winpropkey_p.h" -#include "winshobjidl_p.h" - -QT_BEGIN_NAMESPACE - -// Some of these symbols are defined to varying extents in the various -// MinGW versions. To avoid potential conflicts, we provide them prefixed with -// 'q' in Qt's namespace. - -const GUID qCLSID_DestinationList = {0x77f10cf0, 0x3db5, 0x4966, {0xb5,0x20,0xb7,0xc5,0x4f,0xd3,0x5e,0xd6}}; -const GUID qCLSID_EnumerableObjectCollection = {0x2d3468c1, 0x36a7, 0x43b6, {0xac,0x24,0xd3,0xf0,0x2f,0xd9,0x60,0x7a}}; -const GUID qIID_ICustomDestinationList = {0x6332debf, 0x87b5, 0x4670, {0x90,0xc0,0x5e,0x57,0xb4,0x08,0xa4,0x9e}}; -const GUID qIID_IApplicationDestinations = {0x12337d35, 0x94c6, 0x48a0, {0xbc,0xe7,0x6a,0x9c,0x69,0xd4,0xd6,0x00}}; -const GUID qCLSID_ApplicationDestinations = {0x86c14003, 0x4d6b, 0x4ef3, {0xa7,0xb4,0x05,0x06,0x66,0x3b,0x2e,0x68}}; -const GUID qIID_IApplicationDocumentLists = {0x3c594f9f, 0x9f30, 0x47a1, {0x97,0x9a,0xc9,0xe8,0x3d,0x3d,0x0a,0x06}}; -const GUID qCLSID_ApplicationDocumentLists = {0x86bec222, 0x30f2, 0x47e0, {0x9f,0x25,0x60,0xd1,0x1c,0xd7,0x5c,0x28}}; -const GUID qIID_IObjectArray = {0x92ca9dcd, 0x5622, 0x4bba, {0xa8,0x05,0x5e,0x9f,0x54,0x1b,0xd8,0xc9}}; -const GUID qIID_IObjectCollection = {0x5632b1a4, 0xe38a, 0x400a, {0x92,0x8a,0xd4,0xcd,0x63,0x23,0x02,0x95}}; -const GUID qIID_IPropertyStore = {0x886d8eeb, 0x8cf2, 0x4446, {0x8d,0x02,0xcd,0xba,0x1d,0xbd,0xcf,0x99}}; -const GUID qIID_ITaskbarList3 = {0xea1afb91, 0x9e28, 0x4b86, {0x90,0xe9,0x9e,0x9f,0x8a,0x5e,0xef,0xaf}}; -const GUID qIID_ITaskbarList4 = {0xc43dc798, 0x95d1, 0x4bea, {0x90,0x30, 0xbb,0x99,0xe2,0x98,0x3a,0x1a}}; -const PROPERTYKEY qPKEY_Title = {{0xf29f85e0, 0x4ff9, 0x1068, {0xab,0x91,0x08,0x00,0x2b,0x27,0xb3,0xd9}}, 2}; -const PROPERTYKEY qPKEY_Link_Arguments = {{0x436f2667, 0x14e2, 0x4feb, {0xb3,0x0a,0x14,0x6c,0x53,0xb5,0xb6,0x74}}, 100}; -const PROPERTYKEY qPKEY_AppUserModel_IsDestListSeparator = {{0x9f4c2855, 0x9f79, 0x4b39, {0xa8,0xd0,0xe1,0xd4,0x2d,0xe1,0xd5,0xf3}}, 6}; -const GUID qIID_IShellItem2 = {0x7e9fb0d3, 0x919f, 0x4307, {0xab,0x2e,0x9b,0x18,0x60,0x31,0x0c,0x93}}; -const GUID qIID_IShellLinkW = {0x000214f9, 0x0000, 0x0000, {0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}}; -const GUID qIID_ITaskbarList = {0xea1afb91, 0x9e28, 0x4b86, {0x90,0xe9,0x9e,0x9f,0x8a,0x5e,0xef,0xaf}}; -const GUID qIID_ITaskbarList2 = {0x602d4995, 0xb13a, 0x429b, {0xa6,0x6e,0x19,0x35,0xe4,0x4f,0x43,0x17}}; -const GUID qIID_IUnknown = {0x00000000, 0x0000, 0x0000, {0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}}; -const GUID qGUID_NULL = {0x00000000, 0x0000, 0x0000, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}; - -QT_END_NAMESPACE diff --git a/src/winextras/windowsguidsdefs_p.h b/src/winextras/windowsguidsdefs_p.h deleted file mode 100644 index 73dc0e7..0000000 --- a/src/winextras/windowsguidsdefs_p.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef WINDOWSGUIDSDEFS_P_H -#define WINDOWSGUIDSDEFS_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of QtWinExtras. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QtCore/qglobal.h> -#include <QtCore/qt_windows.h> - -QT_BEGIN_NAMESPACE - -extern const GUID qCLSID_DestinationList; -extern const GUID qCLSID_EnumerableObjectCollection; -extern const GUID qIID_ICustomDestinationList; -extern const GUID qIID_IApplicationDestinations; -extern const GUID qCLSID_ApplicationDestinations; -extern const GUID qIID_IApplicationDocumentLists; -extern const GUID qCLSID_ApplicationDocumentLists; -extern const GUID qIID_IObjectArray; -extern const GUID qIID_IObjectCollection; -extern const GUID qIID_IPropertyStore; -extern const GUID qIID_ITaskbarList3; -extern const GUID qIID_ITaskbarList4; -extern const GUID qIID_IShellItem2; -extern const GUID qIID_IShellLinkW; -extern const GUID qIID_ITaskbarList; -extern const GUID qIID_ITaskbarList2; -extern const GUID qIID_IUnknown; -extern const GUID qGUID_NULL; - -QT_END_NAMESPACE - -#endif // WINDOWSGUIDSDEFS_P_H diff --git a/src/winextras/winextras.pro b/src/winextras/winextras.pro deleted file mode 100644 index caedc0a..0000000 --- a/src/winextras/winextras.pro +++ /dev/null @@ -1,57 +0,0 @@ -TARGET = QtWinExtras - -QT += gui-private core-private - -SOURCES += \ - qwinfunctions.cpp \ - qwintaskbarbutton.cpp \ - qwintaskbarprogress.cpp \ - windowsguidsdefs.cpp \ - qwinjumplist.cpp \ - qwinjumplistcategory.cpp \ - qwinjumplistitem.cpp \ - qwineventfilter.cpp \ - qwinthumbnailtoolbar.cpp \ - qwinthumbnailtoolbutton.cpp \ - qwinevent.cpp - -HEADERS += \ - qwinfunctions.h \ - qwinextrasglobal.h \ - qwinfunctions_p.h \ - qwintaskbarbutton_p.h \ - qwintaskbarbutton.h \ - qwintaskbarprogress.h \ - qwinjumplist.h \ - qwinjumplist_p.h \ - qwinjumplistcategory.h \ - qwinjumplistcategory_p.h \ - qwinjumplistitem.h \ - qwinjumplistitem_p.h \ - winshobjidl_p.h \ - winpropkey_p.h \ - qwineventfilter_p.h \ - qwinthumbnailtoolbar.h \ - qwinthumbnailtoolbar_p.h \ - qwinthumbnailtoolbutton.h \ - qwinthumbnailtoolbutton_p.h \ - qwinevent.h \ - windowsguidsdefs_p.h - -QMAKE_DOCS = $$PWD/doc/qtwinextras.qdocconf - -LIBS_PRIVATE += -lole32 -lshlwapi -lshell32 -ldwmapi -win32:!qtHaveModule(opengl)|qtConfig(dynamicgl):LIBS_PRIVATE += -lgdi32 - -OTHER_FILES += \ - doc/qtwinextras.qdocconf \ - doc/src/qtwinextras-index.qdoc \ - doc/src/qtwinextras-module-cpp.qdoc \ - doc/src/qtwinextras-module-qml.qdoc \ - doc/snippets/code/use-qtwinextras.pro \ - doc/snippets/code/jumplist.cpp \ - doc/snippets/code/use-qtwinextras.cpp \ - doc/snippets/code/thumbbar.cpp \ - doc/snippets/code/thumbbar.qml - -load(qt_module) diff --git a/src/winextras/winpropkey_p.h b/src/winextras/winpropkey_p.h deleted file mode 100644 index 53646fc..0000000 --- a/src/winextras/winpropkey_p.h +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef WINPROPKEY_P_H -#define WINPROPKEY_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of QtWinExtras. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QtCore/qglobal.h> -#include <propkey.h> - -QT_BEGIN_NAMESPACE - -extern const PROPERTYKEY qPKEY_Title; -extern const PROPERTYKEY qPKEY_AppUserModel_IsDestListSeparator; -extern const PROPERTYKEY qPKEY_Link_Arguments; - -QT_END_NAMESPACE - -#endif // WINPROPKEY_P_H diff --git a/src/winextras/winshobjidl_p.h b/src/winextras/winshobjidl_p.h deleted file mode 100644 index efd28c6..0000000 --- a/src/winextras/winshobjidl_p.h +++ /dev/null @@ -1,248 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef WINSHOBJIDL_P_H -#define WINSHOBJIDL_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <shobjidl.h> - -#ifndef __ITaskbarList_INTERFACE_DEFINED__ -#define __ITaskbarList_INTERFACE_DEFINED__ - -struct ITaskbarList : IUnknown -{ - virtual HRESULT STDMETHODCALLTYPE HrInit() = 0; - virtual HRESULT STDMETHODCALLTYPE AddTab(HWND hwnd) = 0; - virtual HRESULT STDMETHODCALLTYPE DeleteTab(HWND hwnd) = 0; - virtual HRESULT STDMETHODCALLTYPE ActivateTab(HWND hwnd) = 0; - virtual HRESULT STDMETHODCALLTYPE SetActiveAlt(HWND hwnd) = 0; -}; - -#endif - -#ifndef __ITaskbarList2_INTERFACE_DEFINED__ -#define __ITaskbarList2_INTERFACE_DEFINED__ - -struct ITaskbarList2 : ITaskbarList -{ - virtual HRESULT STDMETHODCALLTYPE MarkFullscreenWindow(HWND hwnd, BOOL fullscreen) = 0; -}; - -#endif - -#ifndef __ITaskbarList3_INTERFACE_DEFINED__ -#define __ITaskbarList3_INTERFACE_DEFINED__ - -enum THUMBBUTTONMASK { - THB_BITMAP = 0x00000001, - THB_ICON = 0x00000002, - THB_TOOLTIP = 0x00000004, - THB_FLAGS = 0x00000008 -}; - -enum THUMBBUTTONFLAGS { - THBF_ENABLED = 0x00000000, - THBF_DISABLED = 0x00000001, - THBF_DISMISSONCLICK = 0x00000002, - THBF_NOBACKGROUND = 0x00000004, - THBF_HIDDEN = 0x00000008, - THBF_NONINTERACTIVE = 0x00000010 -}; - -enum TBPFLAG { - TBPF_NOPROGRESS = 0x00000000, - TBPF_INDETERMINATE = 0x00000001, - TBPF_NORMAL = 0x00000002, - TBPF_ERROR = 0x00000004, - TBPF_PAUSED = 0x00000008 -}; - -enum STPFLAG { - STPF_NONE = 0x00000000, - STPF_USEAPPTHUMBNAILALWAYS = 0x00000001, - STPF_USEAPPTHUMBNAILWHENACTIVE = 0x00000002, - STPF_USEAPPPEEKALWAYS = 0x00000004, - STPF_USEAPPPEEKWHENACTIVE = 0x00000008 -}; - -struct THUMBBUTTON -{ - THUMBBUTTONMASK dwMask; - UINT iId; - UINT iBitmap; - HICON hIcon; - WCHAR szTip[260]; - THUMBBUTTONFLAGS dwFlags; -}; - -struct ITaskbarList3 : ITaskbarList2 -{ - virtual HRESULT STDMETHODCALLTYPE SetProgressValue(HWND hwnd, ULONGLONG completed, ULONGLONG total) = 0; - virtual HRESULT STDMETHODCALLTYPE SetProgressState(HWND hwnd, TBPFLAG tbpFlags) = 0; - virtual HRESULT STDMETHODCALLTYPE RegisterTab(HWND tab, HWND window) = 0; - virtual HRESULT STDMETHODCALLTYPE UnregisterTab(HWND tab) = 0; - virtual HRESULT STDMETHODCALLTYPE SetTabOrder(HWND tab, HWND insertBefore) = 0; - virtual HRESULT STDMETHODCALLTYPE SetTabActive(HWND tab, HWND window, DWORD reserved = 0) = 0; - virtual HRESULT STDMETHODCALLTYPE ThumbBarAddButtons(HWND hwnd, UINT count, THUMBBUTTON buttons) = 0; - virtual HRESULT STDMETHODCALLTYPE ThumbBarUpdateButtons(HWND hwnd, UINT count, THUMBBUTTON *buttons) = 0; - virtual HRESULT STDMETHODCALLTYPE ThumbBarSetImageList(HWND hwnd, HIMAGELIST imglist) = 0; - virtual HRESULT STDMETHODCALLTYPE SetOverlayIcon(HWND hwnd, HICON icon, LPCWSTR description) = 0; - virtual HRESULT STDMETHODCALLTYPE SetThumbnailTooltip(HWND hwnd, LPCWSTR tooltip) = 0; - virtual HRESULT STDMETHODCALLTYPE SetThumbnailClip(HWND hwnd, RECT *clip) = 0; -}; - -#endif - -#ifndef __ITaskbarList4_INTERFACE_DEFINED__ -#define __ITaskbarList4_INTERFACE_DEFINED__ - -struct ITaskbarList4 : ITaskbarList3 -{ - virtual HRESULT STDMETHODCALLTYPE SetTabProperties(HWND tab, STPFLAG flags) = 0; -}; - -#endif - -#ifndef __IObjectArray_INTERFACE_DEFINED__ -#define __IObjectArray_INTERFACE_DEFINED__ - -struct IObjectArray : IUnknown -{ -public: - virtual HRESULT STDMETHODCALLTYPE GetCount(UINT *count) = 0; - virtual HRESULT STDMETHODCALLTYPE GetAt(UINT index, REFIID iid, void **ppv) = 0; -}; - -#endif - -#ifndef __IObjectCollection_INTERFACE_DEFINED__ -#define __IObjectCollection_INTERFACE_DEFINED__ - -struct IObjectCollection : IObjectArray -{ -public: - virtual HRESULT STDMETHODCALLTYPE AddObject(IUnknown *punk) = 0; - virtual HRESULT STDMETHODCALLTYPE AddFromArray(IObjectArray *poaSource) = 0; - virtual HRESULT STDMETHODCALLTYPE RemoveObjectAt(UINT uiIndex) = 0; - virtual HRESULT STDMETHODCALLTYPE Clear() = 0; -}; - -#endif - -#ifndef __ICustomDestinationList_INTERFACE_DEFINED__ -#define __ICustomDestinationList_INTERFACE_DEFINED__ - -enum KNOWNDESTCATEGORY { - KDC_FREQUENT = 1, - KDC_RECENT -}; - -struct ICustomDestinationList : IUnknown -{ -public: - virtual HRESULT STDMETHODCALLTYPE SetAppID(LPCWSTR pszAppID) = 0; - virtual HRESULT STDMETHODCALLTYPE BeginList(UINT *pcMinSlots, REFIID riid, void **ppv) = 0; - virtual HRESULT STDMETHODCALLTYPE AppendCategory(LPCWSTR pszCategory, IObjectArray *poa) = 0; - virtual HRESULT STDMETHODCALLTYPE AppendKnownCategory(KNOWNDESTCATEGORY category) = 0; - virtual HRESULT STDMETHODCALLTYPE AddUserTasks(IObjectArray *poa) = 0; - virtual HRESULT STDMETHODCALLTYPE CommitList() = 0; - virtual HRESULT STDMETHODCALLTYPE GetRemovedDestinations(REFIID riid, void **ppv) = 0; - virtual HRESULT STDMETHODCALLTYPE DeleteList(LPCWSTR pszAppID) = 0; - virtual HRESULT STDMETHODCALLTYPE AbortList() = 0; -}; - -#endif - -#ifndef __IApplicationDocumentLists_INTERFACE_DEFINED__ -#define __IApplicationDocumentLists_INTERFACE_DEFINED__ - -enum APPDOCLISTTYPE { - ADLT_RECENT = 0, - ADLT_FREQUENT -}; - -struct IApplicationDocumentLists : public IUnknown -{ -public: - virtual HRESULT STDMETHODCALLTYPE SetAppID(LPCWSTR pszAppID) = 0; - virtual HRESULT STDMETHODCALLTYPE GetList(APPDOCLISTTYPE listtype, UINT cItemsDesired, REFIID riid, void **ppv) = 0; -}; -#endif - -#ifndef __IApplicationDestinations_INTERFACE_DEFINED__ -#define __IApplicationDestinations_INTERFACE_DEFINED__ - -struct IApplicationDestinations : public IUnknown -{ -public: - virtual HRESULT STDMETHODCALLTYPE SetAppID(LPCWSTR pszAppID) = 0; - virtual HRESULT STDMETHODCALLTYPE RemoveDestination(IUnknown *punk) = 0; - virtual HRESULT STDMETHODCALLTYPE RemoveAllDestinations( void) = 0; -}; - -#endif - -#ifdef Q_CC_MINGW - -# if !defined(__MINGW64_VERSION_MAJOR) || !defined(__MINGW64_VERSION_MINOR) || __MINGW64_VERSION_MAJOR * 100 + __MINGW64_VERSION_MINOR < 301 - -typedef struct SHARDAPPIDINFOLINK -{ - IShellLink *psl; // An IShellLink instance that when launched opens a recently used item in the specified - // application. This link is not added to the recent docs folder, but will be added to the - // specified application's destination list. - PCWSTR pszAppID; // The id of the application that should be associated with this recent doc. -} SHARDAPPIDINFOLINK; - -# endif // !defined(__MINGW64_VERSION_MAJOR) || !defined(__MINGW64_VERSION_MINOR) || __MINGW64_VERSION_MAJOR * 100 + __MINGW64_VERSION_MINOR < 301 - -#endif - -#endif // WINSHOBJIDL_P_H |