|
1 /* |
|
2 * Copyright (c) 2002-2004 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 |
|
18 |
|
19 #ifndef MLCOMPDATA2CDL_H |
|
20 #define MLCOMPDATA2CDL_H |
|
21 |
|
22 #include <string> |
|
23 #include <vector> |
|
24 #include <iosfwd> |
|
25 #include "MLCompData.h" |
|
26 using namespace std; |
|
27 |
|
28 #include <cdlcompilertoolkit/cdltkinterface.h> |
|
29 using namespace CdlCompilerToolkit; |
|
30 |
|
31 |
|
32 /** |
|
33 * MLCompDataToCdl |
|
34 * Generate a CDL interface for a layout |
|
35 */ |
|
36 class MLCompDataToCdl |
|
37 { |
|
38 public: |
|
39 static int Process(const vector<string>& args); |
|
40 static void ShowHelp(ostream& stream); |
|
41 static void LayoutToInterface(CCdlTkInterface& aInterface, const TMLCompData& aLayout, bool aDeletesAllowed, bool aAllParams); |
|
42 static void AddGenericApiToInterface(CCdlTkInterface& aInterface, const string& aReturnType, const string& aName, bool aNeedsOptions, bool aNeedsColsRows); |
|
43 static void AddTableToInterface(CCdlTkInterface& aInterface, TMLCompDataTable& aTable, bool aAllParams); |
|
44 static void AddTableCommentToApi(TMLCompDataTable& aTable, CCdlTkApi& aApi); |
|
45 static void AddTableCommentToApi(TMLCompDataLine& aLine, CCdlTkApi& aApi); |
|
46 static void AddLineToInterface(CCdlTkInterface& aInterface, TMLCompDataLine& aLine, bool aAllParams); |
|
47 static void AddParamLimitsToInterface(CCdlTkInterface& aInterface, TMLCompDataLine& aLine, bool aAllParams); |
|
48 static void AddSubTableToInterface(CCdlTkInterface& aInterface, TMLCompDataTable& aTable, TMLCompDataTable::TMLCompDataSubTable& aSubTable, bool aAllParams); |
|
49 static void AddSubTableLimitsToInterface(CCdlTkInterface& aInterface, TMLCompDataTable& aTable, TMLCompDataTable::TMLCompDataSubTable& aSubTable); |
|
50 static void AddSubTableParamLimitsToInterface(CCdlTkInterface& aInterface, TMLCompDataTable& aTable, TMLCompDataTable::TMLCompDataSubTable& aSubTable, bool aAllParams); |
|
51 static void AddParamsToFunc(TMLCompDataLine& aLine, CCdlTkFunctionApi& aFunc, bool aAllParams, bool aIsNew, bool aRowsCols); |
|
52 static void AddParamsToFunc(TMLCompDataTable& aTable, TMLCompDataTable::TMLCompDataSubTable& aSubTable, CCdlTkFunctionApi& aFunc, bool aAllParams, bool aIsNew, bool aRowsCols); |
|
53 static void AddParamToParams(CCdlTkApiParams& aOldParams, CCdlTkApiParams& aParams, string aType, bool aAllParams, bool aIsNewLine, bool aNeedsParam); |
|
54 static void SetHeaders(CCdlTkInterface& aInterface, const string& aCdlName, const string& aComment, int aUid, bool aRomOnly); |
|
55 static string InterfaceName(const string& aFileName); |
|
56 static string SubTableApiName(TMLCompDataTable::TMLCompDataSubTable& aSubTable); |
|
57 static string SubTableLimitsApiName(TMLCompDataTable::TMLCompDataSubTable& aSubTable); |
|
58 static string SubTableParamLimtsApiName(TMLCompDataTable::TMLCompDataSubTable& aSubTable); |
|
59 static string LineApiName(TMLCompDataLine& aLine); |
|
60 static string LineParamLimitsApiName(TMLCompDataLine& aLine); |
|
61 private: |
|
62 static string MLCompDataToCdl::ReturnType(TMLCompDataLine& aLine); |
|
63 static void ReplaceRemovedAPIs(CCdlTkInterface& aInterface, const TMLCompData& aLayout, bool aDeletesAllowed); |
|
64 static void CleanUpAPIComments(CCdlTkInterface& aInterface); |
|
65 static CCdlTkFunctionApi* ProcessFunctionApi(CCdlTkInterface& aInterface, string aReturnType, string aName, bool& aIsNew); |
|
66 static CCdlTkFunctionApi* CreateFunctionApi(CCdlTkInterface& aInterface, string aReturnType, string aName); |
|
67 static void UpdateFunctionApi(CCdlTkFunctionApi& aApi, CCdlTkInterface& aInterface, string aReturnType, string aName); |
|
68 static void UpdateParams(CCdlTkApiParams& aOldParams, CCdlTkApiParams& aParams, string aApiName, bool aAllParamsRequested, bool aColsRowsRequired, bool aIsNew, bool aNeedsComponentId, bool aNeedsOptions, bool aNeedsCols, bool aNeedsRows); |
|
69 private: |
|
70 typedef set<string> CApiNamesUsed; |
|
71 static CApiNamesUsed iInterfaceNamesUsed; |
|
72 }; |
|
73 |
|
74 #endif |