{
    "version": 1,
    "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject" ],
    "id": "K.KMailEditorConverterTextPlugin",
    "category": "K.PIM",
    "trDescription": "Create a KMail Editor Converter Text Plugin.",
    "trDisplayName": "KMail Editor Converter Text Plugin",
    "trDisplayCategory": "KMail Plugin",
    "enabled": "%{JS: [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}",

    "options":
        [
        { "key": "ProjectFile", "value": "%{JS: '%{CMakeFile}'}" },
        { "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" },
        { "key": "JsonFileName", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectNameLower}editorplugin', 'json')}" },
        { "key": "CppPluginEditor", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectNameLower}plugineditor.cpp')}" },
        { "key": "CN", "value": "%{JS: '%{ProjectName}'.charAt(0).toUpperCase() + '%{ProjectName}'.substr(1)}" },
        { "key": "ProjectNameLower", "value": "%{JS: '%{ProjectName}'.toLowerCase() }" },
        { "key": "ProjectNameUpper", "value": "%{JS: '%{ProjectName}'.toUpperCase()}" },
        { "key": "HeaderPluginEditor", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectNameLower}plugineditor.h')}" },
        { "key": "CppPluginEditorInterface", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectNameLower}plugineditorinterface.cpp')}" },
        { "key": "HeaderPluginEditorInterface", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectNameLower}plugineditorinterface.h')}" }
    ],

    "pages":
        [
        {
            "trDisplayName": "Project Location",
            "trShortTitle": "Location",
            "typeId": "Project",
            "data": { "trDescription": "This wizard creates a KMail editor converter text plugin." }
        },
        {
            "trDisplayName": "Define Project Details",
            "trShortTitle": "Details",
            "typeId": "Fields",
            "data" :
                [
                {
                    "name": "PluginName",
                    "trDisplayName": "Name:",
                    "mandatory": true,
                    "type": "LineEdit"
                },
                {
                    "name": "PluginDescription",
                    "trDisplayName": "Description:",
                    "mandatory": true,
                    "type": "LineEdit"
                },
                {
                    "name": "DebugCategoryName",
                    "trDisplayName": "Debug Category Name:",
                    "mandatory": true,
                    "type": "LineEdit",
                    "data": { "validator": "(?:(?:[a-zA-Z_][a-zA-Z_0-9]*::)*[a-zA-Z_][a-zA-Z_0-9]*|)" }
                },
                {
                    "name": "DebugIdentifierName",
                    "trDisplayName": "Debug Identifier Name:",
                    "mandatory": true,
                    "type": "LineEdit",
                    "data": { "validator": "(?:(?:[a-zA-Z_][a-zA-Z_0-9]*::)*[a-zA-Z_][a-zA-Z_0-9]*|)" }
                }
            ]
        },
        {
            "trDisplayName": "Kit Selection",
            "trShortTitle": "Kits",
            "typeId": "Kits",
            "enabled": "%{JS: ! %{IsSubproject}}",
            "data": { "projectFilePath": "%{ProjectFile}" }
        },

        {
            "trDisplayName": "Project Management",
            "trShortTitle": "Summary",
            "typeId": "Summary"
        }
    ],
    "generators":
        [
        {
            "typeId": "File",
            "data":
                [
                {
                    "source": "CMakeLists.txt",
                    "openAsProject": true,
                    "condition": "true"
                },
                {
                    "source": "plugineditor.cpp",
                    "target": "%{CppPluginEditor}",
                    "openInEditor": true
                },
                {
                    "source": "plugineditor.h",
                    "target": "%{HeaderPluginEditor}",
                    "openInEditor": true
                },
                {
                    "source": "plugineditorinterface.cpp",
                    "target": "%{CppPluginEditorInterface}",
                    "openInEditor": true
                },
                {
                    "source": "plugineditorinterface.h",
                    "target": "%{HeaderPluginEditorInterface}",
                    "openInEditor": true
                },
                {
                    "source": "plugin.json.impl",
                    "target": "%{JsonFileName}",
                    "openInEditor": false
                }
            ]
        }
    ]
}
