cdlcompilertoolkit/inc/CdlTkStdTrans.h
changeset 0 f58d6ec98e88
equal deleted inserted replaced
-1:000000000000 0:f58d6ec98e88
       
     1 /*
       
     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 "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 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 // These are the standard data type translations supplied by the CDL compiler toolkit
       
    18 
       
    19 struct SStdTranslation
       
    20 	{
       
    21 	const char* iType;
       
    22 	const char* iInit;
       
    23 	const char* iRef;
       
    24 	};
       
    25 
       
    26 // these are the standard translations. First gets matched last.
       
    27 const SStdTranslation gStdTranslations[] =
       
    28 	{
       
    29 		{
       
    30 		"aType", 
       
    31 		"aType const aName = ?value", 
       
    32 		"&aName"
       
    33 		},
       
    34 		{
       
    35 		"TDesC",
       
    36 		"_LIT(aName,\"\")",
       
    37 		"LIT_AS_DESC_PTR(aName)"
       
    38 		},
       
    39 		{
       
    40 		"TCdlArray<aType>",
       
    41 		"CDL_ARRAY_START(aType, aName)\n\t{\n?array_contents\n\t}\nCDL_ARRAY_END(aType, aName)",
       
    42 		"&aName"
       
    43 		},
       
    44 		{
       
    45 		"TInt64", 
       
    46 		"SCdlInt64 const aName = { ?low_word, ?high_word }", 
       
    47 		"(const TInt64*)&aName"
       
    48 		},
       
    49 		{
       
    50 		"TVersion", 
       
    51 		"SCdlVersion const aName = { ?major, ?minor, ?build }", 
       
    52 		"(const TVersion*)&aName"
       
    53 		},
       
    54 		{
       
    55 		"TDateTime", 
       
    56 		"CDL_DATETIME(aName, ?year, ?month, ?day, ?hour, ?minute, ?second, ?microSecond)", 
       
    57 		"(const TDateTime*)&aName"
       
    58 		},
       
    59 		{
       
    60 		"TPoint", 
       
    61 		"SCdlPoint const aName = { ?x, ?y }", 
       
    62 		"(const TPoint*)&aName"
       
    63 		},
       
    64 		{
       
    65 		"TSize", 
       
    66 		"SCdlSize const aName = { ?width, ?height }", 
       
    67 		"(const TSize*)&aName"
       
    68 		},
       
    69 		{
       
    70 		"TRect", 
       
    71 		"SCdlRect const aName = { { ?left, ?top }, { ?right+1, ?bottom+1 } }", 
       
    72 		"(const TRect*)&aName"
       
    73 		},
       
    74 		{
       
    75 		"TRgb", 
       
    76 		"CDL_COLOR(aName, ?red, ?green, ?blue)", 
       
    77 		"(const TRgb*)&aName"
       
    78 		},
       
    79 	};
       
    80 
       
    81