uidesigner/com.nokia.sdt.component.symbian.test/data/srcgen/srcgen3.component
changeset 0 fb279309251b
equal deleted inserted replaced
-1:000000000000 0:fb279309251b
       
     1 <?xml version="1.0" encoding="UTF-8"?>
       
     2 <!-- Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -->
       
     3 <!-- All rights reserved.                                              -->
       
     4 <!-- This component and the accompanying materials are made available  -->
       
     5 <!-- under the terms of the License "Eclipse Public License v1.0"      -->
       
     6 <!-- which accompanies this distribution, and is available             -->
       
     7 <!-- at the URL "http://www.eclipse.org/legal/epl-v10.html".           -->
       
     8 <componentDefinition xmlns="http://www.nokia.com/sdt/emf/component" 
       
     9 xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" 
       
    10 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       
    11 xsi:schemaLocation="http://www.nokia.com/sdt/emf/component
       
    12 C:\Users\NOKIAI~1\RADPLA~1\design\component.xsd">
       
    13 	<component baseComponent="com.nokia.examples.baseComponent"
       
    14 	friendlyName="SourceGen Test" qualifiedName="com.nokia.examples.srcgen3" 
       
    15 	category="Testing" version="1.0">
       
    16 		<sourceGen>
       
    17 			<!-- create the main file -->
       
    18 			<defineLocation domain="cpp" dir="src" file="main.cpp"
       
    19 				id="srcgen3.FILE"
       
    20 				location=""/>
       
    21 			<!-- create the #includes block -->
       
    22 			<defineLocation 
       
    23 				baseLocation="srcgen3.FILE"
       
    24 				id="srcgen3.INCLUDES"
       
    25 				location="region(Designer Includes)"/>
       
    26 			<!-- create MyClass -->
       
    27 			<defineLocation 
       
    28 				baseLocation="srcgen3.FILE"
       
    29 				id="srcgen3.CLASS"
       
    30 				location="class(MyClass)">
       
    31 				<!-- this needs to define code in another block -->
       
    32 				<template location="srcgen3.INCLUDES">
       
    33 #include "baseclass.h"
       
    34 				</template>
       
    35 				<template>
       
    36 class MyClass : public BaseClass
       
    37 	{
       
    38 	}
       
    39 				</template>
       
    40 			</defineLocation>
       
    41 
       
    42 			<!-- create MyClass::InitComponents -->
       
    43 			<defineLocation
       
    44 				baseLocation="srcgen3.CLASS"
       
    45 				id="srcgen3.INIT_COMPONENTS"
       
    46 				location="function(InitComponents())">
       
    47 				<template>
       
    48 void MyClass::InitComponents()
       
    49 	{
       
    50 	}
       
    51 				</template>				
       
    52 			</defineLocation>
       
    53 			
       
    54 <!-- now use the locations to do stuff (a container really does this) -->
       
    55 		   <template location="srcgen3.INCLUDES">
       
    56 #include &lt;myclass.h;&gt;
       
    57 		   </template>
       
    58 
       
    59 		   <template location="srcgen3.CLASS">
       
    60 int iMyField;
       
    61 		   </template>
       
    62 		   
       
    63 		   <templateGroup phase="initcomponents" 
       
    64 			   	location="srcgen3.INIT_COMPONENTS">
       
    65 				<template>
       
    66 iMyField = 23;				
       
    67 				</template>
       
    68 		   </templateGroup>
       
    69 		</sourceGen>
       
    70 	</component>
       
    71 </componentDefinition>