From f3593564da6918990652756cdde0140ee4ec4923 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 17 Sep 2015 15:52:06 +0200 Subject: iOS: add support for native message dialogs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch will add support for native message dialogs on iOS. Change-Id: Iba2237b371ccbdfe4c772d25c3ea925eb64e5a0c Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qiosmessagedialog.h | 65 +++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/plugins/platforms/ios/qiosmessagedialog.h (limited to 'src/plugins/platforms/ios/qiosmessagedialog.h') diff --git a/src/plugins/platforms/ios/qiosmessagedialog.h b/src/plugins/platforms/ios/qiosmessagedialog.h new file mode 100644 index 0000000000..a9bd42324e --- /dev/null +++ b/src/plugins/platforms/ios/qiosmessagedialog.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QIOSMESSAGEDIALOG_H +#define QIOSMESSAGEDIALOG_H + +#include +#include + +QT_BEGIN_NAMESPACE + +Q_FORWARD_DECLARE_OBJC_CLASS(UIAlertController); +Q_FORWARD_DECLARE_OBJC_CLASS(UIAlertAction); + +class QIOSMessageDialog : public QPlatformMessageDialogHelper +{ +public: + QIOSMessageDialog(); + ~QIOSMessageDialog(); + + void exec() Q_DECL_OVERRIDE; + bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) Q_DECL_OVERRIDE; + void hide() Q_DECL_OVERRIDE; + +private: + QEventLoop m_eventLoop; + UIAlertController *m_alertController; + QString messageTextPlain(); + UIAlertAction *createAction(StandardButton button); +}; + +QT_END_NAMESPACE + +#endif // QIOSMESSAGEDIALOG_H + -- cgit v1.2.3