aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Vizir <define-true-false@yandex.com>2013-03-10 13:16:46 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-01 15:56:14 +0200
commit8f3d85814ac5df01a4b633955d1f7f317248fdca (patch)
treea6fe11a1abad2d68d2558d8c440570f081652f4d
parent447815121b25c2de61eba8446ad5db57ae739b50 (diff)
Jump Lists, overlay icon, progress indicator, DWM.
Implemented the most widely used features and QML wrappers for them. Change-Id: I0ac1b174b7f4eb355d097e71255e8d123141b369 Reviewed-by: Ivan Vizir <define-true-false@yandex.com> Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
-rw-r--r--.gitignore2
-rw-r--r--.qmake.conf1
-rw-r--r--examples/dwmfeatures/dwmfeatures.pro11
-rw-r--r--examples/dwmfeatures/examplewidget.cpp180
-rw-r--r--examples/dwmfeatures/examplewidget.h80
-rw-r--r--examples/dwmfeatures/examplewidget.ui319
-rw-r--r--examples/dwmfeatures/main.cpp52
-rw-r--r--examples/examples.pro8
-rw-r--r--examples/iconextractor/main.cpp4
-rw-r--r--examples/jumplistexample/examplewidget.cpp137
-rw-r--r--examples/jumplistexample/examplewidget.h77
-rw-r--r--examples/jumplistexample/examplewidget.ui198
-rw-r--r--examples/jumplistexample/jumplistexample.pro11
-rw-r--r--examples/jumplistexample/main.cpp83
-rw-r--r--examples/quickdwm/icon.pngbin0 -> 4945 bytes
-rw-r--r--examples/quickdwm/quickdwm.qml158
-rw-r--r--examples/quickdwm/quickdwm.qmlproject15
-rw-r--r--src/imports/imports.pro2
-rw-r--r--src/imports/winextras/JumpDestination.qml61
-rw-r--r--src/imports/winextras/JumpLink.qml89
-rw-r--r--src/imports/winextras/JumpListSeparator.qml54
-rw-r--r--src/imports/winextras/qmldir5
-rw-r--r--src/imports/winextras/qquickjumplist.cpp256
-rw-r--r--src/imports/winextras/qquickjumplist.h130
-rw-r--r--src/imports/winextras/qquickwindwmfeatures.cpp314
-rw-r--r--src/imports/winextras/qquickwindwmfeatures.h125
-rw-r--r--src/imports/winextras/qquickwindwmfeatures_p.h75
-rw-r--r--src/imports/winextras/qquickwintaskbarbutton.cpp183
-rw-r--r--src/imports/winextras/qquickwintaskbarbutton.h92
-rw-r--r--src/imports/winextras/qwinextrasplugin.cpp67
-rw-r--r--src/imports/winextras/qwinextrasplugin.h64
-rw-r--r--src/imports/winextras/winextras.pro32
-rw-r--r--src/src.pro3
-rw-r--r--src/winextras/doc/images/glass.pngbin0 -> 47584 bytes
-rw-r--r--src/winextras/doc/images/jumplist.pngbin0 -> 28988 bytes
-rw-r--r--src/winextras/doc/images/peek-on.pngbin0 -> 40988 bytes
-rw-r--r--src/winextras/doc/qtwinextras.qdocconf39
-rw-r--r--src/winextras/doc/snippets/code/jumplist.cpp62
-rw-r--r--src/winextras/doc/snippets/code/use-qtwinextras.cpp43
-rw-r--r--src/winextras/doc/snippets/code/use-qtwinextras.pro3
-rw-r--r--src/winextras/doc/src/qtwinextras-index.qdoc53
-rw-r--r--src/winextras/doc/src/qtwinextras-module-cpp.qdoc39
-rw-r--r--src/winextras/doc/src/qtwinextras-module-qml.qdoc35
-rw-r--r--src/winextras/qjumplist.cpp916
-rw-r--r--src/winextras/qjumplist.h135
-rw-r--r--src/winextras/qwincolorizationcolorchangeevent.cpp88
-rw-r--r--src/winextras/qwincolorizationcolorchangeevent.h72
-rw-r--r--src/winextras/qwincolorizationcolorchangeevent_p.h63
-rw-r--r--src/winextras/qwincompositionstatechangeevent.cpp80
-rw-r--r--src/winextras/qwincompositionstatechangeevent.h69
-rw-r--r--src/winextras/qwincompositionstatechangeevent_p.h62
-rw-r--r--src/winextras/qwineventfilter.cpp130
-rw-r--r--src/winextras/qwineventfilter_p.h70
-rw-r--r--src/winextras/qwinfunctions.cpp1854
-rw-r--r--src/winextras/qwinfunctions.h223
-rw-r--r--src/winextras/qwinfunctions_p.cpp182
-rw-r--r--src/winextras/qwinfunctions_p.h117
-rw-r--r--src/winextras/qwintaskbarbutton.cpp384
-rw-r--r--src/winextras/qwintaskbarbutton.h116
-rw-r--r--src/winextras/qwintaskbarbutton_p.h88
-rw-r--r--src/winextras/qwintaskbarbuttoncreatedevent.cpp66
-rw-r--r--src/winextras/qwintaskbarbuttoncreatedevent.h68
-rw-r--r--src/winextras/qwintaskbarbuttoncreatedevent_p.h60
-rw-r--r--src/winextras/qwinthemechangeevent.cpp67
-rw-r--r--src/winextras/qwinthemechangeevent.h69
-rw-r--r--src/winextras/qwinthemechangeevent_p.h56
-rw-r--r--src/winextras/windowsguidsdefs.cpp70
-rw-r--r--src/winextras/winextras.pro42
-rw-r--r--src/winextras/winpropkey_p.h54
-rw-r--r--src/winextras/winshobjidl_p.h210
70 files changed, 8528 insertions, 45 deletions
diff --git a/.gitignore b/.gitignore
index 16b4ee5..89c113e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,6 +14,8 @@
*.pro.user
*.pro.user.*
+*.qmlproject.user
+*.qmlproject.user.*
moc_*.cpp
qrc_*.cpp
Makefile
diff --git a/.qmake.conf b/.qmake.conf
index 42ba8e4..4f0ccc3 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -1 +1,2 @@
load(qt_build_config)
+MODULE_VERSION = $$QT_VERSION \ No newline at end of file
diff --git a/examples/dwmfeatures/dwmfeatures.pro b/examples/dwmfeatures/dwmfeatures.pro
new file mode 100644
index 0000000..1768438
--- /dev/null
+++ b/examples/dwmfeatures/dwmfeatures.pro
@@ -0,0 +1,11 @@
+QT += widgets winextras
+
+TARGET = dwmfeatures
+TEMPLATE = app
+
+SOURCES += main.cpp\
+ examplewidget.cpp
+
+HEADERS += examplewidget.h
+
+FORMS += examplewidget.ui
diff --git a/examples/dwmfeatures/examplewidget.cpp b/examples/dwmfeatures/examplewidget.cpp
new file mode 100644
index 0000000..be55df1
--- /dev/null
+++ b/examples/dwmfeatures/examplewidget.cpp
@@ -0,0 +1,180 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#include "examplewidget.h"
+#include "ui_examplewidget.h"
+
+#include <QWinFunctions>
+#include <QWinCompositionStateChangeEvent>
+#include <QWinThemeChangeEvent>
+#include <QDebug>
+#include <qt_windows.h>
+
+ExampleWidget::ExampleWidget(QWidget *parent) :
+ QWidget(parent),
+ ui(new Ui::ExampleWidget)
+{
+ ui->setupUi(this);
+
+ connect(ui->btnPeekDisallow, SIGNAL(clicked()), SLOT(onDisallowPeekClicked()));
+ connect(ui->btnPeekExclude, SIGNAL(clicked()), SLOT(onExcludeFromPeekClicked()));
+ connect(ui->radioFlipDefault, SIGNAL(clicked()), SLOT(onFlip3DPolicyChanged()));
+ connect(ui->radioFlipAbove, SIGNAL(clicked()), SLOT(onFlip3DPolicyChanged()));
+ connect(ui->radioFlipBelow, SIGNAL(clicked()), SLOT(onFlip3DPolicyChanged()));
+ connect(ui->btnFrameReset, SIGNAL(clicked()), SLOT(onResetGlassFrameClicked()));
+ connect(ui->frameTop, SIGNAL(valueChanged(int)), SLOT(onGlassMarginsChanged()));
+ connect(ui->frameRight, SIGNAL(valueChanged(int)), SLOT(onGlassMarginsChanged()));
+ connect(ui->frameBottom, SIGNAL(valueChanged(int)), SLOT(onGlassMarginsChanged()));
+ connect(ui->frameLeft, SIGNAL(valueChanged(int)), SLOT(onGlassMarginsChanged()));
+}
+
+ExampleWidget::~ExampleWidget()
+{
+ delete ui;
+}
+
+void ExampleWidget::changeEvent(QEvent *e)
+{
+ QWidget::changeEvent(e);
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ ui->retranslateUi(this);
+ break;
+ default:
+ break;
+ }
+}
+
+bool ExampleWidget::event(QEvent *e)
+{
+ if (e->type() == QWinCompositionStateChangeEvent::eventType()) {
+ QWinCompositionStateChangeEvent *stateEvent = static_cast<QWinCompositionStateChangeEvent *>(e);
+ qDebug() << "Composition state change: " << stateEvent->isCompositionEnabled();
+ } else if (e->type() == QWinThemeChangeEvent::eventType()) {
+ qDebug() << "Theme change.";
+ }
+ return QWidget::event(e);
+}
+
+void ExampleWidget::onDisallowPeekClicked()
+{
+ QWinExtras::setWindowDisallowPeek(this, ui->btnPeekDisallow->isChecked());
+}
+
+void ExampleWidget::onExcludeFromPeekClicked()
+{
+ QWinExtras::setWindowExcludedFromPeek(this, ui->btnPeekExclude->isChecked());
+}
+
+void ExampleWidget::onFlip3DPolicyChanged()
+{
+ QWinExtras::WindowFlip3DPolicy policy;
+ if (ui->radioFlipAbove->isChecked())
+ policy = QWinExtras::FlipExcludeAbove;
+ else if (ui->radioFlipBelow->isChecked())
+ policy = QWinExtras::FlipExcludeBelow;
+ else
+ policy = QWinExtras::FlipDefault;
+ QWinExtras::setWindowFlip3DPolicy(this, policy);
+}
+
+void ExampleWidget::onGlassMarginsChanged()
+{
+ if (!QWinExtras::isCompositionEnabled())
+ return;
+
+ // what you see here is the only way to force widget to redraw itself
+ // so it actually redraws itself without caching and without any glitch
+ // but causes flickering :(
+ // and yes, update() and redraw() do nothing
+
+ if (!testAttribute(Qt::WA_NoSystemBackground)) {
+
+ QSize original = size();
+ QSize modified = original;
+ modified.setWidth(original.height() + 1);
+ resize(modified);
+
+ setAttribute(Qt::WA_NoSystemBackground);
+ QWinExtras::extendFrameIntoClientArea(this,
+ ui->frameTop->value(),
+ ui->frameRight->value(),
+ ui->frameBottom->value(),
+ ui->frameLeft->value());
+
+ resize(original);
+
+ ui->groupBox_2->setAutoFillBackground(true);
+ ui->groupBox_3->setAutoFillBackground(true);
+ ui->groupBox_4->setAutoFillBackground(true);
+ } else {
+ QWinExtras::extendFrameIntoClientArea(this,
+ ui->frameLeft->value(),
+ ui->frameTop->value(),
+ ui->frameRight->value(),
+ ui->frameBottom->value());
+ }
+}
+
+void ExampleWidget::onResetGlassFrameClicked()
+{
+ if (!testAttribute(Qt::WA_NoSystemBackground))
+ return;
+
+ ui->frameTop->setValue(0);
+ ui->frameRight->setValue(0);
+ ui->frameBottom->setValue(0);
+ ui->frameLeft->setValue(0);
+
+ QWinExtras::resetExtendedFrame(this);
+ setAttribute(Qt::WA_NoSystemBackground, false);
+
+ QSize original = size();
+ QSize modified = original;
+ modified.setHeight(original.height() + 1);
+ resize(modified);
+
+ ui->groupBox_2->setAutoFillBackground(false);
+ ui->groupBox_3->setAutoFillBackground(false);
+ ui->groupBox_4->setAutoFillBackground(false);
+
+ resize(original);
+}
diff --git a/examples/dwmfeatures/examplewidget.h b/examples/dwmfeatures/examplewidget.h
new file mode 100644
index 0000000..3023386
--- /dev/null
+++ b/examples/dwmfeatures/examplewidget.h
@@ -0,0 +1,80 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#ifndef EXAMPLEWIDGET_H
+#define EXAMPLEWIDGET_H
+
+#include <QWidget>
+
+QT_BEGIN_NAMESPACE
+namespace Ui {
+class ExampleWidget;
+}
+QT_END_NAMESPACE
+
+#if defined(QT_NAMESPACE)
+namespace Ui = QT_NAMESPACE::Ui;
+#endif
+
+class ExampleWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ explicit ExampleWidget(QWidget *parent = 0);
+ ~ExampleWidget();
+
+protected:
+ void changeEvent(QEvent *e);
+ bool event(QEvent *);
+
+private:
+ Ui::ExampleWidget *ui;
+
+private slots:
+ void onDisallowPeekClicked();
+ void onExcludeFromPeekClicked();
+ void onFlip3DPolicyChanged();
+ void onGlassMarginsChanged();
+ void onResetGlassFrameClicked();
+};
+
+#endif // EXAMPLEWIDGET_H
diff --git a/examples/dwmfeatures/examplewidget.ui b/examples/dwmfeatures/examplewidget.ui
new file mode 100644
index 0000000..c3520bc
--- /dev/null
+++ b/examples/dwmfeatures/examplewidget.ui
@@ -0,0 +1,319 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ExampleWidget</class>
+ <widget class="QWidget" name="ExampleWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>569</width>
+ <height>331</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>QtWinExtras DWM Example</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="minimumSize">
+ <size>
+ <width>150</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>Aero Peek</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <property name="spacing">
+ <number>3</number>
+ </property>
+ <property name="margin">
+ <number>4</number>
+ </property>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_7">
+ <item>
+ <spacer name="horizontalSpacer_11">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="btnPeekDisallow">
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Disallow peek</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_12">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_8">
+ <item>
+ <spacer name="horizontalSpacer_13">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="btnPeekExclude">
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Exclude from peek</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_14">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QGroupBox" name="groupBox_4">
+ <property name="title">
+ <string>Flip3D</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_5">
+ <property name="spacing">
+ <number>3</number>
+ </property>
+ <property name="margin">
+ <number>4</number>
+ </property>
+ <item>
+ <widget class="QRadioButton" name="radioFlipDefault">
+ <property name="text">
+ <string>Default</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="radioFlipAbove">
+ <property name="text">
+ <string>Exclude above</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="radioFlipBelow">
+ <property name="text">
+ <string>Exclude below</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_3">
+ <property name="title">
+ <string>Glass frame</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout_2">
+ <property name="horizontalSpacing">
+ <number>3</number>
+ </property>
+ <property name="verticalSpacing">
+ <number>3</number>
+ </property>
+ <property name="margin">
+ <number>4</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>Left</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string>Right</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_7">
+ <property name="text">
+ <string>Top</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_8">
+ <property name="text">
+ <string>Bottom</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" colspan="2">
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <item>
+ <spacer name="horizontalSpacer_5">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="btnFrameReset">
+ <property name="text">
+ <string>Reset</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_6">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="1">
+ <widget class="QSpinBox" name="frameLeft">
+ <property name="minimum">
+ <number>-1</number>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QSpinBox" name="frameRight">
+ <property name="minimum">
+ <number>-1</number>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QSpinBox" name="frameTop">
+ <property name="minimum">
+ <number>-1</number>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QSpinBox" name="frameBottom">
+ <property name="minimum">
+ <number>-1</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/examples/dwmfeatures/main.cpp b/examples/dwmfeatures/main.cpp
new file mode 100644
index 0000000..2c69022
--- /dev/null
+++ b/examples/dwmfeatures/main.cpp
@@ -0,0 +1,52 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#include "examplewidget.h"
+#include <QApplication>
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ ExampleWidget w;
+ w.show();
+
+ return a.exec();
+}
diff --git a/examples/examples.pro b/examples/examples.pro
index 6aec066..faa2909 100644
--- a/examples/examples.pro
+++ b/examples/examples.pro
@@ -1,2 +1,8 @@
TEMPLATE = subdirs
-win32:SUBDIRS += iconextractor
+win32:{
+ SUBDIRS += \
+ iconextractor \
+ dwmfeatures \
+ jumplistexample
+ EXAMPLE_FILES += quickdwm
+}
diff --git a/examples/iconextractor/main.cpp b/examples/iconextractor/main.cpp
index f210b52..8511ff1 100644
--- a/examples/iconextractor/main.cpp
+++ b/examples/iconextractor/main.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include <QtWinFunctions>
+#include <QWinFunctions>
#include <QGuiApplication>
#include <QScopedArrayPointer>
@@ -97,7 +97,7 @@ int main(int argc, char *argv[])
imageFileRoot = imageFileRootInfo.absoluteFilePath() + QLatin1Char('/') + QFileInfo(sourceFile).baseName();
for (UINT i = 0; i < extractedIconCount; ++i) {
- const QPixmap pixmap = Qt::fromWinHICON(icons[i]);
+ const QPixmap pixmap = QWinExtras::fromHICON(icons[i]);
if (pixmap.isNull()) {
std::cerr << "Error converting icons.\n";
return 1;
diff --git a/examples/jumplistexample/examplewidget.cpp b/examples/jumplistexample/examplewidget.cpp
new file mode 100644
index 0000000..f762a47
--- /dev/null
+++ b/examples/jumplistexample/examplewidget.cpp
@@ -0,0 +1,137 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#include "examplewidget.h"
+#include "ui_examplewidget.h"
+
+#include <QApplication>
+#include <QStyle>
+#include <QFile>
+#include <QFileDialog>
+#include <QMessageBox>
+#include <QJumpList>
+#include <QDebug>
+
+ExampleWidget::ExampleWidget(QWidget *parent) :
+ QWidget(parent),
+ ui(new Ui::ExampleWidget)
+{
+ ui->setupUi(this);
+
+ if (QCoreApplication::arguments().contains("-text"))
+ ui->text->setPlainText("Hello, world!");
+ if (!QCoreApplication::arguments().contains("-fullscreen"))
+ ui->btnClose->hide();
+
+ for (int i = 1; i < QCoreApplication::arguments().size(); i++) {
+ const QString arg = QCoreApplication::arguments().at(i);
+ if (!arg.isEmpty() && arg.at(0) != '-' && QFile(arg).exists()) {
+ showFile(arg);
+ break;
+ }
+ }
+
+ connect(ui->btnUpdate, SIGNAL(clicked()), SLOT(updateJumpList()));
+ connect(ui->btnOpenFile, SIGNAL(clicked()), SLOT(openFile()));
+ connect(ui->btnClose, SIGNAL(clicked()), qApp, SLOT(quit()));
+}
+
+ExampleWidget::~ExampleWidget()
+{
+ delete ui;
+}
+
+void ExampleWidget::changeEvent(QEvent *e)
+{
+ QWidget::changeEvent(e);
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ ui->retranslateUi(this);
+ break;
+ default:
+ break;
+ }
+}
+
+void ExampleWidget::showFile(const QString &path)
+{
+ QFile file(path);
+ if (file.open(QIODevice::ReadOnly|QIODevice::Text))
+ ui->text->setPlainText(QString::fromUtf8(file.readAll()));
+ else
+ QMessageBox::warning(this, "Error", "Failed to open file");
+}
+
+void ExampleWidget::updateJumpList()
+{
+ QJumpList jumplist;
+ jumplist.begin();
+ if (ui->cbShowFrequent->isChecked())
+ jumplist.setFrequentCategoryShown(true);
+ if (ui->cbShowRecent->isChecked())
+ jumplist.setRecentCategoryShown(true);
+ jumplist.beginTasks();
+ if (ui->cbRunFullscreen->isChecked()) {
+ QJumpListItem *item = new QJumpListItem(QJumpListItem::Link);
+ item->setTitle(ui->cbRunFullscreen->text());
+ item->setFilePath(QDir::toNativeSeparators(QCoreApplication::applicationFilePath()));
+ item->setArguments(QStringList("-fullscreen"));
+ item->setIcon(style()->standardIcon(QStyle::SP_TitleBarMaxButton));
+ jumplist.addItem(item);
+ }
+ if (ui->cbRunFusion->isChecked()) {
+ jumplist.addLink(style()->standardIcon(QStyle::SP_DesktopIcon), ui->cbRunFusion->text(), QDir::toNativeSeparators(QCoreApplication::applicationFilePath()), (QStringList() << "-style" << "fusion"));
+ }
+ if (ui->cbRunText->isChecked()) {
+ jumplist.addSeparator();
+ jumplist.addLink(ui->cbRunText->text(), QDir::toNativeSeparators(QCoreApplication::applicationFilePath()), QStringList("-text"));
+ }
+ jumplist.commit();
+}
+
+void ExampleWidget::openFile()
+{
+ QString filePath = QFileDialog::getOpenFileName(this, "Open a text file", QString(), "Text files (*.txt)");
+ if (filePath.isEmpty())
+ return;
+ else
+ showFile(filePath);
+}
diff --git a/examples/jumplistexample/examplewidget.h b/examples/jumplistexample/examplewidget.h
new file mode 100644
index 0000000..1528be4
--- /dev/null
+++ b/examples/jumplistexample/examplewidget.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#ifndef EXAMPLEWIDGET_H
+#define EXAMPLEWIDGET_H
+
+#include <QWidget>
+
+QT_BEGIN_NAMESPACE
+namespace Ui {
+class ExampleWidget;
+}
+QT_END_NAMESPACE
+
+#if defined(QT_NAMESPACE)
+namespace Ui = QT_NAMESPACE::Ui;
+#endif
+
+class ExampleWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ explicit ExampleWidget(QWidget *parent = 0);
+ ~ExampleWidget();
+
+protected:
+ void changeEvent(QEvent *e);
+
+private:
+ Ui::ExampleWidget *ui;
+ void showFile(const QString &path);
+
+private slots:
+ void updateJumpList();
+ void openFile();
+};
+
+#endif // EXAMPLEWIDGET_H
diff --git a/examples/jumplistexample/examplewidget.ui b/examples/jumplistexample/examplewidget.ui
new file mode 100644
index 0000000..592a913
--- /dev/null
+++ b/examples/jumplistexample/examplewidget.ui
@@ -0,0 +1,198 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ExampleWidget</class>
+ <widget class="QWidget" name="ExampleWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>695</width>
+ <height>394</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>QtWinExtras JumpList Example</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,1">
+ <property name="spacing">
+ <number>3</number>
+ </property>
+ <property name="margin">
+ <number>3</number>
+ </property>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
+ <string>Known categories</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <property name="spacing">
+ <number>3</number>
+ </property>
+ <property name="margin">
+ <number>3</number>
+ </property>
+ <item>
+ <widget class="QCheckBox" name="cbShowFrequent">
+ <property name="text">
+ <string>Frequent</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cbShowRecent">
+ <property name="text">
+ <string>Recent</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="title">
+ <string>Tasks</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <property name="spacing">
+ <number>3</number>
+ </property>
+ <property name="margin">
+ <number>3</number>
+ </property>
+ <item>
+ <widget class="QCheckBox" name="cbRunFullscreen">
+ <property name="text">
+ <string>Run in fullscreen</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cbRunFusion">
+ <property name="text">
+ <string>Run with Fusion style</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cbRunText">
+ <property name="text">
+ <string>Run with some text displayed</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="btnUpdate">
+ <property name="text">
+ <string>Update</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <property name="spacing">
+ <number>3</number>
+ </property>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QPushButton" name="btnOpenFile">
+ <property name="text">
+ <string>Open a file</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="btnClose">
+ <property name="text">
+ <string>Close</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QTextEdit" name="text">
+ <property name="font">
+ <font>
+ <family>Consolas</family>
+ <pointsize>10</pointsize>
+ </font>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/examples/jumplistexample/jumplistexample.pro b/examples/jumplistexample/jumplistexample.pro
new file mode 100644
index 0000000..9263372
--- /dev/null
+++ b/examples/jumplistexample/jumplistexample.pro
@@ -0,0 +1,11 @@
+QT += widgets winextras
+
+TARGET = jumplistexample
+TEMPLATE = app
+
+SOURCES += main.cpp\
+ examplewidget.cpp
+
+HEADERS += examplewidget.h
+
+FORMS += examplewidget.ui
diff --git a/examples/jumplistexample/main.cpp b/examples/jumplistexample/main.cpp
new file mode 100644
index 0000000..785577c
--- /dev/null
+++ b/examples/jumplistexample/main.cpp
@@ -0,0 +1,83 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#include "examplewidget.h"
+
+#include <QApplication>
+#include <QSettings>
+#include <QDir>
+
+void associateFileType()
+{
+ QString exeFileName = QCoreApplication::applicationFilePath();
+ exeFileName = exeFileName.right(exeFileName.length() - exeFileName.lastIndexOf("/") - 1);
+ QString appName = "QtWinExtras JumpList Example";
+
+ QSettings regApplications("HKEY_CURRENT_USER\\Software\\Classes\\Applications\\" + exeFileName, QSettings::NativeFormat);
+ regApplications.setValue("FriendlyAppName", appName);
+
+ regApplications.beginGroup("SupportedTypes");
+ regApplications.setValue(".txt", QString());
+ regApplications.endGroup();
+
+ regApplications.beginGroup("shell");
+ regApplications.beginGroup("open");
+ regApplications.setValue("FriendlyAppName", appName);
+ regApplications.beginGroup("command");
+ regApplications.setValue(".", '"' + QDir::toNativeSeparators(QCoreApplication::applicationFilePath()) + "\" \"%1\"");
+ regApplications.endGroup();
+ regApplications.endGroup();
+ regApplications.endGroup();
+}
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ associateFileType();
+
+ ExampleWidget w;
+ if (QCoreApplication::arguments().contains("-fullscreen"))
+ w.showFullScreen();
+ else
+ w.show();
+
+ return a.exec();
+}
diff --git a/examples/quickdwm/icon.png b/examples/quickdwm/icon.png
new file mode 100644
index 0000000..6ad8096
--- /dev/null
+++ b/examples/quickdwm/icon.png
Binary files differ
diff --git a/examples/quickdwm/quickdwm.qml b/examples/quickdwm/quickdwm.qml
new file mode 100644
index 0000000..f6f807c
--- /dev/null
+++ b/examples/quickdwm/quickdwm.qml
@@ -0,0 +1,158 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+import QtQuick 2.0
+import QtWinExtras 1.0
+import QtQuick.Window 2.1
+
+Rectangle {
+ width: 300
+ height: 130
+ color: "transparent"
+
+ WinDwmFeatures {
+ id: dwmfeatures
+ bottomGlassMargin: isCompositionEnabled ? 30 : 0
+ excludedFromPeek: true
+ flip3DPolicy: WinDwmFeatures.FlipExcludeAbove
+ }
+
+ WinTaskbarButton {
+ progressState: WinTaskbarButton.IndeterminateState
+ overlayIcon: "icon.png"
+ }
+
+ Window {
+ height: 128
+ width: 256
+ maximumHeight: height
+ minimumHeight: height
+ maximumWidth: width
+ minimumWidth: width
+ visible: true
+ title: "Sheet of glass"
+
+ WinDwmFeatures {
+ bottomGlassMargin: isCompositionEnabled ? -1 : 0
+ }
+ }
+
+ Rectangle {
+ id: contentRect
+ anchors.fill: parent
+ anchors.bottomMargin: dwmfeatures.bottomGlassMargin
+
+ Rectangle {
+ id: rectColorization
+ color: WinDwmFeatures.colorizationColor
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ height: 32
+
+ Text {
+ text: "Colorization color"
+ anchors.centerIn: parent
+ font.pointSize: 12
+ }
+ }
+
+ Rectangle {
+ id: rectRealColorization
+ color: WinDwmFeatures.realColorizationColor
+ anchors.top: rectColorization.bottom
+ anchors.left: parent.left
+ anchors.right: parent.right
+ height: rectColorization.height
+
+ Text {
+ text: "Real colorization color"
+ anchors.centerIn: parent
+ font.pointSize: 12
+ }
+ }
+
+ Rectangle {
+ anchors.topMargin: 2
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.top: rectRealColorization.bottom
+ height: rectRealColorization.height
+ color: (function () {
+ if (!mouseComposition.containsMouse)
+ return "#D7D7D7";
+ else if (mouseComposition.containsMouse && !mouseComposition.pressedButtons)
+ return "#D7E0E7";
+ else
+ return "#EEEEF7"
+ })()
+
+ Text {
+ anchors.centerIn: parent
+ text: "DWM composition is " + (WinDwmFeatures.isCompositionEnabled ? "enabled" : "disabled")
+ font.pointSize: 12
+ }
+
+ MouseArea {
+ id: mouseComposition
+ anchors.fill: parent
+ hoverEnabled: true
+ onClicked: WinDwmFeatures.isCompositionEnabled = !WinDwmFeatures.isCompositionEnabled
+ }
+ }
+ }
+
+ Rectangle {
+ id: transparentBottom
+ color: WinDwmFeatures.isCompositionEnabled ? "transparent" : "#EEE"
+ height: dwmfeatures.bottomGlassMargin
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ anchors.right: parent.right
+
+ Text {
+ id: textOnGlass
+ anchors.centerIn: parent
+ text: "Text on glass" + (WinDwmFeatures.isCompositionEnabled ? "" : " (potentially)")
+ font.pointSize: 12
+ }
+ }
+}
diff --git a/examples/quickdwm/quickdwm.qmlproject b/examples/quickdwm/quickdwm.qmlproject
new file mode 100644
index 0000000..20a7c55
--- /dev/null
+++ b/examples/quickdwm/quickdwm.qmlproject
@@ -0,0 +1,15 @@
+import QmlProject 1.1
+
+Project {
+ mainFile: "quickdwm.qml"
+
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+}
diff --git a/src/imports/imports.pro b/src/imports/imports.pro
new file mode 100644
index 0000000..b8e59ad
--- /dev/null
+++ b/src/imports/imports.pro
@@ -0,0 +1,2 @@
+TEMPLATE = subdirs
+SUBDIRS += winextras
diff --git a/src/imports/winextras/JumpDestination.qml b/src/imports/winextras/JumpDestination.qml
new file mode 100644
index 0000000..5625e5e
--- /dev/null
+++ b/src/imports/winextras/JumpDestination.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+import QtWinExtras 1.0
+
+/*!
+ \qmltype JumpDestination
+ \instantiates QQuickJumpListItem
+ \inqmlmodule QtWinExtras
+
+ \brief Represents a file, which can be edited or viewed by application.
+ */
+
+JumpListItem {
+ __jumpListItemType: JumpListItem.ItemTypeDestination
+
+ /*!
+ \qmlproperty string JumpDestination::filePath
+
+ Path of the file.
+ */
+ property string filePath
+}
diff --git a/src/imports/winextras/JumpLink.qml b/src/imports/winextras/JumpLink.qml
new file mode 100644
index 0000000..e7d779d
--- /dev/null
+++ b/src/imports/winextras/JumpLink.qml
@@ -0,0 +1,89 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+import QtWinExtras 1.0
+
+/*!
+ \qmltype JumpLink
+ \instantiates QQuickJumpListItem
+ \inqmlmodule QtWinExtras
+
+ \brief Represents a command to a application.
+ */
+
+JumpListItem {
+ __jumpListItemType: JumpListItem.ItemTypeLink
+
+ /*!
+ \qmlproperty string JumpLink::iconPath
+
+ Path to link icon.
+ */
+ property string iconPath
+
+ /*!
+ \qmlproperty string JumpLink::executablePath
+
+ Path to executable file.
+ */
+ property string executablePath
+
+ /*!
+ \qmlproperty string JumpLink::arguments
+
+ Command-line arguments.
+ */
+ property string arguments
+
+ /*!
+ \qmlproperty string JumpLink::description
+
+ Description of the link.
+ */
+ property string description
+
+ /*!
+ \qmlproperty string JumpLink::title
+
+ Title of the link.
+ */
+ property string title
+}
diff --git a/src/imports/winextras/JumpListSeparator.qml b/src/imports/winextras/JumpListSeparator.qml
new file mode 100644
index 0000000..4acf192
--- /dev/null
+++ b/src/imports/winextras/JumpListSeparator.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+import QtWinExtras 1.0
+
+/*!
+ \qmltype JumpListSeparator
+ \instantiates QQuickJumpListItem
+ \inqmlmodule QtWinExtras
+
+ \brief Represents a task list separator.
+ */
+
+JumpListItem {
+ __jumpListItemType: JumpListItem.ItemTypeSeparator
+}
diff --git a/src/imports/winextras/qmldir b/src/imports/winextras/qmldir
new file mode 100644
index 0000000..d488e01
--- /dev/null
+++ b/src/imports/winextras/qmldir
@@ -0,0 +1,5 @@
+module QtWinExtras
+plugin qml_winextras
+JumpLink 1.0 JumpLink.qml
+JumpDestination 1.0 JumpDestination.qml
+JumpListSeparator 1.0 JumpListSeparator.qml
diff --git a/src/imports/winextras/qquickjumplist.cpp b/src/imports/winextras/qquickjumplist.cpp
new file mode 100644
index 0000000..11cdfb9
--- /dev/null
+++ b/src/imports/winextras/qquickjumplist.cpp
@@ -0,0 +1,256 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#include "qquickjumplist.h"
+#include <QIcon>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmltype JumpList
+ \instantiates QQuickJumpList
+ \inqmlmodule QtWinExtras
+
+ \brief The JumpList item allows modifying application Jump List.
+ */
+
+/*!
+ \class QQuickJumpList
+ \internal
+ */
+
+QQuickJumpList::QQuickJumpList(QQuickItem *parent) :
+ QQuickItem(parent), frequentCategoryShown(false), recentCategoryShown(false)
+{
+}
+
+/*!
+ \qmlproperty object JumpList::tasks
+
+ Application tasks.
+ */
+QQmlListProperty<QQuickJumpListItem> QQuickJumpList::tasks()
+{
+ return QQmlListProperty<QQuickJumpListItem>(this, this, &QQuickJumpList::appendTaskItem, 0, 0, 0);
+}
+
+/*!
+ \qmlproperty object JumpList::destinations
+
+ Categories of custom destinations.
+ */
+QQmlListProperty<QQuickJumpListCategory> QQuickJumpList::destinations()
+{
+ return QQmlListProperty<QQuickJumpListCategory>(this, this, &QQuickJumpList::appendGroup, 0, 0, 0);
+}
+
+/*!
+ \qmlproperty bool JumpList::showFrequentCategory
+
+ Contains true if 'frequent' category is shown, false otherwise.
+ */
+bool QQuickJumpList::showFrequentCategory() const
+{
+ return frequentCategoryShown;
+}
+
+void QQuickJumpList::setShowFrequentCategory(bool show)
+{
+ frequentCategoryShown = show;
+}
+
+/*!
+ \qmlproperty bool JumpList::showRecentCategory
+
+ Contains true if 'recent' category is shown, false otherwise.
+ */
+bool QQuickJumpList::showRecentCategory() const
+{
+ return recentCategoryShown;
+}
+
+void QQuickJumpList::setShowRecentCategory(bool show)
+{
+ recentCategoryShown = show;
+}
+
+void QQuickJumpList::componentComplete()
+{
+ QQuickItem::componentComplete();
+ QJumpList jumplist;
+ jumplist.begin();
+ jumplist.setFrequentCategoryShown(frequentCategoryShown);
+ jumplist.setRecentCategoryShown(recentCategoryShown);
+ if (!taskList.isEmpty()) {
+ jumplist.beginTasks();
+ Q_FOREACH (QQuickJumpListItem *item, taskList)
+ jumplist.addItem(item->toJumpListItem());
+ taskList.clear();
+ }
+ if (!categoryList.isEmpty()) {
+ Q_FOREACH (QQuickJumpListCategory *category, categoryList) {
+ jumplist.beginCategory(category->title());
+ QList<QJumpListItem *> items = category->toItemList();
+ Q_FOREACH (QJumpListItem *item, items)
+ jumplist.addItem(item);
+ }
+ }
+ jumplist.commit();
+}
+
+void QQuickJumpList::appendTaskItem(QQmlListProperty<QQuickJumpListItem> *property, QQuickJumpListItem *value)
+{
+ static_cast<QQuickJumpList *>(property->data)->taskList.append(value);
+}
+
+void QQuickJumpList::appendGroup(QQmlListProperty<QQuickJumpListCategory> *property, QQuickJumpListCategory *value)
+{
+ static_cast<QQuickJumpList *>(property->data)->categoryList.append(value);
+}
+
+
+/*!
+ \qmltype JumpCategory
+ \instantiates QQuickJumpListCategory
+ \inqmlmodule QtWinExtras
+
+ \brief Represents a category of custom destinations.
+
+ A category consists of several destinations and has a title.
+ */
+
+/*!
+ \class QQuickJumpListCategory
+ \internal
+ */
+
+QQuickJumpListCategory::QQuickJumpListCategory(QObject *parent) :
+ QObject(parent)
+{
+}
+
+QQuickJumpListCategory::~QQuickJumpListCategory()
+{
+}
+
+/*!
+ \qmlproperty object JumpCategory::destinations
+
+ Destinations in this category.
+ */
+QQmlListProperty<QQuickJumpListItem> QQuickJumpListCategory::destinations()
+{
+ return QQmlListProperty<QQuickJumpListItem>(this, this, &QQuickJumpListCategory::addItem, 0, 0, 0);
+}
+
+void QQuickJumpListCategory::setTitle(const QString &title)
+{
+ m_groupTitle = title;
+}
+
+/*!
+ \qmlproperty string JumpCategory::title
+
+ Title of the category.
+ */
+QString QQuickJumpListCategory::title() const
+{
+ return m_groupTitle;
+}
+
+QList<QJumpListItem *> QQuickJumpListCategory::toItemList() const
+{
+ QList<QJumpListItem *> destinations;
+ foreach (QQuickJumpListItem *item, m_destinations)
+ destinations.append(item->toJumpListItem());
+ return destinations;
+}
+
+void QQuickJumpListCategory::addItem(QQmlListProperty<QQuickJumpListItem> *property, QQuickJumpListItem *value)
+{
+ static_cast<QQuickJumpListCategory *>(property->data)->m_destinations.append(value);
+}
+
+
+QQuickJumpListItem::QQuickJumpListItem(QObject *p) :
+ QObject(p)
+{
+}
+
+QQuickJumpListItem::~QQuickJumpListItem()
+{
+}
+
+void QQuickJumpListItem::setType(int type)
+{
+ m_type = type;
+}
+
+int QQuickJumpListItem::type() const
+{
+ return m_type;
+}
+
+QJumpListItem *QQuickJumpListItem::toJumpListItem() const
+{
+ QJumpListItem *item = new QJumpListItem();
+ switch (m_type) {
+ case ItemTypeSeparator :
+ item->setType(QJumpListItem::Separator);
+ break;
+ case ItemTypeDestination :
+ item->setType(QJumpListItem::Destination);
+ item->setFilePath(property("filePath").toString());
+ break;
+ case ItemTypeLink :
+ item->setType(QJumpListItem::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/qquickjumplist.h b/src/imports/winextras/qquickjumplist.h
new file mode 100644
index 0000000..f500517
--- /dev/null
+++ b/src/imports/winextras/qquickjumplist.h
@@ -0,0 +1,130 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#ifndef QQUICKJUMPLIST_H
+#define QQUICKJUMPLIST_H
+
+#include <QQuickItem>
+#include <QQmlListProperty>
+#include <QIcon>
+#include <QJumpList>
+
+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_ENUMS(JumpListItemType)
+
+ explicit QQuickJumpListItem(QObject *p = 0);
+ ~QQuickJumpListItem();
+ void setType(int type);
+ int type() const;
+ QJumpListItem *toJumpListItem() const;
+
+private:
+ int m_type; // 1 - link, 2 - destination
+};
+
+class QQuickJumpListCategory : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QQmlListProperty<QQuickJumpListItem> destinations READ destinations)
+ Q_PROPERTY(QString title READ title WRITE setTitle)
+ Q_CLASSINFO("DefaultProperty", "destinations")
+
+public:
+ explicit QQuickJumpListCategory(QObject *parent = 0);
+ ~QQuickJumpListCategory();
+ QQmlListProperty<QQuickJumpListItem> destinations();
+ void setTitle(const QString &title);
+ QString title() const;
+
+ QList<QJumpListItem *> toItemList() const;
+
+ static void addItem(QQmlListProperty<QQuickJumpListItem> *property, QQuickJumpListItem *value);
+
+private:
+ QString m_groupTitle;
+ QList<QQuickJumpListItem *> m_destinations;
+};
+
+class QQuickJumpList : public QQuickItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QQmlListProperty<QQuickJumpListItem> tasks READ tasks)
+ Q_PROPERTY(QQmlListProperty<QQuickJumpListCategory> destinations READ destinations)
+ Q_PROPERTY(bool showFrequentCategory READ showFrequentCategory WRITE setShowFrequentCategory)
+ Q_PROPERTY(bool showRecentCategory READ showRecentCategory WRITE setShowRecentCategory)
+
+public:
+ explicit QQuickJumpList(QQuickItem *parent = 0);
+ QQmlListProperty<QQuickJumpListItem> tasks();
+ QQmlListProperty<QQuickJumpListCategory> destinations();
+ bool showFrequentCategory() const;
+ void setShowFrequentCategory(bool);
+ bool showRecentCategory() const;
+ void setShowRecentCategory(bool);
+
+ virtual void componentComplete();
+
+ static void appendTaskItem(QQmlListProperty<QQuickJumpListItem> *property, QQuickJumpListItem *value);
+ static void appendGroup(QQmlListProperty<QQuickJumpListCategory> *property, QQuickJumpListCategory *value);
+
+private:
+ QList<QQuickJumpListItem *> taskList;
+ QList<QQuickJumpListCategory *> categoryList;
+ bool frequentCategoryShown;
+ bool recentCategoryShown;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKJUMPLIST_H
diff --git a/src/imports/winextras/qquickwindwmfeatures.cpp b/src/imports/winextras/qquickwindwmfeatures.cpp
new file mode 100644
index 0000000..cbdbbb9
--- /dev/null
+++ b/src/imports/winextras/qquickwindwmfeatures.cpp
@@ -0,0 +1,314 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#include "qquickwindwmfeatures.h"
+#include "qquickwindwmfeatures_p.h"
+
+#include <QtWinExtras/private/qwineventfilter_p.h>
+#include <QWinColorizationColorChangeEvent>
+#include <QWinCompositionStateChangeEvent>
+#include <QQuickWindow>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmltype WinDwmFeatures
+ \instantiates QQuickWinDwmFeatures
+ \inqmlmodule QtWinExtras
+
+ \brief The WinDwmFeatures item allows extending glass frame into client area, as well as controlling behavior of Aero Peek and Flip3D.
+ */
+
+/*!
+ \class QQuickWinDwmFeatures
+ \internal
+ */
+
+QQuickWinDwmFeatures::QQuickWinDwmFeatures(QQuickItem *parent) :
+ QQuickItem(parent), d_ptr(new QQuickWinDwmFeaturesPrivate(this))
+{
+ QWinEventFilter::setup();
+}
+
+QQuickWinDwmFeatures::~QQuickWinDwmFeatures()
+{
+}
+
+void QQuickWinDwmFeatures::setCompositionEnabled(bool enabled)
+{
+ QWinExtras::setCompositionEnabled(enabled);
+}
+
+bool QQuickWinDwmFeatures::isCompositionEnabled() const
+{
+ return QWinExtras::isCompositionEnabled();
+}
+
+QColor QQuickWinDwmFeatures::colorizationColor() const
+{
+ return QWinExtras::colorizationColor();
+}
+
+QColor QQuickWinDwmFeatures::realColorizationColor() const
+{
+ return QWinExtras::realColorizationColor();
+}
+
+bool QQuickWinDwmFeatures::colorizationOpaqueBlend() const
+{
+ bool opaque;
+ QWinExtras::colorizationColor(&opaque);
+ return opaque;
+}
+
+/*!
+ \qmlproperty int WinDwmFeatures::topGlassMargin
+
+ Top glass frame height. Default value is 0.
+ */
+void QQuickWinDwmFeatures::setTopGlassMargin(int margin)
+{
+ Q_D(QQuickWinDwmFeatures);
+ d->topMargin = margin;
+ d->update();
+}
+
+/*!
+ \qmlproperty int WinDwmFeatures::rightGlassMargin
+
+ Right glass frame width. Default value is 0.
+ */
+void QQuickWinDwmFeatures::setRightGlassMargin(int margin)
+{
+ Q_D(QQuickWinDwmFeatures);
+ d->rightMargin = margin;
+ d->update();
+}
+
+/*!
+ \qmlproperty int WinDwmFeatures::bottomGlassMargin
+
+ Bottom glass frame height. Default value is 0.
+ */
+void QQuickWinDwmFeatures::setBottomGlassMargin(int margin)
+{
+ Q_D(QQuickWinDwmFeatures);
+ d->bottomMargin = margin;
+ d->update();
+}
+
+/*!
+ \qmlproperty int WinDwmFeatures::leftGlassMargin
+
+ Left glass frame width. Default value is 0.
+ */
+void QQuickWinDwmFeatures::setLeftGlassMargin(int margin)
+{
+ Q_D(QQuickWinDwmFeatures);
+ d->leftMargin = margin;
+ d->update();
+}
+
+int QQuickWinDwmFeatures::topGlassMargin() const
+{
+ Q_D(const QQuickWinDwmFeatures);
+ return d->topMargin;
+}
+
+int QQuickWinDwmFeatures::rightGlassMargin() const
+{
+ Q_D(const QQuickWinDwmFeatures);
+ return d->rightMargin;
+}
+
+int QQuickWinDwmFeatures::bottomGlassMargin() const
+{
+ Q_D(const QQuickWinDwmFeatures);
+ return d->bottomMargin;
+}
+
+int QQuickWinDwmFeatures::leftGlassMargin() const
+{
+ Q_D(const QQuickWinDwmFeatures);
+ return d->leftMargin;
+}
+
+/*!
+ \qmlproperty bool WinDwmFeatures::excludedFromPeek
+
+ Specifies whether the window is excluded from Aero Peek.
+ The default value is false.
+ */
+bool QQuickWinDwmFeatures::excludedFromPeek() const
+{
+ Q_D(const QQuickWinDwmFeatures);
+ if (window())
+ return QWinExtras::isWindowExcludedFromPeek(window());
+ else
+ return d->peekExcluded;
+}
+
+void QQuickWinDwmFeatures::setExcludedFromPeek(bool exclude)
+{
+ Q_D(QQuickWinDwmFeatures);
+ d->peekExcluded = exclude;
+}
+
+/*!
+ \qmlproperty bool WinDwmFeatures::peekDisallowed
+
+ Default is false. Set this to \c true if you want to forbid Aero Peek when user hovers mouse on window thumbnail.
+ */
+bool QQuickWinDwmFeatures::peekDisallowed() const
+{
+ Q_D(const QQuickWinDwmFeatures);
+ if (window())
+ return QWinExtras::isWindowPeekDisallowed(window());
+ else
+ return d->peekDisallowed;
+}
+
+void QQuickWinDwmFeatures::setPeekDisallowed(bool disallow)
+{
+ Q_D(QQuickWinDwmFeatures);
+ d->peekDisallowed = disallow;
+}
+
+/*!
+ \enum QQuickWinDwmFeatures::Flip3DPolicy
+
+ See QtWinExtras::WindowFlip3DPolicy.
+ */
+
+/*!
+ \qmlproperty WinDwmFeatures::Flip3DPolicy WinDwmFeatures::flip3DPolicy
+
+ Contains current Flip3D policy for the window.
+ */
+QQuickWinDwmFeatures::Flip3DPolicy QQuickWinDwmFeatures::flip3DPolicy() const
+{
+ Q_D(const QQuickWinDwmFeatures);
+ if (window())
+ return static_cast<Flip3DPolicy>(QWinExtras::windowFlip3DPolicy(window()));
+ else
+ return static_cast<Flip3DPolicy>(d->flipPolicy);
+}
+
+void QQuickWinDwmFeatures::setFlip3DPolicy(QQuickWinDwmFeatures::Flip3DPolicy policy)
+{
+ Q_D(QQuickWinDwmFeatures);
+ d->flipPolicy = policy;
+}
+
+bool QQuickWinDwmFeatures::eventFilter(QObject *object, QEvent *event)
+{
+ bool filterOut = false;
+ if (object == window()) {
+ if (event->type() == QWinCompositionStateChangeEvent::eventType()) {
+ emit isCompositionEnabledChanged();
+ filterOut = true;
+ } else if (event->type() == QWinColorizationColorChangeEvent::eventType()) {
+ emit colorizationColorChanged();
+ emit realColorizationColorChanged();
+ emit colorizationOpaqueBlendChanged();
+ filterOut = true;
+ }
+ }
+ if (!filterOut)
+ return QQuickItem::eventFilter(object, event);
+ else
+ return filterOut;
+}
+
+QQuickWinDwmFeatures *QQuickWinDwmFeatures::qmlAttachedProperties(QObject *parentObject)
+{
+ QQuickWinDwmFeatures *featuresObj = new QQuickWinDwmFeatures();
+ QQuickItem *parentItem = qobject_cast<QQuickItem *>(parentObject);
+ if (parentItem)
+ featuresObj->setParentItem(parentItem);
+ else
+ featuresObj->setParent(parentObject);
+ return featuresObj;
+}
+
+void QQuickWinDwmFeatures::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data)
+{
+ Q_D(QQuickWinDwmFeatures);
+ if (change == ItemSceneChange && data.window) {
+ d->update();
+ data.window->installEventFilter(this);
+ }
+ QQuickItem::itemChange(change, data);
+}
+
+
+
+QQuickWinDwmFeaturesPrivate::QQuickWinDwmFeaturesPrivate(QQuickWinDwmFeatures *parent) :
+ topMargin(0), rightMargin(0), bottomMargin(0), leftMargin(0),
+ peekDisallowed(false), peekExcluded(false), flipPolicy(QQuickWinDwmFeatures::FlipDefault),
+ q_ptr(parent), formatSet(false), frameUpdateScheduled(false), attributesUpdateScheduled(false)
+{
+}
+
+void QQuickWinDwmFeaturesPrivate::update()
+{
+ Q_Q(QQuickWinDwmFeatures);
+ QWindow *w = q->window();
+ if (w) {
+ if (!formatSet) {
+ formatSet = true;
+ QSurfaceFormat format = w->format();
+ format.setAlphaBufferSize(8);
+ w->setFormat(format);
+ q->window()->setColor(Qt::transparent);
+ }
+ if (peekExcluded)
+ QWinExtras::setWindowExcludedFromPeek(w, peekExcluded);
+ if (peekDisallowed)
+ QWinExtras::setWindowDisallowPeek(w, peekDisallowed);
+ if (flipPolicy != QQuickWinDwmFeatures::FlipDefault)
+ QWinExtras::setWindowFlip3DPolicy(w, static_cast<QWinExtras::WindowFlip3DPolicy>(flipPolicy));
+ if (topMargin || rightMargin || bottomMargin || leftMargin)
+ QWinExtras::extendFrameIntoClientArea(w, leftMargin, topMargin, rightMargin, bottomMargin);
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/winextras/qquickwindwmfeatures.h b/src/imports/winextras/qquickwindwmfeatures.h
new file mode 100644
index 0000000..a496b56
--- /dev/null
+++ b/src/imports/winextras/qquickwindwmfeatures.h
@@ -0,0 +1,125 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#ifndef QQUICKWINDWMFEATURES_H
+#define QQUICKWINDWMFEATURES_H
+
+#include <QQuickItem>
+#include <QWinFunctions>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickWinDwmFeaturesPrivate;
+
+class QQuickWinDwmFeatures : public QQuickItem
+{
+ Q_OBJECT
+ Q_PROPERTY(bool isCompositionEnabled READ isCompositionEnabled WRITE setCompositionEnabled NOTIFY isCompositionEnabledChanged)
+ 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)
+ Q_PROPERTY(int rightGlassMargin READ rightGlassMargin WRITE setRightGlassMargin)
+ Q_PROPERTY(int bottomGlassMargin READ bottomGlassMargin WRITE setBottomGlassMargin)
+ Q_PROPERTY(int leftGlassMargin READ leftGlassMargin WRITE setLeftGlassMargin)
+ Q_PROPERTY(bool excludedFromPeek READ excludedFromPeek WRITE setExcludedFromPeek)
+ Q_PROPERTY(bool peekDisallowed READ peekDisallowed WRITE setPeekDisallowed)
+ Q_PROPERTY(Flip3DPolicy flip3DPolicy READ flip3DPolicy WRITE setFlip3DPolicy)
+
+public:
+ enum Flip3DPolicy // keep sync with Qt::WindowFlip3DPolicy
+ {
+ FlipDefault,
+ FlipExcludeBelow,
+ FlipExcludeAbove
+ };
+
+ Q_ENUMS(Flip3DPolicy)
+
+ explicit QQuickWinDwmFeatures(QQuickItem *parent = 0);
+ ~QQuickWinDwmFeatures();
+
+ 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 excludedFromPeek() const;
+ void setExcludedFromPeek(bool exclude);
+ bool peekDisallowed() const;
+ void setPeekDisallowed(bool disallow);
+ Flip3DPolicy flip3DPolicy() const;
+ void setFlip3DPolicy(Flip3DPolicy policy);
+
+ bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE;
+
+ static QQuickWinDwmFeatures *qmlAttachedProperties(QObject *object);
+
+Q_SIGNALS:
+ void colorizationColorChanged();
+ void realColorizationColorChanged();
+ void isCompositionEnabledChanged();
+ void colorizationOpaqueBlendChanged();
+
+protected:
+ void itemChange(ItemChange, const ItemChangeData &) Q_DECL_OVERRIDE;
+
+private:
+ QScopedPointer<QQuickWinDwmFeaturesPrivate> d_ptr;
+
+ Q_DECLARE_PRIVATE(QQuickWinDwmFeatures)
+};
+
+QML_DECLARE_TYPEINFO(QQuickWinDwmFeatures, QML_HAS_ATTACHED_PROPERTIES)
+
+QT_END_NAMESPACE
+
+#endif // QQUICKWINDWMFEATURES_H
diff --git a/src/imports/winextras/qquickwindwmfeatures_p.h b/src/imports/winextras/qquickwindwmfeatures_p.h
new file mode 100644
index 0000000..46b9fe1
--- /dev/null
+++ b/src/imports/winextras/qquickwindwmfeatures_p.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#ifndef QQUICKWINDWMFEATURES_P_H
+#define QQUICKWINDWMFEATURES_P_H
+
+#include "qquickwindwmfeatures.h"
+
+QT_BEGIN_NAMESPACE
+
+class QQuickWinDwmFeaturesPrivate
+{
+public:
+ QQuickWinDwmFeaturesPrivate(QQuickWinDwmFeatures *parent);
+ int topMargin;
+ int rightMargin;
+ int bottomMargin;
+ int leftMargin;
+
+ bool peekDisallowed;
+ bool peekExcluded;
+ QQuickWinDwmFeatures::Flip3DPolicy flipPolicy;
+
+ void update();
+
+private:
+ QQuickWinDwmFeatures *q_ptr;
+ bool formatSet;
+ bool frameUpdateScheduled;
+ bool attributesUpdateScheduled;
+
+ Q_DECLARE_PUBLIC(QQuickWinDwmFeatures)
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKWINDWMFEATURES_P_H
diff --git a/src/imports/winextras/qquickwintaskbarbutton.cpp b/src/imports/winextras/qquickwintaskbarbutton.cpp
new file mode 100644
index 0000000..52555f5
--- /dev/null
+++ b/src/imports/winextras/qquickwintaskbarbutton.cpp
@@ -0,0 +1,183 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#include "qquickwintaskbarbutton.h"
+#include <QtWinExtras/private/qwintaskbarbutton_p.h>
+#include <QQuickWindow>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmltype WinTaskbarButton
+ \instantiates QQuickWinTaskbarButton
+ \inqmlmodule QtWinExtras
+
+ \brief The WinTaskbarButton item allows setting overlay icons on a button, displaying progress indicator and adding small toolbar to window thumbnail popup..
+
+ \sa QWinTaskbarButton
+ */
+
+/*!
+ \class QQuickWinTaskbarButton
+ \internal
+ */
+
+QQuickWinTaskbarButton::QQuickWinTaskbarButton(QQuickItem *parent) :
+ QQuickItem(parent), button(new QWinTaskbarButton(this))
+{
+}
+
+QQuickWinTaskbarButton::~QQuickWinTaskbarButton()
+{
+}
+
+int QQuickWinTaskbarButton::progressMinimum() const
+{
+ return button->progressMinimum();
+}
+
+void QQuickWinTaskbarButton::setProgressMinimum(int min)
+{
+ button->setProgressMinimum(min);
+}
+
+/*!
+ \qmlproperty int WinTaskbarButton::progressMaximum
+
+ Maximum progress value.
+ */
+int QQuickWinTaskbarButton::progressMaximum() const
+{
+ return button->progressMaximum();
+}
+
+void QQuickWinTaskbarButton::setProgressMaximum(int max)
+{
+ button->setProgressMaximum(max);
+}
+
+/*!
+ \qmlproperty int WinTaskbarButton::progressValue
+
+ Displayed progress value.
+ */
+int QQuickWinTaskbarButton::progressValue() const
+{
+ return button->progressValue();
+}
+
+void QQuickWinTaskbarButton::setProgressValue(int progress)
+{
+ button->setProgressValue(progress);
+}
+
+/*!
+ \qmlproperty string WinTaskbarButton::icon
+
+ Overlay icon path.
+ */
+QString QQuickWinTaskbarButton::overlayIcon() const
+{
+ return m_iconPath;
+}
+
+void QQuickWinTaskbarButton::setOverlayIcon(const QString &path)
+{
+ m_iconPath = path;
+ button->setOverlayIcon(QIcon(m_iconPath));
+}
+
+/*!
+ \qmlproperty int WinTaskbarButton::iconDescription
+
+ Accessibility description for overlay icon.
+ */
+QString QQuickWinTaskbarButton::iconDescription() const
+{
+ return m_iconDescription;
+}
+
+void QQuickWinTaskbarButton::setIconDescription(const QString &descr)
+{
+ m_iconDescription = descr;
+ button->setOverlayIconAccessibilityDescription(m_iconDescription);
+}
+
+/*!
+ \qmlproperty enumeration WinTaskbarButton::progressState
+
+ State of progress indicator.
+
+ The state can be one of the following:
+
+ \table
+ \header \li Value \li Description
+ \row \li NoProgressState
+ \li No progress indicator.
+ \row \li IndeterminateState
+ \li The progress indicator cycles repeatedly.
+ \row \li NormalState
+ \li
+ \row \li PausedState
+ \li Indicator turns yellow. Use that to show that operation has been paused, but can be continued.
+ \row \li ErrorState
+ \li Indicator turns red.
+ \endtable
+ */
+QWinTaskbarButton::ProgressState QQuickWinTaskbarButton::progressState() const
+{
+ return button->progressState();
+}
+
+void QQuickWinTaskbarButton::setProgressState(QWinTaskbarButton::ProgressState state)
+{
+ button->setProgressState(state);
+}
+
+void QQuickWinTaskbarButton::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data)
+{
+ if (change == ItemSceneChange) {
+ button->setWindow(data.window);
+ }
+ QQuickItem::itemChange(change, data);
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/winextras/qquickwintaskbarbutton.h b/src/imports/winextras/qquickwintaskbarbutton.h
new file mode 100644
index 0000000..e318bb8
--- /dev/null
+++ b/src/imports/winextras/qquickwintaskbarbutton.h
@@ -0,0 +1,92 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#ifndef QQUICKWINTASKBARBUTTON_H
+#define QQUICKWINTASKBARBUTTON_H
+
+#include <QQuickItem>
+#include <QWinTaskbarButton>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickWinTaskbarButtonPrivate;
+
+class QQuickWinTaskbarButton : public QQuickItem
+{
+ Q_OBJECT
+ Q_PROPERTY(int progressMinimum READ progressMinimum WRITE setProgressMinimum)
+ Q_PROPERTY(int progressMaximum READ progressMaximum WRITE setProgressMaximum)
+ Q_PROPERTY(int progressValue READ progressValue WRITE setProgressValue)
+ Q_PROPERTY(QString overlayIcon READ overlayIcon WRITE setOverlayIcon)
+ Q_PROPERTY(QString iconDescription READ iconDescription WRITE setIconDescription)
+ Q_PROPERTY(QWinTaskbarButton::ProgressState progressState READ progressState WRITE setProgressState)
+
+public:
+ Q_ENUMS(QWinTaskbarButton::ProgressState)
+
+ QQuickWinTaskbarButton(QQuickItem *parent = 0);
+ ~QQuickWinTaskbarButton();
+ int progressMinimum() const;
+ void setProgressMinimum(int min);
+ int progressMaximum() const;
+ void setProgressMaximum(int max);
+ int progressValue() const;
+ void setProgressValue(int progress);
+ QString overlayIcon() const;
+ void setOverlayIcon(const QString &path);
+ QString iconDescription() const;
+ void setIconDescription(const QString &descr);
+
+ QWinTaskbarButton::ProgressState progressState() const;
+ void setProgressState(QWinTaskbarButton::ProgressState state);
+
+protected:
+ void itemChange(ItemChange, const ItemChangeData &) Q_DECL_OVERRIDE;
+
+private:
+ QWinTaskbarButton *button;
+ QString m_iconPath;
+ QString m_iconDescription;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKWINTASKBARBUTTON_H
diff --git a/src/imports/winextras/qwinextrasplugin.cpp b/src/imports/winextras/qwinextrasplugin.cpp
new file mode 100644
index 0000000..ad72ca7
--- /dev/null
+++ b/src/imports/winextras/qwinextrasplugin.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#include "qwinextrasplugin.h"
+#include "qquickwindwmfeatures.h"
+#include "qquickwintaskbarbutton.h"
+#include "qquickjumplist.h"
+
+#include <QtQml/QtQml>
+
+QT_BEGIN_NAMESPACE
+
+QWinExtrasQmlPlugin::QWinExtrasQmlPlugin(QObject *parent) :
+ QQmlExtensionPlugin(parent)
+{
+}
+
+void QWinExtrasQmlPlugin::registerTypes(const char *uri)
+{
+ Q_ASSERT(uri == QLatin1String("QtWinExtras"));
+ qmlRegisterType<QQuickWinDwmFeatures>(uri, 1, 0, "WinDwmFeatures");
+ qmlRegisterType<QQuickWinTaskbarButton>(uri, 1, 0, "WinTaskbarButton");
+ qmlRegisterType<QQuickJumpList>(uri, 1, 0, "JumpList");
+ qmlRegisterType<QQuickJumpListItem>(uri, 1, 0, "JumpListItem");
+ qmlRegisterType<QQuickJumpListCategory>(uri, 1, 0, "JumpListCategory");
+}
+
+
+QT_END_NAMESPACE
diff --git a/src/imports/winextras/qwinextrasplugin.h b/src/imports/winextras/qwinextrasplugin.h
new file mode 100644
index 0000000..f0fb3c0
--- /dev/null
+++ b/src/imports/winextras/qwinextrasplugin.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#ifndef QWINEXTRASPLUGIN_H
+#define QWINEXTRASPLUGIN_H
+
+#include <QQmlExtensionPlugin>
+
+QT_BEGIN_NAMESPACE
+
+class QJSEngine;
+class QQuickWinExtras;
+
+class QWinExtrasQmlPlugin : public QQmlExtensionPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QWinExtrasQmlPlugin")
+
+public:
+ explicit QWinExtrasQmlPlugin(QObject *parent = 0);
+ void registerTypes(const char *uri) Q_DECL_OVERRIDE;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWINEXTRASPLUGIN_H
diff --git a/src/imports/winextras/winextras.pro b/src/imports/winextras/winextras.pro
new file mode 100644
index 0000000..97f1de6
--- /dev/null
+++ b/src/imports/winextras/winextras.pro
@@ -0,0 +1,32 @@
+CXX_MODULE = qml
+TARGET = qml_winextras
+TARGETPATH = QtWinExtras
+IMPORT_VERSION = 1.0
+
+QT += qml quick winextras winextras-private
+
+QML_FILES += \
+ JumpLink.qml \
+ JumpDestination.qml \
+ JumpListSeparator.qml
+
+HEADERS += \
+ qwinextrasplugin.h \
+ qquickwindwmfeatures.h \
+ qquickwindwmfeatures_p.h \
+ qquickwintaskbarbutton.h \
+ qquickjumplist.h
+
+SOURCES += \
+ qwinextrasplugin.cpp \
+ qquickwindwmfeatures.cpp \
+ qquickwintaskbarbutton.cpp \
+ qquickjumplist.cpp
+
+OTHER_FILES += \
+ qmldir \
+ JumpLink.qml \
+ JumpDestination.qml \
+ JumpListSeparator.qml
+
+load(qml_plugin)
diff --git a/src/src.pro b/src/src.pro
index 7ab303c..1a9e120 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -1,2 +1,3 @@
TEMPLATE = subdirs
-win32:SUBDIRS += winextras
+CONFIG += ordered
+win32:SUBDIRS += winextras imports
diff --git a/src/winextras/doc/images/glass.png b/src/winextras/doc/images/glass.png
new file mode 100644
index 0000000..513fe5d
--- /dev/null
+++ b/src/winextras/doc/images/glass.png
Binary files differ
diff --git a/src/winextras/doc/images/jumplist.png b/src/winextras/doc/images/jumplist.png
new file mode 100644
index 0000000..dff2487
--- /dev/null
+++ b/src/winextras/doc/images/jumplist.png
Binary files differ
diff --git a/src/winextras/doc/images/peek-on.png b/src/winextras/doc/images/peek-on.png
new file mode 100644
index 0000000..2ad48e9
--- /dev/null
+++ b/src/winextras/doc/images/peek-on.png
Binary files differ
diff --git a/src/winextras/doc/qtwinextras.qdocconf b/src/winextras/doc/qtwinextras.qdocconf
new file mode 100644
index 0000000..6f1d0f3
--- /dev/null
+++ b/src/winextras/doc/qtwinextras.qdocconf
@@ -0,0 +1,39 @@
+include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
+
+project = QtWinExtras
+description = Qt Windows Extras Reference Documentation
+url = http://qt-project.org/doc/qt-$QT_VER/qtwinextras
+version = $QT_VERSION
+
+exampledirs += ../../../examples \
+ snippets
+
+headerdirs = .. ../../imports/winextras
+sourcedirs = .. ../../imports/winextras
+imagedirs += images
+
+depends += qtcore qtgui
+
+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 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.qmltypes.title = QML Types
+qhp.QtWinExtras.subprojects.qmltypes.indexTitle = Qt Windows Extras QML Types
+qhp.QtWinExtras.subprojects.qmltypes.selectors = fake:qmlclass
+qhp.QtWinExtras.subprojects.qmltypes.sortPages = true
diff --git a/src/winextras/doc/snippets/code/jumplist.cpp b/src/winextras/doc/snippets/code/jumplist.cpp
new file mode 100644
index 0000000..e6dd75a
--- /dev/null
+++ b/src/winextras/doc/snippets/code/jumplist.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** 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 Digia Plc and its Subsidiary(-ies) 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 <QJumpList>
+
+void foo()
+{
+//! [jumplist]
+ QJumpList jumplist;
+ jumplist.begin();
+ jumplist.setKnownCategoryShown(QJumpList::RecentCategory);
+
+ jumplist.beginTasks();
+
+ QJumpListItem *newProject = new QJumpListItem(QJumpListItem::Link);
+ newProject->setTitle(tr("Create new project"));
+ newProject->setFilePath(QDir::toNativeSeparators(QCoreApplication::applicationFilePath()));
+ newProject->setArguments(QStringList("--new-project"));
+ jumplist.addItem(newProject);
+
+ jumplist.addLink(tr("Launch SDK Manager"), QDir::toNativeSeparators(QCoreApplication::applicationDirPath()) + "\\sdk-manager.exe");
+
+ jumplist.commit();
+//! [jumplist]
+}
diff --git a/src/winextras/doc/snippets/code/use-qtwinextras.cpp b/src/winextras/doc/snippets/code/use-qtwinextras.cpp
new file mode 100644
index 0000000..1c51f0c
--- /dev/null
+++ b/src/winextras/doc/snippets/code/use-qtwinextras.cpp
@@ -0,0 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** 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 Digia Plc and its Subsidiary(-ies) 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
new file mode 100644
index 0000000..fd6cfdb
--- /dev/null
+++ b/src/winextras/doc/snippets/code/use-qtwinextras.pro
@@ -0,0 +1,3 @@
+#! [link]
+QT += winextras
+#! [link]
diff --git a/src/winextras/doc/src/qtwinextras-index.qdoc b/src/winextras/doc/src/qtwinextras-index.qdoc
new file mode 100644
index 0000000..2953e3d
--- /dev/null
+++ b/src/winextras/doc/src/qtwinextras-index.qdoc
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+** Contact: http://www.qt-project.org/legal
+**
+** 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/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: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page qtwinextras-index.html
+ \title Qt Windows Extras
+ \brief The Qt Windows Extras module provides classes and functions which allow using some Windows APIs in Qt-way.
+
+ The Qt Windows Extras module provides classes and functions which allow using some Windows APIs in Qt-way, including but no limiting to type conversion functions.
+
+ \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 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
new file mode 100644
index 0000000..c0b31d6
--- /dev/null
+++ b/src/winextras/doc/src/qtwinextras-module-cpp.qdoc
@@ -0,0 +1,39 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+** Contact: http://www.qt-project.org/legal
+**
+** 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/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: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \module QtWinExtras
+ \title Qt Windows Extras C++ Classes
+ \brief The Qt Windows Extras module provides classes and functions which allow using some Windows APIs in Qt-way.
+
+ \ingroup modules
+ \ingroup technology-apis
+
+ The namespaces contain Windows-specific functions for type conversion and DWM glass frame manipulation.
+
+ The classes provided allow using features, introduced with Windows 7, like JumpLists or progress indicator on taskbar button.
+*/
diff --git a/src/winextras/doc/src/qtwinextras-module-qml.qdoc b/src/winextras/doc/src/qtwinextras-module-qml.qdoc
new file mode 100644
index 0000000..d702360
--- /dev/null
+++ b/src/winextras/doc/src/qtwinextras-module-qml.qdoc
@@ -0,0 +1,35 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+** Contact: http://www.qt-project.org/legal
+**
+** 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/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: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \qmlmodule QtWinExtras
+ \title Qt Windows Extras QML Types
+ \ingroup qmlmodules
+ \brief Enables use of MS Windows features with QML.
+
+ \section1 QML Types
+ */
diff --git a/src/winextras/qjumplist.cpp b/src/winextras/qjumplist.cpp
new file mode 100644
index 0000000..f92f40d
--- /dev/null
+++ b/src/winextras/qjumplist.cpp
@@ -0,0 +1,916 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#include "qjumplist.h"
+
+#include <QIcon>
+#include <QDir>
+#include <QCoreApplication>
+#include <qt_windows.h>
+#include <propvarutil.h>
+
+#include "qwinfunctions.h"
+#include "qwinfunctions_p.h"
+#include "winshobjidl_p.h"
+#include "winpropkey_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QJumpListItemPrivate
+{
+public:
+ QString filePath;
+ QString workingDirectory;
+ QString title;
+ QString description;
+ QIcon icon;
+ QStringList arguments;
+ QJumpListItem::Type type;
+};
+
+/*!
+ \class QJumpListItem
+ \inmodule QtWinExtras
+ \since 5.2
+ \inheaderfile QJumpList
+ \brief This class represents Jump List destination or link.
+
+ Objects of this class are returned by QJumpList::removedDestinations()
+ and can also be used to add items to Jump List.
+ */
+
+/*!
+ Constructs a QJumpListItem with specified \a type.
+ */
+QJumpListItem::QJumpListItem(QJumpListItem::Type type) :
+ d_ptr(new QJumpListItemPrivate)
+{
+ d_ptr->type = type;
+}
+
+/*!
+ Destroys the QJumpListItem.
+ */
+QJumpListItem::~QJumpListItem()
+{
+}
+
+/*!
+ Sets item \a type.
+ */
+void QJumpListItem::setType(QJumpListItem::Type type)
+{
+ Q_D(QJumpListItem);
+ d->type = type;
+}
+
+/*!
+ Returns item type.
+ */
+QJumpListItem::Type QJumpListItem::type() const
+{
+ Q_D(const QJumpListItem);
+ return d->type;
+}
+
+/*!
+ Sets item \a filePath, meaning of which depends on type of this item.
+
+ If item type is QJumpListItem::Destination, then \a filePath is path to a file, which can be opened by application.
+
+ If item type is QJumpListItem::Link, then \a filePath is path to an executable, which will be executed when this item is clicked by user.
+
+ \sa setWorkingDirectory(), setArguments()
+ */
+void QJumpListItem::setFilePath(const QString &filePath)
+{
+ Q_D(QJumpListItem);
+ d->filePath = filePath;
+}
+
+/*!
+ Returns file path, set by setFilePath().
+ */
+QString QJumpListItem::filePath() const
+{
+ Q_D(const QJumpListItem);
+ return d->filePath;
+}
+
+/*!
+ Sets working directory path of this item using \a workingDirectory provided.
+
+ This value is used only if type of this item is QJumpListItem::Link.
+
+ \sa setFilePath()
+ */
+void QJumpListItem::setWorkingDirectory(const QString &workingDirectory)
+{
+ Q_D(QJumpListItem);
+ d->workingDirectory = workingDirectory;
+}
+
+/*!
+ Returns working directory path.
+ */
+QString QJumpListItem::workingDirectory() const
+{
+ Q_D(const QJumpListItem);
+ return d->workingDirectory;
+}
+
+/*!
+ Sets \a icon of this item.
+
+ This value is used only if type of this item is QJumpListItem::Link.
+ */
+void QJumpListItem::setIcon(const QIcon &icon)
+{
+ Q_D(QJumpListItem);
+ d->icon = icon;
+}
+
+/*!
+ Returns icon set for this item.
+ */
+QIcon QJumpListItem::icon() const
+{
+ Q_D(const QJumpListItem);
+ return d->icon;
+}
+
+/*!
+ Sets \a title of this item.
+
+ This value is used only if type of this item is QJumpListItem::Link.
+ */
+void QJumpListItem::setTitle(const QString &title)
+{
+ Q_D(QJumpListItem);
+ d->title = title;
+}
+
+/*!
+ Returns title of this item.
+ */
+QString QJumpListItem::title() const
+{
+ Q_D(const QJumpListItem);
+ return d->title;
+}
+
+/*!
+ Sets \a description for this item.
+
+ This value is used only if type of this item is QJumpListItem::Link.
+ */
+void QJumpListItem::setDescription(const QString &description)
+{
+ Q_D(QJumpListItem);
+ d->description = description;
+}
+
+/*!
+ Returns description of this item.
+ */
+QString QJumpListItem::description() const
+{
+ Q_D(const QJumpListItem);
+ return d->description;
+}
+
+/*!
+ Sets command-line \a arguments for this item.
+
+ This value is used only if type of this item is QJumpListItem::Link.
+
+ \sa setFilePath()
+ */
+void QJumpListItem::setArguments(const QStringList &arguments)
+{
+ Q_D(QJumpListItem);
+ d->arguments = arguments;
+}
+
+/*!
+ Returns command-line arguments of this item.
+ */
+QStringList QJumpListItem::arguments() const
+{
+ Q_D(const QJumpListItem);
+ return d->arguments;
+}
+
+
+class QJumpListPrivate
+{
+public:
+ QJumpListPrivate() :
+ pDestList(0), isListBegan(false), showFrequentCategory(false), showRecentCategory(false),
+ categoryBegan(false), tasksBegan(false), listSize(0)
+ {
+ }
+
+ static void warning(const char *function, HRESULT hresult)
+ {
+ QByteArray err = QWinExtras::errorStringFromHresult(hresult).toLocal8Bit();
+ qWarning("QJumpList: %s() failed: %#010x, %s.", function, (unsigned)hresult, err.data());
+ }
+
+ static QString iconsDirPath()
+ {
+ QString iconDirPath = QDir::tempPath() + QLatin1Char('/') + QCoreApplication::instance()->applicationName() + QLatin1String("/qt-jl-icons/");
+ QDir().mkpath(iconDirPath);
+ return iconDirPath;
+ }
+
+ bool appendKnownCategory(KNOWNDESTCATEGORY category)
+ {
+ if (!pDestList)
+ return false;
+
+ HRESULT hresult = pDestList->AppendKnownCategory(category);
+ if (FAILED(hresult))
+ warning("AppendKnownCategory", hresult);
+
+ return SUCCEEDED(hresult);
+ }
+
+ void appendCategory()
+ {
+ IObjectCollection *collection = toComCollection(jumpListItems);
+ if (collection) {
+ wchar_t *title = qt_qstringToNullTerminated(currentlyBuiltCategoryTitle);
+ pDestList->AppendCategory(title, collection);
+ delete[] title;
+ collection->Release();
+ }
+ }
+
+ void appendTasks()
+ {
+ IObjectCollection *collection = toComCollection(jumpListItems);
+ if (collection) {
+ pDestList->AddUserTasks(collection);
+ collection->Release();
+ }
+ }
+
+ static QList<QJumpListItem *> fromComCollection(IObjectArray *array)
+ {
+ QList<QJumpListItem *> list;
+ UINT count = 0;
+ array->GetCount(&count);
+ for (unsigned i = 0; i < count; i++) {
+ IUnknown *collectionItem = 0;
+ HRESULT hresult = array->GetAt(i, IID_IUnknown, reinterpret_cast<void **>(collectionItem));
+ if (FAILED(hresult))
+ continue;
+ IShellItem2 *shellItem = 0;
+ IShellLinkW *shellLink = 0;
+ QJumpListItem *jumplistItem = 0;
+ if (SUCCEEDED(collectionItem->QueryInterface(IID_IShellItem2, reinterpret_cast<void **>(shellItem)))) {
+ jumplistItem = fromIShellItem(shellItem);
+ shellItem->Release();
+ } else if (SUCCEEDED(collectionItem->QueryInterface(IID_IShellLinkW, reinterpret_cast<void **>(shellLink)))) {
+ jumplistItem = fromIShellLink(shellLink);
+ shellLink->Release();
+ } else {
+ qWarning("QJumpList: object of unexpected class found");
+ }
+ collectionItem->Release();
+ if (jumplistItem)
+ list.append(jumplistItem);
+ }
+ return list;
+ }
+
+ static IObjectCollection *toComCollection(const QList<QJumpListItem *> &list)
+ {
+ if (list.isEmpty())
+ return 0;
+ IObjectCollection *collection = 0;
+ HRESULT hresult = CoCreateInstance(CLSID_EnumerableObjectCollection, 0, CLSCTX_INPROC_SERVER, IID_IObjectCollection, reinterpret_cast<void **>(&collection));
+ if (FAILED(hresult)) {
+ QByteArray err = QWinExtras::errorStringFromHresult(hresult).toLocal8Bit();
+ qWarning("QJumpList: failed to instantiate IObjectCollection: %#010x, %s.", (unsigned)hresult, err.data());
+ return 0;
+ }
+ Q_FOREACH (QJumpListItem *item, list) {
+ IUnknown *iitem = toICustomDestinationListItem(item);
+ if (iitem) {
+ collection->AddObject(iitem);
+ iitem->Release();
+ }
+ }
+ return collection;
+ }
+
+ static QJumpListItem *fromIShellLink(IShellLinkW *link)
+ {
+ QJumpListItem *item = new QJumpListItem(QJumpListItem::Link);
+
+ IPropertyStore *linkProps;
+ link->QueryInterface(IID_IPropertyStore, reinterpret_cast<void **>(&linkProps));
+ PROPVARIANT var;
+ linkProps->GetValue(PKEY_Link_Arguments, &var);
+ item->setArguments(QStringList(QString::fromWCharArray(var.pwszVal)));
+ PropVariantClear(&var);
+ linkProps->Release();
+
+ const int buffersize = 2048;
+ wchar_t buffer[buffersize] = {0};
+
+ link->GetDescription(buffer, INFOTIPSIZE);
+ item->setDescription(QString::fromWCharArray(buffer));
+
+ memset(buffer, 0, buffersize);
+ int dummyindex;
+ link->GetIconLocation(buffer, buffersize-1, &dummyindex);
+ item->setIcon(QIcon(QString::fromWCharArray(buffer)));
+
+ memset(buffer, 0, buffersize);
+ link->GetPath(buffer, buffersize-1, 0, 0);
+ item->setFilePath(QString::fromWCharArray(buffer));
+
+ return item;
+ }
+
+ static QJumpListItem *fromIShellItem(IShellItem2 *shellitem)
+ {
+ QJumpListItem *item = new QJumpListItem(QJumpListItem::Destination);
+ wchar_t *strPtr;
+ shellitem->GetDisplayName(SIGDN_FILESYSPATH, &strPtr);
+ item->setFilePath(QString::fromWCharArray(strPtr));
+ CoTaskMemFree(strPtr);
+ return item;
+ }
+
+ // 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(QRegExp(QLatin1String("(\\\\*)\"")), QLatin1String("\\1\\1\\\""));
+ if (tmp.isEmpty() || tmp.contains(QLatin1Char(' ')) || tmp.contains(QLatin1Char('\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) == QLatin1Char('\\'))
+ --i;
+ tmp.insert(i, QLatin1Char('"'));
+ tmp.prepend(QLatin1Char('"'));
+ }
+ args += QLatin1Char(' ') + tmp;
+ }
+ return args;
+ }
+
+ static IUnknown *toICustomDestinationListItem(const QJumpListItem *item)
+ {
+ switch (item->type()) {
+ case QJumpListItem::Destination :
+ return toIShellItem(item);
+ case QJumpListItem::Link :
+ return toIShellLink(item);
+ case QJumpListItem::Separator :
+ return makeSeparatorShellItem();
+ default:
+ return 0;
+ }
+ }
+
+ static IShellLinkW *toIShellLink(const QJumpListItem *item)
+ {
+ IShellLinkW *link = 0;
+ HRESULT hresult = CoCreateInstance(CLSID_ShellLink, 0, CLSCTX_INPROC_SERVER, IID_IShellLinkW, reinterpret_cast<void **>(&link));
+ if (FAILED(hresult)) {
+ QByteArray err = QWinExtras::errorStringFromHresult(hresult).toLocal8Bit();
+ qWarning("QJumpList: failed to instantiate IShellLinkW: %#010x, %s.", (unsigned)hresult, err.data());
+ return 0;
+ }
+
+ const int iconPathSize = QJumpListPrivate::iconsDirPath().size() + sizeof(void *)*2 + 4; // path + ptr-name-in-hex + .ico
+ const int bufferSize = qMax(item->workingDirectory().size(), qMax(item->description().size(), qMax(item->title().size(), qMax(item->filePath().size(), iconPathSize)))) + 1;
+ wchar_t *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);
+ }
+
+ QString args = createArguments(item->arguments());
+
+ qt_qstringToNullTerminated(args, buffer);
+ link->SetArguments(buffer);
+
+ if (!item->icon().isNull()) {
+ QString iconPath = QJumpListPrivate::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(IID_IPropertyStore, reinterpret_cast<void **>(&properties));
+ if (FAILED(hresult)) {
+ link->Release();
+ return 0;
+ }
+
+ qt_qstringToNullTerminated(item->title(), buffer);
+ InitPropVariantFromString(buffer, &titlepv);
+ properties->SetValue(PKEY_Title, titlepv);
+ properties->Commit();
+ properties->Release();
+ PropVariantClear(&titlepv);
+
+ delete[] buffer;
+ return link;
+ }
+
+ static IShellItem2 *toIShellItem(const QJumpListItem *item)
+ {
+ IShellItem2 *shellitem = 0;
+ wchar_t *buffer = new wchar_t[item->filePath().length() + 1];
+ qt_qstringToNullTerminated(item->filePath(), buffer);
+ qt_SHCreateItemFromParsingName(buffer, 0, IID_IShellItem2, reinterpret_cast<void **>(&shellitem));
+ delete[] buffer;
+ return shellitem;
+ }
+
+ static IShellLinkW *makeSeparatorShellItem()
+ {
+ IShellLinkW *separator;
+ HRESULT res = CoCreateInstance(CLSID_ShellLink, 0, CLSCTX_INPROC_SERVER, IID_IShellLinkW, reinterpret_cast<void **>(&separator));
+ if (FAILED(res))
+ return 0;
+
+ IPropertyStore *properties;
+ res = separator->QueryInterface(IID_IPropertyStore, reinterpret_cast<void **>(&properties));
+ if (FAILED(res)) {
+ separator->Release();
+ return 0;
+ }
+
+ PROPVARIANT isSeparator;
+ InitPropVariantFromBoolean(TRUE, &isSeparator);
+ properties->SetValue(PKEY_AppUserModel_IsDestListSeparator, isSeparator);
+ properties->Commit();
+ properties->Release();
+ PropVariantClear(&isSeparator);
+
+ return separator;
+ }
+
+ ICustomDestinationList *pDestList;
+ bool isListBegan;
+ bool showFrequentCategory;
+ bool showRecentCategory;
+ QString currentlyBuiltCategoryTitle;
+ bool categoryBegan;
+ bool tasksBegan;
+ QList<QJumpListItem *> jumpListItems;
+ UINT listSize;
+};
+
+
+/*!
+ \class QJumpList
+ \inmodule QtWinExtras
+ \brief This class represents a transparent wrapper around Windows Jump Lists.
+
+ \since 5.2
+
+ An application can use Jump Lists to provide user with faster access to files or display shortcuts to tasks or commands.
+
+ \image jumplist.png Jump List
+
+ \b Destinations — categorized shortucts to files and URLs which application can handle and even links to another applications.
+ Windows provides two standard categories, which can be added to custom Jump List, in addition to ones that application can create by itself.
+ \b Recent and \b Frequent — so called 'known' categories — are populated automatically by Windows when application
+ uses QFileDialog::getOpenFileName function or when the application is launched to open a file from Windos Shell.
+ \note in order for application to be able to add destinations to its Jump Lists it should associate itself with
+ file types it can handle.
+
+ \b Tasks — shortcuts to application functionality. Application can display there its most frequently used context-independent functions.
+
+ \section3 Example
+
+ \snippet code/jumplist.cpp jumplist
+ */
+
+/*!
+ \enum QJumpListItem::Type
+
+ This enum specifies QJumpListItem type, changing its meaning for QJumpList.
+
+ \value Unknown Invalid item type.
+ \value Destination Item acts as link to file which application can open.
+ \value Link Item represends a link to some application.
+ \value Separator Item becomes a separator. Used only for task list.
+ */
+
+/*!
+ Constructs a QJumpList with parent object \a parent.
+ */
+QJumpList::QJumpList(QObject *parent) :
+ QObject(parent), d_ptr(new QJumpListPrivate)
+{
+ HRESULT hresult = CoCreateInstance(CLSID_DestinationList, 0, CLSCTX_INPROC_SERVER, IID_ICustomDestinationList, reinterpret_cast<void **>(&d_ptr->pDestList));
+ if (FAILED(hresult))
+ QJumpListPrivate::warning("CoCreateInstance", hresult);
+}
+
+/*!
+ Destroys the QJumpList. If commit() or abort() were not called for corresponding begin() call
+ thenJump List building is aborted.
+ */
+QJumpList::~QJumpList()
+{
+ Q_D(QJumpList);
+ if (d->isListBegan)
+ abort();
+ if (d->pDestList)
+ d->pDestList->Release();
+}
+
+/*!
+ Initiates Jump List building.
+ This method must be called before adding any item.
+ Returns true in success and false otherwise.
+ */
+bool QJumpList::begin()
+{
+ Q_D(QJumpList);
+ if (!d->pDestList)
+ return false;
+
+ UINT maxSlots;
+ IUnknown *array;
+ HRESULT hresult = d->pDestList->BeginList(&maxSlots, IID_IUnknown, reinterpret_cast<void **>(&array));
+ if (SUCCEEDED(hresult)) {
+ array->Release();
+ d->isListBegan = true;
+ } else {
+ QJumpListPrivate::warning("BeginList", hresult);
+ }
+ return SUCCEEDED(hresult);
+}
+
+/*!
+ Completes Jump List building, initiated by begin(), and displays it.
+ Returns true in success and false otherwise.
+ */
+bool QJumpList::commit()
+{
+ Q_D(QJumpList);
+ if (!d->pDestList || !d->isListBegan)
+ return false;
+
+ if (d->showFrequentCategory)
+ d->appendKnownCategory(KDC_FREQUENT);
+ if (d->showRecentCategory)
+ d->appendKnownCategory(KDC_RECENT);
+
+ if (d->tasksBegan) {
+ d->appendTasks();
+ } else if (d->categoryBegan) {
+ d->appendCategory();
+ }
+
+ d->isListBegan = false;
+ qDeleteAll(d->jumpListItems);
+ d->jumpListItems.clear();
+ HRESULT hresult = d->pDestList->CommitList();
+ if (FAILED(hresult))
+ QJumpListPrivate::warning("CommitList", hresult);
+ return SUCCEEDED(hresult);
+}
+
+/*!
+ Aborts Jump List building initiated by begin() leving currently active Jump List unchanged.
+ Returns true on success and false otherwise.
+ */
+bool QJumpList::abort()
+{
+ Q_D(QJumpList);
+ if (!d->pDestList)
+ return false;
+
+ d->isListBegan = false;
+ qDeleteAll(d->jumpListItems);
+ qDeleteAll(d->jumpListItems);
+ d->jumpListItems.clear();
+ HRESULT hresult = d->pDestList->AbortList();
+ if (FAILED(hresult))
+ QJumpListPrivate::warning("AbortList", hresult);
+ return SUCCEEDED(hresult);
+}
+
+/*!
+ Clears application Jump List.
+ Returns true on success and false otherwise.
+ */
+bool QJumpList::clear()
+{
+ Q_D(QJumpList);
+ if (!d->pDestList)
+ return false;
+
+ bool result;
+ if (!d->isListBegan) {
+ begin();
+ result = commit();
+ } else {
+ result = abort() && clear() && begin();
+ }
+ return result;
+}
+/*!
+ Specifies a unique AppUserModelID \a appId for the application whose custom Jump List will be built using this object.
+ This is optional.
+ This method must be called before begin().
+ Returns true in success and false otherwise.
+*/
+bool QJumpList::setApplicationId(const QString &appId)
+{
+ Q_D(QJumpList);
+ if (!d->pDestList)
+ return false;
+
+ wchar_t *wcAppId = qt_qstringToNullTerminated(appId);
+ HRESULT hresult = d->pDestList->SetAppID(wcAppId);
+ delete[] wcAppId;
+ if (FAILED(hresult))
+ QJumpListPrivate::warning("SetAppID", hresult);
+ return SUCCEEDED(hresult);
+}
+
+/*!
+ Retrieves destinations which were removed by user and must not be added again.
+ Adding a group with removed destinations will fail.
+ */
+QList<QJumpListItem *> QJumpList::removedDestinations() const
+{
+ Q_D(const QJumpList);
+ IObjectArray *array = 0;
+ d->pDestList->GetRemovedDestinations(IID_IObjectArray, reinterpret_cast<void **>(&array));
+ QList<QJumpListItem *> list = QJumpListPrivate::fromComCollection(array);
+ array->Release();
+ return list;
+}
+
+/*!
+ Returns the number of items which Jump List will display. This is configured by user.
+ */
+int QJumpList::capacity() const
+{
+ Q_D(const QJumpList);
+ return d->listSize;
+}
+
+/*!
+ \property QJumpList::isRecentCategoryShown
+ \brief whether to show 'Recent' known category.
+
+ This property's default is false.
+ Changes to this property are applied only after commit() is called.
+*/
+void QJumpList::setRecentCategoryShown(bool show)
+{
+ Q_D(QJumpList);
+ d->showRecentCategory = show;
+}
+
+bool QJumpList::isRecentCategoryShown() const
+{
+ Q_D(const QJumpList);
+ return d->showRecentCategory;
+}
+
+/*!
+ \property QJumpList::isFrequentCategoryShown
+ \brief whether to show 'Recent' known category.
+
+ This property's default is false.
+ Changes to this property are applied only after commit() is called.
+*/
+void QJumpList::setFrequentCategoryShown(bool show)
+{
+ Q_D(QJumpList);
+ d->showFrequentCategory = show;
+}
+
+bool QJumpList::isFrequentCategoryShown() const
+{
+ Q_D(const QJumpList);
+ return d->showFrequentCategory;
+}
+
+/*!
+ Declares building of a custom category with specified \a title.
+
+ begin() must be called before call to this method.
+ */
+void QJumpList::beginCategory(const QString &title)
+{
+ Q_D(QJumpList);
+ if (!d->pDestList)
+ return;
+
+ if (d->categoryBegan) {
+ d->appendCategory();
+ } else if (d->tasksBegan) {
+ d->appendTasks();
+ }
+ d->currentlyBuiltCategoryTitle = title;
+}
+
+/*!
+ Declares building of a task list.
+
+ begin() must be called before call to this method.
+ */
+void QJumpList::beginTasks()
+{
+ Q_D(QJumpList);
+ if (!d->pDestList)
+ return;
+
+ if (d->categoryBegan) {
+ d->appendCategory();
+ }
+ d->tasksBegan = true;
+}
+
+/*!
+ Adds a \a item to Jump List.
+
+ beginCategory() or beginTasks() should be called before call to this method.
+ Returns true in success and false otherwise.
+ */
+bool QJumpList::addItem(QJumpListItem *item)
+{
+ Q_D(QJumpList);
+ if (!d->pDestList || (!d->categoryBegan && !d->tasksBegan)) {
+ return false;
+ }
+
+ d->jumpListItems.append(item);
+ return true;
+}
+
+/*!
+ Adds a destination to Jump List pointing to \a filePath provided.
+
+ beginCategory() or beginTasks() should be called before call to this method.
+ */
+void QJumpList::addDestination(const QString &filePath)
+{
+ Q_D(QJumpList);
+ if (!d->pDestList || (!d->categoryBegan && !d->tasksBegan))
+ return;
+
+ QJumpListItem *item = new QJumpListItem(QJumpListItem::Destination);
+ item->setFilePath(filePath);
+ d->jumpListItems.append(item);
+}
+
+/*!
+ \overload addLink(const QIcon &icon, const QString &title, const QString &description, const QString &workingDirectory, const QString &executablePath, const QStringList &arguments)
+
+ Adds a link to to JumpList using \a title, \a executablePath and optional \a arguments provided.
+
+ beginCategory() or beginTasks() should be called before call to this method.
+ */
+void QJumpList::addLink(const QString &title, const QString &executablePath, const QStringList &arguments)
+{
+ addLink(QIcon(), title, QString(), QString(), executablePath, arguments);
+}
+
+/*!
+ \overload addLink(const QIcon &icon, const QString &title, const QString &description, const QString &workingDirectory, const QString &executablePath, const QStringList &arguments)
+
+ Adds a link to to JumpList using \a title, \a description, \a executablePath and optional \a arguments provided.
+
+ beginCategory() or beginTasks() should be called before call to this method.
+ */
+void QJumpList::addLink(const QString &title, const QString &description, const QString &executablePath, const QStringList &arguments)
+{
+ addLink(QIcon(), title, description, QString(), executablePath, arguments);
+}
+
+/*!
+ \overload addLink(const QIcon &icon, const QString &title, const QString &description, const QString &workingDirectory, const QString &executablePath, const QStringList &arguments)
+
+ Adds a link to to JumpList using \a icon, \a title, \a executablePath and optional \a arguments provided.
+
+ beginCategory() or beginTasks() should be called before call to this method.
+ */
+void QJumpList::addLink(const QIcon &icon, const QString &title, const QString &executablePath, const QStringList &arguments)
+{
+ addLink(icon, title, QString(), QString(), executablePath, arguments);
+}
+
+/*!
+ \overload addLink(const QIcon &icon, const QString &title, const QString &description, const QString &workingDirectory, const QString &executablePath, const QStringList &arguments)
+
+ Adds a link to to JumpList using \a icon, \a title, \a description, \a executablePath and optional \a arguments provided.
+
+ beginCategory() or beginTasks() should be called before call to this method.
+ */
+void QJumpList::addLink(const QIcon &icon, const QString &title, const QString &description, const QString &executablePath, const QStringList &arguments)
+{
+ addLink(icon, title, description, QString(), executablePath, arguments);
+}
+
+/*!
+ Adds a link to to JumpList using \a icon, \a title, \a description, \a workingDirectory, \a executablePath and \a arguments provided.
+
+ beginCategory() or beginTasks() should be called before call to this method.
+ */
+void QJumpList::addLink(const QIcon &icon, const QString &title, const QString &description, const QString &workingDirectory, const QString &executablePath, const QStringList &arguments)
+{
+ Q_D(QJumpList);
+ if (!d->pDestList || (!d->categoryBegan && !d->tasksBegan))
+ return;
+
+ QJumpListItem *item = new QJumpListItem(QJumpListItem::Link);
+ item->setFilePath(executablePath);
+ item->setTitle(title);
+ item->setArguments(arguments);
+ item->setDescription(description);
+ item->setIcon(icon);
+ item->setWorkingDirectory(workingDirectory);
+ d->jumpListItems.append(item);
+}
+
+/*!
+ Adds separator to Jump List.
+
+ beginTasks() should be called before call to this method.
+ */
+void QJumpList::addSeparator()
+{
+ Q_D(QJumpList);
+ if (!d->pDestList || (!d->categoryBegan && !d->tasksBegan))
+ return;
+
+ QJumpListItem *item = new QJumpListItem(QJumpListItem::Separator);
+ d->jumpListItems.append(item);
+}
+
+QT_END_NAMESPACE
diff --git a/src/winextras/qjumplist.h b/src/winextras/qjumplist.h
new file mode 100644
index 0000000..ff8f592
--- /dev/null
+++ b/src/winextras/qjumplist.h
@@ -0,0 +1,135 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#ifndef QJUMPLIST2_H
+#define QJUMPLIST2_H
+
+#include <QtWinExtras/qwinextrasglobal.h>
+#include <QObject>
+#include <QStringList>
+
+QT_BEGIN_NAMESPACE
+
+class QJumpListItemPrivate;
+
+class Q_WINEXTRAS_EXPORT QJumpListItem
+{
+public:
+ enum Type {
+ Unknown,
+ Destination,
+ Link,
+ Separator
+ };
+
+ explicit QJumpListItem(Type type = Unknown);
+ ~QJumpListItem();
+
+ 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:
+ QScopedPointer<QJumpListItemPrivate> d_ptr;
+
+ Q_DECLARE_PRIVATE(QJumpListItem)
+};
+
+class QJumpListPrivate;
+
+class Q_WINEXTRAS_EXPORT QJumpList : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int isRecentCategoryShown READ isRecentCategoryShown WRITE setRecentCategoryShown)
+ Q_PROPERTY(int isFrequentCategoryShown READ isFrequentCategoryShown WRITE setFrequentCategoryShown)
+
+public:
+ explicit QJumpList(QObject *parent = 0);
+ ~QJumpList();
+
+public Q_SLOTS:
+ bool begin();
+ bool commit();
+ bool abort();
+ bool clear();
+
+public:
+ bool setApplicationId(const QString &);
+ QList<QJumpListItem *> removedDestinations() const;
+ int capacity() const;
+
+ void setRecentCategoryShown(bool);
+ bool isRecentCategoryShown() const;
+ void setFrequentCategoryShown(bool);
+ bool isFrequentCategoryShown() const;
+
+ void beginCategory(const QString &title);
+ void beginTasks();
+
+ bool addItem(QJumpListItem *item);
+ void addDestination(const QString &filePath);
+ void addLink(const QString &title, const QString &executablePath, const QStringList &arguments = QStringList());
+ void addLink(const QString &title, const QString &description, const QString &executablePath, const QStringList &arguments = QStringList());
+ void addLink(const QIcon &icon, const QString &title, const QString &executablePath, const QStringList &arguments = QStringList());
+ void addLink(const QIcon &icon, const QString &title, const QString &description, const QString &executablePath, const QStringList &arguments = QStringList());
+ void addLink(const QIcon &icon, const QString &title, const QString &description, const QString &workingDirectory, const QString &executablePath, const QStringList &arguments);
+ void addSeparator();
+
+private:
+ QScopedPointer<QJumpListPrivate> d_ptr;
+
+ Q_DECLARE_PRIVATE(QJumpList)
+};
+
+QT_END_NAMESPACE
+
+#endif // QJUMPLIST2_H
diff --git a/src/winextras/qwincolorizationcolorchangeevent.cpp b/src/winextras/qwincolorizationcolorchangeevent.cpp
new file mode 100644
index 0000000..a958b3d
--- /dev/null
+++ b/src/winextras/qwincolorizationcolorchangeevent.cpp
@@ -0,0 +1,88 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#include "qwincolorizationcolorchangeevent.h"
+#include "qwincolorizationcolorchangeevent_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QWinColorizationColorChangeEvent::QWinColorizationColorChangeEvent(QRgb color, bool opaque) :
+ QEvent(QWinColorizationColorChangeEventPrivate::eventType()),
+ d_ptr(new QWinColorizationColorChangeEventPrivate)
+{
+ Q_D(QWinColorizationColorChangeEvent);
+ d->color = color;
+ d->opaqueBlend = opaque;
+}
+
+QWinColorizationColorChangeEvent::~QWinColorizationColorChangeEvent()
+{
+}
+
+bool QWinColorizationColorChangeEvent::opaqueBlend() const
+{
+ Q_D(const QWinColorizationColorChangeEvent);
+ return d->opaqueBlend;
+}
+
+QRgb QWinColorizationColorChangeEvent::color() const
+{
+ Q_D(const QWinColorizationColorChangeEvent);
+ return d->color;
+}
+
+QEvent::Type QWinColorizationColorChangeEvent::eventType()
+{
+ return QWinColorizationColorChangeEventPrivate::eventType();
+}
+
+
+
+int QWinColorizationColorChangeEventPrivate::eventTypeId = 0;
+
+QEvent::Type QWinColorizationColorChangeEventPrivate::eventType()
+{
+ if (!eventTypeId)
+ eventTypeId = QEvent::registerEventType();
+ return static_cast<QEvent::Type>(eventTypeId);
+}
+
+QT_END_NAMESPACE
diff --git a/src/winextras/qwincolorizationcolorchangeevent.h b/src/winextras/qwincolorizationcolorchangeevent.h
new file mode 100644
index 0000000..a018591
--- /dev/null
+++ b/src/winextras/qwincolorizationcolorchangeevent.h
@@ -0,0 +1,72 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#ifndef QWINCOLORIZATIONCOLORCHANGEEVENT_H
+#define QWINCOLORIZATIONCOLORCHANGEEVENT_H
+
+#include <QtWinExtras/qwinextrasglobal.h>
+#include <QEvent>
+#include <QScopedPointer>
+#include <QRgb>
+
+QT_BEGIN_NAMESPACE
+
+class QWinColorizationColorChangeEventPrivate;
+
+class Q_WINEXTRAS_EXPORT QWinColorizationColorChangeEvent : public QEvent
+{
+public:
+ QWinColorizationColorChangeEvent(QRgb color, bool opaque);
+ ~QWinColorizationColorChangeEvent();
+ bool opaqueBlend() const;
+ QRgb color() const;
+
+ static QEvent::Type eventType();
+
+private:
+ QScopedPointer<QWinColorizationColorChangeEventPrivate> d_ptr;
+
+ Q_DECLARE_PRIVATE(QWinColorizationColorChangeEvent)
+};
+
+QT_END_NAMESPACE
+
+#endif // QWINCOLORIZATIONCOLORCHANGEEVENT_H
diff --git a/src/winextras/qwincolorizationcolorchangeevent_p.h b/src/winextras/qwincolorizationcolorchangeevent_p.h
new file mode 100644
index 0000000..df85ad7
--- /dev/null
+++ b/src/winextras/qwincolorizationcolorchangeevent_p.h
@@ -0,0 +1,63 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#ifndef QWINCOLORIZATIONCOLORCHANGEEVENT_P_H
+#define QWINCOLORIZATIONCOLORCHANGEEVENT_P_H
+
+#include "qwincolorizationcolorchangeevent.h"
+
+QT_BEGIN_NAMESPACE
+
+class QWinColorizationColorChangeEventPrivate
+{
+public:
+ static QEvent::Type eventType();
+
+ bool opaqueBlend;
+ QRgb color;
+
+private:
+ static int eventTypeId;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWINCOLORIZATIONCOLORCHANGEEVENT_P_H
diff --git a/src/winextras/qwincompositionstatechangeevent.cpp b/src/winextras/qwincompositionstatechangeevent.cpp
new file mode 100644
index 0000000..4eec606
--- /dev/null
+++ b/src/winextras/qwincompositionstatechangeevent.cpp
@@ -0,0 +1,80 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#include "qwincompositionstatechangeevent.h"
+#include "qwincompositionstatechangeevent_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QWinCompositionStateChangeEvent::QWinCompositionStateChangeEvent(bool enabled) :
+ QEvent(QWinCompositionStateChangeEventPrivate::eventType()), d_ptr(new QWinCompositionStateChangeEventPrivate)
+{
+ Q_D(QWinCompositionStateChangeEvent);
+ d->enabled = enabled;
+}
+
+QWinCompositionStateChangeEvent::~QWinCompositionStateChangeEvent()
+{
+}
+
+bool QWinCompositionStateChangeEvent::isCompositionEnabled() const
+{
+ Q_D(const QWinCompositionStateChangeEvent);
+ return d->enabled;
+}
+
+QEvent::Type QWinCompositionStateChangeEvent::eventType()
+{
+ return QWinCompositionStateChangeEventPrivate::eventType();
+}
+
+
+
+int QWinCompositionStateChangeEventPrivate::eventTypeId = 0;
+
+QEvent::Type QWinCompositionStateChangeEventPrivate::eventType()
+{
+ if (!eventTypeId)
+ eventTypeId = QEvent::registerEventType();
+ return static_cast<QEvent::Type>(eventTypeId);
+}
+
+QT_END_NAMESPACE
diff --git a/src/winextras/qwincompositionstatechangeevent.h b/src/winextras/qwincompositionstatechangeevent.h
new file mode 100644
index 0000000..43c0cf4
--- /dev/null
+++ b/src/winextras/qwincompositionstatechangeevent.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#ifndef QWINCOMPOSITIONSTATECHANGEEVENT_H
+#define QWINCOMPOSITIONSTATECHANGEEVENT_H
+
+#include <QtWinExtras/qwinextrasglobal.h>
+#include <QEvent>
+#include <QScopedPointer>
+
+QT_BEGIN_NAMESPACE
+
+class QWinCompositionStateChangeEventPrivate;
+
+class Q_WINEXTRAS_EXPORT QWinCompositionStateChangeEvent : public QEvent
+{
+public:
+ explicit QWinCompositionStateChangeEvent(bool isCompositionEnabled);
+ ~QWinCompositionStateChangeEvent();
+ bool isCompositionEnabled() const;
+
+ static QEvent::Type eventType();
+
+private:
+ QScopedPointer<QWinCompositionStateChangeEventPrivate> d_ptr;
+ Q_DECLARE_PRIVATE(QWinCompositionStateChangeEvent)
+};
+
+QT_END_NAMESPACE
+
+#endif // QWINCOMPOSITIONSTATECHANGEEVENT_H
diff --git a/src/winextras/qwincompositionstatechangeevent_p.h b/src/winextras/qwincompositionstatechangeevent_p.h
new file mode 100644
index 0000000..c8b1d6f
--- /dev/null
+++ b/src/winextras/qwincompositionstatechangeevent_p.h
@@ -0,0 +1,62 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#ifndef QWINCOMPOSITIONSTATECHANGEEVENTPRIVATE_H
+#define QWINCOMPOSITIONSTATECHANGEEVENTPRIVATE_H
+
+#include "qwincolorizationcolorchangeevent.h"
+
+QT_BEGIN_NAMESPACE
+
+class QWinCompositionStateChangeEventPrivate
+{
+public:
+ static QEvent::Type eventType();
+
+ bool enabled;
+
+private:
+ static int eventTypeId;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWINCOMPOSITIONSTATECHANGEEVENTPRIVATE_H
diff --git a/src/winextras/qwineventfilter.cpp b/src/winextras/qwineventfilter.cpp
new file mode 100644
index 0000000..20c4c35
--- /dev/null
+++ b/src/winextras/qwineventfilter.cpp
@@ -0,0 +1,130 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#include "qwineventfilter_p.h"
+#include "qwincolorizationcolorchangeevent.h"
+#include "qwincompositionstatechangeevent.h"
+#include "qwinthemechangeevent.h"
+#include "qwintaskbarbuttoncreatedevent.h"
+#include "qwinfunctions.h"
+#include <QGuiApplication>
+#include <QWindow>
+
+#ifndef WM_DWMCOLORIZATIONCOLORCHANGED
+# define WM_DWMCOLORIZATIONCOLORCHANGED 0x0320
+#endif
+
+#ifndef WM_DWMCOMPOSITIONCHANGED
+# define WM_DWMCOMPOSITIONCHANGED 0x031E
+#endif
+
+QWinEventFilter *QWinEventFilter::instance = 0;
+
+QWinEventFilter::QWinEventFilter() :
+ tbButtonCreatedMsgId(RegisterWindowMessageW(L"TaskbarButtonCreated"))
+{
+}
+
+QWinEventFilter::~QWinEventFilter()
+{
+ instance = 0;
+}
+
+bool QWinEventFilter::nativeEventFilter(const QByteArray &, void *message, long *result)
+{
+ MSG *msg = static_cast<MSG *>(message);
+ bool filterOut = false;
+
+ QEvent *event = 0;
+ QWindow *window = 0;
+ switch (msg->message) {
+ case WM_DWMCOLORIZATIONCOLORCHANGED :
+ event = new QWinColorizationColorChangeEvent(msg->wParam, msg->lParam);
+ break;
+ case WM_DWMCOMPOSITIONCHANGED :
+ event = new QWinCompositionStateChangeEvent(QWinExtras::isCompositionEnabled());
+ break;
+ case WM_THEMECHANGED :
+ event = new QWinThemeChangeEvent();
+ break;
+ default :
+ if (tbButtonCreatedMsgId == msg->message) {
+ event = new QWinTaskbarButtonCreatedEvent;
+ filterOut = true;
+ }
+ break;
+ }
+
+ if (event) {
+ window = findWindow(msg->hwnd);
+ if (window)
+ qApp->sendEvent(window, event);
+ else
+ 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)
+{
+ QWindow *w = 0;
+ QWindowList list = qApp->topLevelWindows();
+ for (int i = 0; i < list.size(); i++) {
+ if (list.at(i)->winId() == reinterpret_cast<WId>(handle)) {
+ w = list.at(i);
+ break;
+ }
+ }
+ return w;
+}
diff --git a/src/winextras/qwineventfilter_p.h b/src/winextras/qwineventfilter_p.h
new file mode 100644
index 0000000..5cf82b1
--- /dev/null
+++ b/src/winextras/qwineventfilter_p.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#ifndef QWINEVENTFILTER_H
+#define QWINEVENTFILTER_H
+
+#include <QtWinExtras/qwinextrasglobal.h>
+#include <QAbstractNativeEventFilter>
+#include <qt_windows.h>
+
+QT_BEGIN_NAMESPACE
+
+class QWindow;
+
+class Q_WINEXTRAS_EXPORT QWinEventFilter : public QAbstractNativeEventFilter
+{
+public:
+ QWinEventFilter();
+ ~QWinEventFilter();
+ virtual bool nativeEventFilter(const QByteArray &eventType, void *message, long *result);
+
+ static void setup();
+
+private:
+ static QWinEventFilter *instance;
+ QWindow *findWindow(HWND);
+ UINT tbButtonCreatedMsgId;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWINEVENTFILTER_H
diff --git a/src/winextras/qwinfunctions.cpp b/src/winextras/qwinfunctions.cpp
index 0e52e46..52642f6 100644
--- a/src/winextras/qwinfunctions.cpp
+++ b/src/winextras/qwinfunctions.cpp
@@ -41,9 +41,21 @@
****************************************************************************/
#include "qwinfunctions.h"
+#include "qwinfunctions_p.h"
+#include "qwineventfilter_p.h"
+
+#include <QGuiApplication>
+#include <QWindow>
+#include <QSettings>
#include <QPixmap>
#include <QBitmap>
#include <QImage>
+#include <QColor>
+#include <QRegion>
+#include <QMargins>
+
+#include <comdef.h>
+#include "winshobjidl_p.h"
QT_BEGIN_NAMESPACE
@@ -54,104 +66,1870 @@ Q_GUI_EXPORT HICON qt_pixmapToWinHICON(const QPixmap &p);
Q_GUI_EXPORT QImage qt_imageFromWinHBITMAP(HDC hdc, HBITMAP bitmap, int w, int h);
Q_GUI_EXPORT QPixmap qt_pixmapFromWinHICON(HICON icon);
-namespace Qt
-{
+/*!
+ \namespace QWinExtras
+ \inmodule QtWinExtras
+ \brief The QWinExtras namespace contains miscellaneous Windows-specific functions.
+ \inheaderfile QWinFunctions
+
+ \section2 Type conversion
+
+ The QWinExtras namespace provides functions with the help of which Qt objects of classes such as QPixmap or QImage
+ can be converted to Windows HBITMAP or HICON handle and vice versa.
+
+ \section2 DWM and glass frame
+
+ The glass frame firstly introduced with Windows Vista can be easily manipulated using extendFrameIntoClientArea() and enableBlurBehindWindow() functions.
+ Windows 8 lost glass effect, but applications still can integrate their windows into system frame.
+ Applications can use that feature to visually separate window controls from the rest if it or focus user's attention on window content.
+
+ \image glass.png Glass frame extended into client area of a window.
+
+ Windows 7 \b {Aero Peek} feature gives user power of X-ray vision allowing user to peer past all open windows straight to desktop and gadgets placed there.
+ An application can use the setWindowExcludedFromPeek function to exclude it's window from Aero Peek to allow user to view window contents without him actually switching to it.
+ That behavior, for example, can be enabled for a gadget-like window of for a window which constantly displays some monitoring data.
+
+ \note The Aero Peek is disabled in Windows 8 by defalut but can be enabled by user.
+
+ \image peek-on.png A window excluded from Aero Peek
+ */
/*!
- \since 5.1
+ \since 5.2
- Creates a \c HBITMAP equivalent of the QBitmap.
+ 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 toWinHBITMAP()
+ \sa toHBITMAP()
*/
-HBITMAP createWinIconMask(const QBitmap &bitmap)
+HBITMAP QWinExtras::createMask(const QBitmap &bitmap)
{
return qt_createIconMask(bitmap);
}
/*!
- \since 5.1
+ \since 5.2
- Creates a \c HBITMAP equivalent to the QPixmap,
+ Creates a \c HBITMAP equivalent to 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 fromWinHBITMAP()
+ \sa fromHBITMAP()
*/
-HBITMAP toWinHBITMAP(const QPixmap &p, HBitmapFormat format)
+HBITMAP QWinExtras::toHBITMAP(const QPixmap &p, QWinExtras::HBitmapFormat format)
{
return qt_pixmapToWinHBITMAP(p, format);
}
/*!
- \since 5.1
+ \since 5.2
Returns a QPixmap that is equivalent to the
given \a bitmap. The conversion is based on the specified \a format.
- \sa toWinHBITMAP()
+ \sa toHBITMAP()
*/
-QPixmap fromWinHBITMAP(HBITMAP bitmap, HBitmapFormat format)
+QPixmap QWinExtras::fromHBITMAP(HBITMAP bitmap, QWinExtras::HBitmapFormat format)
{
return qt_pixmapFromWinHBITMAP(bitmap, format);
}
/*!
- \since 5.1
+ \since 5.2
- Creates a \c HICON equivalent to the QPixmap.
+ Creates a \c HICON equivalent to the QPixmap \a p.
Returns the \c HICON handle.
It is the caller's responsibility to free the \c HICON data after use.
- \sa fromWinHICON()
+ \sa fromHICON()
*/
-HICON toWinHICON(const QPixmap &p)
+HICON QWinExtras::toHICON(const QPixmap &p)
{
return qt_pixmapToWinHICON(p);
}
/*!
- \since 5.1
+ \since 5.2
Returns a QImage that is equivalent to the
- given \a bitmap. The conversion is based on the specified \c HDC context.
+ given \a bitmap. The conversion is based on the specified \c HDC context \a hdc
+ using specified \a width and \a height.
- \sa toWinHBITMAP()
+ \sa toHBITMAP()
*/
-QImage imageFromWinHBITMAP(HDC hdc, HBITMAP bitmap, int w, int h)
+QImage QWinExtras::imageFromHBITMAP(HDC hdc, HBITMAP bitmap, int width, int height)
{
- return qt_imageFromWinHBITMAP(hdc, bitmap, w, h);
+ return qt_imageFromWinHBITMAP(hdc, bitmap, width, height);
}
/*!
- \since 5.1
+ \since 5.2
Returns a QPixmap that is equivalent to the given \a icon.
- \sa toWinHICON()
+ \sa toHICON()
*/
-QPixmap fromWinHICON(HICON icon)
+QPixmap QWinExtras::fromHICON(HICON icon)
{
return qt_pixmapFromWinHICON(icon);
}
-} // namespace Qt
+HRGN qt_RectToHRGN(const QRect &rc)
+{
+ return CreateRectRgn(rc.left(), rc.top(), rc.right()+1, rc.bottom()+1);
+}
+
+/*!
+ \since 5.2
+
+ Returns a HRGN that is equivalent to the given \a region.
+ */
+HRGN QWinExtras::toHRGN(const QRegion &region)
+{
+ if (region.isNull() || region.rectCount() == 0) {
+ return 0;
+ }
+ HRGN resultRgn = 0;
+ QVector<QRect> rects = region.rects();
+ resultRgn = qt_RectToHRGN(rects.at(0));
+ const int size = rects.size();
+ for (int i = 1; i < size; i++) {
+ HRGN tmpRgn = qt_RectToHRGN(rects.at(i));
+ int err = CombineRgn(resultRgn, resultRgn, tmpRgn, RGN_OR);
+ if (err == ERROR)
+ qWarning("Error combining HRGNs.");
+ DeleteObject(tmpRgn);
+ }
+ return resultRgn;
+}
+
+/*!
+ \since 5.2
+
+ Returns a message string which explains \a hresult error id specified or empty string
+ if explanation cannot be found.
+ */
+QString QWinExtras::stringFromHresult(HRESULT hresult)
+{
+ _com_error error(hresult);
+ QString errorMsg;
+ if (sizeof(TCHAR) == sizeof(wchar_t))
+ errorMsg = QString::fromWCharArray((wchar_t*) error.ErrorMessage());
+ else
+ errorMsg = QString::fromLocal8Bit((char*) error.ErrorMessage());
+ return errorMsg;
+}
+
+/*!
+ \since 5.2
+
+ Returns code name of \a hresult error id specified (usually WinAPI macros name) or empty string if message is unknown.
+ */
+QString QWinExtras::errorStringFromHresult(HRESULT hresult)
+{
+ switch (hresult) {
+ case 0x8000FFFF : return QStringLiteral("E_UNEXPECTED");
+ case 0x80004001 : return QStringLiteral("E_NOTIMPL");
+ case 0x8007000E : return QStringLiteral("E_OUTOFMEMORY");
+ case 0x80070057 : return QStringLiteral("E_INVALIDARG");
+ case 0x80004002 : return QStringLiteral("E_NOINTERFACE");
+ case 0x80004003 : return QStringLiteral("E_POINTER");
+ case 0x80070006 : return QStringLiteral("E_HANDLE");
+ case 0x80004004 : return QStringLiteral("E_ABORT");
+ case 0x80004005 : return QStringLiteral("E_FAIL");
+ case 0x80070005 : return QStringLiteral("E_ACCESSDENIED");
+ case 0x8000000A : return QStringLiteral("E_PENDING");
+ case 0x80004006 : return QStringLiteral("CO_E_INIT_TLS");
+ case 0x80004007 : return QStringLiteral("CO_E_INIT_SHARED_ALLOCATOR");
+ case 0x80004008 : return QStringLiteral("CO_E_INIT_MEMORY_ALLOCATOR");
+ case 0x80004009 : return QStringLiteral("CO_E_INIT_CLASS_CACHE");
+ case 0x8000400A : return QStringLiteral("CO_E_INIT_RPC_CHANNEL");
+ case 0x8000400B : return QStringLiteral("CO_E_INIT_TLS_SET_CHANNEL_CONTROL");
+ case 0x8000400C : return QStringLiteral("CO_E_INIT_TLS_CHANNEL_CONTROL");
+ case 0x8000400D : return QStringLiteral("CO_E_INIT_UNACCEPTED_USER_ALLOCATOR");
+ case 0x8000400E : return QStringLiteral("CO_E_INIT_SCM_MUTEX_EXISTS");
+ case 0x8000400F : return QStringLiteral("CO_E_INIT_SCM_FILE_MAPPING_EXISTS");
+ case 0x80004010 : return QStringLiteral("CO_E_INIT_SCM_MAP_VIEW_OF_FILE");
+ case 0x80004011 : return QStringLiteral("CO_E_INIT_SCM_EXEC_FAILURE");
+ case 0x80004012 : return QStringLiteral("CO_E_INIT_ONLY_SINGLE_THREADED");
+ case 0x80004013 : return QStringLiteral("CO_E_CANT_REMOTE");
+ case 0x80004014 : return QStringLiteral("CO_E_BAD_SERVER_NAME");
+ case 0x80004015 : return QStringLiteral("CO_E_WRONG_SERVER_IDENTITY");
+ case 0x80004016 : return QStringLiteral("CO_E_OLE1DDE_DISABLED");
+ case 0x80004017 : return QStringLiteral("CO_E_RUNAS_SYNTAX");
+ case 0x80004018 : return QStringLiteral("CO_E_CREATEPROCESS_FAILURE");
+ case 0x80004019 : return QStringLiteral("CO_E_RUNAS_CREATEPROCESS_FAILURE");
+ case 0x8000401A : return QStringLiteral("CO_E_RUNAS_LOGON_FAILURE");
+ case 0x8000401B : return QStringLiteral("CO_E_LAUNCH_PERMSSION_DENIED");
+ case 0x8000401C : return QStringLiteral("CO_E_START_SERVICE_FAILURE");
+ case 0x8000401D : return QStringLiteral("CO_E_REMOTE_COMMUNICATION_FAILURE");
+ case 0x8000401E : return QStringLiteral("CO_E_SERVER_START_TIMEOUT");
+ case 0x8000401F : return QStringLiteral("CO_E_CLSREG_INCONSISTENT");
+ case 0x80004020 : return QStringLiteral("CO_E_IIDREG_INCONSISTENT");
+ case 0x80004021 : return QStringLiteral("CO_E_NOT_SUPPORTED");
+ case 0x80004022 : return QStringLiteral("CO_E_RELOAD_DLL");
+ case 0x80004023 : return QStringLiteral("CO_E_MSI_ERROR");
+ case 0x80004024 : return QStringLiteral("CO_E_ATTEMPT_TO_CREATE_OUTSIDE_CLIENT_CONTEXT");
+ case 0x80004025 : return QStringLiteral("CO_E_SERVER_PAUSED");
+ case 0x80004026 : return QStringLiteral("CO_E_SERVER_NOT_PAUSED");
+ case 0x80004027 : return QStringLiteral("CO_E_CLASS_DISABLED");
+ case 0x80004028 : return QStringLiteral("CO_E_CLRNOTAVAILABLE");
+ case 0x80004029 : return QStringLiteral("CO_E_ASYNC_WORK_REJECTED");
+ case 0x8000402A : return QStringLiteral("CO_E_SERVER_INIT_TIMEOUT");
+ case 0x8000402B : return QStringLiteral("CO_E_NO_SECCTX_IN_ACTIVATE");
+ case 0x80004030 : return QStringLiteral("CO_E_TRACKER_CONFIG");
+ case 0x80004031 : return QStringLiteral("CO_E_THREADPOOL_CONFIG");
+ case 0x80004032 : return QStringLiteral("CO_E_SXS_CONFIG");
+ case 0x80004033 : return QStringLiteral("CO_E_MALFORMED_SPN");
+ case 0x80040000 : return QStringLiteral("OLE_E_OLEVERB");
+ case 0x80040001 : return QStringLiteral("OLE_E_ADVF");
+ case 0x80040002 : return QStringLiteral("OLE_E_ENUM_NOMORE");
+ case 0x80040003 : return QStringLiteral("OLE_E_ADVISENOTSUPPORTED");
+ case 0x80040004 : return QStringLiteral("OLE_E_NOCONNECTION");
+ case 0x80040005 : return QStringLiteral("OLE_E_NOTRUNNING");
+ case 0x80040006 : return QStringLiteral("OLE_E_NOCACHE");
+ case 0x80040007 : return QStringLiteral("OLE_E_BLANK");
+ case 0x80040008 : return QStringLiteral("OLE_E_CLASSDIFF");
+ case 0x80040009 : return QStringLiteral("OLE_E_CANT_GETMONIKER");
+ case 0x8004000A : return QStringLiteral("OLE_E_CANT_BINDTOSOURCE");
+ case 0x8004000B : return QStringLiteral("OLE_E_STATIC");
+ case 0x8004000C : return QStringLiteral("OLE_E_PROMPTSAVECANCELLED");
+ case 0x8004000D : return QStringLiteral("OLE_E_INVALIDRECT");
+ case 0x8004000E : return QStringLiteral("OLE_E_WRONGCOMPOBJ");
+ case 0x8004000F : return QStringLiteral("OLE_E_INVALIDHWND");
+ case 0x80040010 : return QStringLiteral("OLE_E_NOT_INPLACEACTIVE");
+ case 0x80040011 : return QStringLiteral("OLE_E_CANTCONVERT");
+ case 0x80040012 : return QStringLiteral("OLE_E_NOSTORAGE");
+ case 0x80040064 : return QStringLiteral("DV_E_FORMATETC");
+ case 0x80040065 : return QStringLiteral("DV_E_DVTARGETDEVICE");
+ case 0x80040066 : return QStringLiteral("DV_E_STGMEDIUM");
+ case 0x80040067 : return QStringLiteral("DV_E_STATDATA");
+ case 0x80040068 : return QStringLiteral("DV_E_LINDEX");
+ case 0x80040069 : return QStringLiteral("DV_E_TYMED");
+ case 0x8004006A : return QStringLiteral("DV_E_CLIPFORMAT");
+ case 0x8004006B : return QStringLiteral("DV_E_DVASPECT");
+ case 0x8004006C : return QStringLiteral("DV_E_DVTARGETDEVICE_SIZE");
+ case 0x8004006D : return QStringLiteral("DV_E_NOIVIEWOBJECT");
+ case 0x80040100 : return QStringLiteral("DRAGDROP_E_NOTREGISTERED");
+ case 0x80040101 : return QStringLiteral("DRAGDROP_E_ALREADYREGISTERED");
+ case 0x80040102 : return QStringLiteral("DRAGDROP_E_INVALIDHWND");
+ case 0x80040110 : return QStringLiteral("CLASS_E_NOAGGREGATION");
+ case 0x80040111 : return QStringLiteral("CLASS_E_CLASSNOTAVAILABLE");
+ case 0x80040112 : return QStringLiteral("CLASS_E_NOTLICENSED");
+ case 0x80040140 : return QStringLiteral("VIEW_E_DRAW");
+ case 0x80040150 : return QStringLiteral("REGDB_E_READREGDB");
+ case 0x80040151 : return QStringLiteral("REGDB_E_WRITEREGDB");
+ case 0x80040152 : return QStringLiteral("REGDB_E_KEYMISSING");
+ case 0x80040153 : return QStringLiteral("REGDB_E_INVALIDVALUE");
+ case 0x80040154 : return QStringLiteral("REGDB_E_CLASSNOTREG");
+ case 0x80040155 : return QStringLiteral("REGDB_E_IIDNOTREG");
+ case 0x80040156 : return QStringLiteral("REGDB_E_BADTHREADINGMODEL");
+ case 0x80040160 : return QStringLiteral("CAT_E_CATIDNOEXIST");
+ case 0x80040161 : return QStringLiteral("CAT_E_NODESCRIPTION");
+ case 0x80040164 : return QStringLiteral("CS_E_PACKAGE_NOTFOUND");
+ case 0x80040165 : return QStringLiteral("CS_E_NOT_DELETABLE");
+ case 0x80040166 : return QStringLiteral("CS_E_CLASS_NOTFOUND");
+ case 0x80040167 : return QStringLiteral("CS_E_INVALID_VERSION");
+ case 0x80040168 : return QStringLiteral("CS_E_NO_CLASSSTORE");
+ case 0x80040169 : return QStringLiteral("CS_E_OBJECT_NOTFOUND");
+ case 0x8004016A : return QStringLiteral("CS_E_OBJECT_ALREADY_EXISTS");
+ case 0x8004016B : return QStringLiteral("CS_E_INVALID_PATH");
+ case 0x8004016C : return QStringLiteral("CS_E_NETWORK_ERROR");
+ case 0x8004016D : return QStringLiteral("CS_E_ADMIN_LIMIT_EXCEEDED");
+ case 0x8004016E : return QStringLiteral("CS_E_SCHEMA_MISMATCH");
+ case 0x8004016F : return QStringLiteral("CS_E_INTERNAL_ERROR");
+ case 0x80040170 : return QStringLiteral("CACHE_E_NOCACHE_UPDATED");
+ case 0x80040180 : return QStringLiteral("OLEOBJ_E_NOVERBS");
+ case 0x80040181 : return QStringLiteral("OLEOBJ_E_INVALIDVERB");
+ case 0x800401A0 : return QStringLiteral("INPLACE_E_NOTUNDOABLE");
+ case 0x800401A1 : return QStringLiteral("INPLACE_E_NOTOOLSPACE");
+ case 0x800401C0 : return QStringLiteral("CONVERT10_E_OLESTREAM_GET");
+ case 0x800401C1 : return QStringLiteral("CONVERT10_E_OLESTREAM_PUT");
+ case 0x800401C2 : return QStringLiteral("CONVERT10_E_OLESTREAM_FMT");
+ case 0x800401C3 : return QStringLiteral("CONVERT10_E_OLESTREAM_BITMAP_TO_DIB");
+ case 0x800401C4 : return QStringLiteral("CONVERT10_E_STG_FMT");
+ case 0x800401C5 : return QStringLiteral("CONVERT10_E_STG_NO_STD_STREAM");
+ case 0x800401C6 : return QStringLiteral("CONVERT10_E_STG_DIB_TO_BITMAP");
+ case 0x800401D0 : return QStringLiteral("CLIPBRD_E_CANT_OPEN");
+ case 0x800401D1 : return QStringLiteral("CLIPBRD_E_CANT_EMPTY");
+ case 0x800401D2 : return QStringLiteral("CLIPBRD_E_CANT_SET");
+ case 0x800401D3 : return QStringLiteral("CLIPBRD_E_BAD_DATA");
+ case 0x800401D4 : return QStringLiteral("CLIPBRD_E_CANT_CLOSE");
+ case 0x800401E0 : return QStringLiteral("MK_E_CONNECTMANUALLY");
+ case 0x800401E1 : return QStringLiteral("MK_E_EXCEEDEDDEADLINE");
+ case 0x800401E2 : return QStringLiteral("MK_E_NEEDGENERIC");
+ case 0x800401E3 : return QStringLiteral("MK_E_UNAVAILABLE");
+ case 0x800401E4 : return QStringLiteral("MK_E_SYNTAX");
+ case 0x800401E5 : return QStringLiteral("MK_E_NOOBJECT");
+ case 0x800401E6 : return QStringLiteral("MK_E_INVALIDEXTENSION");
+ case 0x800401E7 : return QStringLiteral("MK_E_INTERMEDIATEINTERFACENOTSUPPORTED");
+ case 0x800401E8 : return QStringLiteral("MK_E_NOTBINDABLE");
+ case 0x800401E9 : return QStringLiteral("MK_E_NOTBOUND");
+ case 0x800401EA : return QStringLiteral("MK_E_CANTOPENFILE");
+ case 0x800401EB : return QStringLiteral("MK_E_MUSTBOTHERUSER");
+ case 0x800401EC : return QStringLiteral("MK_E_NOINVERSE");
+ case 0x800401ED : return QStringLiteral("MK_E_NOSTORAGE");
+ case 0x800401EE : return QStringLiteral("MK_E_NOPREFIX");
+ case 0x800401EF : return QStringLiteral("MK_E_ENUMERATION_FAILED");
+ case 0x800401F0 : return QStringLiteral("CO_E_NOTINITIALIZED");
+ case 0x800401F1 : return QStringLiteral("CO_E_ALREADYINITIALIZED");
+ case 0x800401F2 : return QStringLiteral("CO_E_CANTDETERMINECLASS");
+ case 0x800401F3 : return QStringLiteral("CO_E_CLASSSTRING");
+ case 0x800401F4 : return QStringLiteral("CO_E_IIDSTRING");
+ case 0x800401F5 : return QStringLiteral("CO_E_APPNOTFOUND");
+ case 0x800401F6 : return QStringLiteral("CO_E_APPSINGLEUSE");
+ case 0x800401F7 : return QStringLiteral("CO_E_ERRORINAPP");
+ case 0x800401F8 : return QStringLiteral("CO_E_DLLNOTFOUND");
+ case 0x800401F9 : return QStringLiteral("CO_E_ERRORINDLL");
+ case 0x800401FA : return QStringLiteral("CO_E_WRONGOSFORAPP");
+ case 0x800401FB : return QStringLiteral("CO_E_OBJNOTREG");
+ case 0x800401FC : return QStringLiteral("CO_E_OBJISREG");
+ case 0x800401FD : return QStringLiteral("CO_E_OBJNOTCONNECTED");
+ case 0x800401FE : return QStringLiteral("CO_E_APPDIDNTREG");
+ case 0x800401FF : return QStringLiteral("CO_E_RELEASED");
+ case 0x00040200 : return QStringLiteral("EVENT_S_SOME_SUBSCRIBERS_FAILED");
+ case 0x80040201 : return QStringLiteral("EVENT_E_ALL_SUBSCRIBERS_FAILED");
+ case 0x00040202 : return QStringLiteral("EVENT_S_NOSUBSCRIBERS");
+ case 0x80040203 : return QStringLiteral("EVENT_E_QUERYSYNTAX");
+ case 0x80040204 : return QStringLiteral("EVENT_E_QUERYFIELD");
+ case 0x80040205 : return QStringLiteral("EVENT_E_INTERNALEXCEPTION");
+ case 0x80040206 : return QStringLiteral("EVENT_E_INTERNALERROR");
+ case 0x80040207 : return QStringLiteral("EVENT_E_INVALID_PER_USER_SID");
+ case 0x80040208 : return QStringLiteral("EVENT_E_USER_EXCEPTION");
+ case 0x80040209 : return QStringLiteral("EVENT_E_TOO_MANY_METHODS");
+ case 0x8004020A : return QStringLiteral("EVENT_E_MISSING_EVENTCLASS");
+ case 0x8004020B : return QStringLiteral("EVENT_E_NOT_ALL_REMOVED");
+ case 0x8004020C : return QStringLiteral("EVENT_E_COMPLUS_NOT_INSTALLED");
+ case 0x8004020D : return QStringLiteral("EVENT_E_CANT_MODIFY_OR_DELETE_UNCONFIGURED_OBJECT");
+ case 0x8004020E : return QStringLiteral("EVENT_E_CANT_MODIFY_OR_DELETE_CONFIGURED_OBJECT");
+ case 0x8004020F : return QStringLiteral("EVENT_E_INVALID_EVENT_CLASS_PARTITION");
+ case 0x80040210 : return QStringLiteral("EVENT_E_PER_USER_SID_NOT_LOGGED_ON");
+ case 0x8004D000 : return QStringLiteral("XACT_E_ALREADYOTHERSINGLEPHASE");
+ case 0x8004D001 : return QStringLiteral("XACT_E_CANTRETAIN");
+ case 0x8004D002 : return QStringLiteral("XACT_E_COMMITFAILED");
+ case 0x8004D003 : return QStringLiteral("XACT_E_COMMITPREVENTED");
+ case 0x8004D004 : return QStringLiteral("XACT_E_HEURISTICABORT");
+ case 0x8004D005 : return QStringLiteral("XACT_E_HEURISTICCOMMIT");
+ case 0x8004D006 : return QStringLiteral("XACT_E_HEURISTICDAMAGE");
+ case 0x8004D007 : return QStringLiteral("XACT_E_HEURISTICDANGER");
+ case 0x8004D008 : return QStringLiteral("XACT_E_ISOLATIONLEVEL");
+ case 0x8004D009 : return QStringLiteral("XACT_E_NOASYNC");
+ case 0x8004D00A : return QStringLiteral("XACT_E_NOENLIST");
+ case 0x8004D00B : return QStringLiteral("XACT_E_NOISORETAIN");
+ case 0x8004D00C : return QStringLiteral("XACT_E_NORESOURCE");
+ case 0x8004D00D : return QStringLiteral("XACT_E_NOTCURRENT");
+ case 0x8004D00E : return QStringLiteral("XACT_E_NOTRANSACTION");
+ case 0x8004D00F : return QStringLiteral("XACT_E_NOTSUPPORTED");
+ case 0x8004D010 : return QStringLiteral("XACT_E_UNKNOWNRMGRID");
+ case 0x8004D011 : return QStringLiteral("XACT_E_WRONGSTATE");
+ case 0x8004D012 : return QStringLiteral("XACT_E_WRONGUOW");
+ case 0x8004D013 : return QStringLiteral("XACT_E_XTIONEXISTS");
+ case 0x8004D014 : return QStringLiteral("XACT_E_NOIMPORTOBJECT");
+ case 0x8004D015 : return QStringLiteral("XACT_E_INVALIDCOOKIE");
+ case 0x8004D016 : return QStringLiteral("XACT_E_INDOUBT");
+ case 0x8004D017 : return QStringLiteral("XACT_E_NOTIMEOUT");
+ case 0x8004D018 : return QStringLiteral("XACT_E_ALREADYINPROGRESS");
+ case 0x8004D019 : return QStringLiteral("XACT_E_ABORTED");
+ case 0x8004D01A : return QStringLiteral("XACT_E_LOGFULL");
+ case 0x8004D01B : return QStringLiteral("XACT_E_TMNOTAVAILABLE");
+ case 0x8004D01C : return QStringLiteral("XACT_E_CONNECTION_DOWN");
+ case 0x8004D01D : return QStringLiteral("XACT_E_CONNECTION_DENIED");
+ case 0x8004D01E : return QStringLiteral("XACT_E_REENLISTTIMEOUT");
+ case 0x8004D01F : return QStringLiteral("XACT_E_TIP_CONNECT_FAILED");
+ case 0x8004D020 : return QStringLiteral("XACT_E_TIP_PROTOCOL_ERROR");
+ case 0x8004D021 : return QStringLiteral("XACT_E_TIP_PULL_FAILED");
+ case 0x8004D022 : return QStringLiteral("XACT_E_DEST_TMNOTAVAILABLE");
+ case 0x8004D023 : return QStringLiteral("XACT_E_TIP_DISABLED");
+ case 0x8004D024 : return QStringLiteral("XACT_E_NETWORK_TX_DISABLED");
+ case 0x8004D025 : return QStringLiteral("XACT_E_PARTNER_NETWORK_TX_DISABLED");
+ case 0x8004D026 : return QStringLiteral("XACT_E_XA_TX_DISABLED");
+ case 0x8004D027 : return QStringLiteral("XACT_E_UNABLE_TO_READ_DTC_CONFIG");
+ case 0x8004D028 : return QStringLiteral("XACT_E_UNABLE_TO_LOAD_DTC_PROXY");
+ case 0x8004D029 : return QStringLiteral("XACT_E_ABORTING");
+ case 0x8004D080 : return QStringLiteral("XACT_E_CLERKNOTFOUND");
+ case 0x8004D081 : return QStringLiteral("XACT_E_CLERKEXISTS");
+ case 0x8004D082 : return QStringLiteral("XACT_E_RECOVERYINPROGRESS");
+ case 0x8004D083 : return QStringLiteral("XACT_E_TRANSACTIONCLOSED");
+ case 0x8004D084 : return QStringLiteral("XACT_E_INVALIDLSN");
+ case 0x8004D085 : return QStringLiteral("XACT_E_REPLAYREQUEST");
+ case 0x0004D000 : return QStringLiteral("XACT_S_ASYNC");
+ case 0x0004D001 : return QStringLiteral("XACT_S_DEFECT");
+ case 0x0004D002 : return QStringLiteral("XACT_S_READONLY");
+ case 0x0004D003 : return QStringLiteral("XACT_S_SOMENORETAIN");
+ case 0x0004D004 : return QStringLiteral("XACT_S_OKINFORM");
+ case 0x0004D005 : return QStringLiteral("XACT_S_MADECHANGESCONTENT");
+ case 0x0004D006 : return QStringLiteral("XACT_S_MADECHANGESINFORM");
+ case 0x0004D007 : return QStringLiteral("XACT_S_ALLNORETAIN");
+ case 0x0004D008 : return QStringLiteral("XACT_S_ABORTING");
+ case 0x0004D009 : return QStringLiteral("XACT_S_SINGLEPHASE");
+ case 0x0004D00A : return QStringLiteral("XACT_S_LOCALLY_OK");
+ case 0x0004D010 : return QStringLiteral("XACT_S_LASTRESOURCEMANAGER");
+ case 0x8004E002 : return QStringLiteral("CONTEXT_E_ABORTED");
+ case 0x8004E003 : return QStringLiteral("CONTEXT_E_ABORTING");
+ case 0x8004E004 : return QStringLiteral("CONTEXT_E_NOCONTEXT");
+ case 0x8004E005 : return QStringLiteral("CONTEXT_E_WOULD_DEADLOCK");
+ case 0x8004E006 : return QStringLiteral("CONTEXT_E_SYNCH_TIMEOUT");
+ case 0x8004E007 : return QStringLiteral("CONTEXT_E_OLDREF");
+ case 0x8004E00C : return QStringLiteral("CONTEXT_E_ROLENOTFOUND");
+ case 0x8004E00F : return QStringLiteral("CONTEXT_E_TMNOTAVAILABLE");
+ case 0x8004E021 : return QStringLiteral("CO_E_ACTIVATIONFAILED");
+ case 0x8004E022 : return QStringLiteral("CO_E_ACTIVATIONFAILED_EVENTLOGGED");
+ case 0x8004E023 : return QStringLiteral("CO_E_ACTIVATIONFAILED_CATALOGERROR");
+ case 0x8004E024 : return QStringLiteral("CO_E_ACTIVATIONFAILED_TIMEOUT");
+ case 0x8004E025 : return QStringLiteral("CO_E_INITIALIZATIONFAILED");
+ case 0x8004E026 : return QStringLiteral("CONTEXT_E_NOJIT");
+ case 0x8004E027 : return QStringLiteral("CONTEXT_E_NOTRANSACTION");
+ case 0x8004E028 : return QStringLiteral("CO_E_THREADINGMODEL_CHANGED");
+ case 0x8004E029 : return QStringLiteral("CO_E_NOIISINTRINSICS");
+ case 0x8004E02A : return QStringLiteral("CO_E_NOCOOKIES");
+ case 0x8004E02B : return QStringLiteral("CO_E_DBERROR");
+ case 0x8004E02C : return QStringLiteral("CO_E_NOTPOOLED");
+ case 0x8004E02D : return QStringLiteral("CO_E_NOTCONSTRUCTED");
+ case 0x8004E02E : return QStringLiteral("CO_E_NOSYNCHRONIZATION");
+ case 0x8004E02F : return QStringLiteral("CO_E_ISOLEVELMISMATCH");
+ case 0x00040000 : return QStringLiteral("OLE_S_USEREG");
+ case 0x00040001 : return QStringLiteral("OLE_S_STATIC");
+ case 0x00040002 : return QStringLiteral("OLE_S_MAC_CLIPFORMAT");
+ case 0x00040100 : return QStringLiteral("DRAGDROP_S_DROP");
+ case 0x00040101 : return QStringLiteral("DRAGDROP_S_CANCEL");
+ case 0x00040102 : return QStringLiteral("DRAGDROP_S_USEDEFAULTCURSORS");
+ case 0x00040130 : return QStringLiteral("DATA_S_SAMEFORMATETC");
+ case 0x00040140 : return QStringLiteral("VIEW_S_ALREADY_FROZEN");
+ case 0x00040170 : return QStringLiteral("CACHE_S_FORMATETC_NOTSUPPORTED");
+ case 0x00040171 : return QStringLiteral("CACHE_S_SAMECACHE");
+ case 0x00040172 : return QStringLiteral("CACHE_S_SOMECACHES_NOTUPDATED");
+ case 0x00040180 : return QStringLiteral("OLEOBJ_S_INVALIDVERB");
+ case 0x00040181 : return QStringLiteral("OLEOBJ_S_CANNOT_DOVERB_NOW");
+ case 0x00040182 : return QStringLiteral("OLEOBJ_S_INVALIDHWND");
+ case 0x000401A0 : return QStringLiteral("INPLACE_S_TRUNCATED");
+ case 0x000401C0 : return QStringLiteral("CONVERT10_S_NO_PRESENTATION");
+ case 0x000401E2 : return QStringLiteral("MK_S_REDUCED_TO_SELF");
+ case 0x000401E4 : return QStringLiteral("MK_S_ME");
+ case 0x000401E5 : return QStringLiteral("MK_S_HIM");
+ case 0x000401E6 : return QStringLiteral("MK_S_US");
+ case 0x000401E7 : return QStringLiteral("MK_S_MONIKERALREADYREGISTERED");
+ case 0x00041300 : return QStringLiteral("SCHED_S_TASK_READY");
+ case 0x00041301 : return QStringLiteral("SCHED_S_TASK_RUNNING");
+ case 0x00041302 : return QStringLiteral("SCHED_S_TASK_DISABLED");
+ case 0x00041303 : return QStringLiteral("SCHED_S_TASK_HAS_NOT_RUN");
+ case 0x00041304 : return QStringLiteral("SCHED_S_TASK_NO_MORE_RUNS");
+ case 0x00041305 : return QStringLiteral("SCHED_S_TASK_NOT_SCHEDULED");
+ case 0x00041306 : return QStringLiteral("SCHED_S_TASK_TERMINATED");
+ case 0x00041307 : return QStringLiteral("SCHED_S_TASK_NO_VALID_TRIGGERS");
+ case 0x00041308 : return QStringLiteral("SCHED_S_EVENT_TRIGGER");
+ case 0x80041309 : return QStringLiteral("SCHED_E_TRIGGER_NOT_FOUND");
+ case 0x8004130A : return QStringLiteral("SCHED_E_TASK_NOT_READY");
+ case 0x8004130B : return QStringLiteral("SCHED_E_TASK_NOT_RUNNING");
+ case 0x8004130C : return QStringLiteral("SCHED_E_SERVICE_NOT_INSTALLED");
+ case 0x8004130D : return QStringLiteral("SCHED_E_CANNOT_OPEN_TASK");
+ case 0x8004130E : return QStringLiteral("SCHED_E_INVALID_TASK");
+ case 0x8004130F : return QStringLiteral("SCHED_E_ACCOUNT_INFORMATION_NOT_SET");
+ case 0x80041310 : return QStringLiteral("SCHED_E_ACCOUNT_NAME_NOT_FOUND");
+ case 0x80041311 : return QStringLiteral("SCHED_E_ACCOUNT_DBASE_CORRUPT");
+ case 0x80041312 : return QStringLiteral("SCHED_E_NO_SECURITY_SERVICES");
+ case 0x80041313 : return QStringLiteral("SCHED_E_UNKNOWN_OBJECT_VERSION");
+ case 0x80041314 : return QStringLiteral("SCHED_E_UNSUPPORTED_ACCOUNT_OPTION");
+ case 0x80041315 : return QStringLiteral("SCHED_E_SERVICE_NOT_RUNNING");
+ case 0x80080001 : return QStringLiteral("CO_E_CLASS_CREATE_FAILED");
+ case 0x80080002 : return QStringLiteral("CO_E_SCM_ERROR");
+ case 0x80080003 : return QStringLiteral("CO_E_SCM_RPC_FAILURE");
+ case 0x80080004 : return QStringLiteral("CO_E_BAD_PATH");
+ case 0x80080005 : return QStringLiteral("CO_E_SERVER_EXEC_FAILURE");
+ case 0x80080006 : return QStringLiteral("CO_E_OBJSRV_RPC_FAILURE");
+ case 0x80080007 : return QStringLiteral("MK_E_NO_NORMALIZED");
+ case 0x80080008 : return QStringLiteral("CO_E_SERVER_STOPPING");
+ case 0x80080009 : return QStringLiteral("MEM_E_INVALID_ROOT");
+ case 0x80080010 : return QStringLiteral("MEM_E_INVALID_LINK");
+ case 0x80080011 : return QStringLiteral("MEM_E_INVALID_SIZE");
+ case 0x00080012 : return QStringLiteral("CO_S_NOTALLINTERFACES");
+ case 0x00080013 : return QStringLiteral("CO_S_MACHINENAMENOTFOUND");
+ case 0x80020001 : return QStringLiteral("DISP_E_UNKNOWNINTERFACE");
+ case 0x80020003 : return QStringLiteral("DISP_E_MEMBERNOTFOUND");
+ case 0x80020004 : return QStringLiteral("DISP_E_PARAMNOTFOUND");
+ case 0x80020005 : return QStringLiteral("DISP_E_TYPEMISMATCH");
+ case 0x80020006 : return QStringLiteral("DISP_E_UNKNOWNNAME");
+ case 0x80020007 : return QStringLiteral("DISP_E_NONAMEDARGS");
+ case 0x80020008 : return QStringLiteral("DISP_E_BADVARTYPE");
+ case 0x80020009 : return QStringLiteral("DISP_E_EXCEPTION");
+ case 0x8002000A : return QStringLiteral("DISP_E_OVERFLOW");
+ case 0x8002000B : return QStringLiteral("DISP_E_BADINDEX");
+ case 0x8002000C : return QStringLiteral("DISP_E_UNKNOWNLCID");
+ case 0x8002000D : return QStringLiteral("DISP_E_ARRAYISLOCKED");
+ case 0x8002000E : return QStringLiteral("DISP_E_BADPARAMCOUNT");
+ case 0x8002000F : return QStringLiteral("DISP_E_PARAMNOTOPTIONAL");
+ case 0x80020010 : return QStringLiteral("DISP_E_BADCALLEE");
+ case 0x80020011 : return QStringLiteral("DISP_E_NOTACOLLECTION");
+ case 0x80020012 : return QStringLiteral("DISP_E_DIVBYZERO");
+ case 0x80020013 : return QStringLiteral("DISP_E_BUFFERTOOSMALL");
+ case 0x80028016 : return QStringLiteral("TYPE_E_BUFFERTOOSMALL");
+ case 0x80028017 : return QStringLiteral("TYPE_E_FIELDNOTFOUND");
+ case 0x80028018 : return QStringLiteral("TYPE_E_INVDATAREAD");
+ case 0x80028019 : return QStringLiteral("TYPE_E_UNSUPFORMAT");
+ case 0x8002801C : return QStringLiteral("TYPE_E_REGISTRYACCESS");
+ case 0x8002801D : return QStringLiteral("TYPE_E_LIBNOTREGISTERED");
+ case 0x80028027 : return QStringLiteral("TYPE_E_UNDEFINEDTYPE");
+ case 0x80028028 : return QStringLiteral("TYPE_E_QUALIFIEDNAMEDISALLOWED");
+ case 0x80028029 : return QStringLiteral("TYPE_E_INVALIDSTATE");
+ case 0x8002802A : return QStringLiteral("TYPE_E_WRONGTYPEKIND");
+ case 0x8002802B : return QStringLiteral("TYPE_E_ELEMENTNOTFOUND");
+ case 0x8002802C : return QStringLiteral("TYPE_E_AMBIGUOUSNAME");
+ case 0x8002802D : return QStringLiteral("TYPE_E_NAMECONFLICT");
+ case 0x8002802E : return QStringLiteral("TYPE_E_UNKNOWNLCID");
+ case 0x8002802F : return QStringLiteral("TYPE_E_DLLFUNCTIONNOTFOUND");
+ case 0x800288BD : return QStringLiteral("TYPE_E_BADMODULEKIND");
+ case 0x800288C5 : return QStringLiteral("TYPE_E_SIZETOOBIG");
+ case 0x800288C6 : return QStringLiteral("TYPE_E_DUPLICATEID");
+ case 0x800288CF : return QStringLiteral("TYPE_E_INVALIDID");
+ case 0x80028CA0 : return QStringLiteral("TYPE_E_TYPEMISMATCH");
+ case 0x80028CA1 : return QStringLiteral("TYPE_E_OUTOFBOUNDS");
+ case 0x80028CA2 : return QStringLiteral("TYPE_E_IOERROR");
+ case 0x80028CA3 : return QStringLiteral("TYPE_E_CANTCREATETMPFILE");
+ case 0x80029C4A : return QStringLiteral("TYPE_E_CANTLOADLIBRARY");
+ case 0x80029C83 : return QStringLiteral("TYPE_E_INCONSISTENTPROPFUNCS");
+ case 0x80029C84 : return QStringLiteral("TYPE_E_CIRCULARTYPE");
+ case 0x80030001 : return QStringLiteral("STG_E_INVALIDFUNCTION");
+ case 0x80030002 : return QStringLiteral("STG_E_FILENOTFOUND");
+ case 0x80030003 : return QStringLiteral("STG_E_PATHNOTFOUND");
+ case 0x80030004 : return QStringLiteral("STG_E_TOOMANYOPENFILES");
+ case 0x80030005 : return QStringLiteral("STG_E_ACCESSDENIED");
+ case 0x80030006 : return QStringLiteral("STG_E_INVALIDHANDLE");
+ case 0x80030008 : return QStringLiteral("STG_E_INSUFFICIENTMEMORY");
+ case 0x80030009 : return QStringLiteral("STG_E_INVALIDPOINTER");
+ case 0x80030012 : return QStringLiteral("STG_E_NOMOREFILES");
+ case 0x80030013 : return QStringLiteral("STG_E_DISKISWRITEPROTECTED");
+ case 0x80030019 : return QStringLiteral("STG_E_SEEKERROR");
+ case 0x8003001D : return QStringLiteral("STG_E_WRITEFAULT");
+ case 0x8003001E : return QStringLiteral("STG_E_READFAULT");
+ case 0x80030020 : return QStringLiteral("STG_E_SHAREVIOLATION");
+ case 0x80030021 : return QStringLiteral("STG_E_LOCKVIOLATION");
+ case 0x80030050 : return QStringLiteral("STG_E_FILEALREADYEXISTS");
+ case 0x80030057 : return QStringLiteral("STG_E_INVALIDPARAMETER");
+ case 0x80030070 : return QStringLiteral("STG_E_MEDIUMFULL");
+ case 0x800300F0 : return QStringLiteral("STG_E_PROPSETMISMATCHED");
+ case 0x800300FA : return QStringLiteral("STG_E_ABNORMALAPIEXIT");
+ case 0x800300FB : return QStringLiteral("STG_E_INVALIDHEADER");
+ case 0x800300FC : return QStringLiteral("STG_E_INVALIDNAME");
+ case 0x800300FD : return QStringLiteral("STG_E_UNKNOWN");
+ case 0x800300FE : return QStringLiteral("STG_E_UNIMPLEMENTEDFUNCTION");
+ case 0x800300FF : return QStringLiteral("STG_E_INVALIDFLAG");
+ case 0x80030100 : return QStringLiteral("STG_E_INUSE");
+ case 0x80030101 : return QStringLiteral("STG_E_NOTCURRENT");
+ case 0x80030102 : return QStringLiteral("STG_E_REVERTED");
+ case 0x80030103 : return QStringLiteral("STG_E_CANTSAVE");
+ case 0x80030104 : return QStringLiteral("STG_E_OLDFORMAT");
+ case 0x80030105 : return QStringLiteral("STG_E_OLDDLL");
+ case 0x80030106 : return QStringLiteral("STG_E_SHAREREQUIRED");
+ case 0x80030107 : return QStringLiteral("STG_E_NOTFILEBASEDSTORAGE");
+ case 0x80030108 : return QStringLiteral("STG_E_EXTANTMARSHALLINGS");
+ case 0x80030109 : return QStringLiteral("STG_E_DOCFILECORRUPT");
+ case 0x80030110 : return QStringLiteral("STG_E_BADBASEADDRESS");
+ case 0x80030111 : return QStringLiteral("STG_E_DOCFILETOOLARGE");
+ case 0x80030112 : return QStringLiteral("STG_E_NOTSIMPLEFORMAT");
+ case 0x80030201 : return QStringLiteral("STG_E_INCOMPLETE");
+ case 0x80030202 : return QStringLiteral("STG_E_TERMINATED");
+ case 0x00030200 : return QStringLiteral("STG_S_CONVERTED");
+ case 0x00030201 : return QStringLiteral("STG_S_BLOCK");
+ case 0x00030202 : return QStringLiteral("STG_S_RETRYNOW");
+ case 0x00030203 : return QStringLiteral("STG_S_MONITORING");
+ case 0x00030204 : return QStringLiteral("STG_S_MULTIPLEOPENS");
+ case 0x00030205 : return QStringLiteral("STG_S_CONSOLIDATIONFAILED");
+ case 0x00030206 : return QStringLiteral("STG_S_CANNOTCONSOLIDATE");
+ case 0x80030305 : return QStringLiteral("STG_E_STATUS_COPY_PROTECTION_FAILURE");
+ case 0x80030306 : return QStringLiteral("STG_E_CSS_AUTHENTICATION_FAILURE");
+ case 0x80030307 : return QStringLiteral("STG_E_CSS_KEY_NOT_PRESENT");
+ case 0x80030308 : return QStringLiteral("STG_E_CSS_KEY_NOT_ESTABLISHED");
+ case 0x80030309 : return QStringLiteral("STG_E_CSS_SCRAMBLED_SECTOR");
+ case 0x8003030A : return QStringLiteral("STG_E_CSS_REGION_MISMATCH");
+ case 0x8003030B : return QStringLiteral("STG_E_RESETS_EXHAUSTED");
+ case 0x80010001 : return QStringLiteral("RPC_E_CALL_REJECTED");
+ case 0x80010002 : return QStringLiteral("RPC_E_CALL_CANCELED");
+ case 0x80010003 : return QStringLiteral("RPC_E_CANTPOST_INSENDCALL");
+ case 0x80010004 : return QStringLiteral("RPC_E_CANTCALLOUT_INASYNCCALL");
+ case 0x80010005 : return QStringLiteral("RPC_E_CANTCALLOUT_INEXTERNALCALL");
+ case 0x80010006 : return QStringLiteral("RPC_E_CONNECTION_TERMINATED");
+ case 0x80010007 : return QStringLiteral("RPC_E_SERVER_DIED");
+ case 0x80010008 : return QStringLiteral("RPC_E_CLIENT_DIED");
+ case 0x80010009 : return QStringLiteral("RPC_E_INVALID_DATAPACKET");
+ case 0x8001000A : return QStringLiteral("RPC_E_CANTTRANSMIT_CALL");
+ case 0x8001000B : return QStringLiteral("RPC_E_CLIENT_CANTMARSHAL_DATA");
+ case 0x8001000C : return QStringLiteral("RPC_E_CLIENT_CANTUNMARSHAL_DATA");
+ case 0x8001000D : return QStringLiteral("RPC_E_SERVER_CANTMARSHAL_DATA");
+ case 0x8001000E : return QStringLiteral("RPC_E_SERVER_CANTUNMARSHAL_DATA");
+ case 0x8001000F : return QStringLiteral("RPC_E_INVALID_DATA");
+ case 0x80010010 : return QStringLiteral("RPC_E_INVALID_PARAMETER");
+ case 0x80010011 : return QStringLiteral("RPC_E_CANTCALLOUT_AGAIN");
+ case 0x80010012 : return QStringLiteral("RPC_E_SERVER_DIED_DNE");
+ case 0x80010100 : return QStringLiteral("RPC_E_SYS_CALL_FAILED");
+ case 0x80010101 : return QStringLiteral("RPC_E_OUT_OF_RESOURCES");
+ case 0x80010102 : return QStringLiteral("RPC_E_ATTEMPTED_MULTITHREAD");
+ case 0x80010103 : return QStringLiteral("RPC_E_NOT_REGISTERED");
+ case 0x80010104 : return QStringLiteral("RPC_E_FAULT");
+ case 0x80010105 : return QStringLiteral("RPC_E_SERVERFAULT");
+ case 0x80010106 : return QStringLiteral("RPC_E_CHANGED_MODE");
+ case 0x80010107 : return QStringLiteral("RPC_E_INVALIDMETHOD");
+ case 0x80010108 : return QStringLiteral("RPC_E_DISCONNECTED");
+ case 0x80010109 : return QStringLiteral("RPC_E_RETRY");
+ case 0x8001010A : return QStringLiteral("RPC_E_SERVERCALL_RETRYLATER");
+ case 0x8001010B : return QStringLiteral("RPC_E_SERVERCALL_REJECTED");
+ case 0x8001010C : return QStringLiteral("RPC_E_INVALID_CALLDATA");
+ case 0x8001010D : return QStringLiteral("RPC_E_CANTCALLOUT_ININPUTSYNCCALL");
+ case 0x8001010E : return QStringLiteral("RPC_E_WRONG_THREAD");
+ case 0x8001010F : return QStringLiteral("RPC_E_THREAD_NOT_INIT");
+ case 0x80010110 : return QStringLiteral("RPC_E_VERSION_MISMATCH");
+ case 0x80010111 : return QStringLiteral("RPC_E_INVALID_HEADER");
+ case 0x80010112 : return QStringLiteral("RPC_E_INVALID_EXTENSION");
+ case 0x80010113 : return QStringLiteral("RPC_E_INVALID_IPID");
+ case 0x80010114 : return QStringLiteral("RPC_E_INVALID_OBJECT");
+ case 0x80010115 : return QStringLiteral("RPC_S_CALLPENDING");
+ case 0x80010116 : return QStringLiteral("RPC_S_WAITONTIMER");
+ case 0x80010117 : return QStringLiteral("RPC_E_CALL_COMPLETE");
+ case 0x80010118 : return QStringLiteral("RPC_E_UNSECURE_CALL");
+ case 0x80010119 : return QStringLiteral("RPC_E_TOO_LATE");
+ case 0x8001011A : return QStringLiteral("RPC_E_NO_GOOD_SECURITY_PACKAGES");
+ case 0x8001011B : return QStringLiteral("RPC_E_ACCESS_DENIED");
+ case 0x8001011C : return QStringLiteral("RPC_E_REMOTE_DISABLED");
+ case 0x8001011D : return QStringLiteral("RPC_E_INVALID_OBJREF");
+ case 0x8001011E : return QStringLiteral("RPC_E_NO_CONTEXT");
+ case 0x8001011F : return QStringLiteral("RPC_E_TIMEOUT");
+ case 0x80010120 : return QStringLiteral("RPC_E_NO_SYNC");
+ case 0x80010121 : return QStringLiteral("RPC_E_FULLSIC_REQUIRED");
+ case 0x80010122 : return QStringLiteral("RPC_E_INVALID_STD_NAME");
+ case 0x80010123 : return QStringLiteral("CO_E_FAILEDTOIMPERSONATE");
+ case 0x80010124 : return QStringLiteral("CO_E_FAILEDTOGETSECCTX");
+ case 0x80010125 : return QStringLiteral("CO_E_FAILEDTOOPENTHREADTOKEN");
+ case 0x80010126 : return QStringLiteral("CO_E_FAILEDTOGETTOKENINFO");
+ case 0x80010127 : return QStringLiteral("CO_E_TRUSTEEDOESNTMATCHCLIENT");
+ case 0x80010128 : return QStringLiteral("CO_E_FAILEDTOQUERYCLIENTBLANKET");
+ case 0x80010129 : return QStringLiteral("CO_E_FAILEDTOSETDACL");
+ case 0x8001012A : return QStringLiteral("CO_E_ACCESSCHECKFAILED");
+ case 0x8001012B : return QStringLiteral("CO_E_NETACCESSAPIFAILED");
+ case 0x8001012C : return QStringLiteral("CO_E_WRONGTRUSTEENAMESYNTAX");
+ case 0x8001012D : return QStringLiteral("CO_E_INVALIDSID");
+ case 0x8001012E : return QStringLiteral("CO_E_CONVERSIONFAILED");
+ case 0x8001012F : return QStringLiteral("CO_E_NOMATCHINGSIDFOUND");
+ case 0x80010130 : return QStringLiteral("CO_E_LOOKUPACCSIDFAILED");
+ case 0x80010131 : return QStringLiteral("CO_E_NOMATCHINGNAMEFOUND");
+ case 0x80010132 : return QStringLiteral("CO_E_LOOKUPACCNAMEFAILED");
+ case 0x80010133 : return QStringLiteral("CO_E_SETSERLHNDLFAILED");
+ case 0x80010134 : return QStringLiteral("CO_E_FAILEDTOGETWINDIR");
+ case 0x80010135 : return QStringLiteral("CO_E_PATHTOOLONG");
+ case 0x80010136 : return QStringLiteral("CO_E_FAILEDTOGENUUID");
+ case 0x80010137 : return QStringLiteral("CO_E_FAILEDTOCREATEFILE");
+ case 0x80010138 : return QStringLiteral("CO_E_FAILEDTOCLOSEHANDLE");
+ case 0x80010139 : return QStringLiteral("CO_E_EXCEEDSYSACLLIMIT");
+ case 0x8001013A : return QStringLiteral("CO_E_ACESINWRONGORDER");
+ case 0x8001013B : return QStringLiteral("CO_E_INCOMPATIBLESTREAMVERSION");
+ case 0x8001013C : return QStringLiteral("CO_E_FAILEDTOOPENPROCESSTOKEN");
+ case 0x8001013D : return QStringLiteral("CO_E_DECODEFAILED");
+ case 0x8001013F : return QStringLiteral("CO_E_ACNOTINITIALIZED");
+ case 0x80010140 : return QStringLiteral("CO_E_CANCEL_DISABLED");
+ case 0x8001FFFF : return QStringLiteral("RPC_E_UNEXPECTED");
+ case 0xC0090001 : return QStringLiteral("ERROR_AUDITING_DISABLED");
+ case 0xC0090002 : return QStringLiteral("ERROR_ALL_SIDS_FILTERED");
+ case 0x80090001 : return QStringLiteral("NTE_BAD_UID");
+ case 0x80090002 : return QStringLiteral("NTE_BAD_HASH");
+ case 0x80090003 : return QStringLiteral("NTE_BAD_KEY");
+ case 0x80090004 : return QStringLiteral("NTE_BAD_LEN");
+ case 0x80090005 : return QStringLiteral("NTE_BAD_DATA");
+ case 0x80090006 : return QStringLiteral("NTE_BAD_SIGNATURE");
+ case 0x80090007 : return QStringLiteral("NTE_BAD_VER");
+ case 0x80090008 : return QStringLiteral("NTE_BAD_ALGID");
+ case 0x80090009 : return QStringLiteral("NTE_BAD_FLAGS");
+ case 0x8009000A : return QStringLiteral("NTE_BAD_TYPE");
+ case 0x8009000B : return QStringLiteral("NTE_BAD_KEY_STATE");
+ case 0x8009000C : return QStringLiteral("NTE_BAD_HASH_STATE");
+ case 0x8009000D : return QStringLiteral("NTE_NO_KEY");
+ case 0x8009000E : return QStringLiteral("NTE_NO_MEMORY");
+ case 0x8009000F : return QStringLiteral("NTE_EXISTS");
+ case 0x80090010 : return QStringLiteral("NTE_PERM");
+ case 0x80090011 : return QStringLiteral("NTE_NOT_FOUND");
+ case 0x80090012 : return QStringLiteral("NTE_DOUBLE_ENCRYPT");
+ case 0x80090013 : return QStringLiteral("NTE_BAD_PROVIDER");
+ case 0x80090014 : return QStringLiteral("NTE_BAD_PROV_TYPE");
+ case 0x80090015 : return QStringLiteral("NTE_BAD_PUBLIC_KEY");
+ case 0x80090016 : return QStringLiteral("NTE_BAD_KEYSET");
+ case 0x80090017 : return QStringLiteral("NTE_PROV_TYPE_NOT_DEF");
+ case 0x80090018 : return QStringLiteral("NTE_PROV_TYPE_ENTRY_BAD");
+ case 0x80090019 : return QStringLiteral("NTE_KEYSET_NOT_DEF");
+ case 0x8009001A : return QStringLiteral("NTE_KEYSET_ENTRY_BAD");
+ case 0x8009001B : return QStringLiteral("NTE_PROV_TYPE_NO_MATCH");
+ case 0x8009001C : return QStringLiteral("NTE_SIGNATURE_FILE_BAD");
+ case 0x8009001D : return QStringLiteral("NTE_PROVIDER_DLL_FAIL");
+ case 0x8009001E : return QStringLiteral("NTE_PROV_DLL_NOT_FOUND");
+ case 0x8009001F : return QStringLiteral("NTE_BAD_KEYSET_PARAM");
+ case 0x80090020 : return QStringLiteral("NTE_FAIL");
+ case 0x80090021 : return QStringLiteral("NTE_SYS_ERR");
+ case 0x80090022 : return QStringLiteral("NTE_SILENT_CONTEXT");
+ case 0x80090023 : return QStringLiteral("NTE_TOKEN_KEYSET_STORAGE_FULL");
+ case 0x80090024 : return QStringLiteral("NTE_TEMPORARY_PROFILE");
+ case 0x80090025 : return QStringLiteral("NTE_FIXEDPARAMETER");
+ case 0x80090300 : return QStringLiteral("SEC_E_INSUFFICIENT_MEMORY");
+ case 0x80090301 : return QStringLiteral("SEC_E_INVALID_HANDLE");
+ case 0x80090302 : return QStringLiteral("SEC_E_UNSUPPORTED_FUNCTION");
+ case 0x80090303 : return QStringLiteral("SEC_E_TARGET_UNKNOWN");
+ case 0x80090304 : return QStringLiteral("SEC_E_INTERNAL_ERROR");
+ case 0x80090305 : return QStringLiteral("SEC_E_SECPKG_NOT_FOUND");
+ case 0x80090306 : return QStringLiteral("SEC_E_NOT_OWNER");
+ case 0x80090307 : return QStringLiteral("SEC_E_CANNOT_INSTALL");
+ case 0x80090308 : return QStringLiteral("SEC_E_INVALID_TOKEN");
+ case 0x80090309 : return QStringLiteral("SEC_E_CANNOT_PACK");
+ case 0x8009030A : return QStringLiteral("SEC_E_QOP_NOT_SUPPORTED");
+ case 0x8009030B : return QStringLiteral("SEC_E_NO_IMPERSONATION");
+ case 0x8009030C : return QStringLiteral("SEC_E_LOGON_DENIED");
+ case 0x8009030D : return QStringLiteral("SEC_E_UNKNOWN_CREDENTIALS");
+ case 0x8009030E : return QStringLiteral("SEC_E_NO_CREDENTIALS");
+ case 0x8009030F : return QStringLiteral("SEC_E_MESSAGE_ALTERED");
+ case 0x80090310 : return QStringLiteral("SEC_E_OUT_OF_SEQUENCE");
+ case 0x80090311 : return QStringLiteral("SEC_E_NO_AUTHENTICATING_AUTHORITY");
+ case 0x00090312 : return QStringLiteral("SEC_I_CONTINUE_NEEDED");
+ case 0x00090313 : return QStringLiteral("SEC_I_COMPLETE_NEEDED");
+ case 0x00090314 : return QStringLiteral("SEC_I_COMPLETE_AND_CONTINUE");
+ case 0x00090315 : return QStringLiteral("SEC_I_LOCAL_LOGON");
+ case 0x80090316 : return QStringLiteral("SEC_E_BAD_PKGID");
+ case 0x80090317 : return QStringLiteral("SEC_E_CONTEXT_EXPIRED");
+ case 0x00090317 : return QStringLiteral("SEC_I_CONTEXT_EXPIRED");
+ case 0x80090318 : return QStringLiteral("SEC_E_INCOMPLETE_MESSAGE");
+ case 0x80090320 : return QStringLiteral("SEC_E_INCOMPLETE_CREDENTIALS");
+ case 0x80090321 : return QStringLiteral("SEC_E_BUFFER_TOO_SMALL");
+ case 0x00090320 : return QStringLiteral("SEC_I_INCOMPLETE_CREDENTIALS");
+ case 0x00090321 : return QStringLiteral("SEC_I_RENEGOTIATE");
+ case 0x80090322 : return QStringLiteral("SEC_E_WRONG_PRINCIPAL");
+ case 0x00090323 : return QStringLiteral("SEC_I_NO_LSA_CONTEXT");
+ case 0x80090324 : return QStringLiteral("SEC_E_TIME_SKEW");
+ case 0x80090325 : return QStringLiteral("SEC_E_UNTRUSTED_ROOT");
+ case 0x80090326 : return QStringLiteral("SEC_E_ILLEGAL_MESSAGE");
+ case 0x80090327 : return QStringLiteral("SEC_E_CERT_UNKNOWN");
+ case 0x80090328 : return QStringLiteral("SEC_E_CERT_EXPIRED");
+ case 0x80090329 : return QStringLiteral("SEC_E_ENCRYPT_FAILURE");
+ case 0x80090330 : return QStringLiteral("SEC_E_DECRYPT_FAILURE");
+ case 0x80090331 : return QStringLiteral("SEC_E_ALGORITHM_MISMATCH");
+ case 0x80090332 : return QStringLiteral("SEC_E_SECURITY_QOS_FAILED");
+ case 0x80090333 : return QStringLiteral("SEC_E_UNFINISHED_CONTEXT_DELETED");
+ case 0x80090334 : return QStringLiteral("SEC_E_NO_TGT_REPLY");
+ case 0x80090335 : return QStringLiteral("SEC_E_NO_IP_ADDRESSES");
+ case 0x80090336 : return QStringLiteral("SEC_E_WRONG_CREDENTIAL_HANDLE");
+ case 0x80090337 : return QStringLiteral("SEC_E_CRYPTO_SYSTEM_INVALID");
+ case 0x80090338 : return QStringLiteral("SEC_E_MAX_REFERRALS_EXCEEDED");
+ case 0x80090339 : return QStringLiteral("SEC_E_MUST_BE_KDC");
+ case 0x8009033A : return QStringLiteral("SEC_E_STRONG_CRYPTO_NOT_SUPPORTED");
+ case 0x8009033B : return QStringLiteral("SEC_E_TOO_MANY_PRINCIPALS");
+ case 0x8009033C : return QStringLiteral("SEC_E_NO_PA_DATA");
+ case 0x8009033D : return QStringLiteral("SEC_E_PKINIT_NAME_MISMATCH");
+ case 0x8009033E : return QStringLiteral("SEC_E_SMARTCARD_LOGON_REQUIRED");
+ case 0x8009033F : return QStringLiteral("SEC_E_SHUTDOWN_IN_PROGRESS");
+ case 0x80090340 : return QStringLiteral("SEC_E_KDC_INVALID_REQUEST");
+ case 0x80090341 : return QStringLiteral("SEC_E_KDC_UNABLE_TO_REFER");
+ case 0x80090342 : return QStringLiteral("SEC_E_KDC_UNKNOWN_ETYPE");
+ case 0x80090343 : return QStringLiteral("SEC_E_UNSUPPORTED_PREAUTH");
+ case 0x80090345 : return QStringLiteral("SEC_E_DELEGATION_REQUIRED");
+ case 0x80090346 : return QStringLiteral("SEC_E_BAD_BINDINGS");
+ case 0x80090347 : return QStringLiteral("SEC_E_MULTIPLE_ACCOUNTS");
+ case 0x80090348 : return QStringLiteral("SEC_E_NO_KERB_KEY");
+ case 0x80090349 : return QStringLiteral("SEC_E_CERT_WRONG_USAGE");
+ case 0x80090350 : return QStringLiteral("SEC_E_DOWNGRADE_DETECTED");
+ case 0x80090351 : return QStringLiteral("SEC_E_SMARTCARD_CERT_REVOKED");
+ case 0x80090352 : return QStringLiteral("SEC_E_ISSUING_CA_UNTRUSTED");
+ case 0x80090353 : return QStringLiteral("SEC_E_REVOCATION_OFFLINE_C");
+ case 0x80090354 : return QStringLiteral("SEC_E_PKINIT_CLIENT_FAILURE");
+ case 0x80090355 : return QStringLiteral("SEC_E_SMARTCARD_CERT_EXPIRED");
+ case 0x80090356 : return QStringLiteral("SEC_E_NO_S4U_PROT_SUPPORT");
+ case 0x80090357 : return QStringLiteral("SEC_E_CROSSREALM_DELEGATION_FAILURE");
+ case 0x80090358 : return QStringLiteral("SEC_E_REVOCATION_OFFLINE_KDC");
+ case 0x80090359 : return QStringLiteral("SEC_E_ISSUING_CA_UNTRUSTED_KDC");
+ case 0x8009035A : return QStringLiteral("SEC_E_KDC_CERT_EXPIRED");
+ case 0x8009035B : return QStringLiteral("SEC_E_KDC_CERT_REVOKED");
+ case 0x80091001 : return QStringLiteral("CRYPT_E_MSG_ERROR");
+ case 0x80091002 : return QStringLiteral("CRYPT_E_UNKNOWN_ALGO");
+ case 0x80091003 : return QStringLiteral("CRYPT_E_OID_FORMAT");
+ case 0x80091004 : return QStringLiteral("CRYPT_E_INVALID_MSG_TYPE");
+ case 0x80091005 : return QStringLiteral("CRYPT_E_UNEXPECTED_ENCODING");
+ case 0x80091006 : return QStringLiteral("CRYPT_E_AUTH_ATTR_MISSING");
+ case 0x80091007 : return QStringLiteral("CRYPT_E_HASH_VALUE");
+ case 0x80091008 : return QStringLiteral("CRYPT_E_INVALID_INDEX");
+ case 0x80091009 : return QStringLiteral("CRYPT_E_ALREADY_DECRYPTED");
+ case 0x8009100A : return QStringLiteral("CRYPT_E_NOT_DECRYPTED");
+ case 0x8009100B : return QStringLiteral("CRYPT_E_RECIPIENT_NOT_FOUND");
+ case 0x8009100C : return QStringLiteral("CRYPT_E_CONTROL_TYPE");
+ case 0x8009100D : return QStringLiteral("CRYPT_E_ISSUER_SERIALNUMBER");
+ case 0x8009100E : return QStringLiteral("CRYPT_E_SIGNER_NOT_FOUND");
+ case 0x8009100F : return QStringLiteral("CRYPT_E_ATTRIBUTES_MISSING");
+ case 0x80091010 : return QStringLiteral("CRYPT_E_STREAM_MSG_NOT_READY");
+ case 0x80091011 : return QStringLiteral("CRYPT_E_STREAM_INSUFFICIENT_DATA");
+ case 0x00091012 : return QStringLiteral("CRYPT_I_NEW_PROTECTION_REQUIRED");
+ case 0x80092001 : return QStringLiteral("CRYPT_E_BAD_LEN");
+ case 0x80092002 : return QStringLiteral("CRYPT_E_BAD_ENCODE");
+ case 0x80092003 : return QStringLiteral("CRYPT_E_FILE_ERROR");
+ case 0x80092004 : return QStringLiteral("CRYPT_E_NOT_FOUND");
+ case 0x80092005 : return QStringLiteral("CRYPT_E_EXISTS");
+ case 0x80092006 : return QStringLiteral("CRYPT_E_NO_PROVIDER");
+ case 0x80092007 : return QStringLiteral("CRYPT_E_SELF_SIGNED");
+ case 0x80092008 : return QStringLiteral("CRYPT_E_DELETED_PREV");
+ case 0x80092009 : return QStringLiteral("CRYPT_E_NO_MATCH");
+ case 0x8009200A : return QStringLiteral("CRYPT_E_UNEXPECTED_MSG_TYPE");
+ case 0x8009200B : return QStringLiteral("CRYPT_E_NO_KEY_PROPERTY");
+ case 0x8009200C : return QStringLiteral("CRYPT_E_NO_DECRYPT_CERT");
+ case 0x8009200D : return QStringLiteral("CRYPT_E_BAD_MSG");
+ case 0x8009200E : return QStringLiteral("CRYPT_E_NO_SIGNER");
+ case 0x8009200F : return QStringLiteral("CRYPT_E_PENDING_CLOSE");
+ case 0x80092010 : return QStringLiteral("CRYPT_E_REVOKED");
+ case 0x80092011 : return QStringLiteral("CRYPT_E_NO_REVOCATION_DLL");
+ case 0x80092012 : return QStringLiteral("CRYPT_E_NO_REVOCATION_CHECK");
+ case 0x80092013 : return QStringLiteral("CRYPT_E_REVOCATION_OFFLINE");
+ case 0x80092014 : return QStringLiteral("CRYPT_E_NOT_IN_REVOCATION_DATABASE");
+ case 0x80092020 : return QStringLiteral("CRYPT_E_INVALID_NUMERIC_STRING");
+ case 0x80092021 : return QStringLiteral("CRYPT_E_INVALID_PRINTABLE_STRING");
+ case 0x80092022 : return QStringLiteral("CRYPT_E_INVALID_IA5_STRING");
+ case 0x80092023 : return QStringLiteral("CRYPT_E_INVALID_X500_STRING");
+ case 0x80092024 : return QStringLiteral("CRYPT_E_NOT_CHAR_STRING");
+ case 0x80092025 : return QStringLiteral("CRYPT_E_FILERESIZED");
+ case 0x80092026 : return QStringLiteral("CRYPT_E_SECURITY_SETTINGS");
+ case 0x80092027 : return QStringLiteral("CRYPT_E_NO_VERIFY_USAGE_DLL");
+ case 0x80092028 : return QStringLiteral("CRYPT_E_NO_VERIFY_USAGE_CHECK");
+ case 0x80092029 : return QStringLiteral("CRYPT_E_VERIFY_USAGE_OFFLINE");
+ case 0x8009202A : return QStringLiteral("CRYPT_E_NOT_IN_CTL");
+ case 0x8009202B : return QStringLiteral("CRYPT_E_NO_TRUSTED_SIGNER");
+ case 0x8009202C : return QStringLiteral("CRYPT_E_MISSING_PUBKEY_PARA");
+ case 0x80093000 : return QStringLiteral("CRYPT_E_OSS_ERROR");
+ case 0x80093001 : return QStringLiteral("OSS_MORE_BUF");
+ case 0x80093002 : return QStringLiteral("OSS_NEGATIVE_UINTEGER");
+ case 0x80093003 : return QStringLiteral("OSS_PDU_RANGE");
+ case 0x80093004 : return QStringLiteral("OSS_MORE_INPUT");
+ case 0x80093005 : return QStringLiteral("OSS_DATA_ERROR");
+ case 0x80093006 : return QStringLiteral("OSS_BAD_ARG");
+ case 0x80093007 : return QStringLiteral("OSS_BAD_VERSION");
+ case 0x80093008 : return QStringLiteral("OSS_OUT_MEMORY");
+ case 0x80093009 : return QStringLiteral("OSS_PDU_MISMATCH");
+ case 0x8009300A : return QStringLiteral("OSS_LIMITED");
+ case 0x8009300B : return QStringLiteral("OSS_BAD_PTR");
+ case 0x8009300C : return QStringLiteral("OSS_BAD_TIME");
+ case 0x8009300D : return QStringLiteral("OSS_INDEFINITE_NOT_SUPPORTED");
+ case 0x8009300E : return QStringLiteral("OSS_MEM_ERROR");
+ case 0x8009300F : return QStringLiteral("OSS_BAD_TABLE");
+ case 0x80093010 : return QStringLiteral("OSS_TOO_LONG");
+ case 0x80093011 : return QStringLiteral("OSS_CONSTRAINT_VIOLATED");
+ case 0x80093012 : return QStringLiteral("OSS_FATAL_ERROR");
+ case 0x80093013 : return QStringLiteral("OSS_ACCESS_SERIALIZATION_ERROR");
+ case 0x80093014 : return QStringLiteral("OSS_NULL_TBL");
+ case 0x80093015 : return QStringLiteral("OSS_NULL_FCN");
+ case 0x80093016 : return QStringLiteral("OSS_BAD_ENCRULES");
+ case 0x80093017 : return QStringLiteral("OSS_UNAVAIL_ENCRULES");
+ case 0x80093018 : return QStringLiteral("OSS_CANT_OPEN_TRACE_WINDOW");
+ case 0x80093019 : return QStringLiteral("OSS_UNIMPLEMENTED");
+ case 0x8009301A : return QStringLiteral("OSS_OID_DLL_NOT_LINKED");
+ case 0x8009301B : return QStringLiteral("OSS_CANT_OPEN_TRACE_FILE");
+ case 0x8009301C : return QStringLiteral("OSS_TRACE_FILE_ALREADY_OPEN");
+ case 0x8009301D : return QStringLiteral("OSS_TABLE_MISMATCH");
+ case 0x8009301E : return QStringLiteral("OSS_TYPE_NOT_SUPPORTED");
+ case 0x8009301F : return QStringLiteral("OSS_REAL_DLL_NOT_LINKED");
+ case 0x80093020 : return QStringLiteral("OSS_REAL_CODE_NOT_LINKED");
+ case 0x80093021 : return QStringLiteral("OSS_OUT_OF_RANGE");
+ case 0x80093022 : return QStringLiteral("OSS_COPIER_DLL_NOT_LINKED");
+ case 0x80093023 : return QStringLiteral("OSS_CONSTRAINT_DLL_NOT_LINKED");
+ case 0x80093024 : return QStringLiteral("OSS_COMPARATOR_DLL_NOT_LINKED");
+ case 0x80093025 : return QStringLiteral("OSS_COMPARATOR_CODE_NOT_LINKED");
+ case 0x80093026 : return QStringLiteral("OSS_MEM_MGR_DLL_NOT_LINKED");
+ case 0x80093027 : return QStringLiteral("OSS_PDV_DLL_NOT_LINKED");
+ case 0x80093028 : return QStringLiteral("OSS_PDV_CODE_NOT_LINKED");
+ case 0x80093029 : return QStringLiteral("OSS_API_DLL_NOT_LINKED");
+ case 0x8009302A : return QStringLiteral("OSS_BERDER_DLL_NOT_LINKED");
+ case 0x8009302B : return QStringLiteral("OSS_PER_DLL_NOT_LINKED");
+ case 0x8009302C : return QStringLiteral("OSS_OPEN_TYPE_ERROR");
+ case 0x8009302D : return QStringLiteral("OSS_MUTEX_NOT_CREATED");
+ case 0x8009302E : return QStringLiteral("OSS_CANT_CLOSE_TRACE_FILE");
+ case 0x80093100 : return QStringLiteral("CRYPT_E_ASN1_ERROR");
+ case 0x80093101 : return QStringLiteral("CRYPT_E_ASN1_INTERNAL");
+ case 0x80093102 : return QStringLiteral("CRYPT_E_ASN1_EOD");
+ case 0x80093103 : return QStringLiteral("CRYPT_E_ASN1_CORRUPT");
+ case 0x80093104 : return QStringLiteral("CRYPT_E_ASN1_LARGE");
+ case 0x80093105 : return QStringLiteral("CRYPT_E_ASN1_CONSTRAINT");
+ case 0x80093106 : return QStringLiteral("CRYPT_E_ASN1_MEMORY");
+ case 0x80093107 : return QStringLiteral("CRYPT_E_ASN1_OVERFLOW");
+ case 0x80093108 : return QStringLiteral("CRYPT_E_ASN1_BADPDU");
+ case 0x80093109 : return QStringLiteral("CRYPT_E_ASN1_BADARGS");
+ case 0x8009310A : return QStringLiteral("CRYPT_E_ASN1_BADREAL");
+ case 0x8009310B : return QStringLiteral("CRYPT_E_ASN1_BADTAG");
+ case 0x8009310C : return QStringLiteral("CRYPT_E_ASN1_CHOICE");
+ case 0x8009310D : return QStringLiteral("CRYPT_E_ASN1_RULE");
+ case 0x8009310E : return QStringLiteral("CRYPT_E_ASN1_UTF8");
+ case 0x80093133 : return QStringLiteral("CRYPT_E_ASN1_PDU_TYPE");
+ case 0x80093134 : return QStringLiteral("CRYPT_E_ASN1_NYI");
+ case 0x80093201 : return QStringLiteral("CRYPT_E_ASN1_EXTENDED");
+ case 0x80093202 : return QStringLiteral("CRYPT_E_ASN1_NOEOD");
+ case 0x80094001 : return QStringLiteral("CERTSRV_E_BAD_REQUESTSUBJECT");
+ case 0x80094002 : return QStringLiteral("CERTSRV_E_NO_REQUEST");
+ case 0x80094003 : return QStringLiteral("CERTSRV_E_BAD_REQUESTSTATUS");
+ case 0x80094004 : return QStringLiteral("CERTSRV_E_PROPERTY_EMPTY");
+ case 0x80094005 : return QStringLiteral("CERTSRV_E_INVALID_CA_CERTIFICATE");
+ case 0x80094006 : return QStringLiteral("CERTSRV_E_SERVER_SUSPENDED");
+ case 0x80094007 : return QStringLiteral("CERTSRV_E_ENCODING_LENGTH");
+ case 0x80094008 : return QStringLiteral("CERTSRV_E_ROLECONFLICT");
+ case 0x80094009 : return QStringLiteral("CERTSRV_E_RESTRICTEDOFFICER");
+ case 0x8009400A : return QStringLiteral("CERTSRV_E_KEY_ARCHIVAL_NOT_CONFIGURED");
+ case 0x8009400B : return QStringLiteral("CERTSRV_E_NO_VALID_KRA");
+ case 0x8009400C : return QStringLiteral("CERTSRV_E_BAD_REQUEST_KEY_ARCHIVAL");
+ case 0x8009400D : return QStringLiteral("CERTSRV_E_NO_CAADMIN_DEFINED");
+ case 0x8009400E : return QStringLiteral("CERTSRV_E_BAD_RENEWAL_CERT_ATTRIBUTE");
+ case 0x8009400F : return QStringLiteral("CERTSRV_E_NO_DB_SESSIONS");
+ case 0x80094010 : return QStringLiteral("CERTSRV_E_ALIGNMENT_FAULT");
+ case 0x80094011 : return QStringLiteral("CERTSRV_E_ENROLL_DENIED");
+ case 0x80094012 : return QStringLiteral("CERTSRV_E_TEMPLATE_DENIED");
+ case 0x80094013 : return QStringLiteral("CERTSRV_E_DOWNLEVEL_DC_SSL_OR_UPGRADE");
+ case 0x80094800 : return QStringLiteral("CERTSRV_E_UNSUPPORTED_CERT_TYPE");
+ case 0x80094801 : return QStringLiteral("CERTSRV_E_NO_CERT_TYPE");
+ case 0x80094802 : return QStringLiteral("CERTSRV_E_TEMPLATE_CONFLICT");
+ case 0x80094803 : return QStringLiteral("CERTSRV_E_SUBJECT_ALT_NAME_REQUIRED");
+ case 0x80094804 : return QStringLiteral("CERTSRV_E_ARCHIVED_KEY_REQUIRED");
+ case 0x80094805 : return QStringLiteral("CERTSRV_E_SMIME_REQUIRED");
+ case 0x80094806 : return QStringLiteral("CERTSRV_E_BAD_RENEWAL_SUBJECT");
+ case 0x80094807 : return QStringLiteral("CERTSRV_E_BAD_TEMPLATE_VERSION");
+ case 0x80094808 : return QStringLiteral("CERTSRV_E_TEMPLATE_POLICY_REQUIRED");
+ case 0x80094809 : return QStringLiteral("CERTSRV_E_SIGNATURE_POLICY_REQUIRED");
+ case 0x8009480A : return QStringLiteral("CERTSRV_E_SIGNATURE_COUNT");
+ case 0x8009480B : return QStringLiteral("CERTSRV_E_SIGNATURE_REJECTED");
+ case 0x8009480C : return QStringLiteral("CERTSRV_E_ISSUANCE_POLICY_REQUIRED");
+ case 0x8009480D : return QStringLiteral("CERTSRV_E_SUBJECT_UPN_REQUIRED");
+ case 0x8009480E : return QStringLiteral("CERTSRV_E_SUBJECT_DIRECTORY_GUID_REQUIRED");
+ case 0x8009480F : return QStringLiteral("CERTSRV_E_SUBJECT_DNS_REQUIRED");
+ case 0x80094810 : return QStringLiteral("CERTSRV_E_ARCHIVED_KEY_UNEXPECTED");
+ case 0x80094811 : return QStringLiteral("CERTSRV_E_KEY_LENGTH");
+ case 0x80094812 : return QStringLiteral("CERTSRV_E_SUBJECT_EMAIL_REQUIRED");
+ case 0x80094813 : return QStringLiteral("CERTSRV_E_UNKNOWN_CERT_TYPE");
+ case 0x80094814 : return QStringLiteral("CERTSRV_E_CERT_TYPE_OVERLAP");
+ case 0x80095000 : return QStringLiteral("XENROLL_E_KEY_NOT_EXPORTABLE");
+ case 0x80095001 : return QStringLiteral("XENROLL_E_CANNOT_ADD_ROOT_CERT");
+ case 0x80095002 : return QStringLiteral("XENROLL_E_RESPONSE_KA_HASH_NOT_FOUND");
+ case 0x80095003 : return QStringLiteral("XENROLL_E_RESPONSE_UNEXPECTED_KA_HASH");
+ case 0x80095004 : return QStringLiteral("XENROLL_E_RESPONSE_KA_HASH_MISMATCH");
+ case 0x80095005 : return QStringLiteral("XENROLL_E_KEYSPEC_SMIME_MISMATCH");
+ case 0x80096001 : return QStringLiteral("TRUST_E_SYSTEM_ERROR");
+ case 0x80096002 : return QStringLiteral("TRUST_E_NO_SIGNER_CERT");
+ case 0x80096003 : return QStringLiteral("TRUST_E_COUNTER_SIGNER");
+ case 0x80096004 : return QStringLiteral("TRUST_E_CERT_SIGNATURE");
+ case 0x80096005 : return QStringLiteral("TRUST_E_TIME_STAMP");
+ case 0x80096010 : return QStringLiteral("TRUST_E_BAD_DIGEST");
+ case 0x80096019 : return QStringLiteral("TRUST_E_BASIC_CONSTRAINTS");
+ case 0x8009601E : return QStringLiteral("TRUST_E_FINANCIAL_CRITERIA");
+ case 0x80097001 : return QStringLiteral("MSSIPOTF_E_OUTOFMEMRANGE");
+ case 0x80097002 : return QStringLiteral("MSSIPOTF_E_CANTGETOBJECT");
+ case 0x80097003 : return QStringLiteral("MSSIPOTF_E_NOHEADTABLE");
+ case 0x80097004 : return QStringLiteral("MSSIPOTF_E_BAD_MAGICNUMBER");
+ case 0x80097005 : return QStringLiteral("MSSIPOTF_E_BAD_OFFSET_TABLE");
+ case 0x80097006 : return QStringLiteral("MSSIPOTF_E_TABLE_TAGORDER");
+ case 0x80097007 : return QStringLiteral("MSSIPOTF_E_TABLE_LONGWORD");
+ case 0x80097008 : return QStringLiteral("MSSIPOTF_E_BAD_FIRST_TABLE_PLACEMENT");
+ case 0x80097009 : return QStringLiteral("MSSIPOTF_E_TABLES_OVERLAP");
+ case 0x8009700A : return QStringLiteral("MSSIPOTF_E_TABLE_PADBYTES");
+ case 0x8009700B : return QStringLiteral("MSSIPOTF_E_FILETOOSMALL");
+ case 0x8009700C : return QStringLiteral("MSSIPOTF_E_TABLE_CHECKSUM");
+ case 0x8009700D : return QStringLiteral("MSSIPOTF_E_FILE_CHECKSUM");
+ case 0x80097010 : return QStringLiteral("MSSIPOTF_E_FAILED_POLICY");
+ case 0x80097011 : return QStringLiteral("MSSIPOTF_E_FAILED_HINTS_CHECK");
+ case 0x80097012 : return QStringLiteral("MSSIPOTF_E_NOT_OPENTYPE");
+ case 0x80097013 : return QStringLiteral("MSSIPOTF_E_FILE");
+ case 0x80097014 : return QStringLiteral("MSSIPOTF_E_CRYPT");
+ case 0x80097015 : return QStringLiteral("MSSIPOTF_E_BADVERSION");
+ case 0x80097016 : return QStringLiteral("MSSIPOTF_E_DSIG_STRUCTURE");
+ case 0x80097017 : return QStringLiteral("MSSIPOTF_E_PCONST_CHECK");
+ case 0x80097018 : return QStringLiteral("MSSIPOTF_E_STRUCTURE");
+ case 0x800B0001 : return QStringLiteral("TRUST_E_PROVIDER_UNKNOWN");
+ case 0x800B0002 : return QStringLiteral("TRUST_E_ACTION_UNKNOWN");
+ case 0x800B0003 : return QStringLiteral("TRUST_E_SUBJECT_FORM_UNKNOWN");
+ case 0x800B0004 : return QStringLiteral("TRUST_E_SUBJECT_NOT_TRUSTED");
+ case 0x800B0005 : return QStringLiteral("DIGSIG_E_ENCODE");
+ case 0x800B0006 : return QStringLiteral("DIGSIG_E_DECODE");
+ case 0x800B0007 : return QStringLiteral("DIGSIG_E_EXTENSIBILITY");
+ case 0x800B0008 : return QStringLiteral("DIGSIG_E_CRYPTO");
+ case 0x800B0009 : return QStringLiteral("PERSIST_E_SIZEDEFINITE");
+ case 0x800B000A : return QStringLiteral("PERSIST_E_SIZEINDEFINITE");
+ case 0x800B000B : return QStringLiteral("PERSIST_E_NOTSELFSIZING");
+ case 0x800B0100 : return QStringLiteral("TRUST_E_NOSIGNATURE");
+ case 0x800B0101 : return QStringLiteral("CERT_E_EXPIRED");
+ case 0x800B0102 : return QStringLiteral("CERT_E_VALIDITYPERIODNESTING");
+ case 0x800B0103 : return QStringLiteral("CERT_E_ROLE");
+ case 0x800B0104 : return QStringLiteral("CERT_E_PATHLENCONST");
+ case 0x800B0105 : return QStringLiteral("CERT_E_CRITICAL");
+ case 0x800B0106 : return QStringLiteral("CERT_E_PURPOSE");
+ case 0x800B0107 : return QStringLiteral("CERT_E_ISSUERCHAINING");
+ case 0x800B0108 : return QStringLiteral("CERT_E_MALFORMED");
+ case 0x800B0109 : return QStringLiteral("CERT_E_UNTRUSTEDROOT");
+ case 0x800B010A : return QStringLiteral("CERT_E_CHAINING");
+ case 0x800B010B : return QStringLiteral("TRUST_E_FAIL");
+ case 0x800B010C : return QStringLiteral("CERT_E_REVOKED");
+ case 0x800B010D : return QStringLiteral("CERT_E_UNTRUSTEDTESTROOT");
+ case 0x800B010E : return QStringLiteral("CERT_E_REVOCATION_FAILURE");
+ case 0x800B010F : return QStringLiteral("CERT_E_CN_NO_MATCH");
+ case 0x800B0110 : return QStringLiteral("CERT_E_WRONG_USAGE");
+ case 0x800B0111 : return QStringLiteral("TRUST_E_EXPLICIT_DISTRUST");
+ case 0x800B0112 : return QStringLiteral("CERT_E_UNTRUSTEDCA");
+ case 0x800B0113 : return QStringLiteral("CERT_E_INVALID_POLICY");
+ case 0x800B0114 : return QStringLiteral("CERT_E_INVALID_NAME");
+ case 0x800F0000 : return QStringLiteral("SPAPI_E_EXPECTED_SECTION_NAME");
+ case 0x800F0001 : return QStringLiteral("SPAPI_E_BAD_SECTION_NAME_LINE");
+ case 0x800F0002 : return QStringLiteral("SPAPI_E_SECTION_NAME_TOO_LONG");
+ case 0x800F0003 : return QStringLiteral("SPAPI_E_GENERAL_SYNTAX");
+ case 0x800F0100 : return QStringLiteral("SPAPI_E_WRONG_INF_STYLE");
+ case 0x800F0101 : return QStringLiteral("SPAPI_E_SECTION_NOT_FOUND");
+ case 0x800F0102 : return QStringLiteral("SPAPI_E_LINE_NOT_FOUND");
+ case 0x800F0103 : return QStringLiteral("SPAPI_E_NO_BACKUP");
+ case 0x800F0200 : return QStringLiteral("SPAPI_E_NO_ASSOCIATED_CLASS");
+ case 0x800F0201 : return QStringLiteral("SPAPI_E_CLASS_MISMATCH");
+ case 0x800F0202 : return QStringLiteral("SPAPI_E_DUPLICATE_FOUND");
+ case 0x800F0203 : return QStringLiteral("SPAPI_E_NO_DRIVER_SELECTED");
+ case 0x800F0204 : return QStringLiteral("SPAPI_E_KEY_DOES_NOT_EXIST");
+ case 0x800F0205 : return QStringLiteral("SPAPI_E_INVALID_DEVINST_NAME");
+ case 0x800F0206 : return QStringLiteral("SPAPI_E_INVALID_CLASS");
+ case 0x800F0207 : return QStringLiteral("SPAPI_E_DEVINST_ALREADY_EXISTS");
+ case 0x800F0208 : return QStringLiteral("SPAPI_E_DEVINFO_NOT_REGISTERED");
+ case 0x800F0209 : return QStringLiteral("SPAPI_E_INVALID_REG_PROPERTY");
+ case 0x800F020A : return QStringLiteral("SPAPI_E_NO_INF");
+ case 0x800F020B : return QStringLiteral("SPAPI_E_NO_SUCH_DEVINST");
+ case 0x800F020C : return QStringLiteral("SPAPI_E_CANT_LOAD_CLASS_ICON");
+ case 0x800F020D : return QStringLiteral("SPAPI_E_INVALID_CLASS_INSTALLER");
+ case 0x800F020E : return QStringLiteral("SPAPI_E_DI_DO_DEFAULT");
+ case 0x800F020F : return QStringLiteral("SPAPI_E_DI_NOFILECOPY");
+ case 0x800F0210 : return QStringLiteral("SPAPI_E_INVALID_HWPROFILE");
+ case 0x800F0211 : return QStringLiteral("SPAPI_E_NO_DEVICE_SELECTED");
+ case 0x800F0212 : return QStringLiteral("SPAPI_E_DEVINFO_LIST_LOCKED");
+ case 0x800F0213 : return QStringLiteral("SPAPI_E_DEVINFO_DATA_LOCKED");
+ case 0x800F0214 : return QStringLiteral("SPAPI_E_DI_BAD_PATH");
+ case 0x800F0215 : return QStringLiteral("SPAPI_E_NO_CLASSINSTALL_PARAMS");
+ case 0x800F0216 : return QStringLiteral("SPAPI_E_FILEQUEUE_LOCKED");
+ case 0x800F0217 : return QStringLiteral("SPAPI_E_BAD_SERVICE_INSTALLSECT");
+ case 0x800F0218 : return QStringLiteral("SPAPI_E_NO_CLASS_DRIVER_LIST");
+ case 0x800F0219 : return QStringLiteral("SPAPI_E_NO_ASSOCIATED_SERVICE");
+ case 0x800F021A : return QStringLiteral("SPAPI_E_NO_DEFAULT_DEVICE_INTERFACE");
+ case 0x800F021B : return QStringLiteral("SPAPI_E_DEVICE_INTERFACE_ACTIVE");
+ case 0x800F021C : return QStringLiteral("SPAPI_E_DEVICE_INTERFACE_REMOVED");
+ case 0x800F021D : return QStringLiteral("SPAPI_E_BAD_INTERFACE_INSTALLSECT");
+ case 0x800F021E : return QStringLiteral("SPAPI_E_NO_SUCH_INTERFACE_CLASS");
+ case 0x800F021F : return QStringLiteral("SPAPI_E_INVALID_REFERENCE_STRING");
+ case 0x800F0220 : return QStringLiteral("SPAPI_E_INVALID_MACHINENAME");
+ case 0x800F0221 : return QStringLiteral("SPAPI_E_REMOTE_COMM_FAILURE");
+ case 0x800F0222 : return QStringLiteral("SPAPI_E_MACHINE_UNAVAILABLE");
+ case 0x800F0223 : return QStringLiteral("SPAPI_E_NO_CONFIGMGR_SERVICES");
+ case 0x800F0224 : return QStringLiteral("SPAPI_E_INVALID_PROPPAGE_PROVIDER");
+ case 0x800F0225 : return QStringLiteral("SPAPI_E_NO_SUCH_DEVICE_INTERFACE");
+ case 0x800F0226 : return QStringLiteral("SPAPI_E_DI_POSTPROCESSING_REQUIRED");
+ case 0x800F0227 : return QStringLiteral("SPAPI_E_INVALID_COINSTALLER");
+ case 0x800F0228 : return QStringLiteral("SPAPI_E_NO_COMPAT_DRIVERS");
+ case 0x800F0229 : return QStringLiteral("SPAPI_E_NO_DEVICE_ICON");
+ case 0x800F022A : return QStringLiteral("SPAPI_E_INVALID_INF_LOGCONFIG");
+ case 0x800F022B : return QStringLiteral("SPAPI_E_DI_DONT_INSTALL");
+ case 0x800F022C : return QStringLiteral("SPAPI_E_INVALID_FILTER_DRIVER");
+ case 0x800F022D : return QStringLiteral("SPAPI_E_NON_WINDOWS_NT_DRIVER");
+ case 0x800F022E : return QStringLiteral("SPAPI_E_NON_WINDOWS_DRIVER");
+ case 0x800F022F : return QStringLiteral("SPAPI_E_NO_CATALOG_FOR_OEM_INF");
+ case 0x800F0230 : return QStringLiteral("SPAPI_E_DEVINSTALL_QUEUE_NONNATIVE");
+ case 0x800F0231 : return QStringLiteral("SPAPI_E_NOT_DISABLEABLE");
+ case 0x800F0232 : return QStringLiteral("SPAPI_E_CANT_REMOVE_DEVINST");
+ case 0x800F0233 : return QStringLiteral("SPAPI_E_INVALID_TARGET");
+ case 0x800F0234 : return QStringLiteral("SPAPI_E_DRIVER_NONNATIVE");
+ case 0x800F0235 : return QStringLiteral("SPAPI_E_IN_WOW64");
+ case 0x800F0236 : return QStringLiteral("SPAPI_E_SET_SYSTEM_RESTORE_POINT");
+ case 0x800F0237 : return QStringLiteral("SPAPI_E_INCORRECTLY_COPIED_INF");
+ case 0x800F0238 : return QStringLiteral("SPAPI_E_SCE_DISABLED");
+ case 0x800F0239 : return QStringLiteral("SPAPI_E_UNKNOWN_EXCEPTION");
+ case 0x800F023A : return QStringLiteral("SPAPI_E_PNP_REGISTRY_ERROR");
+ case 0x800F023B : return QStringLiteral("SPAPI_E_REMOTE_REQUEST_UNSUPPORTED");
+ case 0x800F023C : return QStringLiteral("SPAPI_E_NOT_AN_INSTALLED_OEM_INF");
+ case 0x800F023D : return QStringLiteral("SPAPI_E_INF_IN_USE_BY_DEVICES");
+ case 0x800F023E : return QStringLiteral("SPAPI_E_DI_FUNCTION_OBSOLETE");
+ case 0x800F023F : return QStringLiteral("SPAPI_E_NO_AUTHENTICODE_CATALOG");
+ case 0x800F0240 : return QStringLiteral("SPAPI_E_AUTHENTICODE_DISALLOWED");
+ case 0x800F0241 : return QStringLiteral("SPAPI_E_AUTHENTICODE_TRUSTED_PUBLISHER");
+ case 0x800F0242 : return QStringLiteral("SPAPI_E_AUTHENTICODE_TRUST_NOT_ESTABLISHED");
+ case 0x800F0243 : return QStringLiteral("SPAPI_E_AUTHENTICODE_PUBLISHER_NOT_TRUSTED");
+ case 0x800F0244 : return QStringLiteral("SPAPI_E_SIGNATURE_OSATTRIBUTE_MISMATCH");
+ case 0x800F0245 : return QStringLiteral("SPAPI_E_ONLY_VALIDATE_VIA_AUTHENTICODE");
+ case 0x800F0300 : return QStringLiteral("SPAPI_E_UNRECOVERABLE_STACK_OVERFLOW");
+ case 0x800F1000 : return QStringLiteral("SPAPI_E_ERROR_NOT_INSTALLED");
+ case 0x80100001 : return QStringLiteral("SCARD_F_INTERNAL_ERROR");
+ case 0x80100002 : return QStringLiteral("SCARD_E_CANCELLED");
+ case 0x80100003 : return QStringLiteral("SCARD_E_INVALID_HANDLE");
+ case 0x80100004 : return QStringLiteral("SCARD_E_INVALID_PARAMETER");
+ case 0x80100005 : return QStringLiteral("SCARD_E_INVALID_TARGET");
+ case 0x80100006 : return QStringLiteral("SCARD_E_NO_MEMORY");
+ case 0x80100007 : return QStringLiteral("SCARD_F_WAITED_TOO_LONG");
+ case 0x80100008 : return QStringLiteral("SCARD_E_INSUFFICIENT_BUFFER");
+ case 0x80100009 : return QStringLiteral("SCARD_E_UNKNOWN_READER");
+ case 0x8010000A : return QStringLiteral("SCARD_E_TIMEOUT");
+ case 0x8010000B : return QStringLiteral("SCARD_E_SHARING_VIOLATION");
+ case 0x8010000C : return QStringLiteral("SCARD_E_NO_SMARTCARD");
+ case 0x8010000D : return QStringLiteral("SCARD_E_UNKNOWN_CARD");
+ case 0x8010000E : return QStringLiteral("SCARD_E_CANT_DISPOSE");
+ case 0x8010000F : return QStringLiteral("SCARD_E_PROTO_MISMATCH");
+ case 0x80100010 : return QStringLiteral("SCARD_E_NOT_READY");
+ case 0x80100011 : return QStringLiteral("SCARD_E_INVALID_VALUE");
+ case 0x80100012 : return QStringLiteral("SCARD_E_SYSTEM_CANCELLED");
+ case 0x80100013 : return QStringLiteral("SCARD_F_COMM_ERROR");
+ case 0x80100014 : return QStringLiteral("SCARD_F_UNKNOWN_ERROR");
+ case 0x80100015 : return QStringLiteral("SCARD_E_INVALID_ATR");
+ case 0x80100016 : return QStringLiteral("SCARD_E_NOT_TRANSACTED");
+ case 0x80100017 : return QStringLiteral("SCARD_E_READER_UNAVAILABLE");
+ case 0x80100018 : return QStringLiteral("SCARD_P_SHUTDOWN");
+ case 0x80100019 : return QStringLiteral("SCARD_E_PCI_TOO_SMALL");
+ case 0x8010001A : return QStringLiteral("SCARD_E_READER_UNSUPPORTED");
+ case 0x8010001B : return QStringLiteral("SCARD_E_DUPLICATE_READER");
+ case 0x8010001C : return QStringLiteral("SCARD_E_CARD_UNSUPPORTED");
+ case 0x8010001D : return QStringLiteral("SCARD_E_NO_SERVICE");
+ case 0x8010001E : return QStringLiteral("SCARD_E_SERVICE_STOPPED");
+ case 0x8010001F : return QStringLiteral("SCARD_E_UNEXPECTED");
+ case 0x80100020 : return QStringLiteral("SCARD_E_ICC_INSTALLATION");
+ case 0x80100021 : return QStringLiteral("SCARD_E_ICC_CREATEORDER");
+ case 0x80100022 : return QStringLiteral("SCARD_E_UNSUPPORTED_FEATURE");
+ case 0x80100023 : return QStringLiteral("SCARD_E_DIR_NOT_FOUND");
+ case 0x80100024 : return QStringLiteral("SCARD_E_FILE_NOT_FOUND");
+ case 0x80100025 : return QStringLiteral("SCARD_E_NO_DIR");
+ case 0x80100026 : return QStringLiteral("SCARD_E_NO_FILE");
+ case 0x80100027 : return QStringLiteral("SCARD_E_NO_ACCESS");
+ case 0x80100028 : return QStringLiteral("SCARD_E_WRITE_TOO_MANY");
+ case 0x80100029 : return QStringLiteral("SCARD_E_BAD_SEEK");
+ case 0x8010002A : return QStringLiteral("SCARD_E_INVALID_CHV");
+ case 0x8010002B : return QStringLiteral("SCARD_E_UNKNOWN_RES_MNG");
+ case 0x8010002C : return QStringLiteral("SCARD_E_NO_SUCH_CERTIFICATE");
+ case 0x8010002D : return QStringLiteral("SCARD_E_CERTIFICATE_UNAVAILABLE");
+ case 0x8010002E : return QStringLiteral("SCARD_E_NO_READERS_AVAILABLE");
+ case 0x8010002F : return QStringLiteral("SCARD_E_COMM_DATA_LOST");
+ case 0x80100030 : return QStringLiteral("SCARD_E_NO_KEY_CONTAINER");
+ case 0x80100031 : return QStringLiteral("SCARD_E_SERVER_TOO_BUSY");
+ case 0x80100065 : return QStringLiteral("SCARD_W_UNSUPPORTED_CARD");
+ case 0x80100066 : return QStringLiteral("SCARD_W_UNRESPONSIVE_CARD");
+ case 0x80100067 : return QStringLiteral("SCARD_W_UNPOWERED_CARD");
+ case 0x80100068 : return QStringLiteral("SCARD_W_RESET_CARD");
+ case 0x80100069 : return QStringLiteral("SCARD_W_REMOVED_CARD");
+ case 0x8010006A : return QStringLiteral("SCARD_W_SECURITY_VIOLATION");
+ case 0x8010006B : return QStringLiteral("SCARD_W_WRONG_CHV");
+ case 0x8010006C : return QStringLiteral("SCARD_W_CHV_BLOCKED");
+ case 0x8010006D : return QStringLiteral("SCARD_W_EOF");
+ case 0x8010006E : return QStringLiteral("SCARD_W_CANCELLED_BY_USER");
+ case 0x8010006F : return QStringLiteral("SCARD_W_CARD_NOT_AUTHENTICATED");
+ case 0x80100070 : return QStringLiteral("SCARD_W_CACHE_ITEM_NOT_FOUND");
+ case 0x80100071 : return QStringLiteral("SCARD_W_CACHE_ITEM_STALE");
+ case 0x80110401 : return QStringLiteral("COMADMIN_E_OBJECTERRORS");
+ case 0x80110402 : return QStringLiteral("COMADMIN_E_OBJECTINVALID");
+ case 0x80110403 : return QStringLiteral("COMADMIN_E_KEYMISSING");
+ case 0x80110404 : return QStringLiteral("COMADMIN_E_ALREADYINSTALLED");
+ case 0x80110407 : return QStringLiteral("COMADMIN_E_APP_FILE_WRITEFAIL");
+ case 0x80110408 : return QStringLiteral("COMADMIN_E_APP_FILE_READFAIL");
+ case 0x80110409 : return QStringLiteral("COMADMIN_E_APP_FILE_VERSION");
+ case 0x8011040A : return QStringLiteral("COMADMIN_E_BADPATH");
+ case 0x8011040B : return QStringLiteral("COMADMIN_E_APPLICATIONEXISTS");
+ case 0x8011040C : return QStringLiteral("COMADMIN_E_ROLEEXISTS");
+ case 0x8011040D : return QStringLiteral("COMADMIN_E_CANTCOPYFILE");
+ case 0x8011040F : return QStringLiteral("COMADMIN_E_NOUSER");
+ case 0x80110410 : return QStringLiteral("COMADMIN_E_INVALIDUSERIDS");
+ case 0x80110411 : return QStringLiteral("COMADMIN_E_NOREGISTRYCLSID");
+ case 0x80110412 : return QStringLiteral("COMADMIN_E_BADREGISTRYPROGID");
+ case 0x80110413 : return QStringLiteral("COMADMIN_E_AUTHENTICATIONLEVEL");
+ case 0x80110414 : return QStringLiteral("COMADMIN_E_USERPASSWDNOTVALID");
+ case 0x80110418 : return QStringLiteral("COMADMIN_E_CLSIDORIIDMISMATCH");
+ case 0x80110419 : return QStringLiteral("COMADMIN_E_REMOTEINTERFACE");
+ case 0x8011041A : return QStringLiteral("COMADMIN_E_DLLREGISTERSERVER");
+ case 0x8011041B : return QStringLiteral("COMADMIN_E_NOSERVERSHARE");
+ case 0x8011041D : return QStringLiteral("COMADMIN_E_DLLLOADFAILED");
+ case 0x8011041E : return QStringLiteral("COMADMIN_E_BADREGISTRYLIBID");
+ case 0x8011041F : return QStringLiteral("COMADMIN_E_APPDIRNOTFOUND");
+ case 0x80110423 : return QStringLiteral("COMADMIN_E_REGISTRARFAILED");
+ case 0x80110424 : return QStringLiteral("COMADMIN_E_COMPFILE_DOESNOTEXIST");
+ case 0x80110425 : return QStringLiteral("COMADMIN_E_COMPFILE_LOADDLLFAIL");
+ case 0x80110426 : return QStringLiteral("COMADMIN_E_COMPFILE_GETCLASSOBJ");
+ case 0x80110427 : return QStringLiteral("COMADMIN_E_COMPFILE_CLASSNOTAVAIL");
+ case 0x80110428 : return QStringLiteral("COMADMIN_E_COMPFILE_BADTLB");
+ case 0x80110429 : return QStringLiteral("COMADMIN_E_COMPFILE_NOTINSTALLABLE");
+ case 0x8011042A : return QStringLiteral("COMADMIN_E_NOTCHANGEABLE");
+ case 0x8011042B : return QStringLiteral("COMADMIN_E_NOTDELETEABLE");
+ case 0x8011042C : return QStringLiteral("COMADMIN_E_SESSION");
+ case 0x8011042D : return QStringLiteral("COMADMIN_E_COMP_MOVE_LOCKED");
+ case 0x8011042E : return QStringLiteral("COMADMIN_E_COMP_MOVE_BAD_DEST");
+ case 0x80110430 : return QStringLiteral("COMADMIN_E_REGISTERTLB");
+ case 0x80110433 : return QStringLiteral("COMADMIN_E_SYSTEMAPP");
+ case 0x80110434 : return QStringLiteral("COMADMIN_E_COMPFILE_NOREGISTRAR");
+ case 0x80110435 : return QStringLiteral("COMADMIN_E_COREQCOMPINSTALLED");
+ case 0x80110436 : return QStringLiteral("COMADMIN_E_SERVICENOTINSTALLED");
+ case 0x80110437 : return QStringLiteral("COMADMIN_E_PROPERTYSAVEFAILED");
+ case 0x80110438 : return QStringLiteral("COMADMIN_E_OBJECTEXISTS");
+ case 0x80110439 : return QStringLiteral("COMADMIN_E_COMPONENTEXISTS");
+ case 0x8011043B : return QStringLiteral("COMADMIN_E_REGFILE_CORRUPT");
+ case 0x8011043C : return QStringLiteral("COMADMIN_E_PROPERTY_OVERFLOW");
+ case 0x8011043E : return QStringLiteral("COMADMIN_E_NOTINREGISTRY");
+ case 0x8011043F : return QStringLiteral("COMADMIN_E_OBJECTNOTPOOLABLE");
+ case 0x80110446 : return QStringLiteral("COMADMIN_E_APPLID_MATCHES_CLSID");
+ case 0x80110447 : return QStringLiteral("COMADMIN_E_ROLE_DOES_NOT_EXIST");
+ case 0x80110448 : return QStringLiteral("COMADMIN_E_START_APP_NEEDS_COMPONENTS");
+ case 0x80110449 : return QStringLiteral("COMADMIN_E_REQUIRES_DIFFERENT_PLATFORM");
+ case 0x8011044A : return QStringLiteral("COMADMIN_E_CAN_NOT_EXPORT_APP_PROXY");
+ case 0x8011044B : return QStringLiteral("COMADMIN_E_CAN_NOT_START_APP");
+ case 0x8011044C : return QStringLiteral("COMADMIN_E_CAN_NOT_EXPORT_SYS_APP");
+ case 0x8011044D : return QStringLiteral("COMADMIN_E_CANT_SUBSCRIBE_TO_COMPONENT");
+ case 0x8011044E : return QStringLiteral("COMADMIN_E_EVENTCLASS_CANT_BE_SUBSCRIBER");
+ case 0x8011044F : return QStringLiteral("COMADMIN_E_LIB_APP_PROXY_INCOMPATIBLE");
+ case 0x80110450 : return QStringLiteral("COMADMIN_E_BASE_PARTITION_ONLY");
+ case 0x80110451 : return QStringLiteral("COMADMIN_E_START_APP_DISABLED");
+ case 0x80110457 : return QStringLiteral("COMADMIN_E_CAT_DUPLICATE_PARTITION_NAME");
+ case 0x80110458 : return QStringLiteral("COMADMIN_E_CAT_INVALID_PARTITION_NAME");
+ case 0x80110459 : return QStringLiteral("COMADMIN_E_CAT_PARTITION_IN_USE");
+ case 0x8011045A : return QStringLiteral("COMADMIN_E_FILE_PARTITION_DUPLICATE_FILES");
+ case 0x8011045B : return QStringLiteral("COMADMIN_E_CAT_IMPORTED_COMPONENTS_NOT_ALLOWED");
+ case 0x8011045C : return QStringLiteral("COMADMIN_E_AMBIGUOUS_APPLICATION_NAME");
+ case 0x8011045D : return QStringLiteral("COMADMIN_E_AMBIGUOUS_PARTITION_NAME");
+ case 0x80110472 : return QStringLiteral("COMADMIN_E_REGDB_NOTINITIALIZED");
+ case 0x80110473 : return QStringLiteral("COMADMIN_E_REGDB_NOTOPEN");
+ case 0x80110474 : return QStringLiteral("COMADMIN_E_REGDB_SYSTEMERR");
+ case 0x80110475 : return QStringLiteral("COMADMIN_E_REGDB_ALREADYRUNNING");
+ case 0x80110480 : return QStringLiteral("COMADMIN_E_MIG_VERSIONNOTSUPPORTED");
+ case 0x80110481 : return QStringLiteral("COMADMIN_E_MIG_SCHEMANOTFOUND");
+ case 0x80110482 : return QStringLiteral("COMADMIN_E_CAT_BITNESSMISMATCH");
+ case 0x80110483 : return QStringLiteral("COMADMIN_E_CAT_UNACCEPTABLEBITNESS");
+ case 0x80110484 : return QStringLiteral("COMADMIN_E_CAT_WRONGAPPBITNESS");
+ case 0x80110485 : return QStringLiteral("COMADMIN_E_CAT_PAUSE_RESUME_NOT_SUPPORTED");
+ case 0x80110486 : return QStringLiteral("COMADMIN_E_CAT_SERVERFAULT");
+ case 0x80110600 : return QStringLiteral("COMQC_E_APPLICATION_NOT_QUEUED");
+ case 0x80110601 : return QStringLiteral("COMQC_E_NO_QUEUEABLE_INTERFACES");
+ case 0x80110602 : return QStringLiteral("COMQC_E_QUEUING_SERVICE_NOT_AVAILABLE");
+ case 0x80110603 : return QStringLiteral("COMQC_E_NO_IPERSISTSTREAM");
+ case 0x80110604 : return QStringLiteral("COMQC_E_BAD_MESSAGE");
+ case 0x80110605 : return QStringLiteral("COMQC_E_UNAUTHENTICATED");
+ case 0x80110606 : return QStringLiteral("COMQC_E_UNTRUSTED_ENQUEUER");
+ case 0x80110701 : return QStringLiteral("MSDTC_E_DUPLICATE_RESOURCE");
+ case 0x80110808 : return QStringLiteral("COMADMIN_E_OBJECT_PARENT_MISSING");
+ case 0x80110809 : return QStringLiteral("COMADMIN_E_OBJECT_DOES_NOT_EXIST");
+ case 0x8011080A : return QStringLiteral("COMADMIN_E_APP_NOT_RUNNING");
+ case 0x8011080B : return QStringLiteral("COMADMIN_E_INVALID_PARTITION");
+ case 0x8011080D : return QStringLiteral("COMADMIN_E_SVCAPP_NOT_POOLABLE_OR_RECYCLABLE");
+ case 0x8011080E : return QStringLiteral("COMADMIN_E_USER_IN_SET");
+ case 0x8011080F : return QStringLiteral("COMADMIN_E_CANTRECYCLELIBRARYAPPS");
+ case 0x80110811 : return QStringLiteral("COMADMIN_E_CANTRECYCLESERVICEAPPS");
+ case 0x80110812 : return QStringLiteral("COMADMIN_E_PROCESSALREADYRECYCLED");
+ case 0x80110813 : return QStringLiteral("COMADMIN_E_PAUSEDPROCESSMAYNOTBERECYCLED");
+ case 0x80110814 : return QStringLiteral("COMADMIN_E_CANTMAKEINPROCSERVICE");
+ case 0x80110815 : return QStringLiteral("COMADMIN_E_PROGIDINUSEBYCLSID");
+ case 0x80110816 : return QStringLiteral("COMADMIN_E_DEFAULT_PARTITION_NOT_IN_SET");
+ case 0x80110817 : return QStringLiteral("COMADMIN_E_RECYCLEDPROCESSMAYNOTBEPAUSED");
+ case 0x80110818 : return QStringLiteral("COMADMIN_E_PARTITION_ACCESSDENIED");
+ case 0x80110819 : return QStringLiteral("COMADMIN_E_PARTITION_MSI_ONLY");
+ case 0x8011081A : return QStringLiteral("COMADMIN_E_LEGACYCOMPS_NOT_ALLOWED_IN_1_0_FORMAT");
+ case 0x8011081B : return QStringLiteral("COMADMIN_E_LEGACYCOMPS_NOT_ALLOWED_IN_NONBASE_PARTITIONS");
+ case 0x8011081C : return QStringLiteral("COMADMIN_E_COMP_MOVE_SOURCE");
+ case 0x8011081D : return QStringLiteral("COMADMIN_E_COMP_MOVE_DEST");
+ case 0x8011081E : return QStringLiteral("COMADMIN_E_COMP_MOVE_PRIVATE");
+ case 0x8011081F : return QStringLiteral("COMADMIN_E_BASEPARTITION_REQUIRED_IN_SET");
+ case 0x80110820 : return QStringLiteral("COMADMIN_E_CANNOT_ALIAS_EVENTCLASS");
+ case 0x80110821 : return QStringLiteral("COMADMIN_E_PRIVATE_ACCESSDENIED");
+ case 0x80110822 : return QStringLiteral("COMADMIN_E_SAFERINVALID");
+ case 0x80110823 : return QStringLiteral("COMADMIN_E_REGISTRY_ACCESSDENIED");
+ case 0x80110824 : return QStringLiteral("COMADMIN_E_PARTITIONS_DISABLED");
+ case 0x80042301 : return QStringLiteral("VSS_E_BAD_STATE");
+ case 0x800423F7 : return QStringLiteral("VSS_E_LEGACY_PROVIDER");
+ case 0x800423FF : return QStringLiteral("VSS_E_RESYNC_IN_PROGRESS");
+ case 0x8004232B : return QStringLiteral("VSS_E_SNAPSHOT_NOT_IN_SET");
+ case 0x80042312 : return QStringLiteral("VSS_E_MAXIMUM_NUMBER_OF_VOLUMES_REACHED");
+ case 0x80042317 : return QStringLiteral("VSS_E_MAXIMUM_NUMBER_OF_SNAPSHOTS_REACHED");
+ case 0x8004232C : return QStringLiteral("VSS_E_NESTED_VOLUME_LIMIT");
+ case 0x80042308 : return QStringLiteral("VSS_E_OBJECT_NOT_FOUND");
+ case 0x80042304 : return QStringLiteral("VSS_E_PROVIDER_NOT_REGISTERED");
+ case 0x80042306 : return QStringLiteral("VSS_E_PROVIDER_VETO");
+ case 0x8004230C : return QStringLiteral("VSS_E_VOLUME_NOT_SUPPORTED");
+ case 0x8004230E : return QStringLiteral("VSS_E_VOLUME_NOT_SUPPORTED_BY_PROVIDER");
+ case 0x80042302 : return QStringLiteral("VSS_E_UNEXPECTED");
+ case 0x8004230F : return QStringLiteral("VSS_E_UNEXPECTED_PROVIDER_ERROR");
+ case 0x8004232A : return QStringLiteral("VSS_E_UNSELECTED_VOLUME");
+ case 0x800423FE : return QStringLiteral("VSS_E_CANNOT_REVERT_DISKID");
+ case 0x80042311 : return QStringLiteral("VSS_E_INVALID_XML_DOCUMENT");
+ case 0x8004230D : return QStringLiteral("VSS_E_OBJECT_ALREADY_EXISTS");
+ case 0x80284001 : return QStringLiteral("TBS_E_INTERNAL_ERROR");
+ case 0x80284002 : return QStringLiteral("TBS_E_BAD_PARAMETER");
+ case 0x80284003 : return QStringLiteral("TBS_E_INVALID_OUTPUT_POINTER");
+ case 0x80284005 : return QStringLiteral("TBS_E_INSUFFICIENT_BUFFER");
+ case 0x80284006 : return QStringLiteral("TBS_E_IOERROR");
+ case 0x80284007 : return QStringLiteral("TBS_E_INVALID_CONTEXT_PARAM");
+ case 0x80284008 : return QStringLiteral("TBS_E_SERVICE_NOT_RUNNING");
+ case 0x80284009 : return QStringLiteral("TBS_E_TOO_MANY_TBS_CONTEXTS");
+ case 0x8028400B : return QStringLiteral("TBS_E_SERVICE_START_PENDING");
+ case 0x8028400E : return QStringLiteral("TBS_E_BUFFER_TOO_LARGE");
+ case 0x8028400F : return QStringLiteral("TBS_E_TPM_NOT_FOUND");
+ case 0x80284010 : return QStringLiteral("TBS_E_SERVICE_DISABLED");
+ case 0x80284016 : return QStringLiteral("TBS_E_DEACTIVATED");
+ case 0x80320001 : return QStringLiteral("FWP_E_CALLOUT_NOT_FOUND");
+ case 0x80320002 : return QStringLiteral("FWP_E_CONDITION_NOT_FOUND");
+ case 0x80320003 : return QStringLiteral("FWP_E_FILTER_NOT_FOUND");
+ case 0x80320004 : return QStringLiteral("FWP_E_LAYER_NOT_FOUND");
+ case 0x80320005 : return QStringLiteral("FWP_E_PROVIDER_NOT_FOUND");
+ case 0x80320006 : return QStringLiteral("FWP_E_PROVIDER_CONTEXT_NOT_FOUND");
+ case 0x80320007 : return QStringLiteral("FWP_E_SUBLAYER_NOT_FOUND");
+ case 0x80320008 : return QStringLiteral("FWP_E_NOT_FOUND");
+ case 0x80320009 : return QStringLiteral("FWP_E_ALREADY_EXISTS");
+ case 0x8032000A : return QStringLiteral("FWP_E_IN_USE");
+ case 0x8032000B : return QStringLiteral("FWP_E_DYNAMIC_SESSION_IN_PROGRESS");
+ case 0x8032000C : return QStringLiteral("FWP_E_WRONG_SESSION");
+ case 0x8032000D : return QStringLiteral("FWP_E_NO_TXN_IN_PROGRESS");
+ case 0x8032000E : return QStringLiteral("FWP_E_TXN_IN_PROGRESS");
+ case 0x8032000F : return QStringLiteral("FWP_E_TXN_ABORTED");
+ case 0x80320010 : return QStringLiteral("FWP_E_SESSION_ABORTED");
+ case 0x80320011 : return QStringLiteral("FWP_E_INCOMPATIBLE_TXN");
+ case 0x80320012 : return QStringLiteral("FWP_E_TIMEOUT");
+ case 0x80320013 : return QStringLiteral("FWP_E_NET_EVENTS_DISABLED");
+ case 0x80320014 : return QStringLiteral("FWP_E_INCOMPATIBLE_LAYER");
+ case 0x80320015 : return QStringLiteral("FWP_E_KM_CLIENTS_ONLY");
+ case 0x80320016 : return QStringLiteral("FWP_E_LIFETIME_MISMATCH");
+ case 0x80320017 : return QStringLiteral("FWP_E_BUILTIN_OBJECT");
+ case 0x80320018 : return QStringLiteral("FWP_E_TOO_MANY_CALLOUTS");
+ case 0x80320019 : return QStringLiteral("FWP_E_NOTIFICATION_DROPPED");
+ case 0x8032001A : return QStringLiteral("FWP_E_TRAFFIC_MISMATCH");
+ case 0x8032001B : return QStringLiteral("FWP_E_INCOMPATIBLE_SA_STATE");
+ case 0x8032001C : return QStringLiteral("FWP_E_NULL_POINTER");
+ case 0x8032001D : return QStringLiteral("FWP_E_INVALID_ENUMERATOR");
+ case 0x8032001E : return QStringLiteral("FWP_E_INVALID_FLAGS");
+ case 0x8032001F : return QStringLiteral("FWP_E_INVALID_NET_MASK");
+ case 0x80320020 : return QStringLiteral("FWP_E_INVALID_RANGE");
+ case 0x80320021 : return QStringLiteral("FWP_E_INVALID_INTERVAL");
+ case 0x80320022 : return QStringLiteral("FWP_E_ZERO_LENGTH_ARRAY");
+ case 0x80320023 : return QStringLiteral("FWP_E_NULL_DISPLAY_NAME");
+ case 0x80320024 : return QStringLiteral("FWP_E_INVALID_ACTION_TYPE");
+ case 0x80320025 : return QStringLiteral("FWP_E_INVALID_WEIGHT");
+ case 0x80320026 : return QStringLiteral("FWP_E_MATCH_TYPE_MISMATCH");
+ case 0x80320027 : return QStringLiteral("FWP_E_TYPE_MISMATCH");
+ case 0x80320028 : return QStringLiteral("FWP_E_OUT_OF_BOUNDS");
+ case 0x80320029 : return QStringLiteral("FWP_E_RESERVED");
+ case 0x8032002A : return QStringLiteral("FWP_E_DUPLICATE_CONDITION");
+ case 0x8032002B : return QStringLiteral("FWP_E_DUPLICATE_KEYMOD");
+ case 0x8032002C : return QStringLiteral("FWP_E_ACTION_INCOMPATIBLE_WITH_LAYER");
+ case 0x8032002D : return QStringLiteral("FWP_E_ACTION_INCOMPATIBLE_WITH_SUBLAYER");
+ case 0x8032002E : return QStringLiteral("FWP_E_CONTEXT_INCOMPATIBLE_WITH_LAYER");
+ case 0x8032002F : return QStringLiteral("FWP_E_CONTEXT_INCOMPATIBLE_WITH_CALLOUT");
+ case 0x80320030 : return QStringLiteral("FWP_E_INCOMPATIBLE_AUTH_METHOD");
+ case 0x80320031 : return QStringLiteral("FWP_E_INCOMPATIBLE_DH_GROUP");
+ case 0x80320032 : return QStringLiteral("FWP_E_EM_NOT_SUPPORTED");
+ case 0x80320033 : return QStringLiteral("FWP_E_NEVER_MATCH");
+ case 0x80320034 : return QStringLiteral("FWP_E_PROVIDER_CONTEXT_MISMATCH");
+ case 0x80320035 : return QStringLiteral("FWP_E_INVALID_PARAMETER");
+ case 0x80320036 : return QStringLiteral("FWP_E_TOO_MANY_SUBLAYERS");
+ case 0x80320037 : return QStringLiteral("FWP_E_CALLOUT_NOTIFICATION_FAILED");
+ case 0x80320038 : return QStringLiteral("FWP_E_INVALID_AUTH_TRANSFORM");
+ case 0x80320039 : return QStringLiteral("FWP_E_INVALID_CIPHER_TRANSFORM");
+ default : return QString();
+ }
+}
+
+/*!
+ \since 5.2
+
+ Returns DWM colorization color. After function returns the optional \a opaqueBlend will contain true if the color is an opaque blend and false otherwise.
+ */
+QColor QWinExtras::colorizationColor(bool *opaqueBlend)
+{
+ QWinEventFilter::setup();
+
+ DWORD colorization;
+ BOOL dummy;
+ qt_DwmGetColorizationColor(&colorization, &dummy);
+ if (opaqueBlend)
+ *opaqueBlend = dummy;
+ return QColor::fromRgba(colorization);
+}
+
+/*!
+ \since 5.2
+
+ Returns real colorization color, set by user, using undocumented registry key.
+ API-based function \c getColorizationColor() returns a alpha-blended color which is often more like semitransparent gray
+ than something similar to what is chosen by user.
+
+ \sa QWinExtras::colorizationColor()
+ */
+QColor QWinExtras::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 QWinExtras::setWindowExcludedFromPeek(QWidget *window, bool exclude)
+ \since 5.2
+ \overload QWinExtras::setWindowExcludedFromPeek()
+*/
+
+/*!
+ \since 5.2
+
+ Excludes the \a window from Aero Peek if \a exclude is \c true.
+ */
+void QWinExtras::setWindowExcludedFromPeek(QWindow *window, bool exclude)
+{
+ Q_ASSERT_X(window, Q_FUNC_INFO, "window is null");
+ BOOL value = exclude;
+ qt_DwmSetWindowAttribute(reinterpret_cast<HWND>(window->winId()), qt_DWMWA_EXCLUDED_FROM_PEEK, &value, sizeof(value));
+}
+
+/*!
+ \fn bool QWinExtras::isWindowExcludedFromPeek(QWidget *window)
+ \since 5.2
+ \overload QWinExtras::isWindowExcludedFromPeek()
+*/
+
+/*!
+ \since 5.2
+
+ Returns true if the \a window is excluded from Aero Peek.
+ */
+bool QWinExtras::isWindowExcludedFromPeek(QWindow *window)
+{
+ Q_ASSERT_X(window, Q_FUNC_INFO, "window is null");
+ BOOL value;
+ qt_DwmGetWindowAttribute(reinterpret_cast<HWND>(window->winId()), qt_DWMWA_EXCLUDED_FROM_PEEK, &value, sizeof(value));
+ return value;
+}
+
+/*!
+ \fn void QWinExtras::setWindowDisallowPeek(QWidget *window, bool disallow)
+ \since 5.2
+ \overload QWinExtras::setWindowDisallowPeek()
+*/
+
+/*!
+ \since 5.2
+
+ Disables Aero Peek for the \a window when hovering taskbar thumbnail of the window with mouse pointer if \a disallow is true and allows otherwise.
+
+ The default is false.
+ */
+void QWinExtras::setWindowDisallowPeek(QWindow *window, bool disallow)
+{
+ Q_ASSERT_X(window, Q_FUNC_INFO, "window is null");
+ BOOL value = disallow;
+ qt_DwmSetWindowAttribute(reinterpret_cast<HWND>(window->winId()), qt_DWMWA_DISALLOW_PEEK, &value, sizeof(value));
+}
+
+/*!
+ \fn bool QWinExtras::isWindowPeekDisallowed(QWidget *window)
+ \since 5.2
+ \overload QWinExtras::isWindowPeekDisallowed()
+*/
+
+/*!
+ \since 5.2
+
+ Returns true if Aero Peek is disallowed on thumbnail of this \a window.
+ */
+bool QWinExtras::isWindowPeekDisallowed(QWindow *window)
+{
+ Q_ASSERT_X(window, Q_FUNC_INFO, "window is null");
+ BOOL value;
+ qt_DwmGetWindowAttribute(reinterpret_cast<HWND>(window->winId()), qt_DWMWA_DISALLOW_PEEK, &value, sizeof(value));
+ return value;
+}
+
+/*!
+ \fn void QWinExtras::setWindowFlip3DPolicy(QWidget *window, QWinExtras::WindowFlip3DPolicy policy)
+ \since 5.2
+ \overload QWinExtras::setWindowFlip3DPolicy()
+*/
+
+/*!
+ \since 5.2
+
+ Set Flip3D \a policy for \a window.
+ */
+void QWinExtras::setWindowFlip3DPolicy(QWindow *window, QWinExtras::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 = qt_DWMFLIP3D_DEFAULT;
+ qt_DwmSetWindowAttribute(handle, qt_DWMWA_FLIP3D_POLICY, &value, sizeof(value));
+
+ switch (policy) {
+ default :
+ case FlipDefault :
+ value = -1;
+ break;
+ case FlipExcludeBelow :
+ value = qt_DWMFLIP3D_EXCLUDEBELOW;
+ break;
+ case FlipExcludeAbove :
+ value = qt_DWMFLIP3D_EXCLUDEABOVE;
+ break;
+ }
+
+ if (qt_DWMFLIP3D_DEFAULT != value)
+ qt_DwmSetWindowAttribute(handle, qt_DWMWA_FLIP3D_POLICY, &value, sizeof(value));
+}
+
+/*!
+ \fn QWinExtras::WindowFlip3DPolicy QWinExtras::windowFlip3DPolicy(QWidget *window)
+ \since 5.2
+ \overload QWinExtras::WindowFlip3DPolicy QWinExtras::windowFlip3DPolicy()
+ */
+
+/*!
+ \since 5.2
+
+ Returns current Flip3D policy for \a window.
+ */
+QWinExtras::WindowFlip3DPolicy QWinExtras::windowFlip3DPolicy(QWindow *window)
+{
+ Q_ASSERT_X(window, Q_FUNC_INFO, "window is null");
+
+ DWORD value;
+ QWinExtras::WindowFlip3DPolicy policy;
+ qt_DwmGetWindowAttribute(reinterpret_cast<HWND>(window->winId()), qt_DWMWA_FLIP3D_POLICY, &value, sizeof(value));
+ switch (value) {
+ case qt_DWMFLIP3D_EXCLUDEABOVE :
+ policy = QWinExtras::FlipExcludeAbove;
+ break;
+ case qt_DWMFLIP3D_EXCLUDEBELOW :
+ policy = QWinExtras::FlipExcludeBelow;
+ break;
+ default :
+ policy = QWinExtras::FlipDefault;
+ break;
+ }
+ return policy;
+}
+
+void qt_ExtendFrameIntoClientArea(QWindow *window, int left, int top, int right, int bottom)
+{
+ QWinEventFilter::setup();
+
+ MARGINS margins = {left, right, top, bottom};
+ qt_DwmExtendFrameIntoClientArea(reinterpret_cast<HWND>(window->winId()), &margins);
+}
+
+/*! \fn void QWinExtras::extendFrameIntoClientArea(QWidget *window, int left, int top, int right, int bottom)
+ \since 5.2
+ \overload QWinExtras::extendFrameIntoClientArea()
+ */
+
+/*!
+ \since 5.2
+
+ Extend glass frame into client area of the \a window using \a left, \a top, \a right and \a bottom margin values.
+
+ Pass -1 as values for any of the four margins to fully extend frame, creating "sheet of glass" effect.
+
+ If you want extended frame to act like standard window border, you should handle that yourself.
+
+ \note If the \a window is a QWidget handle, then you should set the Qt::WA_NoSystemBackground attribute to your widget.
+
+ \sa QWinExtras::resetExtendedFrame()
+ */
+void QWinExtras::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 QWinExtras::extendFrameIntoClientArea(QWidget *window, const QMargins &margins)
+ \since 5.2
+ \overload QWinExtras::extendFrameIntoClientArea()
+
+ Convenience overload which allows passing frame sizes in a \a margins structure.
+ */
+
+/*!
+ \since 5.2
+ \overload QWinExtras::extendFrameIntoClientArea()
+
+ Extend glass frame into client area of the \a window using \a margins provided.
+ */
+void QWinExtras::extendFrameIntoClientArea(QWindow *window, const QMargins &margins)
+{
+ QWinExtras::extendFrameIntoClientArea(window, margins.left(), margins.top(), margins.right(), margins.bottom());
+}
+
+/*!
+ \fn void QWinExtras::resetExtendedFrame(QWidget *window)
+ \since 5.2
+ \overload QWinExtras::resetExtendedFrame()
+ */
+
+/*!
+ \since 5.2
+
+ Resets glass frame and restores \a window attributes.
+
+ This functions just calls \c extendFrameIntoClientArea() with margins set to 0 and is provided for convenience.
+
+ \note You should unset the \c Qt::WA_NoSystemBackground attribute if you did that in order to \c extendFrameIntoClientArea() to work.
+
+ \sa QWinExtras::extendFrameIntoClientArea()
+ */
+void QWinExtras::resetExtendedFrame(QWindow *window)
+{
+ Q_ASSERT_X(window, Q_FUNC_INFO, "window is null");
+ qt_ExtendFrameIntoClientArea(window, 0, 0, 0, 0);
+}
+
+/*!
+ \fn void QWinExtras::enableBlurBehindWindow(QWidget *window, const QRegion &region)
+ \since 5.2
+ \overload QWinExtras::enableBlurBehindWindow()
+ */
+
+/*!
+ \since 5.2
+
+ Enables the blur effect for the \a window on a specified \a region.
+
+ \sa disableBlurBehindWindow()
+ */
+void QWinExtras::enableBlurBehindWindow(QWindow *window, const QRegion &region)
+{
+ Q_ASSERT_X(window, Q_FUNC_INFO, "window is null");
+
+ qt_DWM_BLURBEHIND dwmbb = {0, 0, 0, 0};
+ dwmbb.dwFlags = qt_DWM_BB_ENABLE;
+ dwmbb.fEnable = TRUE;
+ HRGN rgn = 0;
+ if (!region.isNull()) {
+ rgn = toHRGN(region);
+ if (rgn) {
+ dwmbb.hRgnBlur = rgn;
+ dwmbb.dwFlags |= qt_DWM_BB_BLURREGION;
+ }
+ }
+ qt_DwmEnableBlurBehindWindow(reinterpret_cast<HWND>(window->winId()), &dwmbb);
+ if (rgn)
+ DeleteObject(rgn);
+}
+
+/*!
+ \fn void QWinExtras::enableBlurBehindWindow(QWidget *window)
+ \since 5.2
+ \overload QWinExtras::enableBlurBehindWindow()
+ */
+
+/*!
+ \since 5.2
+
+ Enables blur effect on a \a window.
+
+ \sa disableBlurBehindWindow()
+ */
+void QWinExtras::enableBlurBehindWindow(QWindow *window)
+{
+ QWinExtras::enableBlurBehindWindow(window, QRegion());
+}
+
+/*!
+ \fn void QWinExtras::disableBlurBehindWindow(QWidget *window)
+ \since 5.2
+ \overload QWinExtras::disableBlurBehindWindow()
+ */
+
+/*!
+ \since 5.2
+
+ Disables previuosly enabled blur effect on the \a window.
+
+ \sa enableBlurBehindWindow()
+ */
+void QWinExtras::disableBlurBehindWindow(QWindow *window)
+{
+ Q_ASSERT_X(window, Q_FUNC_INFO, "window is null");
+ qt_DWM_BLURBEHIND dwmbb = {0, 0, 0, 0};
+ dwmbb.dwFlags = qt_DWM_BB_ENABLE;
+ dwmbb.fEnable = FALSE;
+ qt_DwmEnableBlurBehindWindow(reinterpret_cast<HWND>(window->winId()), &dwmbb);
+}
+
+/*!
+ \since 5.2
+
+ Returns DWM composition state.
+ */
+bool QWinExtras::isCompositionEnabled()
+{
+ QWinEventFilter::setup();
+
+ BOOL enabled;
+ qt_DwmIsCompositionEnabled(&enabled);
+ return enabled;
+}
+
+/*!
+ \since 5.2
+
+ Set whether Windows Desktop composition is \a enabled.
+
+ \note Underlying function declared deprecated as of Windows 8 and has no effect.
+ */
+void QWinExtras::setCompositionEnabled(bool enabled)
+{
+ QWinEventFilter::setup();
+
+ UINT compositionEnabled = enabled;
+ qt_DwmEnableComposition(compositionEnabled);
+}
/*!
- \enum Qt::HBitmapFormat
+ \since 5.2
- \since 5.1
+ Set Application User Model ID \a id.
+
+ More at http://msdn.microsoft.com/en-us/library/windows/desktop/dd378459.aspx
+ */
+void QWinExtras::setCurrentProcessExplicitAppUserModelID(const QString &id)
+{
+ wchar_t *wid = qt_qstringToNullTerminated(id);
+ qt_SetCurrentProcessExplicitAppUserModelID(wid);
+ delete[] wid;
+}
+
+/*!
+ \internal
+ */
+ITaskbarList3 *qt_createITaskbarList3()
+{
+ ITaskbarList3 *pTbList = 0;
+ HRESULT result = CoCreateInstance(CLSID_TaskbarList, 0, CLSCTX_INPROC_SERVER, IID_ITaskbarList3, reinterpret_cast<void **>(&pTbList));
+ if (SUCCEEDED(result)) {
+ if (FAILED(pTbList->HrInit())) {
+ pTbList->Release();
+ pTbList = 0;
+ }
+ }
+ return pTbList;
+}
+
+/*!
+ \internal
+ */
+ITaskbarList2 *qt_createITaskbarList2()
+{
+ ITaskbarList3 *pTbList = 0;
+ HRESULT result = CoCreateInstance(CLSID_TaskbarList, 0, CLSCTX_INPROC_SERVER, IID_ITaskbarList2, reinterpret_cast<void **>(&pTbList));
+ if (SUCCEEDED(result)) {
+ if (FAILED(pTbList->HrInit())) {
+ pTbList->Release();
+ pTbList = 0;
+ }
+ }
+ return pTbList;
+}
+
+/*!
+ \fn void QWinExtras::markFullscreenWindow(QWidget *window, bool fullscreen)
+ \since 5.2
+ \overload QWinExtras::markFullscreenWindow()
+ */
+
+/*!
+ \since 5.2
+
+ Marks a \a window as full-screen in order to handle it correctly by the shell if \a fullscreen is true and removes the mark otherwise.
+
+ \note You don't usually need to call this function as Windows taskbar always tries to determine whether windows is fullscreen.
+ */
+void QWinExtras::markFullscreenWindow(QWindow *window, bool fullscreen)
+{
+ ITaskbarList2 *pTbList = qt_createITaskbarList2();
+ if (pTbList) {
+ pTbList->MarkFullscreenWindow(reinterpret_cast<HWND>(window->winId()), fullscreen);
+ pTbList->Release();
+ }
+}
+
+/*!
+ \fn void QWinExtras::taskbarActivateTab(QWidget *window)
+ \since 5.2
+ \overload QWinExtras::taskbarActivateTab()
+ */
+
+/*!
+ \since 5.2
+
+ Activates an item on the taskbar without activating \a window itself.
+ */
+void QWinExtras::taskbarActivateTab(QWindow *window)
+{
+ ITaskbarList *pTbList = qt_createITaskbarList2();
+ if (pTbList) {
+ pTbList->ActivateTab(reinterpret_cast<HWND>(window->winId()));
+ pTbList->Release();
+ }
+}
+
+/*!
+ \fn void QWinExtras::taskbarActivateTabAlt(QWidget *window)
+ \since 5.2
+ \overload QWinExtras::taskbarActivateTabAlt()
+ */
+
+/*!
+ \since 5.2
+
+ Marks an item on the taskbar which represents \a window as active but not visually activates it.
+ */
+void QWinExtras::taskbarActivateTabAlt(QWindow *window)
+{
+ ITaskbarList *pTbList = qt_createITaskbarList2();
+ if (pTbList) {
+ pTbList->SetActiveAlt(reinterpret_cast<HWND>(window->winId()));
+ pTbList->Release();
+ }
+}
+
+/*!
+ \fn void QWinExtras::taskbarAddTab(QWidget *window)
+ \since 5.2
+ \overload QWinExtras::taskbarAddTab()
+ */
+
+/*!
+ \since 5.2
+
+ Adds an item for the \a window to taskbar.
+ */
+void QWinExtras::taskbarAddTab(QWindow *window)
+{
+ ITaskbarList *pTbList = qt_createITaskbarList2();
+ if (pTbList) {
+ pTbList->AddTab(reinterpret_cast<HWND>(window->winId()));
+ pTbList->Release();
+ }
+}
+
+/*!
+ \fn void QWinExtras::taskbarDeleteTab(QWidget *window)
+ \since 5.2
+ \overload QWinExtras::taskbarDeleteTab()
+ */
+
+/*!
+ \since 5.2
+
+ Removes the \a window from taskbar.
+ */
+void QWinExtras::taskbarDeleteTab(QWindow *window)
+{
+ ITaskbarList *pTbList = qt_createITaskbarList3();
+ if (pTbList) {
+ pTbList->DeleteTab(reinterpret_cast<HWND>(window->winId()));
+ pTbList->Release();
+ }
+}
+
+/*!
+ \enum QWinExtras::HBitmapFormat
+
+ \since 5.2
This enum defines how the conversion between \c
HBITMAP and QPixmap is performed.
- \warning This enum is only available on Windows.
-
\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().
@@ -164,7 +1942,21 @@ QPixmap fromWinHICON(HICON icon)
channel. This is the preferred format if the \c HBITMAP is going
to be used as an application icon or systray icon.
- \sa fromWinHBITMAP(), toWinHBITMAP()
+ \sa fromHBITMAP(), toHBITMAP()
*/
+/*!
+ \enum QWinExtras::WindowFlip3DPolicy
+
+ \since 5.2
+
+ \value FlipDefault Let the OS decide.
+
+ \value FlipExcludeAbove Exclude the window from Flip3D and display it above Flip3D.
+
+ \value FlipExcludeBelow Exclude the window from Flip3D and display it below Flip3D.
+
+ \sa setWindowFlip3DPolicy()
+ */
+
QT_END_NAMESPACE
diff --git a/src/winextras/qwinfunctions.h b/src/winextras/qwinfunctions.h
index 6be77cb..5e19e78 100644
--- a/src/winextras/qwinfunctions.h
+++ b/src/winextras/qwinfunctions.h
@@ -43,9 +43,10 @@
#define QWINFUNCTIONS_H
#if 0
-#pragma qt_class(QtWinFunctions)
+#pragma qt_class(QWinFunctions)
#endif
+#include <QObject>
#include <QtWinExtras/qwinextrasglobal.h>
#include <QtCore/qt_windows.h>
@@ -54,8 +55,12 @@ QT_BEGIN_NAMESPACE
class QPixmap;
class QImage;
class QBitmap;
+class QColor;
+class QWindow;
+class QString;
+class QMargins;
-namespace Qt
+namespace QWinExtras
{
enum HBitmapFormat
@@ -65,15 +70,217 @@ enum HBitmapFormat
HBitmapAlpha
};
-HBITMAP Q_WINEXTRAS_EXPORT createWinIconMask(const QBitmap &bitmap);
-HBITMAP Q_WINEXTRAS_EXPORT toWinHBITMAP(const QPixmap &p, HBitmapFormat format = HBitmapNoAlpha);
-QPixmap Q_WINEXTRAS_EXPORT fromWinHBITMAP(HBITMAP bitmap, HBitmapFormat format = HBitmapNoAlpha);
-HICON Q_WINEXTRAS_EXPORT toWinHICON(const QPixmap &p);
-QImage Q_WINEXTRAS_EXPORT imageFromWinHBITMAP(HDC hdc, HBITMAP bitmap, int w, int h);
-QPixmap Q_WINEXTRAS_EXPORT fromWinHICON(HICON icon);
+HBITMAP Q_WINEXTRAS_EXPORT createMask(const QBitmap &bitmap);
+HBITMAP Q_WINEXTRAS_EXPORT toHBITMAP(const QPixmap &p, HBitmapFormat format = HBitmapNoAlpha);
+QPixmap Q_WINEXTRAS_EXPORT fromHBITMAP(HBITMAP bitmap, HBitmapFormat format = HBitmapNoAlpha);
+HICON Q_WINEXTRAS_EXPORT toHICON(const QPixmap &p);
+QImage Q_WINEXTRAS_EXPORT imageFromHBITMAP(HDC hdc, HBITMAP bitmap, int width, int height);
+QPixmap Q_WINEXTRAS_EXPORT fromHICON(HICON icon);
+HRGN Q_WINEXTRAS_EXPORT toHRGN(const QRegion &region);
+QString Q_WINEXTRAS_EXPORT stringFromHresult(HRESULT hresult);
+QString Q_WINEXTRAS_EXPORT errorStringFromHresult(HRESULT hresult);
+
+enum WindowFlip3DPolicy
+{
+ FlipDefault,
+ FlipExcludeBelow,
+ FlipExcludeAbove
+};
+
+QColor Q_WINEXTRAS_EXPORT colorizationColor(bool *opaqueBlend = 0);
+QColor Q_WINEXTRAS_EXPORT realColorizationColor();
+
+void Q_WINEXTRAS_EXPORT setWindowExcludedFromPeek(QWindow *window, bool exclude);
+bool Q_WINEXTRAS_EXPORT isWindowExcludedFromPeek(QWindow *window);
+void Q_WINEXTRAS_EXPORT setWindowDisallowPeek(QWindow *window, bool disallow);
+bool Q_WINEXTRAS_EXPORT isWindowPeekDisallowed(QWindow *window);
+void Q_WINEXTRAS_EXPORT setWindowFlip3DPolicy(QWindow *window, WindowFlip3DPolicy policy);
+WindowFlip3DPolicy Q_WINEXTRAS_EXPORT windowFlip3DPolicy(QWindow *);
+
+void Q_WINEXTRAS_EXPORT extendFrameIntoClientArea(QWindow *window, int left, int top, int right, int bottom);
+void Q_WINEXTRAS_EXPORT extendFrameIntoClientArea(QWindow *window, const QMargins &margins);
+void Q_WINEXTRAS_EXPORT resetExtendedFrame(QWindow *window);
+
+void Q_WINEXTRAS_EXPORT enableBlurBehindWindow(QWindow *window, const QRegion &region);
+void Q_WINEXTRAS_EXPORT enableBlurBehindWindow(QWindow *window);
+void Q_WINEXTRAS_EXPORT disableBlurBehindWindow(QWindow *window);
+
+bool Q_WINEXTRAS_EXPORT isCompositionEnabled();
+void Q_WINEXTRAS_EXPORT setCompositionEnabled(bool enabled);
+
+void Q_WINEXTRAS_EXPORT setCurrentProcessExplicitAppUserModelID(const QString &id);
+
+void Q_WINEXTRAS_EXPORT markFullscreenWindow(QWindow *, bool fullscreen = true);
+
+void Q_WINEXTRAS_EXPORT taskbarActivateTab(QWindow *);
+void Q_WINEXTRAS_EXPORT taskbarActivateTabAlt(QWindow *);
+void Q_WINEXTRAS_EXPORT taskbarAddTab(QWindow *);
+void Q_WINEXTRAS_EXPORT taskbarDeleteTab(QWindow *);
+
+}
+
+#ifdef QT_WIDGETS_LIB
+
+#include <QWidget>
+
+namespace QWinExtras
+{
+
+inline void setWindowExcludedFromPeek(QWidget *window, bool exclude)
+{
+ window->createWinId();
+ setWindowExcludedFromPeek(window->windowHandle(), exclude);
+}
+
+inline bool isWindowExcludedFromPeek(QWidget *window)
+{
+ if (!window->windowHandle())
+ return false;
+ else
+ return isWindowExcludedFromPeek(window->windowHandle());
+}
+
+inline void setWindowDisallowPeek(QWidget *window, bool disallow)
+{
+ window->createWinId();
+ setWindowDisallowPeek(window->windowHandle(), disallow);
+}
+
+inline bool isWindowPeekDisallowed(QWidget *window)
+{
+ if (!window->windowHandle())
+ return false;
+ else
+ return isWindowPeekDisallowed(window->windowHandle());
+}
+
+inline void setWindowFlip3DPolicy(QWidget *window, WindowFlip3DPolicy policy)
+{
+ window->createWinId();
+ setWindowFlip3DPolicy(window->windowHandle(), policy);
+}
+
+inline WindowFlip3DPolicy windowFlip3DPolicy(QWidget *window)
+{
+ if (!window->windowHandle())
+ return FlipDefault;
+ else
+ return windowFlip3DPolicy(window->windowHandle());
+}
+
+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 &region)
+{
+ window->createWinId();
+ enableBlurBehindWindow(window->windowHandle(), region);
+}
+
+inline void enableBlurBehindWindow(QWidget *window)
+{
+ window->createWinId();
+ enableBlurBehindWindow(window->windowHandle());
}
+inline void disableBlurBehindWindow(QWidget *window)
+{
+ if (window->windowHandle())
+ enableBlurBehindWindow(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
+
+#ifdef Q_QDOC
+
+namespace QWinExtras
+{
+
+HBITMAP createMask(const QBitmap &bitmap);
+HBITMAP toHBITMAP(const QPixmap &p, HBitmapFormat format = HBitmapNoAlpha);
+QPixmap fromHBITMAP(HBITMAP bitmap, HBitmapFormat format = HBitmapNoAlpha);
+HICON toHICON(const QPixmap &p);
+QImage imageFromHBITMAP(HDC hdc, HBITMAP bitmap, int w, int h);
+QPixmap fromHICON(HICON icon);
+HRGN toHRGN(const QRegion &region);
+QString stringFromHresult(HRESULT hresult);
+QString errorStringFromHresult(HRESULT hresult);
+QColor colorizationColor(bool *opaqueBlend = 0);
+QColor realColorizationColor();
+void setWindowExcludedFromPeek(QWindow *window, bool exclude);
+bool isWindowExcludedFromPeek(QWindow *window);
+void setWindowDisallowPeek(QWindow *window, bool disallow);
+bool isWindowPeekDisallowed(QWindow *window);
+void setWindowFlip3DPolicy(QWindow *window, WindowFlip3DPolicy policy);
+WindowFlip3DPolicy windowFlip3DPolicy(QWindow *);
+void extendFrameIntoClientArea(QWindow *window, int left, int top, int right, int bottom);
+void extendFrameIntoClientArea(QWindow *window, const QMargins &margins);
+void resetExtendedFrame(QWindow *window);
+void enableBlurBehindWindow(QWindow *window, const QRegion &region);
+void enableBlurBehindWindow(QWindow *window);
+void disableBlurBehindWindow(QWindow *window);
+
+bool isCompositionEnabled();
+void setCompositionEnabled(bool enabled);
+void setCurrentProcessExplicitAppUserModelID(const QString &id);
+void markFullscreenWindow(QWindow *, bool fullscreen = true);
+void taskbarActivateTab(QWindow *);
+void taskbarActivateTabAlt(QWindow *);
+void taskbarAddTab(QWindow *);
+void taskbarDeleteTab(QWindow *);
+
+}
+
+#endif // #ifdef Q_DOC
+
QT_END_NAMESPACE
#endif // QWINFUNCTIONS_H
diff --git a/src/winextras/qwinfunctions_p.cpp b/src/winextras/qwinfunctions_p.cpp
new file mode 100644
index 0000000..eef9cd9
--- /dev/null
+++ b/src/winextras/qwinfunctions_p.cpp
@@ -0,0 +1,182 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#include "qwinfunctions_p.h"
+
+#include <qt_windows.h>
+
+QT_BEGIN_NAMESPACE
+
+// in order to allow binary to load on WinXP...
+
+void qt_winextras_init();
+
+typedef HRESULT (STDAPICALLTYPE *DwmGetColorizationColor_t)(DWORD *, BOOL *);
+static DwmGetColorizationColor_t pDwmGetColorizationColor = 0;
+
+typedef HRESULT (STDAPICALLTYPE *DwmSetWindowAttribute_t)(HWND, DWORD, LPCVOID, DWORD);
+static DwmSetWindowAttribute_t pDwmSetWindowAttribute = 0;
+
+typedef HRESULT (STDAPICALLTYPE *DwmGetWindowAttribute_t)(HWND, DWORD, PVOID, DWORD);
+static DwmGetWindowAttribute_t pDwmGetWindowAttribute = 0;
+
+typedef HRESULT (STDAPICALLTYPE *DwmExtendFrameIntoClientArea_t)(HWND, const MARGINS *);
+static DwmExtendFrameIntoClientArea_t pDwmExtendFrameIntoClientArea = 0;
+
+typedef HRESULT (STDAPICALLTYPE *DwmEnableBlurBehindWindow_t)(HWND, const qt_DWM_BLURBEHIND *);
+DwmEnableBlurBehindWindow_t pDwmEnableBlurBehindWindow = 0;
+
+typedef HRESULT (STDAPICALLTYPE *DwmIsCompositionEnabled_t)(BOOL *);
+static DwmIsCompositionEnabled_t pDwmIsCompositionEnabled = 0;
+
+typedef HRESULT (STDAPICALLTYPE *DwmEnableComposition_t)(UINT);
+static DwmEnableComposition_t pDwmEnableComposition = 0;
+
+typedef HRESULT (STDAPICALLTYPE *SHCreateItemFromParsingName_t)(PCWSTR, IBindCtx *, REFIID, void **);
+static SHCreateItemFromParsingName_t pSHCreateItemFromParsingName = 0;
+
+typedef HRESULT (STDAPICALLTYPE *SetCurrentProcessExplicitAppUserModelID_t)(PCWSTR);
+static SetCurrentProcessExplicitAppUserModelID_t pSetCurrentProcessExplicitAppUserModelID = 0;
+
+HRESULT qt_DwmGetColorizationColor(DWORD *colorization, BOOL *opaqueBlend)
+{
+ qt_winextras_init();
+ if (pDwmGetColorizationColor)
+ return pDwmGetColorizationColor(colorization, opaqueBlend);
+ else
+ return E_FAIL;
+}
+
+HRESULT qt_DwmSetWindowAttribute(HWND hwnd, DWORD dwAttribute, LPCVOID pvAttribute, DWORD cbAttribute)
+{
+ qt_winextras_init();
+ if (pDwmGetColorizationColor)
+ return pDwmSetWindowAttribute(hwnd, dwAttribute, pvAttribute, cbAttribute);
+ else
+ return E_FAIL;
+}
+
+HRESULT qt_DwmGetWindowAttribute(HWND hwnd, DWORD dwAttribute, PVOID pvAttribute, DWORD cbAttribute)
+{
+ qt_winextras_init();
+ if (pDwmGetWindowAttribute)
+ return pDwmGetWindowAttribute(hwnd, dwAttribute, pvAttribute, cbAttribute);
+ else
+ return E_FAIL;
+}
+
+HRESULT qt_DwmExtendFrameIntoClientArea(HWND hwnd, const MARGINS *margins)
+{
+ qt_winextras_init();
+ if (pDwmExtendFrameIntoClientArea)
+ return pDwmExtendFrameIntoClientArea(hwnd, margins);
+ else
+ return E_FAIL;
+}
+
+HRESULT qt_DwmEnableBlurBehindWindow(HWND hwnd, const qt_DWM_BLURBEHIND *blurBehind)
+{
+ qt_winextras_init();
+ if (pDwmEnableBlurBehindWindow)
+ return pDwmEnableBlurBehindWindow(hwnd, blurBehind);
+ else
+ return E_FAIL;
+}
+
+HRESULT qt_DwmIsCompositionEnabled(BOOL *enabled)
+{
+ qt_winextras_init();
+ if (pDwmIsCompositionEnabled)
+ return pDwmIsCompositionEnabled(enabled);
+ else
+ return E_FAIL;
+}
+
+HRESULT qt_DwmEnableComposition(UINT enabled)
+{
+ qt_winextras_init();
+ if (pDwmEnableComposition)
+ return pDwmEnableComposition(enabled);
+ else
+ return E_FAIL;
+}
+
+HRESULT qt_SHCreateItemFromParsingName(PCWSTR path, IBindCtx *bindcontext, REFIID riid, void **ppv)
+{
+ qt_winextras_init();
+ if (pSHCreateItemFromParsingName)
+ return pSHCreateItemFromParsingName(path, bindcontext, riid, ppv);
+ else
+ return E_FAIL;
+}
+
+HRESULT qt_SetCurrentProcessExplicitAppUserModelID(PCWSTR appId)
+{
+ qt_winextras_init();
+ if (pSetCurrentProcessExplicitAppUserModelID)
+ return pSetCurrentProcessExplicitAppUserModelID(appId);
+ else
+ return E_FAIL;
+}
+
+void qt_winextras_init()
+{
+ static bool initialized = false;
+ if (initialized)
+ return;
+ HMODULE dwmapi = LoadLibraryW(L"dwmapi.dll");
+ HMODULE shell32 = LoadLibraryW(L"shell32.dll");
+ if (dwmapi) {
+ pDwmExtendFrameIntoClientArea = (DwmExtendFrameIntoClientArea_t) GetProcAddress(dwmapi, "DwmExtendFrameIntoClientArea");
+ pDwmEnableBlurBehindWindow = (DwmEnableBlurBehindWindow_t) GetProcAddress(dwmapi, "DwmEnableBlurBehindWindow");
+ pDwmGetColorizationColor = (DwmGetColorizationColor_t) GetProcAddress(dwmapi, "DwmGetColorizationColor");
+ pDwmSetWindowAttribute = (DwmSetWindowAttribute_t) GetProcAddress(dwmapi, "DwmSetWindowAttribute");
+ pDwmGetWindowAttribute = (DwmGetWindowAttribute_t) GetProcAddress(dwmapi, "DwmGetWindowAttribute");
+ pDwmIsCompositionEnabled = (DwmIsCompositionEnabled_t) GetProcAddress(dwmapi, "DwmIsCompositionEnabled");
+ pDwmEnableComposition = (DwmEnableComposition_t) GetProcAddress(dwmapi, "DwmEnableComposition");
+ }
+ if (shell32) {
+ pSHCreateItemFromParsingName = (SHCreateItemFromParsingName_t) GetProcAddress(shell32, "SHCreateItemFromParsingName");
+ pSetCurrentProcessExplicitAppUserModelID = (SetCurrentProcessExplicitAppUserModelID_t) GetProcAddress(shell32, "SetCurrentProcessExplicitAppUserModelID");
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/winextras/qwinfunctions_p.h b/src/winextras/qwinfunctions_p.h
new file mode 100644
index 0000000..f1e5fff
--- /dev/null
+++ b/src/winextras/qwinfunctions_p.h
@@ -0,0 +1,117 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#ifndef QWINFUNCTIONS_P_H
+#define QWINFUNCTIONS_P_H
+
+#include <QString>
+#include <qt_windows.h>
+#include <uxtheme.h>
+
+QT_BEGIN_NAMESPACE
+
+enum qt_DWMWINDOWATTRIBUTE
+{
+ qt_DWMWA_NCRENDERING_ENABLED = 1,
+ qt_DWMWA_NCRENDERING_POLICY,
+ qt_DWMWA_TRANSITIONS_FORCEDISABLED,
+ qt_DWMWA_ALLOW_NCPAINT,
+ qt_DWMWA_CAPTION_BUTTON_BOUNDS,
+ qt_DWMWA_NONCLIENT_RTL_LAYOUT,
+ qt_DWMWA_FORCE_ICONIC_REPRESENTATION,
+ qt_DWMWA_FLIP3D_POLICY,
+ qt_DWMWA_EXTENDED_FRAME_BOUNDS,
+ qt_DWMWA_HAS_ICONIC_BITMAP,
+ qt_DWMWA_DISALLOW_PEEK,
+ qt_DWMWA_EXCLUDED_FROM_PEEK,
+ qt_DWMWA_CLOAK,
+ qt_DWMWA_CLOAKED,
+ qt_DWMWA_FREEZE_REPRESENTATION,
+ qt_DWMWA_LAST
+};
+
+enum qt_DWMFLIP3DWINDOWPOLICY {
+ qt_DWMFLIP3D_DEFAULT,
+ qt_DWMFLIP3D_EXCLUDEBELOW,
+ qt_DWMFLIP3D_EXCLUDEABOVE,
+ qt_DWMFLIP3D_LAST
+};
+
+#include <pshpack1.h>
+
+struct qt_DWM_BLURBEHIND {
+ DWORD dwFlags;
+ BOOL fEnable;
+ HRGN hRgnBlur;
+ BOOL fTransitionOnMaximized;
+};
+
+#include <poppack.h>
+
+const int qt_DWM_BB_ENABLE = 0x00000001;
+const int qt_DWM_BB_BLURREGION = 0x00000002;
+const int qt_DWM_BB_TRANSITIONONMAXIMIZED = 0x00000004;
+
+HRESULT qt_DwmGetColorizationColor(DWORD *colorization, BOOL *opaqueBlend);
+HRESULT qt_DwmSetWindowAttribute(HWND hwnd, DWORD dwAttribute, LPCVOID pvAttribute, DWORD cbAttribute);
+HRESULT qt_DwmGetWindowAttribute(HWND hwnd, DWORD dwAttribute, PVOID pvAttribute, DWORD cbAttribute);
+HRESULT qt_DwmExtendFrameIntoClientArea(HWND hwnd, const MARGINS *pMarInset);
+HRESULT qt_DwmEnableBlurBehindWindow(HWND hwnd, const qt_DWM_BLURBEHIND *blurBehind);
+HRESULT qt_DwmIsCompositionEnabled(BOOL *enabled);
+HRESULT qt_DwmEnableComposition(UINT enabled);
+HRESULT qt_SHCreateItemFromParsingName(PCWSTR, IBindCtx *, REFIID, void **);
+HRESULT qt_SetCurrentProcessExplicitAppUserModelID(PCWSTR appId);
+
+inline void qt_qstringToNullTerminated(const QString &src, wchar_t *dst)
+{
+ dst[src.toWCharArray(dst)] = 0;
+}
+
+inline wchar_t *qt_qstringToNullTerminated(const QString &src)
+{
+ wchar_t *buffer = new wchar_t[src.length() + 1];
+ qt_qstringToNullTerminated(src, buffer);
+ return buffer;
+}
+
+QT_END_NAMESPACE
+
+#endif // QWINFUNCTIONS_P_H
diff --git a/src/winextras/qwintaskbarbutton.cpp b/src/winextras/qwintaskbarbutton.cpp
new file mode 100644
index 0000000..e7e1db1
--- /dev/null
+++ b/src/winextras/qwintaskbarbutton.cpp
@@ -0,0 +1,384 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#include "qwintaskbarbutton.h"
+#include "qwintaskbarbutton_p.h"
+#include "qwinfunctions.h"
+#include "qwineventfilter_p.h"
+#include "qwintaskbarbuttoncreatedevent.h"
+
+#include <QWindow>
+#include <QIcon>
+#include <QPair>
+#include <dwmapi.h>
+#include <shobjidl.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QWinTaskbarButton
+ \inmodule QtWinExtras
+ \brief The QWinTaskbarButton class represents Windows taskbar button for a window.
+
+ \since 5.2
+
+ The QWinTaskbarButton class allows setting overlay icons on a button, displaying progress indicator and adding small toolbar to window thumbnail popup.
+ */
+
+/*!
+ \enum QWinTaskbarButton::ProgressState
+ \value NoProgressState No progress indicator.
+ \value IndeterminateState The progress indicator cycles repeatedly.
+ \value NormalState
+ \value PausedState Indicator turns yellow. Use that to show that operation has been paused, but can be continued.
+ \value ErrorState Indicator turns red.
+ */
+
+/*!
+ Constructs a QWinTaskbarButton with parent object \a parent.
+ */
+QWinTaskbarButton::QWinTaskbarButton(QObject *parent) :
+ QObject(parent), d_ptr(new QWinTaskbarButtonPrivate(this))
+{
+ QWinEventFilter::setup();
+}
+
+/*!
+ Destroys the QWinTaskbarButton.
+ */
+QWinTaskbarButton::~QWinTaskbarButton()
+{
+}
+
+/*!
+ Sets \a window, on taskbar button of which this QWinTaskbarButton will operate.
+ */
+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->updateProgressValue();
+ d->updateOverlayIcon();
+ }
+ }
+}
+
+/*!
+ \property QWinTaskbarButton::overlayIcon
+ \brief holds overlay icon of the button.
+ */
+QIcon QWinTaskbarButton::overlayIcon() const
+{
+ Q_D(const QWinTaskbarButton);
+ return d->overlayIcon;
+}
+
+/*!
+ \property QWinTaskbarButton::overlayIconAccessibilityDescription
+ \brief holds the overlay icon accessibility description text.
+ */
+QString QWinTaskbarButton::overlayIconAccessibilityDescription() const
+{
+ Q_D(const QWinTaskbarButton);
+ return d->overlayIconDescription;
+}
+
+/*!
+ \property QWinTaskbarButton::progressState
+ \brief holds progress state of the progress indicator.
+ */
+QWinTaskbarButton::ProgressState QWinTaskbarButton::progressState() const
+{
+ Q_D(const QWinTaskbarButton);
+ return d->progressState;
+}
+
+/*!
+ \property QWinTaskbarButton::progressValue
+ \brief holds the current progress value of the progress indicator.
+ */
+int QWinTaskbarButton::progressValue() const
+{
+ Q_D(const QWinTaskbarButton);
+ return d->progressValue;
+}
+
+/*!
+ \property QWinTaskbarButton::progressMinimum
+ \brief holds the minimum value of the progress indicator.
+ */
+int QWinTaskbarButton::progressMinimum() const
+{
+ Q_D(const QWinTaskbarButton);
+ return d->progressMinimum;
+}
+
+/*!
+ \property QWinTaskbarButton::progressMaximum
+ \brief holds the maximum value of the progress indicator.
+ */
+int QWinTaskbarButton::progressMaximum() const
+{
+ Q_D(const QWinTaskbarButton);
+ return d->progressMaximum;
+}
+
+/*!
+ \internal
+ Used to intercept TaskbarButtonCreated messages.
+ */
+bool QWinTaskbarButton::eventFilter(QObject *object, QEvent *event)
+{
+ Q_D(QWinTaskbarButton);
+ if (object == d->window && event->type() == QWinTaskbarButtonCreatedEvent::eventType()) {
+ d->pTbList->SetProgressState(d->handle(), QWinTaskbarButtonPrivate::nativeProgressState(d->progressState));
+ d->updateProgressValue();
+ d->updateOverlayIcon();
+ }
+ return false;
+}
+
+void QWinTaskbarButton::setOverlayIcon(const QIcon &icon)
+{
+ Q_D(QWinTaskbarButton);
+
+ d->overlayIcon = icon;
+ d->updateOverlayIcon();
+}
+
+void QWinTaskbarButton::setOverlayIconAccessibilityDescription(const QString &description)
+{
+ Q_D(QWinTaskbarButton);
+
+ d->overlayIconDescription = description;
+ d->updateOverlayIcon();
+}
+
+/*!
+ Clear previously set overlay icon.
+ \sa QWinTaskbarButton::setOverlayIcon()
+ */
+void QWinTaskbarButton::clearOverlayIcon()
+{
+ setOverlayIconAccessibilityDescription(QString());
+ setOverlayIcon(QIcon());
+}
+
+void QWinTaskbarButton::setProgressState(const QWinTaskbarButton::ProgressState state)
+{
+ Q_D(QWinTaskbarButton);
+
+ if (state == d->progressState)
+ return;
+
+ d->progressState = state;
+ emit progressStateChanged(d->progressState);
+
+ if (!d->pTbList || !d->window)
+ return;
+
+ d->pTbList->SetProgressState(d->handle(), QWinTaskbarButtonPrivate::nativeProgressState(state));
+ d->updateProgressValue();
+}
+
+void QWinTaskbarButton::setProgressValue(int value)
+{
+ Q_D(QWinTaskbarButton);
+
+ if ((value == d->progressValue && !d->updateNeeded) || value < d->progressMinimum || value > d->progressMaximum)
+ return;
+
+ d->updateNeeded = false;
+
+ d->progressValue = value;
+ emit progressValueChanged(d->progressValue);
+ d->updateProgressValue();
+}
+
+void QWinTaskbarButton::setProgressMinimum(int min)
+{
+ Q_D(QWinTaskbarButton);
+ setProgressRange(min, qMax(min, d->progressMaximum));
+}
+
+void QWinTaskbarButton::setProgressMaximum(int max)
+{
+ Q_D(QWinTaskbarButton);
+ setProgressRange(qMin(d->progressMinimum, max), max);
+}
+
+/*!
+ Sets both \a minimum and \a maximum values.
+ */
+void QWinTaskbarButton::setProgressRange(int minimum, int maximum)
+{
+ Q_D(QWinTaskbarButton);
+ if (minimum != d->progressMinimum || maximum != d->progressMaximum) {
+ d->progressMinimum = minimum;
+ d->progressMaximum = qMax(minimum, maximum);
+
+ if (d->progressValue < d->progressMinimum || d->progressValue > d->progressMaximum)
+ resetProgress();
+ else
+ d->updateProgressValue();
+ }
+}
+
+/*!
+ Resets the progress indicator of this button.
+
+ This function sets progress state to \c NoProgressState and rewinds progress value to minimum.
+ */
+void QWinTaskbarButton::resetProgress()
+{
+ setProgressValue(progressMinimum());
+ setProgressState(NoProgressState);
+}
+
+
+
+QWinTaskbarButtonPrivate::QWinTaskbarButtonPrivate(QWinTaskbarButton *parent) :
+ progressMinimum(0), progressMaximum(100), progressValue(0), progressState(QWinTaskbarButton::NoProgressState),
+ updateNeeded(false), pTbList(0), window(0), q_ptr(parent)
+{
+ HRESULT hresult = CoCreateInstance(CLSID_TaskbarList, 0, CLSCTX_INPROC_SERVER, IID_ITaskbarList4, reinterpret_cast<void **>(&pTbList));
+ if (FAILED(hresult)) {
+ pTbList = 0;
+ QByteArray err = QWinExtras::errorStringFromHresult(hresult).toLocal8Bit();
+ qWarning("QWinTaskbarButton: IID_ITaskbarList4 was not created: %#010x, %s.", (unsigned)hresult, err.data());
+ } else if (FAILED(pTbList->HrInit())) {
+ pTbList->Release();
+ pTbList = 0;
+ QByteArray err = QWinExtras::errorStringFromHresult(hresult).toLocal8Bit();
+ qWarning("QWinTaskbarButton: IID_ITaskbarList4 was not initialized: %#010x, %s.", (unsigned)hresult, err.data());
+ }
+}
+
+QWinTaskbarButtonPrivate::~QWinTaskbarButtonPrivate()
+{
+ pTbList->Release();
+}
+
+HWND QWinTaskbarButtonPrivate::handle()
+{
+ return reinterpret_cast<HWND>(window->winId());
+}
+
+int QWinTaskbarButtonPrivate::iconSize() const
+{
+ return GetSystemMetrics(SM_CXICON);
+}
+
+TBPFLAG QWinTaskbarButtonPrivate::nativeProgressState(QWinTaskbarButton::ProgressState state)
+{
+ TBPFLAG flag;
+ switch (state) {
+ default :
+ case QWinTaskbarButton::NoProgressState : flag = TBPF_NOPROGRESS; break;
+ case QWinTaskbarButton::IndeterminateState : flag = TBPF_INDETERMINATE; break;
+ case QWinTaskbarButton::NormalState : flag = TBPF_NORMAL; break;
+ case QWinTaskbarButton::PausedState : flag = TBPF_PAUSED; break;
+ case QWinTaskbarButton::ErrorState : flag = TBPF_ERROR; break;
+ }
+ return flag;
+}
+
+void QWinTaskbarButtonPrivate::updateOverlayIcon()
+{
+ if (!pTbList || !window)
+ return;
+
+ wchar_t *descrPtr = 0;
+ HICON hicon = 0;
+ if (!overlayIconDescription.isEmpty()) {
+ descrPtr = new wchar_t[overlayIconDescription.length() + 1];
+ descrPtr[overlayIconDescription.toWCharArray(descrPtr)] = 0;
+ }
+ if (!overlayIcon.isNull()) {
+ hicon = QWinExtras::toHICON(overlayIcon.pixmap(iconSize()));
+ }
+
+ pTbList->SetOverlayIcon(handle(), hicon, descrPtr);
+
+ if (hicon)
+ DeleteObject(hicon);
+ if (descrPtr)
+ delete[] descrPtr;
+}
+
+void QWinTaskbarButtonPrivate::updateProgressValue()
+{
+ if (!pTbList || !window || progressState == QWinTaskbarButton::NoProgressState || progressState == QWinTaskbarButton::IndeterminateState)
+ return;
+
+ Q_Q(QWinTaskbarButton);
+
+ const int range = progressMaximum - progressMinimum;
+ if (range > 0) {
+ int value = 100.0 * (progressValue - progressMinimum)/(progressMaximum - progressMinimum);
+ pTbList->SetProgressValue(handle(), value, 100);
+ if (progressState == QWinTaskbarButton::IndeterminateState) {
+ progressState = QWinTaskbarButton::NormalState;
+ emit q->progressStateChanged(progressState);
+ }
+ }
+}
+
+/*!
+ \fn void QWinTaskbarButton::progressStateChanged(const ProgressState state)
+
+ This signal is emitted when \c progressState property changes its value. The \a state argument contains the new value.
+ */
+
+/*!
+ \fn void QWinTaskbarButton::progressValueChanged(int value)
+
+ This signal is emitted when progress indicator \a value changes.
+ */
+
+QT_END_NAMESPACE
+
+#include "moc_qwintaskbarbutton.cpp"
diff --git a/src/winextras/qwintaskbarbutton.h b/src/winextras/qwintaskbarbutton.h
new file mode 100644
index 0000000..6f93788
--- /dev/null
+++ b/src/winextras/qwintaskbarbutton.h
@@ -0,0 +1,116 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#ifndef QWINTASKBARBUTTON_H
+#define QWINTASKBARBUTTON_H
+
+#include <QtWinExtras/qwinextrasglobal.h>
+#include <QObject>
+#include <QList>
+
+QT_BEGIN_NAMESPACE
+
+class QWindow;
+class QWinTaskbarButtonPrivate;
+
+class Q_WINEXTRAS_EXPORT QWinTaskbarButton : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QIcon overlayIcon READ overlayIcon WRITE setOverlayIcon)
+ Q_PROPERTY(QString overlayIconAccessibilityDescription READ overlayIconAccessibilityDescription WRITE setOverlayIconAccessibilityDescription)
+ Q_PROPERTY(int progressValue READ progressValue WRITE setProgressValue)
+ Q_PROPERTY(int progressMaximum READ progressMaximum WRITE setProgressMaximum)
+ Q_PROPERTY(int progressMinimum READ progressMinimum WRITE setProgressMinimum)
+ Q_PROPERTY(ProgressState progressState READ progressState WRITE setProgressState)
+
+public:
+ enum ProgressState {
+ NoProgressState,
+ IndeterminateState,
+ NormalState,
+ PausedState,
+ ErrorState
+ };
+
+ Q_ENUMS(ProgressState)
+
+ explicit QWinTaskbarButton(QObject *parent);
+ ~QWinTaskbarButton();
+ void setWindow(QWindow *window);
+
+ QIcon overlayIcon() const;
+ QString overlayIconAccessibilityDescription() const;
+
+ ProgressState progressState() const;
+ int progressValue() const;
+ int progressMinimum() const;
+ int progressMaximum() const;
+
+ bool eventFilter(QObject *, QEvent *);
+
+public Q_SLOTS:
+ void setOverlayIcon(const QIcon &icon);
+ void setOverlayIconAccessibilityDescription(const QString &description);
+
+ void clearOverlayIcon();
+
+ void setProgressState(ProgressState state);
+ void setProgressValue(int progress);
+ void setProgressMinimum(int min);
+ void setProgressMaximum(int max);
+ void setProgressRange(int mininum, int progressMaximum);
+ void resetProgress();
+
+Q_SIGNALS:
+ void progressStateChanged(const ProgressState state);
+ void progressValueChanged(int value);
+
+private:
+ QScopedPointer<QWinTaskbarButtonPrivate> d_ptr;
+
+ friend class QQuickWinTaskbarButton;
+
+ Q_DECLARE_PRIVATE(QWinTaskbarButton)
+};
+
+QT_END_NAMESPACE
+
+#endif // QWINTASKBARBUTTON_H
diff --git a/src/winextras/qwintaskbarbutton_p.h b/src/winextras/qwintaskbarbutton_p.h
new file mode 100644
index 0000000..4bb187c
--- /dev/null
+++ b/src/winextras/qwintaskbarbutton_p.h
@@ -0,0 +1,88 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#ifndef QWINTASKBARBUTTON_P_H
+#define QWINTASKBARBUTTON_P_H
+
+#include "qwintaskbarbutton.h"
+#include "winshobjidl_p.h"
+
+#include <QWindow>
+#include <QAbstractNativeEventFilter>
+#include <qt_windows.h>
+
+struct ITaskbarList4;
+
+QT_BEGIN_NAMESPACE
+
+class QWinTaskbarButtonPrivate
+{
+public:
+ explicit QWinTaskbarButtonPrivate(QWinTaskbarButton *parent);
+ ~QWinTaskbarButtonPrivate();
+
+ int progressMinimum;
+ int progressMaximum;
+ int progressValue;
+ QIcon overlayIcon;
+ QString overlayIconDescription;
+ QWinTaskbarButton::ProgressState progressState;
+ bool updateNeeded;
+
+ HWND handle();
+ int iconSize() const;
+ static TBPFLAG nativeProgressState(QWinTaskbarButton::ProgressState);
+
+ void updateOverlayIcon();
+ void updateProgressValue();
+
+ ITaskbarList4 *pTbList;
+ QWindow *window;
+
+private:
+ QWinTaskbarButton *q_ptr;
+
+ Q_DECLARE_PUBLIC(QWinTaskbarButton)
+};
+
+QT_END_NAMESPACE
+
+#endif // QWINTASKBARBUTTON_P_H
diff --git a/src/winextras/qwintaskbarbuttoncreatedevent.cpp b/src/winextras/qwintaskbarbuttoncreatedevent.cpp
new file mode 100644
index 0000000..5ea9a62
--- /dev/null
+++ b/src/winextras/qwintaskbarbuttoncreatedevent.cpp
@@ -0,0 +1,66 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#include "qwintaskbarbuttoncreatedevent.h"
+#include "qwintaskbarbuttoncreatedevent_p.h"
+
+QWinTaskbarButtonCreatedEvent::QWinTaskbarButtonCreatedEvent() :
+ QEvent(QWinTaskbarButtonCreatedEventPrivate::eventType())
+{
+}
+
+QWinTaskbarButtonCreatedEvent::~QWinTaskbarButtonCreatedEvent()
+{
+}
+
+QEvent::Type QWinTaskbarButtonCreatedEvent::eventType()
+{
+ return QWinTaskbarButtonCreatedEventPrivate::eventType();
+}
+
+int QWinTaskbarButtonCreatedEventPrivate::eventTypeId = 0;
+
+QEvent::Type QWinTaskbarButtonCreatedEventPrivate::eventType()
+{
+ if (!eventTypeId)
+ eventTypeId = QEvent::registerEventType();
+ return static_cast<QEvent::Type>(eventTypeId);
+}
diff --git a/src/winextras/qwintaskbarbuttoncreatedevent.h b/src/winextras/qwintaskbarbuttoncreatedevent.h
new file mode 100644
index 0000000..17965c9
--- /dev/null
+++ b/src/winextras/qwintaskbarbuttoncreatedevent.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#ifndef QWINTASKBARBUTTONCREATEDEVENT_H
+#define QWINTASKBARBUTTONCREATEDEVENT_H
+
+#include <QEvent>
+#include <QScopedPointer>
+
+QT_BEGIN_NAMESPACE
+
+class QWinTaskbarButtonCreatedEventPrivate;
+
+class QWinTaskbarButtonCreatedEvent : public QEvent
+{
+public:
+ QWinTaskbarButtonCreatedEvent();
+ ~QWinTaskbarButtonCreatedEvent();
+
+ static QEvent::Type eventType();
+
+private:
+ QScopedPointer<QWinTaskbarButtonCreatedEventPrivate> d_ptr;
+
+ Q_DECLARE_PRIVATE(QWinTaskbarButtonCreatedEvent)
+};
+
+QT_END_NAMESPACE
+
+#endif // QWINTASKBARBUTTONCREATEDEVENT_H
diff --git a/src/winextras/qwintaskbarbuttoncreatedevent_p.h b/src/winextras/qwintaskbarbuttoncreatedevent_p.h
new file mode 100644
index 0000000..54ea4e9
--- /dev/null
+++ b/src/winextras/qwintaskbarbuttoncreatedevent_p.h
@@ -0,0 +1,60 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#ifndef QWINTASKBARBUTTONCREATEDEVENT_P_H
+#define QWINTASKBARBUTTONCREATEDEVENT_P_H
+
+#include "qwintaskbarbuttoncreatedevent.h"
+
+QT_BEGIN_NAMESPACE
+
+class QWinTaskbarButtonCreatedEventPrivate
+{
+public:
+ static QEvent::Type eventType();
+
+private:
+ static int eventTypeId;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWINTASKBARBUTTONCREATEDEVENT_P_H
diff --git a/src/winextras/qwinthemechangeevent.cpp b/src/winextras/qwinthemechangeevent.cpp
new file mode 100644
index 0000000..e9eeb63
--- /dev/null
+++ b/src/winextras/qwinthemechangeevent.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#include "qwinthemechangeevent.h"
+#include "qwinthemechangeevent_p.h"
+
+QWinThemeChangeEvent::QWinThemeChangeEvent() :
+ QEvent(eventType())
+{
+}
+
+QWinThemeChangeEvent::~QWinThemeChangeEvent()
+{
+}
+
+QEvent::Type QWinThemeChangeEvent::eventType()
+{
+ return QWinThemeChangeEventPrivate::eventType();
+}
+
+
+int QWinThemeChangeEventPrivate::eventTypeId = 0;
+
+QEvent::Type QWinThemeChangeEventPrivate::eventType()
+{
+ if (!eventTypeId)
+ eventTypeId = QEvent::registerEventType();
+ return static_cast<QEvent::Type>(eventTypeId);
+}
diff --git a/src/winextras/qwinthemechangeevent.h b/src/winextras/qwinthemechangeevent.h
new file mode 100644
index 0000000..63c6c38
--- /dev/null
+++ b/src/winextras/qwinthemechangeevent.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#ifndef QWINTHEMECHANGEEVENT_H
+#define QWINTHEMECHANGEEVENT_H
+
+#include <QtWinExtras/qwinextrasglobal.h>
+#include <QEvent>
+#include <QScopedPointer>
+
+QT_BEGIN_NAMESPACE
+
+class QWinThemeChangeEventPrivate;
+
+class Q_WINEXTRAS_EXPORT QWinThemeChangeEvent : public QEvent
+{
+public:
+ QWinThemeChangeEvent();
+ ~QWinThemeChangeEvent();
+
+ static QEvent::Type eventType();
+
+private:
+ QScopedPointer<QWinThemeChangeEventPrivate> d_ptr;
+
+ Q_DECLARE_PRIVATE(QWinThemeChangeEvent)
+};
+
+QT_END_NAMESPACE
+
+#endif // QWINTHEMECHANGEEVENT_H
diff --git a/src/winextras/qwinthemechangeevent_p.h b/src/winextras/qwinthemechangeevent_p.h
new file mode 100644
index 0000000..62ada0a
--- /dev/null
+++ b/src/winextras/qwinthemechangeevent_p.h
@@ -0,0 +1,56 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#ifndef QWINTHEMECHANGEEVENT_P_H
+#define QWINTHEMECHANGEEVENT_P_H
+
+#include "qwinthemechangeevent.h"
+
+class QWinThemeChangeEventPrivate
+{
+public:
+ static QEvent::Type eventType();
+
+private:
+ static int eventTypeId;
+};
+
+#endif // QWINTHEMECHANGEEVENT_P_H
diff --git a/src/winextras/windowsguidsdefs.cpp b/src/winextras/windowsguidsdefs.cpp
new file mode 100644
index 0000000..8bae7ab
--- /dev/null
+++ b/src/winextras/windowsguidsdefs.cpp
@@ -0,0 +1,70 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#include <QtGlobal>
+
+#include <qt_windows.h>
+#include "winpropkey_p.h"
+#include "winshobjidl_p.h"
+
+// shobjidl.h from MinGW 4.7, shipped with Qt 5.0, does provide many of those, but is unable to link with them
+#if defined(Q_CC_MINGW) || _MSC_VER < 1600
+const GUID CLSID_DestinationList = {0x77f10cf0, 0x3db5, 0x4966, {0xb5,0x20,0xb7,0xc5,0x4f,0xd3,0x5e,0xd6}};
+const GUID CLSID_EnumerableObjectCollection = {0x2d3468c1, 0x36a7, 0x43b6, {0xac,0x24,0xd3,0xf0,0x2f,0xd9,0x60,0x7a}};
+const GUID IID_ICustomDestinationList = {0x6332debf, 0x87b5, 0x4670, {0x90,0xc0,0x5e,0x57,0xb4,0x08,0xa4,0x9e}};
+const GUID IID_IObjectArray = {0x92ca9dcd, 0x5622, 0x4bba, {0xa8,0x05,0x5e,0x9f,0x54,0x1b,0xd8,0xc9}};
+const GUID IID_IObjectCollection = {0x5632b1a4, 0xe38a, 0x400a, {0x92,0x8a,0xd4,0xcd,0x63,0x23,0x02,0x95}};
+const GUID IID_IPropertyStore = {0x886d8eeb, 0x8cf2, 0x4446, {0x8d,0x02,0xcd,0xba,0x1d,0xbd,0xcf,0x99}};
+const GUID IID_ITaskbarList3 = {0xea1afb91, 0x9e28, 0x4b86, {0x90,0xe9,0x9e,0x9f,0x8a,0x5e,0xef,0xaf}};
+const GUID IID_ITaskbarList4 = {0xc43dc798, 0x95d1, 0x4bea, {0x90,0x30, 0xbb,0x99,0xe2,0x98,0x3a,0x1a}};
+const PROPERTYKEY PKEY_Title = {{0xf29f85e0, 0x4ff9, 0x1068, {0xab,0x91,0x08,0x00,0x2b,0x27,0xb3,0xd9}}, 2};
+const PROPERTYKEY PKEY_Link_Arguments = {{0x436f2667, 0x14e2, 0x4feb, {0xb3,0x0a,0x14,0x6c,0x53,0xb5,0xb6,0x74}}, 100};
+const PROPERTYKEY PKEY_AppUserModel_IsDestListSeparator = {{0x9f4c2855, 0x9f79, 0x4b39, {0xa8,0xd0,0xe1,0xd4,0x2d,0xe1,0xd5,0xf3}}, 6};
+#endif
+
+#if defined(Q_CC_MINGW)
+const GUID IID_IShellItem2 = {0x7e9fb0d3, 0x919f, 0x4307, {0xab,0x2e,0x9b,0x18,0x60,0x31,0x0c,0x93}};
+const GUID IID_IShellLinkW = {0x000214f9, 0x0000, 0x0000, {0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}};
+const GUID IID_ITaskbarList = {0xea1afb91, 0x9e28, 0x4b86, {0x90,0xe9,0x9e,0x9f,0x8a,0x5e,0xef,0xaf}};
+const GUID IID_ITaskbarList2 = {0x602d4995, 0xb13a, 0x429b, {0xa6,0x6e,0x19,0x35,0xe4,0x4f,0x43,0x17}};
+const GUID IID_IUnknown = {0x00000000, 0x0000, 0x0000, {0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}};
+const GUID GUID_NULL = {0x00000000, 0x0000, 0x0000, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}};
+#endif
diff --git a/src/winextras/winextras.pro b/src/winextras/winextras.pro
index e6eb1cb..c6f83cb 100644
--- a/src/winextras/winextras.pro
+++ b/src/winextras/winextras.pro
@@ -3,8 +3,46 @@ TARGET = QtWinExtras
load(qt_module)
SOURCES += \
- qwinfunctions.cpp
+ qwinfunctions.cpp \
+ qwinfunctions_p.cpp \
+ qwintaskbarbutton.cpp \
+ windowsguidsdefs.cpp \
+ qjumplist.cpp \
+ qwincolorizationcolorchangeevent.cpp \
+ qwincompositionstatechangeevent.cpp \
+ qwineventfilter.cpp \
+ qwintaskbarbuttoncreatedevent.cpp \
+ qwinthemechangeevent.cpp
HEADERS += \
qwinfunctions.h \
- qwinextrasglobal.h
+ qwinextrasglobal.h \
+ qwinfunctions_p.h \
+ qwintaskbarbutton_p.h \
+ qwintaskbarbutton.h \
+ qjumplist.h \
+ qwincolorizationcolorchangeevent.h \
+ qwincolorizationcolorchangeevent_p.h \
+ qwincompositionstatechangeevent.h \
+ qwincompositionstatechangeevent_p.h \
+ qwintaskbarbuttoncreatedevent.h \
+ qwintaskbarbuttoncreatedevent_p.h \
+ winshobjidl_p.h \
+ winpropkey_p.h \
+ qwineventfilter_p.h \
+ qwinthemechangeevent.h \
+ qwinthemechangeevent_p.h
+
+QMAKE_DOCS = $$PWD/doc/qtwinextras.qdocconf
+
+LIBS += -lole32 -lshlwapi
+LIBS -= -luuid
+
+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
diff --git a/src/winextras/winpropkey_p.h b/src/winextras/winpropkey_p.h
new file mode 100644
index 0000000..aeb0f19
--- /dev/null
+++ b/src/winextras/winpropkey_p.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#ifndef WINPROPKEY_P_H
+#define WINPROPKEY_P_H
+
+#include <propkey.h>
+
+#if _MSC_VER < 1600 || defined(Q_CC_MINGW)
+
+extern const PROPERTYKEY PKEY_AppUserModel_IsDestListSeparator;
+extern const PROPERTYKEY PKEY_Link_Arguments;
+
+#endif
+
+#endif // WINPROPKEY_P_H
diff --git a/src/winextras/winshobjidl_p.h b/src/winextras/winshobjidl_p.h
new file mode 100644
index 0000000..2e8a2d1
--- /dev/null
+++ b/src/winextras/winshobjidl_p.h
@@ -0,0 +1,210 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of QtWinExtras in 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 Digia. For licensing terms and
+ ** conditions see http://qt.digia.com/licensing. For further information
+ ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Digia gives you certain additional
+ ** rights. These rights are described in the Digia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3.0 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.GPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU General Public License version 3.0 requirements will be
+ ** met: http://www.gnu.org/copyleft/gpl.html.
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#ifndef ITASKBARLIST_H
+#define ITASKBARLIST_H
+
+#include <shobjidl.h>
+
+#ifndef __ITaskbarList_INTERFACE_DEFINED__
+#define __ITaskbarList_INTERFACE_DEFINED__
+
+extern const GUID IID_ITaskbarList;
+
+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__
+
+extern const GUID IID_ITaskbarList2;
+
+struct ITaskbarList2 : ITaskbarList
+{
+ virtual HRESULT STDMETHODCALLTYPE MarkFullscreenWindow(HWND hwnd, BOOL fullscreen) = 0;
+};
+
+#endif
+
+#ifndef __ITaskbarList3_INTERFACE_DEFINED__
+#define __ITaskbarList3_INTERFACE_DEFINED__
+
+extern const GUID IID_ITaskbarList3;
+
+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__
+
+extern const GUID IID_ITaskbarList4;
+
+struct ITaskbarList4 : ITaskbarList3
+{
+ virtual HRESULT STDMETHODCALLTYPE SetTabProperties(HWND tab, STPFLAG flags) = 0;
+};
+
+#endif
+
+#ifndef __IObjectArray_INTERFACE_DEFINED__
+#define __IObjectArray_INTERFACE_DEFINED__
+
+extern const GUID CLSID_EnumerableObjectCollection;
+extern const GUID IID_IObjectArray;
+
+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__
+
+extern const GUID IID_IObjectCollection;
+
+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
+};
+
+extern const GUID IID_ICustomDestinationList;
+extern const GUID CLSID_DestinationList;
+
+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
+
+#endif // ITASKBARLIST_H