summaryrefslogtreecommitdiffstats
path: root/tools/utils/qtcreator/templates/wizards/classes/qt3d/wizard.json
blob: 8079aa4b4d325777751ca2a44f4231989ef0e9a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
{
    "version": 1,
    "kind": "file",
    "id": "D.Qt3DClass",
    "category": "O.C++",
    "trDescription": "Creates a Qt3D class consisting of a C++ header, source file and private header for a new component that you can add to a C++ project.",
    "trDisplayName": "Qt3D Class",
    "trDisplayCategory": "C++",
    "icon": "../../global/genericfilewizard.png",
    "enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}",

    "options":
    [
        { "key": "TargetPath", "value": "%{Path}" },
        { "key": "HdrPath", "value": "%{Path}/%{HdrFileName}" },
        { "key": "PrivateHdrPath", "value": "%{Path}/%{PrivateHdrFileName}" },
        { "key": "SrcPath", "value": "%{Path}/%{SrcFileName}" },
        { "key": "CN", "value": "%{JS: Cpp.className('%{Class}')}" },
        { "key": "Base", "value": "%{JS: ( '%{BaseCB}' === '' ) ? '%{BaseEdit}' : '%{BaseCB}'}" },
        { "key": "isQObject", "value": "%{JS: [ 'QNode', 'QComponent', 'QEntity'].indexOf('%{Base}') >= 0 }" },
        { "key": "GUARD", "value": "%{JS: Cpp.classToHeaderGuard('%{Class}', '%{JS: Util.preferredSuffix('text/x-c++hdr')}')}" },
        { "key": "PRIVATEGUARD", "value": "%{JS: Cpp.classToHeaderGuard('%{Class}' + '_P', '%{JS: Util.preferredSuffix('text/x-c++hdr')}')}" },
        { "key": "SharedDataInit", "value": "%{JS: ('%{IncludeQSharedData}') ? 'data(new %{CN}Data)' : '' }" },
        { "key": "IncludeQNode", "value": "%{JS: '%{BaseCB}' === 'QNode'}" },
        { "key": "IncludeQComponent", "value": "%{JS: '%{BaseCB}' === 'QComponent'}" },
        { "key": "IncludeQEntity", "value": "%{JS: '%{BaseCB}' === 'QEntity'}" },
        { "key": "IncludeQBackendNode", "value": "%{JS: '%{BaseCB}' === 'QBackendNode'}" }
    ],

    "pages":
    [
        {
            "trDisplayName": "Define Qt3D Class",
            "trShortTitle": "Details",
            "typeId": "Fields",
            "data" :
            [
                {
                    "name": "Class",
                    "trDisplayName": "Class name:",
                    "mandatory": true,
                    "type": "LineEdit",
                    "data": { "validator": "(?:(?:[a-zA-Z_][a-zA-Z_0-9]*::)+[a-zA-Z_][a-zA-Z_0-9]*|)" }
                },
                {
                    "name": "BaseCB",
                    "trDisplayName": "Base class:",
                    "type": "ComboBox",
                    "data":
                    {
                        "items": [ { "trKey": "<Custom>", "value": "" },
                                   "QNode", "QComponent", "QEntity", "QBackendNode" ]
                    }
                },
                {
                    "name": "BaseEdit",
                    "type": "LineEdit",
                    "enabled": "%{JS: '%{BaseCB}' === ''}",
                    "mandatory": false,
                    "data":
                    {
                        "trText": "%{BaseCB}",
                        "trDisabledText": "%{BaseCB}"
                    }
                },

                {
                    "name": "Sp1",
                    "type": "Spacer",
                    "data": { "factor": 2 }
                },
                {
                    "name": "HdrFileName",
                    "type": "LineEdit",
                    "trDisplayName": "Header file:",
                    "mandatory": false,
                    "enabled": "%{JS: '%{BaseCB}' !== 'QBackendNode'}",
                    "data": { "trText": "%{JS: Cpp.classToFileName('%{Class}', '%{JS: Util.preferredSuffix('text/x-c++hdr')}')}" }
                },
                {
                    "name": "PrivateHdrFileName",
                    "type": "LineEdit",
                    "trDisplayName": "Private header file:",
                    "mandatory": true,
                    "data": { "trText": "%{JS: Cpp.classToFileName('%{Class}' + '_p', '%{JS: Util.preferredSuffix('text/x-c++hdr')}')}" }
                },
                {
                    "name": "SrcFileName",
                    "type": "LineEdit",
                    "trDisplayName": "Source file:",
                    "mandatory": true,
                    "data": { "trText": "%{JS: Cpp.classToFileName('%{Class}', '%{JS: Util.preferredSuffix('text/x-c++src')}')}" }
                },
                {
                    "name": "Path",
                    "type": "PathChooser",
                    "trDisplayName": "Path:",
                    "mandatory": true,
                    "data":
                    {
                        "kind": "existingDirectory",
                        "basePath": "%{InitialPath}",
                        "path": "%{InitialPath}"
                    }
                }
            ]
        },
        {
            "trDisplayName": "Project Management",
            "trShortTitle": "Summary",
            "typeId": "Summary"
        }
    ],

    "generators":
    [
        {
            "typeId": "File",
            "data":
            [
                {
                    "source": "file.h",
                    "target": "%{HdrPath}",
                    "condition": "%{JS: '%{Base}' !== 'QBackendNode'}",
                    "openInEditor": true
                },
                {
                    "source": "file_p.h",
                    "target": "%{PrivateHdrPath}",
                    "condition": "%{JS: '%{Base}' !== 'QBackendNode'}",
                    "openInEditor": true
                },
                {
                    "source": "file.cpp",
                    "target": "%{SrcPath}",
                    "condition": "%{JS: '%{Base}' !== 'QBackendNode'}",
                    "openInEditor": true
                },
                {
                    "source": "backendnode.cpp",
                    "target": "%{SrcPath}",
                    "condition": "%{JS: '%{Base}' === 'QBackendNode'}",
                    "openInEditor": true
                },
                {
                    "source": "backendnode_p.h",
                    "target": "%{PrivateHdrPath}",
                    "condition": "%{JS: '%{Base}' === 'QBackendNode'}",
                    "openInEditor": true
                }
            ]
        }
    ]
}