AusweisApp2/src/activation/intent/IntentActivationHandler.h

52 lines
1.1 KiB
C
Raw Normal View History

2017-07-03 09:30:10 +02:00
/*!
* IntentActivationHandler.h
*
* \copyright Copyright (c) 2015 Governikus GmbH & Co. KG
*/
#pragma once
2017-07-03 09:33:28 +02:00
#include "ActivationHandler.h"
2017-07-03 09:30:10 +02:00
#ifdef Q_OS_ANDROID
#include <jni.h>
extern "C"
{
JNIEXPORT void JNICALL Java_com_governikus_ausweisapp2_MainActivity_triggerActivation(JNIEnv* env, jobject obj, jstring lastIntent);
}
#endif
namespace governikus
{
/*!
2017-07-03 09:33:28 +02:00
* This ActivationHandler implements an API by opening custom URLs registered in the Android manifest,
2017-07-03 09:30:10 +02:00
* as specified by TR-03124-1.
* The URL is passed by an Android Intent mechanism to the application.
*/
class IntentActivationHandler
2017-07-03 09:33:28 +02:00
: public ActivationHandler
2017-07-03 09:30:10 +02:00
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "governikus.ActivationHandler" FILE "metadata.json")
Q_INTERFACES(governikus::ActivationHandler)
#ifdef Q_OS_ANDROID
2017-09-15 10:23:30 +02:00
friend void ::Java_com_governikus_ausweisapp2_MainActivity_triggerActivation(JNIEnv*, jobject, jstring);
2017-07-03 09:30:10 +02:00
#endif
2017-07-03 09:33:28 +02:00
private:
void onIntent(const QUrl& pUrl);
2017-07-03 09:30:10 +02:00
public:
2017-07-03 09:33:28 +02:00
IntentActivationHandler() = default;
2017-07-03 09:30:10 +02:00
virtual bool start() override;
virtual void stop() override;
};
} /* namespace governikus */