diff --git a/doc/org.eclipse.cdt.doc.isv/guide/projectTemplateEngine/Howtodeveloptemplates.html b/doc/org.eclipse.cdt.doc.isv/guide/projectTemplateEngine/Howtodeveloptemplates.html new file mode 100644 index 00000000000..3861e5ab5ba --- /dev/null +++ b/doc/org.eclipse.cdt.doc.isv/guide/projectTemplateEngine/Howtodeveloptemplates.html @@ -0,0 +1,830 @@ + +
+
+ + |
+ + + | +
+Templates form an important part of the drive to support automatic GUI generation
+ of various user interface types as supported in Eclipse frame work.
+These templates are often referred as project
+templates, as they are used to support the creation of ready-made projects. For
+example, you can define a template to create a simple GUI based
+EXE
application for a set of Build Configurations.
+
+The project templates are simple XML files, which follow a structure or
+schema defined in the TemplateDescriptorSchema.xsd
file. These
+templates define the inputs and processes required to create a project for a
+particular platform. Inputs define the type of inputs required such as, files,
+settings etc. The processes define what to do with those inputs to create a
+particular type of project.
+
+The New Project wizard lists all the templates available based on the +matching criteria defined by the templates. Once the user selects a template from the list, the +Template Engine plug-in processes the selected template. The plug-in generates the subsequent wizard +pages based on whether the template needs user input or not. +
+
+This document details the schema for writing project templates. The
+schema file TemplateDescriptorSchema.xsd
, which defines the
+structure for the project templates, is part of
+org.eclipse.cdt.templateengine
plug-in.
+
+The structure or schema for a project template is as follows: +
+<template
type="TemplateType"
version="Version"
supplier="Supplier"
revision="Revision"
author="Author"
id="TemplateId"
label="Template label visible to the user"
description="A brief description of the template"
help="help.html"
preview-icon="icon.gif">
<property-group
id="properyGroupId"
label="Property group label"
description="A simple description of the property group"
type=" Type of UIElement group"
help="help.html"
branding-icon="icon.gif">
...
</property-group>
<process>
...
</process>
</template>
+The root element for a project template is template
, which
+provides the following properties or attributes to describe the template:
+
+type
: Use this attribute to specify the template type.
+For a project template the type
should be ProjTempl
.
+
+version
: Use this attribute to specify the major version
+number of the template.
+
+supplier
: Use this attribute to specify the name of the
+supplier who provided the template.
+
+revision
: Use this attribute to specify the minor
+version number of the template.
+
+author
: Use this attribute to specify the template
+author's name.
+
+id
: Use this attribute to specify a unique name for the
+template.
+
+label
: Use this attribute to specify a label for the
+template, which briefly describes the purpose of the template. For example, if
+you are defining a template for a Helloworld EXE
+application, the label can be "HelloWorld EXE
+Application".
+
+description
: Use this attribute to provide a description
+for the template, which is displayed to users when they choose the template
+from the list of available templates.
+
+help
: Use this attribute to specify the HTML help file
+name for the template.
+
+preview-icon
: Use this attribute to specify a
+GIF
or JPG
file name to be used as a icon for the
+template. There are no constraints on the image, as this attribute is meant for
+future use.
+
+The template
element includes the following child elements:
+
+property-group
: A property-group element represents a
+wizard page in the New Project wizard. It lists all the fields to be displayed
+to the user for input using the property
element. For example, you
+could use this element to define all the input fields to be displayed in the
+Project Directories page of the New Project wizard.
+
+process
: A process element defines the process of
+creating the project in the Eclipse workspace, based on the user input values.
+For example, if the user specifies "include" as the folder name for all the
+header files, the process of creating a folder by that name and copying all the
+header files to it is defined here.
+
+As mentioned earlier, a property-group
includes the
+property
elements that specify all the input fields required for a
+wizard page. A property-group
can include any number of
+property
elements. The following attributes can be used to
+describe a property group:
+
+id
: Use this attribute to specify a unique ID for the
+property group.
+
+label
: Use this attribute to specify a name for the
+property group, which is displayed as a title of the wizard page generated by
+the Template Engine.
+
+description
: Use this attribute to provide a short
+description of the property group, which is displayed below the wizard page
+title.
+
+type
: Use this attribute to specify the wizard page
+type. The possible values for this attribute are:
+
+PAGES_ONLY
: If you want all the properties to be
+listed in a simple page.
+
+PAGES_TAB
: If you want all the properties to be
+displayed as tabs in a page.
+
+PAGES_TREE
: If you want all the properties to be
+displayed in a simple tree structure.
+
+PAGES_TREE_TREE
: If you want all the properties to
+be displayed in a multi-level tree structure.
+
+PAGES_TAB_TREE
: If you want all the properties to be
+displayed as tabs or as a tree structure.
+
+help
: Use this attribute to specify the HTML help file
+name for the property group.
+
+branding-icon
: Use this attribute to specify a
+GIF
file name to be used as an icon for the property group.
+
+The syntax for the property
elements included by the
+property-group element is as follows:
+
<property
id="propertyId"
label="User visible label of the property"
description="A brief description of the property"
type="type of the property"
pattern="Regular expression of the expected property"
default="Default value of the property"
size="size"
mandatory="true|false"
hidden="true|false"
persist="true|false">
<item
name="name of the item"
label="User visible label of the item"
selected="true|false">
...
</item>
</property>
+Here is a list of attributes of the property
element:
+
+id
: Use this attribute to specify a unique ID for the
+property.
+
+label
: Use this attribute to specify a name for the
+property, which is displayed as a label in the wizard page next to the input
+field.
+
+description
: Use this attribute to provide a short
+description of the property, which is displayed whenever the mouse hovers over
+the label.
+
+type
: Use this attribute to specify the property type.
+The possible values for this attribute are:
+
+input
: If you want a text input box.
+
+multiline
: If you want a multiline input box.
+
+select
: If you want a drop-down combo box.
+
+boolean
: If you want an option button.
+
+stringlist
: If you want a list box.
+
+speciallist
: If you want a list box with buttons to
+add and delete items to it.
+
+browse
: If you want a browse field to choose a file
+or directory using the File Open dialog.
+
+pattern
: Use this attribute to specify the input
+character pattern for the property using regular expressions. For more
+information on regular expression patterns, refer to Java API document for
+java.util.regex.Pattern.
+
+default
: Use this attribute to specify a default value
+for the property.
+
+size
: Use this attribute to specify the size of the
+property. Note that this attribute is relevant only if the property type is
+input
or multiline
.
+
+mandatory
: Use this attribute to specify whether the
+property is mandatory or not. The value for this attribute can either be
+true
or false
.
+
+hidden
: Use this attribute to specify whether the
+property is visible to the user or not. The value for this attribute can either
+be true
or false
.
+
+persist
: Use this attribute to specify whether the
+property should persist its value or not. The value for this attribute can
+either be true
or false
.
+
+If the property type
is select
or
+stringlist
, you can include the item
element to
+specify the items to be listed. There is no limitation on the number of items
+that can be listed. Here is the syntax for the item
element:
+
<item
name="name of the item"
label="User visible label of the item"
selected="true|false">
</item>
+Here is a list of attributes of the item
element:
+
+name
: Used to specify a unique name for the list item.
+
+label
: Used to specify a label that is displayed to the
+user.
+
+selected
: Used to specify whether the list item is
+selected by default. The value for this attribute can either be
+true
or false
.
+
+The process
element within the root element of a project
+template defines the processes to be followed to create a project, based on the
+inputs taken. Here is the syntax for this element:
+
<process type="org.eclipse.cdt.templateengine.<process type>">
<simple name="name" value=""/>
<complex name="name">
...
</complex>
<simple-array name="values">
...
</simple-array>
<complex-array name="name">
...
</complex-array>
</process>
+A process
element defines a single process. A process is
+like a procedure with a set of parameters. In similar terms, the
+process
element defines the procedure. You need to specify all the
+parameters expected by a process. In the project template, you need to specify
+arguments for the process matching their types and in the order specified.
+
+You can specify the process type using the type
attribute.
+For example, to add files to a project you can use
+org.eclipse.cdt.templateengine.AddFiles
as the process type.
+
+A process
element may include the following child elements:
+
+simple
: A simple string parameter. In a project
+template, you need to specify a name for the parameter using the
+name
attribute along with the corresponding value
+attribute.
+
+Here is an example showing the usage of this element: +
+<simple name="name" value="value" />
+simple-array
: A simple string array parameter. In the
+project template, you need to specify a name for the parameter using the
+name
attribute along with the corresponding element
+children. You can have any number of element
children per
+simple-array
element with the corresponding value
+attribute.
+
+Here is an example showing the usage of this element: +
+<simple-array name="values">
<element value="value1" />
<element value="value2" />
</simple-array>
+complex
: A complex
parameter groups
+together any number of simple
, simple-array
and
+complex
parameters. In the project template, you need to specify a
+name for the parameter using the name
attribute along with the
+corresponding children elements.
+
+Here is an example showing the usage of this element: +
+<complex name="name">
<element>
<simple name="name" value="value" />
<simple-array name="values">
<element value="value1" />
<element value="value2" />
</simple-array>
</element>
</complex>
+complex-array
: A complex-array parameter. Each element
+of this parameter is of the type complex
. In the project template,
+you need to specify a name for the parameter using the name
+attribute along with the corresponding element
children. You can
+have any number of element children per complex-array element with the
+corresponding complex type arguments.
+
+Here is an example showing the usage of this element: +
+<complex-array name="values">
<element>
<simple name="name1" value="value1" />
<simple name="name2" value="value2" />
<simple name="name3" value="value3" />
</element>
<element>
<simple name="name4" value="value4" />
<simple name="name5" value="value5" />
<simple name="name6" value="value6" />
</element>
</complex-array>
+A process type is a prototype of a process procedure. It defines the +parameters required to complete a procedure. For example, to copy a file you +need its source and destination information, which can be defined as parameters +for the copy process. +
+
+The Template Engine plug-in provides a set of process types using the
+extension-point org.eclipse.cdt.templateengine.processType
. Using
+these process types you can describe a process in your template. For example,
+you can describe the copy process by providing the source and destination
+folder names.
+
+The following is a list of process types provided by the Template Engine: +
++NewProject: It defines all the parameters required for a +new C/C++ project and provides the fully qualified name of the class, which +processes these parameters. +
++Here is a list of parameters defined by this process type: +
+
+Name: You use this parameter to specify the name of
+the project. It is of type simple
.
+
+projectType: You use this parameter to specify the
+type of the project. It is of type simple
.
+
+location: You use this parameter to specify the
+location of the project. It is of type simple
.
+
+targetType: You use this parameter to specify the
+type of the target binary. It is of type simple
.
+
+configs: You use this parameter to specify the build
+configurations for the project. It is of type simple
.
+
+NewManagedProject: It defines all the parameters +required for a new managed project and provides the fully qualified name of the +class, which processes these parameters. +
++Here is a list of parameters defined by this process type: +
+
+Name: You use this parameter to specify the name of
+the managed project. It is of type simple
.
+
+projectType: You use this parameter to specify the
+type of the managed project. It is of type simple
.
+
+location: You use this parameter to specify the
+location of the managed project. It is of type simple
.
+
+targetType: You use this parameter to specify the
+type of the target binary. It is of type simple
.
+
+configs: You use this parameter to specify the build
+configurations for the managed project. It is of type simple
.
+
+Copy: It defines all the parameters required to copy +files and provides the fully qualified name of the class, which processes these +parameters. +
++Here is a list of parameters defined by this process type: +
+
+files: You can use this parameter to list the files
+to be copied. It is of type complexArrary
. Each file to be copied
+is represented by a baseType element
, which contains the following
+simple
types:
+
+source: Use this to specify the source file +location in the file system. +
++target: Use this to specify the target location +for the file. +
+
+replaceable: Use this flag to specify whether
+the file should be replaced or not, if it is found in the target
+location.
+
+Append: It defines all the parameters required to append
+files to a project and provides the fully qualified name of the class, which
+processes these parameters. For more information about the parameters, refer to
+the Copy
process type described above.
+
+AddFile: It defines all the parameters required to add a +file to the project and provides the fully qualified name of the class, which +processes these parameters. +
++Here is a list of parameters defined by this process type: +
+
+projectName: Use this parameter to specify the name
+of the project to which the file should be copied. It is of simple
+type.
+
+file: Use this parameter to include information
+related to source, target and replaceable. It is of complex
type.
+For more information about the parameters, refer to the Copy
+process type described above.
+
+AddFiles: It defines all the parameters required to add +files to a project and provides the fully qualified name of the class, which +processes these parameters. +
++Here is a list of parameters defined by this process type: +
+
+projectName: Use this parameter to specify the name
+of the project to which the file should be copied. It is of simple
+type.
+
+files: Use this parameter to include information
+related to source, target and replaceable. It is of complexArray
+type. For more information about the parameters, refer to the Copy
+process type described above.
+
+CreateSourceFolder: It defines all the parameters +required to create a folder for the source files in a project and provides the +fully qualified name of the class, which processes these parameters. +
++Here is a list of parameters defined by this process type: +
+
+projectName: Use this parameter to specify the name
+of the project to which the file should be copied. It is of simple
+type.
+
+path: Use this parameter to specify the path
+relative to the project folder, where the folder for the source files should be
+created. It is of simple
type.
+
+AddLink: It defines all the parameters required to +create a linked file and provides the fully qualified name of the class, which +processes these parameters. +
++Here is a list of parameters defined by this process type: +
+
+projectName: Use this parameter to specify the name
+of the project in which the linked file should be created. It is of
+simple
type.
+
+filePath: Use this parameter to specify the path of
+the original file relative to the project folder. It is of simple
+type.
+
+targetPath: Use this parameter to specify the target
+location relative to the project folder, where a linked file to the original
+file should be created. It is of simple
type.
+
+CreateIncludeFolder: It defines all the parameters
+required to create a folder for the header files in a project and provides the
+fully qualified name of the class, which processes these parameters. For
+information about the parameters, refer to the CreateSourceFolder
+process type described above.
+
+SetMBSStringOptionValue: It defines all the parameters +required to create a string option value and provides the fully qualified name +of the class, which processes these parameters. +
++Here is a list of parameters defined by this process type: +
+
+projectName: Use this parameter to specify the name
+of the project for which the string option is created. It is of
+simple
type.
+
+resourcePaths: Use this parameter to specify the
+path of the resources. It is of complexArray
type. Each resource
+patth to be created is represented by a baseType element
, which
+contains the following simple
types:
+
+id: Use this parameter to specify a unique ID
+for the resource path. It is of simple
type.
+
+value: Use this parameter to specify a value for
+the resource path. It is of simple
type.
+
+path: Use this parameter to specify the path of
+the resource. It is of simple
type.
+
+SetMBSStringListOptionValues: It defines all the
+parameters required to create a string list of option values and provides the
+fully qualified name of the class, which processes these parameters. The
+parameters required are similar to that of SetMBSStringOptionValue
+process type, only difference is that each resource path will have a list of
+option values. For information about the parameters, refer to the
+SetMBSStringOptionValue
process type described above.
+
+SetMBSBooleanOptionValue: It defines all the parameters
+required to create a boolean option value and provides the fully qualified name
+of the class, which processes these parameters. The parameters required are
+similar to that of SetMBSStringOptionValue
process type, only
+difference is that this process type is used to create boolean option value.
+For information about the parameters, refer to the
+SetMBSStringOptionValue
process type described above.
+
+AppendMBSStringOptionValue: It defines all the
+parameters required to append a string option value to an existing string
+option. It also provides the fully qualified name of the class, which processes
+these parameters. For information about the parameters, refer to the
+SetMBSStringOptionValue
process type described above.
+
+AppendCreate: It defines all the parameters required to
+append or create a file in a project. It also provides the fully qualified name
+of the class, which processes these parameters. For information about the
+parameters, refer to the AddFiles
process type described above.
+
+CreateResourceIdentifier: It defines all the parameters +required to append or create a resource identifier. It also provides the fully +qualified name of the class, which processes these parameters. +
++Here is a list of parameters defined by this process type: +
+
+valueName: Use this attribute to specify a name for
+the resource identifier. It is of simple
type.
+
+appName: Use this attribute to specify application,
+which will be using this resource identifier. It is of simple
+type.
+
+Once the project template has been written, register it with Eclipse to +make it available for use. For more information on this, refer to +How to register a template with Eclipse. +
+ +
+ + |
+ + + | +
+Once the project template is ready, you need to register it with Eclipse +to make the template available for use. It is a good practice to group all the +files and resources related to the project template together in one folder. For +example, if you are writing a project template for a Hello World Application, +group all the resources required for this application in a folder +"HelloWorld". +
++To register a project template with Eclipse follow the steps given below: +
++Create an empty plug-in project from the Eclipse workbench without +the source folders. +
++Create a folder and copy the project template along with all the +resources required to create the project. For example, all the hearder files, +source files, resource files etc. +
+
+Open the plug-in manifest editor and select the
+Dependencies
page. For more information on plug-in manifest
+editor, refer to PDE
+ Guide > Getting Started > Basic Plug-in Tutorial
+> Plug-in manifest editor.
+
+Click Add
to select
+org.eclipse.cdt.templateengine
plug-in from the list.
+
+Select the Extensions
page in the plug-in manifest
+editor.
+
+Click Add
to create an extension to the extension-point.
+
+Select the extension-point with ID
+org.eclipse.cdt.templateengine.templates
from the list of
+extensions-points.
+
+Right-click on the newly added extension, and select
+New
>
+template
from the context menu.
+
+Choose the new template added in step 6 from the All
+Extensions
list.
+
+Specify the wizardId
attribute of the template as
+"org.eclipse.cdt.project.ui.NewProjectWizard". This
+attribute is mandatory.
+
+Specify the location of the template relative to the plug-in created +in step 1. This attribute is mandatory. +
+
+Specify a filterPattern
to indicate the build
+Configurations for which the template is created. It is a regular expression used
+to filter the build Configurations. If the template is designed for a particular
+Configuration, it is recommended to specify the filter pattern. For example, If
+the template is designed for GCC Configurations, the filter pattern can be ".*gcc".
+ If the template is designed for multiple build Configurations, you can specify
+ the filter patterns delimited by "|" .
+
+The New Project wizard filters the available build Configurations based on the filter +pattern for the selected template. The filter patterns are matched against the +available Configurations' ID to get a list of matching SDKs. This is an optional +attribute. +
++For more information on regular expression patterns, refer to Java +API document for +java.util.regex.Pattern. +
+
+Select an appropriate project type from the
+projectType
drop-down list. This is an optional attribute.
+
+Specify the usageDescription
, which is a notation
+describing how this template is used. Usually used to filter the list of
+templates on offer depending on other wizard attributes. This is an optional
+attribute. For more information, refer to Java API document for
+java.util.regex.Pattern.
+
+The New Project wizard will list only those templates, which are
+relevant for the build Configurations choosen for the project. For a example, if the developer
+choose to create a C++ Application for Symbian OS
, the wizard
+will list all the templates with the relevant
+usageDescription
. Otherwise, for a standard CDT
+C++ Project
the wizard will list all the templates, irrespective of
+whether the usageDescription
is specified or not.
+
+Specify the pagesAfterTemplateSelectionProvider
,
+which is a fully qualified name of the class that implements
+org.eclipse.cdt.templateengine.IPagesAfterTemplateSelectionProvider
+interface. This is an optional attribute.
+
+After creating the plug-ins and registering the templates, launch a +runtime workbench and invoke the New Project wizard to check that the template +you added is listed. +
+ +
+ + |
+ + + | +
+The following is an example template to create a simple Symbian OS
+EXE
project:
+
<?xml version="1.0" encoding="ISO-8859-1"?>
<template type="ProjTempl" version="1.0" supplier="Symbian" revision="1.0" author="Bala Torati"
id="EXE" label="Simple EXE" description="A skeletal Symbian OS EXE project. Creates a folder for sources and another for include."
help="help.html">
<property-group id="basics" label="Basic Settings" description="Basic properties of a project" type="PAGES-ONLY" help="help.html">
<property id="uid2"
label="UID 2"
description="UID 2"
default="0x00000000"
type="input"
pattern="0x[0-9a-fA-F]{8}"
hidden="false"
mandatory="true"
persist="true"/>
<property id="uid3"
label="UID 3"
description="UID 3"
default="0x00000000"
type="input"
pattern="0x[0-9a-fA-F]{8}"
hidden="false"
mandatory="false"
persist="true"/>
<property id="vid"
label="Vendor ID"
description="Vendor ID"
default="0x00000000"
type="input"
pattern="0x[0-9a-fA-F]{8}"
hidden="false"
mandatory="true"
persist="true"/>
<property id="author"
label="Author"
description="Name of the author"
type="input"
pattern=".*"
default=""
hidden="false"
persist="true"/>
<property id="copyright"
label="Copyright notice"
description="Your copyright notice"
type="input"
pattern=".*"
default="Your copyright notice"
hidden="false"
persist="true"/>
<property id="targetType"
label="Target Type"
description="Select the target type"
type="select"
hidden="false"
mandatory="true"
persist="true">
<item label="APP" selected="true" name="app"/>
<item label="LIB" selected="false" name="lib"/>
<item label="DLL" selected="false" name="dll"/>
<item label="EXE" selected="false" name="exe"/>
<item label="EXEDLL" selected="false" name="exedll"/>
</property>
</property-group>
<property-group id="directories" label="Project Directories" description="Generated files will be copied to the specified directories under the project root directory" type="PAGES-ONLY" help="help.html">
<property id="incDir"
label="Include"
description="Directory for C++ header files"
type="input"
default="inc"
pattern="[a-zA-Z0-9]+"
mandatory="true"
persist="true"/>
<property id="sourceDir"
label="Source"
description="Directory for C++ source files"
type="input"
default="src"
pattern="[a-zA-Z0-9]+"
mandatory="true"
persist="true"/>
</property-group>
<process type="org.eclipse.cdt.templates.NewSymbianProject">
<simple name="name" value="$(projectName)"/>
<simple name="targetType" value="$(targetType)"/>
<simple name="uid2" value="$(uid2)"/>
<simple name="uid3" value="$(uid3)"/>
<simple name="vid" value="$(vid)"/>
</process>
<process type="org.eclipse.cdt.templateengine.CreateSourceFolder">
<simple name="projectName" value="$(projectName)"/>
<simple name="path" value="$(sourceDir)"/>
</process>
<process type="org.eclipse.cdt.templateengine.CreateIncludeFolder">
<simple name="projectName" value="$(projectName)"/>
<simple name="path" value="$(incDir)"/>
</process>
<process type="org.eclipse.cdt.templateengine.AddFiles">
<simple name="projectName" value="$(projectName)"/>
<complex-array name="files">
<element>
<simple name="source" value="inc/Basename.h"/>
<simple name="target" value="$(incDir)/$(baseName).h"/>
<simple name="replaceable" value="true"/>
</element>
<element>
<simple name="source" value="src/Basename.cpp"/>
<simple name="target" value="$(sourceDir)/$(baseName).cpp"/>
<simple name="replaceable" value="true"/>
</element>
</complex-array>
</process>
<process type="org.eclipse.cdt.templateengine.AppendToMBSStringListOptionValues">
<simple
+name="projectName" value= "$(projectName)"/>
<complex-array name="resourcePaths">
<element>
<simple name="id" value=".*linker\.libraries\.libraries.*" />
<simple-array name="values">
<element value="euser.lib" />
</simple-array>
<simple name="path" value="" />
</element>
</complex-array>
</process>
</template>
+The above given template copies the following source (.cpp
)
+and header (.h
) files in the src
and inc
+folders respectively. These files uses a set of macros to get the values
+specified by the developer for file name, author name, copyright etc.
+
/*
============================================================================
Name : $(baseName).cpp
Author : $(author)
Version :
Copyright : $(copyright)
Description : Exe source file
============================================================================
*/
// Include Files
#include "$(baseName).h"
#include <e32base.h>
#include <e32std.h>
#include <e32cons.h> // Console
// Constants
_LIT(KTextConsoleTitle, "Console");
_LIT(KTextFailed, " failed, leave code = %d");
_LIT(KTextPressAnyKey, " [press any key]\n");
// Global Variables
LOCAL_D CConsoleBase* console; // write all messages to this
// Local Functions
LOCAL_C void MainL(const TDesC& aArgs)
{
//
// add your program code here, example code below
//
console->Write(_L("Hello, world!\n"));
console->Printf(_L("Command line args: \"%S\"\n"), &aArgs);
}
LOCAL_C void DoStartL()
{
// Create active scheduler (to run active objects)
CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
CleanupStack::PushL(scheduler);
CActiveScheduler::Install(scheduler);
// Call main function with command line
TBuf<256> cmdLine;
RProcess().CommandLine(cmdLine);
MainL(cmdLine);
// Delete active scheduler
CleanupStack::PopAndDestroy(scheduler);
}
// Global Functions
GLDEF_C TInt E32Main()
{
// Create cleanup stack
__UHEAP_MARK;
CTrapCleanup* cleanup = CTrapCleanup::New();
// Create output console
TRAPD(createError, console = Console::NewL(KTextConsoleTitle, TSize(KConsFullScreen,KConsFullScreen)));
if (createError)
return createError;
// Run application code inside TRAP harness, wait keypress when terminated
TRAPD(mainError, DoStartL());
if (mainError)
console->Printf(KTextFailed, mainError);
console->Printf(KTextPressAnyKey);
console->Getch();
delete console;
delete cleanup;
__UHEAP_MARKEND;
return KErrNone;
}
/*
============================================================================
Name : $(baseName).h
Author : $(author)
Version :
Copyright : $(copyright)
Description : Exe header file
============================================================================
*/
#ifndef __$(baseName)_H__
#define __$(baseName)_H__
// Include Files
#include <e32base.h>
// Function Prototypes
GLDEF_C TInt E32Main();
#endif // __$(baseName)_H__
+When the developer chooses the above template in the New Project wizard, +the following wizard pages are generated: +
+ + +
+The input fields listed in the above given pages are as per the
+definitions given in the template. In the template, the
+property-group
element with the ID "basics" defines all the input
+fields required for the Basic Settings
page. While the
+property-group
element with the ID "directories" defines all
+the input fields required for the Project Directories
page.
+
+The template will create a Symbian OS EXE
project in the
+Eclipse workspace with all the required resources.
+
+The following C/C++ Projects
view shows the resources
+created by the New Project wizard for the above given template:
+
+ + |
+ + + | +
+CDT 4.0 has a framework and extension points for allowing the contribution of project templates. Project templates +are used by the New Project Wizard to generate projects which are automatically populated with source files or settings. +The particular source files or settings can be dependent on information the user enters into the wizard. +
++The two main parts to integrating a template are writing the template itself (in XML format), and adding this to +a plug-in which extends the appropriate extension point. +
+ + +