code_app/modules/twainui/qmfcapp.hpp

58 lines
1.2 KiB
C++
Raw Permalink Normal View History

2023-04-20 09:49:48 +00:00
// Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
// SPDX-License-Identifier: BSD-3-Clause
// Declaration of the QMfcApp classes
#ifndef QMFCAPP_H
#define QMFCAPP_H
#include <QApplication>
#if defined(_AFXDLL) && defined(_MSC_VER)
#define QTWINMIGRATE_WITHMFC
class CWinApp;
#endif
#if QT_VERSION >= 0x050000
#include <QAbstractNativeEventFilter>
class QMfcAppEventFilter : public QAbstractNativeEventFilter
{
public:
QMfcAppEventFilter();
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result);
};
#endif
class QMfcApp : public QApplication
{
public:
static bool pluginInstance(Qt::HANDLE plugin = 0);
#ifdef QTWINMIGRATE_WITHMFC
static int run(CWinApp *mfcApp);
static QApplication *instance(CWinApp *mfcApp);
QMfcApp(CWinApp *mfcApp, int &argc, char **argv);
#endif
QMfcApp(int &argc, char **argv);
~QMfcApp();
bool winEventFilter(MSG *msg, long *result);
static void enterModalLoop();
static void exitModalLoop();
private:
#ifdef QTWINMIGRATE_WITHMFC
static char ** mfc_argv;
static int mfc_argc;
static CWinApp *mfc_app;
#endif
int idleCount;
bool doIdle;
};
#endif // QMFCAPP_H