diff -r 000000000000 -r f58d6ec98e88 aknlayoutcompiler/inc/MLCompData2Cdl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/aknlayoutcompiler/inc/MLCompData2Cdl.h Thu Dec 17 09:14:18 2009 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef MLCOMPDATA2CDL_H +#define MLCOMPDATA2CDL_H + +#include +#include +#include +#include "MLCompData.h" +using namespace std; + +#include +using namespace CdlCompilerToolkit; + + +/** +* MLCompDataToCdl +* Generate a CDL interface for a layout +*/ +class MLCompDataToCdl + { +public: + static int Process(const vector& args); + static void ShowHelp(ostream& stream); + static void LayoutToInterface(CCdlTkInterface& aInterface, const TMLCompData& aLayout, bool aDeletesAllowed, bool aAllParams); + static void AddGenericApiToInterface(CCdlTkInterface& aInterface, const string& aReturnType, const string& aName, bool aNeedsOptions, bool aNeedsColsRows); + static void AddTableToInterface(CCdlTkInterface& aInterface, TMLCompDataTable& aTable, bool aAllParams); + static void AddTableCommentToApi(TMLCompDataTable& aTable, CCdlTkApi& aApi); + static void AddTableCommentToApi(TMLCompDataLine& aLine, CCdlTkApi& aApi); + static void AddLineToInterface(CCdlTkInterface& aInterface, TMLCompDataLine& aLine, bool aAllParams); + static void AddParamLimitsToInterface(CCdlTkInterface& aInterface, TMLCompDataLine& aLine, bool aAllParams); + static void AddSubTableToInterface(CCdlTkInterface& aInterface, TMLCompDataTable& aTable, TMLCompDataTable::TMLCompDataSubTable& aSubTable, bool aAllParams); + static void AddSubTableLimitsToInterface(CCdlTkInterface& aInterface, TMLCompDataTable& aTable, TMLCompDataTable::TMLCompDataSubTable& aSubTable); + static void AddSubTableParamLimitsToInterface(CCdlTkInterface& aInterface, TMLCompDataTable& aTable, TMLCompDataTable::TMLCompDataSubTable& aSubTable, bool aAllParams); + static void AddParamsToFunc(TMLCompDataLine& aLine, CCdlTkFunctionApi& aFunc, bool aAllParams, bool aIsNew, bool aRowsCols); + static void AddParamsToFunc(TMLCompDataTable& aTable, TMLCompDataTable::TMLCompDataSubTable& aSubTable, CCdlTkFunctionApi& aFunc, bool aAllParams, bool aIsNew, bool aRowsCols); + static void AddParamToParams(CCdlTkApiParams& aOldParams, CCdlTkApiParams& aParams, string aType, bool aAllParams, bool aIsNewLine, bool aNeedsParam); + static void SetHeaders(CCdlTkInterface& aInterface, const string& aCdlName, const string& aComment, int aUid, bool aRomOnly); + static string InterfaceName(const string& aFileName); + static string SubTableApiName(TMLCompDataTable::TMLCompDataSubTable& aSubTable); + static string SubTableLimitsApiName(TMLCompDataTable::TMLCompDataSubTable& aSubTable); + static string SubTableParamLimtsApiName(TMLCompDataTable::TMLCompDataSubTable& aSubTable); + static string LineApiName(TMLCompDataLine& aLine); + static string LineParamLimitsApiName(TMLCompDataLine& aLine); +private: + static string MLCompDataToCdl::ReturnType(TMLCompDataLine& aLine); + static void ReplaceRemovedAPIs(CCdlTkInterface& aInterface, const TMLCompData& aLayout, bool aDeletesAllowed); + static void CleanUpAPIComments(CCdlTkInterface& aInterface); + static CCdlTkFunctionApi* ProcessFunctionApi(CCdlTkInterface& aInterface, string aReturnType, string aName, bool& aIsNew); + static CCdlTkFunctionApi* CreateFunctionApi(CCdlTkInterface& aInterface, string aReturnType, string aName); + static void UpdateFunctionApi(CCdlTkFunctionApi& aApi, CCdlTkInterface& aInterface, string aReturnType, string aName); + static void UpdateParams(CCdlTkApiParams& aOldParams, CCdlTkApiParams& aParams, string aApiName, bool aAllParamsRequested, bool aColsRowsRequired, bool aIsNew, bool aNeedsComponentId, bool aNeedsOptions, bool aNeedsCols, bool aNeedsRows); +private: + typedef set CApiNamesUsed; + static CApiNamesUsed iInterfaceNamesUsed; + }; + +#endif