os_android.h 2.22 KB
Newer Older
1
/*
2
 * Copyright (C) 2014-2019 CZ.NIC
3 4 5 6 7 8 9 10 11 12 13 14
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
15
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 17 18 19 20 21 22 23
 *
 * In addition, as a special exception, the copyright holders give
 * permission to link the code of portions of this program with the
 * OpenSSL library under certain conditions as described in each
 * individual source file, and distribute linked combinations including
 * the two.
 */

24
#pragma once
25 26 27

#include <QObject>

28
#include "src/qml_interaction/interaction_zfo_file.h"
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46

/*!
 * @brief Wraps Android intent retrieval.
 *
 * @todo See https://bugreports.qt.io/browse/QTBUG-44945 ,
 *     https://bugreports.qt.io/browse/QTBUG-36014 ,
 *     http://grokbase.com/t/gg/android-qt/1316xratx9/canonical-way-to-handle-intent-action-view-on-start ,
 *     http://www.opengis.ch/2015/12/03/passing-android-intents-to-qt/ ,
 *     http://blog.qt.io/blog/2016/06/30/intents-with-qt-for-android-part-1/
 *     whether there could be a way how to handle incoming intents via a
 *     signal-slot mechanism.
 */
class IntentNotification : public QObject {
	Q_OBJECT
public:
	/*!
	 * @brief Constructor.
	 *
47
	 * @param[in] inter ZFO file interaction object.
48 49
	 * @param[in] parent Parent object.
	 */
50
	explicit IntentNotification(InteractionZfoFile &inter,
51 52 53 54 55 56 57 58 59 60 61 62 63
	    QObject *parent = Q_NULLPTR);

	/*!
	 * @brief Obtain intent arguments.
	 *
	 * @return List of files to be opened.
	 */
	static
	QStringList getIntentArguments(void);

public slots:
	/*!
	 * @brief Scans intent and process the obtained files.
64 65
	 *
	 * @param[in] newState New application state.
66
	 */
67
	void scanIntentsForFiles(Qt::ApplicationState newState);
68 69

private:
70
	InteractionZfoFile &m_inter; /*!< QML interaction object. */
71
};