{
    "version": 1,
    "supportedProjectTypes": [ "QmlProjectManager.QmlProject" ],
    "id": "QA.QtStudioUiSwipe",
    "category": "H.StudioMobileProject",
    "trDescription": "Creates an application that uses Qt Quick controls to implement a swipable screen.",
    "trDisplayName": "Swipe",
    "trDisplayCategory": "Mobile",
    "icon": "mobile_swipe.png",
    "fontIconName": "wizardsMobile",
    "enabled": "%{JS: [ %{Plugins} ].indexOf('QmlProjectManager') >= 0}",
    "platformIndependent": true,

    "options":
        [
        { "key": "ProjectExecutableName", "value": "%{ProjectName}App" },
        { "key": "ProjectPluginName", "value": "%{ProjectName}plugin" },
        { "key": "ProjectPluginClassName", "value": "%{ProjectName}Plugin" },
        { "key": "QmlProjectFileName", "value": "%{JS: Util.fileName('%{ProjectName}', 'qmlproject')}" },
        { "key": "ImportModuleName", "value": "%{ProjectName}" },
        { "key": "IsQt6Project", "value": "%{JS: value('QtQuickVersion') !== '2.15' }" },
        { "key": "QtQuickVersion", "value": "%{JS: %{TargetQtVersion}.TargetQuickVersion}" },
        { "key": "QtQuickFeature", "value": "QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}" },
        { "key": "QtQuickControlsStyleInternalQt5", "value": "%{JS: %{ControlsStyle}.QtQuickControlsStyle}" },
        { "key": "QtQuickControlsStyleInternalQt6", "value": "%{JS: value('QtQuickControlsStyleInternalQt5') === 'Default' ? 'Basic' : value('QtQuickControlsStyleInternalQt5')}" },
        { "key": "QtQuickControlsStyle", "value": "%{JS: value('IsQt6Project') === 'true' ? value('QtQuickControlsStyleInternalQt6') : value('QtQuickControlsStyleInternalQt5')}" },
        { "key": "QtQuickControlsStyleTheme", "value": "%{JS: %{ControlsStyle}.QtQuickControlsStyleTheme}" },
        { "key": "ApplicationImport", "value": "%{JS: value('IsQt6Project') === 'true' ? '%{ImportModuleName}' : '%{ImportModuleName} 1.0'}" },
        { "key": "UseStandardResolution", "value": "%{JS: value('CustomScreenWidth') === '' || value('CustomScreenHeight') === ''}" },
        { "key": "ScreenWidth", "value": "%{JS: value('UseStandardResolution') === 'true' ? %{ScreenFactor}.ScreenWidth : value('CustomScreenWidth')}" },
        { "key": "ScreenHeight", "value": "%{JS: value('UseStandardResolution') === 'true' ? %{ScreenFactor}.ScreenHeight : value('CustomScreenHeight')}" },
        { "key": "UseVirtualKeyboard", "value": "%{JS: false}" },
        { "key": "ImportModuleVersion", "value": "%{JS: value('IsQt6Project') === 'true' ? '' : '1.0'}" }
    ],

    "pages":
        [
        {
            "defaultValues": "qmlapplication-project-page"
        },
        {
            "trDisplayName": "Define Project Details",
            "trShortTitle": "Details",
            "typeId": "Fields",
            "data":
                [
                {
                    "name": "ScreenFactor",
                    "trDisplayName": "Screen Resolution:",
                    "type": "ComboBox",
                    "data":
                    {
                        "index": 0,
                        "items":
                            [
                            {
                                "trKey": "1080 x 1920",
                                "value":
                                "({
                                    'ScreenWidth': '1080',
                                    'ScreenHeight': '1920'
                                })"
                            },
                            {
                                "trKey": "960 x 1280",
                                "value":
                                "({
                                    'ScreenWidth': '960',
                                    'ScreenHeight': '1280'
                                })"
                            },
                            {
                                "trKey": "750 x 1334",
                                "value":
                                "({
                                    'ScreenWidth': '750',
                                    'ScreenHeight': '1334'
                                })"
                            },
                            {
                                "trKey": "720 x 1280",
                                "value":
                                "({
                                    'ScreenWidth': '720',
                                    'ScreenHeight': '1280'
                                })"
                            }
                        ]
                    }
                },
                {
                    "name": "ControlsStyle",
                    "trDisplayName": "Qt Quick Controls Style:",
                    "type": "ComboBox",
                    "data":
                    {
                        "index": 1,
                        "items":
                            [
                            {
                                "trKey": "Default",
                                "value":
                                "({
                                    'QtQuickControlsStyle': 'Default',
                                    'QtQuickControlsStyleTheme': ''
                                })"
                            },
                            {
                                "trKey": "Material Light",
                                "value":
                                "({
                                    'QtQuickControlsStyle': 'Material',
                                    'QtQuickControlsStyleTheme': 'Light'
                                })"
                            },
                            {
                                "trKey": "Material Dark",
                                "value":
                                "({
                                    'QtQuickControlsStyle': 'Material',
                                    'QtQuickControlsStyleTheme': 'Dark'
                                })"
                            },
                            {
                                "trKey": "Universal Light",
                                "value":
                                "({
                                    'QtQuickControlsStyle': 'Universal',
                                    'QtQuickControlsStyleTheme': 'Light'
                                })"
                            },
                            {
                                "trKey": "Universal Dark",
                                "value":
                                "({
                                    'QtQuickControlsStyle': 'Universal',
                                    'QtQuickControlsStyleTheme': 'Dark'
                                })"
                            },
                            {
                                "trKey": "Universal System",
                                "value":
                                "({
                                    'QtQuickControlsStyle': 'Universal',
                                    'QtQuickControlsStyleTheme': 'System'
                                })"
                            },
                            {
                                "trKey": "Fusion",
                                "value":
                                "({
                                    'QtQuickControlsStyle': 'Fusion',
                                    'QtQuickControlsStyleTheme': ''
                                })"
                            },
                            {
                                "trKey": "Imagine",
                                "value":
                                "({
                                    'QtQuickControlsStyle': 'Imagine',
                                    'QtQuickControlsStyleTheme': ''
                                })"
                            }
                        ]
                    }
                },
                {
                    "name": "CustomScreenWidth",
                    "trDisplayName": "Custom screen width:",
                    "mandatory": false,
                    "type": "LineEdit",
                    "data":
                    {
                        "validator": "^[0-9]*$",
                        "trText": ""
                    }
                },
                {
                    "name": "CustomScreenHeight",
                    "trDisplayName": "Custom screen height:",
                    "mandatory": false,
                    "type": "LineEdit",
                    "data":
                    {
                        "validator": "^[0-9]*$",
                        "trText": ""
                    }
                },
                {
                    "name": "TargetQtVersion",
                    "trDisplayName": "Target Qt Version:",
                    "mandatory": true,
                    "type": "ComboBox",
                    "data":
                    {
                        "index": 1,
                        "items":
                            [
                            {
                                "trKey": "Qt 5",
                                "value":
                                "({
                                    'TargetQuickVersion': '2.15'
                                })"
                            },
                            {
                                "trKey": "Qt 6.2",
                                "value":
                                "({
                                    'TargetQuickVersion': '6.2'
                                })"
                            },
                            {
                                "trKey": "Qt 6.3",
                                "value":
                                "({
                                    'TargetQuickVersion': '6.3'
                                })"
                            }
                        ]
                    }
                }
            ]
        }
    ],
    "generators":
        [
        {
            "typeId": "File",
            "data":
                [
                {
                    "source": "../common/app.qmlproject.tpl",
                    "target": "%{ProjectDirectory}/%{QmlProjectFileName}",
                    "openAsProject": true
                },
                {
                    "source": "../common/CMakeLists.main.txt.tpl",
                    "target": "%{ProjectDirectory}/CMakeLists.txt"
                },
                {
                    "source": "../common/qmlmodules.tpl",
                    "target": "%{ProjectDirectory}/qmlmodules"
                },
                {
                    "source": "../common/main.qml",
                    "target": "%{ProjectDirectory}/main.qml"
                },
                {
                    "source": "../common/qtquickcontrols2.conf.tpl",
                    "target": "%{ProjectDirectory}/qtquickcontrols2.conf"
                },
                {
                    "source": "../common/main.cpp.tpl",
                    "target": "%{ProjectDirectory}/src/main.cpp"
                },
                {
                    "source": "../common/app_environment.h.tpl",
                    "target": "%{ProjectDirectory}/src/app_environment.h"
                },
                {
                    "source": "../common/import_qml_plugins.h.tpl",
                    "target": "%{ProjectDirectory}/src/import_qml_plugins.h"
                },
                {
                    "source": "CMakeLists.content.txt.tpl",
                    "target": "%{ProjectDirectory}/content/CMakeLists.txt"
                },
                {
                    "source": "App.qml.tpl",
                    "target": "%{ProjectDirectory}/content/App.qml"
                },
                {
                    "source": "Screen01.ui.qml.tpl",
                    "target": "%{ProjectDirectory}/content/Screen01.ui.qml",
                    "openInEditor": true
                },
                {
                    "source": "Screen02.ui.qml.tpl",
                    "target": "%{ProjectDirectory}/content/Screen02.ui.qml",
                    "openInEditor": true
                },
                {
                    "source": "../common/fonts.txt",
                    "target": "%{ProjectDirectory}/content/fonts/fonts.txt"
                },
                {
                    "source": "../common/asset_imports.txt",
                    "target": "%{ProjectDirectory}/asset_imports/asset_imports.txt"
                },
                {
                    "source": "../common/CMakeLists.imports.txt.tpl",
                    "target": "%{ProjectDirectory}/imports/CMakeLists.txt"
                },
                {
                    "source": "../shared-plugin/name/CMakeLists.importmodule.txt.tpl",
                    "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/CMakeLists.txt"
                },
                {
                    "source": "../shared-plugin/name/importmodule.qmldir.tpl",
                    "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/qmldir"
                },
                {
                    "source": "../shared-plugin/name/Constants.qml.tpl",
                    "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/Constants.qml"
                },
                {
                    "source": "../shared-plugin/name/DirectoryFontLoader.qml.tpl",
                    "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DirectoryFontLoader.qml"
                },
                {
                    "source": "../shared-plugin/name/EventListModel.qml.tpl",
                    "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/EventListModel.qml"
                },
                {
                    "source": "../shared-plugin/name/EventListSimulator.qml.tpl",
                    "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/EventListSimulator.qml"
                },
                {
                    "source": "../shared-plugin/name/designer/plugin.metainfo",
                    "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/designer/plugin.metainfo"
                }
            ]
        }
    ]
}
