{
    "version": 1,
    "supportedProjectTypes": [ ],
    "id": "B.QtStudio.Qml.2",
    "category": "B.StudioQtQuickFiles",
    "trDescription": "Creates a component file (.qml) with boilerplate code, starting with \"import QtQuick 2.15\".",
    "trDisplayName": "Qt Quick File",
    "trDisplayCategory": "Qt Quick Files",
    "icon": "file_qml.png",
    "platformIndependent": true,

    "options":
        [
        { "key": "QmlFile", "value": "%{Class}.%{JS: Util.preferredSuffix('text/x-qml')}" },
        { "key": "ApplicationImport", "value": "%{QmlProjectName} 1.0" },
        { "key": "RootItem", "value": "%{JS: %{RootItemCB}.RootItem}" },
        { "key": "UseImportDefault", "value": "%{JS: false}" },
        { "key": "UseQtQuickControls2Default", "value": "%{JS: true}" }
    ],

    "pages" :
        [
        {
            "trDisplayName": "Define Class",
            "trShortTitle": "Details",
            "typeId": "Fields",
            "data" :
                [
                {
                    "name": "Class",
                    "trDisplayName": "Component name:",
                    "mandatory": true,
                    "type": "LineEdit",
                    "data": {
                        "validator": "(?:[A-Z_][a-zA-Z_0-9]*|)",
                        "fixup": "%{JS: '%{INPUT}'.charAt(0).toUpperCase() + '%{INPUT}'.slice(1) }"
                    }
                },
                {
                    "name": "TargetPath",
                    "type": "PathChooser",
                    "trDisplayName": "Path:",
                    "mandatory": true,
                    "data":
                    {
                        "kind": "existingDirectory",
                        "basePath": "%{InitialPath}",
                        "path": "%{InitialPath}"
                    }
                },
                {
                    "name": "RootItemCB",
                    "trDisplayName": "Root Item:",
                    "type": "ComboBox",
                    "data":
                    {
                        "index": 0,
                        "items":
                            [
                            {
                                "trKey": "Item",
                                "value":
                                "({
                                    'RootItem': 'Item'
                                })"
                            },
                            {
                                "trKey": "Rectangle",
                                "value":
                                "({
                                    'RootItem': 'Rectangle'
                                })"
                            },
                            {
                                "trKey": "Image",
                                "value":
                                "({
                                    'RootItem': 'Image'
                                })"
                            },
                            {
                                "trKey": "BorderImage",
                                "value":
                                "({
                                    'RootItem': 'BorderImage'
                                })"
                            },
                            {
                                "trKey": "Flickable",
                                "value":
                                "({
                                    'RootItem': 'Flickable'
                                })"
                            },
                            {
                                "trKey": "Row",
                                "value":
                                "({
                                    'RootItem': 'Row'
                                })"
                            },
                            {
                                "trKey": "Column",
                                "value":
                                "({
                                    'RootItem': 'Column'
                                })"
                            },
                            {
                                "trKey": "Flow",
                                "value":
                                "({
                                    'RootItem': 'Flow'
                                })"
                            },
                            {
                                "trKey": "Grid",
                                "value":
                                "({
                                    'RootItem': 'Grid'
                                })"
                            }
                        ]
                    }
                },
                {
                    "name": "UseImport",
                    "trDisplayName": "Use Application Import",
                    "type": "CheckBox",
                    "data":
                    {
                        "checked": "%{UseImportDefault}"
                    }
                },
                {
                    "name": "UseQtQuickControls2",
                    "trDisplayName": "Use QtQuick Controls 2",
                    "type": "CheckBox",
                    "data":
                    {
                        "checked": "%{UseQtQuickControls2Default}"
                    }
                }
            ]
        }
    ],
    "generators" :
        [
        {
            "typeId": "File",
            "data":
            {
                "source": "file.qml.tpl",
                "target": "%{TargetPath}/%{QmlFile}",
                "openInEditor": true
            }
        }
    ]
}
