diff -r 000000000000 -r ba25891c3a9e ncdengine/provider/server/inc/ncdinstallinfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ncdengine/provider/server/inc/ncdinstallinfo.h Thu Dec 17 08:51:10 2009 +0200 @@ -0,0 +1,162 @@ +/* +* Copyright (c) 2006 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: CNcdInstallInfo declaration +* +*/ + + +#ifndef C_NCDINSTALLINFO_H +#define C_NCDINSTALLINFO_H + +#include + +#include "ncdsendable.h" + +class CNcdFileInfo; + + +class CNcdInstallInfo : public CBase, public MNcdSendable + { +public: + + /** + * Different install types + */ + enum TNcdInstallType + { + /** + * Normal content & sisx install + */ + ENcdInstallNormal, + + /** + * Jar install + */ + ENcdInstallJar, + + /** + * Jar install with a JAD descriptor + */ + ENcdInstallJad + }; + + +public: + + /** + * @param aInfo Contained info. Ownership is transferred Can be NULL + */ + static CNcdInstallInfo* NewL( CNcdFileInfo* aInfo, + TNcdInstallType aType ); + + + /** + * @param aInfo Contained info. Ownership is transferred. Can be NULL + */ + static CNcdInstallInfo* NewLC( CNcdFileInfo* aInfo, + TNcdInstallType aType ); + + static CNcdInstallInfo* NewLC( RReadStream& aStream ); + + virtual ~CNcdInstallInfo(); + + + /** + * Adds a new file info. + * + * @param aInfo Info. Ownership is transferred + * @panic ENcdPanicInvalidArgument if aInfo is NULL + */ + void AddFileInfoL( CNcdFileInfo* aInfo ); + + /** + * File info count getter + * + * @return File info count + */ + TInt FileInfoCount() const; + + + /** + * File info getter + * + * @param aIndex Index + * @return Modifiable file info + */ + CNcdFileInfo& FileInfo( TInt aIndex ); + + + /** + * File info getter + * + * @param aIndex Index + * @return Unmodifiable file info + */ + const CNcdFileInfo& FileInfo( TInt aIndex ) const; + + + /** + * Install type + * + * @return Install type + */ + TNcdInstallType InstallType() const; + + + /** + */ + TInt32 Index() const; + + + /** + */ + void SetIndex( TInt32 aIndex ); + +public: // from MNcdSendable + + /** + * @see MNcdSendable::InternalizeL() + */ + void InternalizeL( RReadStream& aStream ); + + /** + * @see MNcdSendable::ExternalizeL() + */ + void ExternalizeL( RWriteStream& aStream ) const; + + + /** + * Externalizes the info without filenames + * + * @param aStream Target stream + */ + void ExternalizeWithoutFilenamesL( + RWriteStream& aStream ) const; + +protected: + + CNcdInstallInfo( TNcdInstallType aType ); + void ConstructL( CNcdFileInfo* aInfo ); + + CNcdInstallInfo( const CNcdInstallInfo& ); + CNcdInstallInfo& operator=( const CNcdInstallInfo& ); + +private: + + RPointerArray iFiles; + TNcdInstallType iType; + TInt32 iIndex; + }; + +#endif // C_NCDINSTALLINFO_H