aknlayoutcompiler/inc/UpdateLayoutApi.h
changeset 0 f58d6ec98e88
equal deleted inserted replaced
-1:000000000000 0:f58d6ec98e88
       
     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 UPDATELAYOUTAPI_H
       
    20 #define UPDATELAYOUTAPI_H
       
    21 
       
    22 #include <string>
       
    23 #include <vector>
       
    24 #include <iosfwd>
       
    25 #include "Layout.h"
       
    26 using namespace std;
       
    27 
       
    28 #include <cdlcompilertoolkit/cdltkinterface.h>
       
    29 #include <cdlcompilertoolkit/cdltkprocess.h>
       
    30 using namespace CdlCompilerToolkit;
       
    31 
       
    32 /**
       
    33 *  UpdateLayoutApi 
       
    34 *  Intended to update a CDL interface for a layout - not yet complete
       
    35 */
       
    36 class UpdateLayoutApi : public MCdlTkApiCheckObserver
       
    37 	{
       
    38 public:
       
    39 	static int Process(const vector<string>& args);
       
    40 	static void ShowHelp(ostream& stream);
       
    41 
       
    42 	UpdateLayoutApi(const std::string& aCdlName, const std::string& aLayoutName, const std::string& aLegacyName, const std::string& aNewName);
       
    43 	~UpdateLayoutApi();
       
    44 
       
    45 private:
       
    46 	void LoadFiles(const std::string& aLayoutName, const std::string& aNewName);
       
    47 	void MergeAndCheck();
       
    48 	void ProcessNewApi();
       
    49 	void WriteFiles();
       
    50 	void Report();
       
    51 	void AddDataToLegacy(const std::string& aOldName, const std::string& aNewName);
       
    52 
       
    53 private:
       
    54 	virtual void StartCheck();
       
    55 	virtual void CheckComplete();
       
    56 	virtual void ApiInBoth(const CCdlTkApi& aApi);
       
    57 	virtual void ApiNotInLeft(const CCdlTkApi& aApi);
       
    58 	virtual void ApiNotInRight(const CCdlTkApi& aApi);
       
    59 
       
    60 private:
       
    61 	class InterfaceCheck : public MCdlTkApiCheckObserver
       
    62 		{
       
    63 		virtual void StartCheck();
       
    64 		virtual void CheckComplete();
       
    65 		virtual void ApiInBoth(const CCdlTkApi& aApi);
       
    66 		virtual void ApiNotInLeft(const CCdlTkApi& aApi);
       
    67 		virtual void ApiNotInRight(const CCdlTkApi& aApi);
       
    68 		};
       
    69 
       
    70 private:
       
    71 	std::string iLegacyName;
       
    72 	std::string iCdlName;
       
    73 	CCdlTkInterface* iInterface;
       
    74 	TLayout* iLayout;
       
    75 	TLayout* iLegacy;
       
    76 	TLayout* iNew;
       
    77 	CCdlTkInterface* iExt;	// not owned
       
    78 	bool iInterfaceChanged;
       
    79 	bool iLegacyUpdated;
       
    80 	string iReport;
       
    81 	};
       
    82 
       
    83 
       
    84 #endif