KDevelop API Documentation

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 parts/filecreate/file-templates dir or languages/YOURLANGUAGE/file_templates 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. KDevelop 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 parts/filecreate/template-info.xml. This file is fairly self-explanatory if you take a look at it.

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

That's all! :)

KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Oct 19 08:02:08 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003