diff -r 000000000000 -r f58d6ec98e88 aknlayoutcompiler/inc/MLCompCdl2InstO.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/aknlayoutcompiler/inc/MLCompCdl2InstO.h Thu Dec 17 09:14:18 2009 +0200 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2002-2008 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 MLCOMPCDL2INSTO_H +#define MLCOMPCDL2INSTO_H + +#include +#include +#include +#include "MLCompData.h" +#include "MLAttributes.h" +using namespace std; + +#include +#include +#include +using namespace CdlCompilerToolkit; + +// forward declares and typedefs +class CInstanceList; +class CMLCompDataInstOpt; +class CMLCompDataInstOptImpl; +typedef vector CMLCompDataInstOptImpls; +class CZoomLevelNames; + +/** +* MLCompDataCdlInstanceOpt +* Generate a set of optimised layout instances for a number of layouts with a common +* CDL interface +*/ +class MLCompDataCdlInstanceOpt + { +private: + struct InstStruct + { + InstStruct(string aInstName, TMLCompData* aInst, TMLAttributes* aAttribs); + string iInstName; + TMLCompData* iInst; + TMLAttributes* iAttribs; + }; + + class InstList : public vector + { + public: + ~InstList(); + }; + + typedef vector CCompDataLayouts; + typedef vector CCompDatas; + typedef map CCompDataZoomLevelDatas; +public: + static int Process(vector& args); + static void ShowHelp(ostream& stream); + +public: + CCdlTkInterface& Interface(); + int FindSimilarBytes(CMLCompDataInstOptImpl* aImpl, int aBaseOffset); + void AddImpl(CMLCompDataInstOptImpl* aImpl); + void ResizeByteStream(int aSize); + int ByteStreamSize() const; + + +private: + static void ProcessSeparators(vector& args, vector& aSeparators); + static bool CheckForUsedInstances(const CInstanceList& aUsedList, const CZoomLevelNames& aZoomLevelNames, const vector& aArgs, const vector& aSeparators, int aSepIndex); + static void ParseInstances(const vector& aArgs, const vector& aSeparators, int aSepIndex, InstList& aInstList); + static void MergeLayouts(CInstanceList& aInstUsedList, CZoomLevelNames& aZoomLevelNames, const InstList& aInstances, InstList& aMergedLayouts); + +private: + MLCompDataCdlInstanceOpt(CCdlTkInterface& aIface); + ~MLCompDataCdlInstanceOpt(); + + void AddInst(const InstStruct& aInstStruct, CZoomLevelNames& aZoomLevelNames, bool aAllParams, bool aNonRomDelivery); + void Process(); + void WriteInstances(); + void ProcessCommonImpl(); + +private: + CCompDataLayouts iLayouts; // the comp datas are owned + CCompDataZoomLevelDatas iZoomLevelDatas; // the comp data inst opts are owned + CCdlTkInterface& iInterface; // not owned + CMLCompDataInstOptImpls iImpls; // not owned + vector iBytesAggregated; + }; + +#endif