summaryrefslogtreecommitdiffstats
path: root/doc/api/HowToAddFileTemplates.dox
blob: cb9ee17b9ae906bf4f4f72c0c60fa6c32a915650 (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
/** \file HowToAddFileTemplates.dox
  * \brief How to add file templates to the file create part
  */
/** \page howToAddFileTemplates How to add file templates to the file create part

File templates provide the developer with a basic file.  They are prototypes for both source files of
the project's language, and for other files that may be useful in the project. For example, a C++
project may have templates for both .cpp and .h files, plus QT Designer .ui files, and supporting
files such as XML.

These prototypes are placed in <code>parts/filecreate/file-templates</code> dir or
<code>languages/YOURLANGUAGE/file_templates</code> and have names equal to the extensions of language
source files.

Sometimes, different 'flavours' of template are required for a particular file type. In these
instances, 'subtypes' can be defined to allow several different templates for a file type. An example
of this are QT designer '.ui' files. TDevelop supplies several different templates for .ui
files. Subtypes are named by the file type extension followed by a hyphen followed by an identifier
for the subtype. E.g. ui-widget, ui-dialog

The description of the prototypes is placed in <code>parts/filecreate/template-info.xml</code>. This
file is fairly self-explanatory if you take a look at it.

Note that templates and templates information can be edited within TDevelop itself. The global
templates that can be made available to any project can be changed in Settings / Configure TDevelop... / New File
Wizard; and project related settings can be changed in Project / Project Options / New File Wizard.

That's all! :)

*/