// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
\page position-plugin-corelocation.html
\title Qt Positioning Core Location plugin
\ingroup QtPositioning-plugins

\brief Provides positioning information on Apple platforms

\section1 Overview

The plugin wraps iOS and macOS positioning subsystems. It is only available
on Apple platforms that support corelocation. The plugin provides only
positioning information.

This plugin can be loaded by using the provider name \b corelocation.

\section1 Parameters

The following table lists parameters that \e can be passed to the corelocation
plugin.

\table
\header
    \li Parameter
    \li Description
\row
    \li RequestAlwaysPermission
    \li Ask permissions for using location not only while using the
        application, but also in background. The parameter is a \c bool, so
        it accepts either \c {true} or \c {false}. If the parameter is not
        specified, it is considered to be \c {false}.
\endtable

On iOS, the application can ask for two levels of location permissions:

\list
    \li \b {When In Use} - makes location updates available only when someone
    uses your app.
    \li \b {Always} - makes location updates available at any time, and lets
    the system launch your app quietly to handle some updates.
\endlist

By default, only the \b {When In Use} permission is requested.
The \c RequestAlwaysPermission parameter is used to explicitly reqeust for
\b {Always} permission.

\section1 Position source usage example

The following examples show how to create a \b corelocation PositionSource
using different permission levels.

\section2 QML

\code
// default - When In Use permission.
PositionSource {
    name: "corelocation"
}

// RequestAlwaysPermission = false. Same as default.
PositionSource {
    name: "corelocation"
    PluginParameter { name: "RequestAlwaysPermission"; value: false }
}

// RequestAlwaysPermission = true. Request Always permission.
PositionSource {
    name: "corelocation"
    PluginParameter { name: "RequestAlwaysPermission"; value: true }
}
\endcode

\section2 C++

\code
// default - When In Use permission.
QGeoPositionInfoSource *defaultSource
                = QGeoPositionInfoSource::createSource("corelocation", this);

// RequestAlwaysPermission = false. Same as default.
params["RequestAlwaysPermission"] = false;
QGeoPositionInfoSource *whenInUseSource
                = QGeoPositionInfoSource::createSource("corelocation", params, this);

// RequestAlwaysPermission = true. Request Always permission.
params["RequestAlwaysPermission"] = true;
QGeoPositionInfoSource *alwaysSource
                = QGeoPositionInfoSource::createSource("corelocation", params, this);
\endcode

*/
