ncdengine/provider/server/inc/ncdinstallinfo.h
changeset 0 ba25891c3a9e
child 18 3ba40be8e484
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2006 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:   CNcdInstallInfo declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_NCDINSTALLINFO_H	
       
    20 #define C_NCDINSTALLINFO_H	
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 #include "ncdsendable.h"
       
    25 
       
    26 class CNcdFileInfo;
       
    27 
       
    28 
       
    29 class CNcdInstallInfo : public CBase, public MNcdSendable
       
    30     {
       
    31 public:
       
    32 
       
    33     /**
       
    34      * Different install types
       
    35      */    
       
    36     enum TNcdInstallType
       
    37         {
       
    38         /**
       
    39          * Normal content & sisx install
       
    40          */
       
    41         ENcdInstallNormal,
       
    42         
       
    43         /**
       
    44          * Jar install
       
    45          */
       
    46         ENcdInstallJar,
       
    47         
       
    48         /**
       
    49          * Jar install with a JAD descriptor
       
    50          */
       
    51         ENcdInstallJad
       
    52         };
       
    53         
       
    54         
       
    55 public:
       
    56 
       
    57     /**
       
    58      * @param aInfo Contained info. Ownership is transferred Can be NULL
       
    59      */
       
    60     static CNcdInstallInfo* NewL( CNcdFileInfo* aInfo,
       
    61         TNcdInstallType aType );
       
    62 
       
    63 
       
    64     /**
       
    65      * @param aInfo Contained info. Ownership is transferred. Can be NULL
       
    66      */
       
    67     static CNcdInstallInfo* NewLC( CNcdFileInfo* aInfo,
       
    68         TNcdInstallType aType );
       
    69 
       
    70     static CNcdInstallInfo* NewLC( RReadStream& aStream );
       
    71         
       
    72     virtual ~CNcdInstallInfo();
       
    73     
       
    74     
       
    75     /**
       
    76      * Adds a new file info.
       
    77      *
       
    78      * @param aInfo Info. Ownership is transferred
       
    79      * @panic ENcdPanicInvalidArgument if aInfo is NULL     
       
    80      */
       
    81     void AddFileInfoL( CNcdFileInfo* aInfo );
       
    82     
       
    83     /**
       
    84      * File info count getter
       
    85      *
       
    86      * @return File info count
       
    87      */
       
    88     TInt FileInfoCount() const;
       
    89     
       
    90     
       
    91     /**
       
    92      * File info getter
       
    93      *
       
    94      * @param aIndex Index
       
    95      * @return Modifiable file info
       
    96      */
       
    97     CNcdFileInfo& FileInfo( TInt aIndex );
       
    98     
       
    99     
       
   100     /**
       
   101      * File info getter
       
   102      *
       
   103      * @param aIndex Index
       
   104      * @return Unmodifiable file info
       
   105      */
       
   106     const CNcdFileInfo& FileInfo( TInt aIndex ) const;
       
   107 
       
   108 
       
   109     /**
       
   110      * Install type
       
   111      *
       
   112      * @return Install type
       
   113      */
       
   114     TNcdInstallType InstallType() const;
       
   115     
       
   116     
       
   117     /**
       
   118      */
       
   119     TInt32 Index() const;
       
   120     
       
   121     
       
   122     /**
       
   123      */
       
   124     void SetIndex( TInt32 aIndex );
       
   125         
       
   126 public: // from MNcdSendable
       
   127 
       
   128     /**  
       
   129      * @see MNcdSendable::InternalizeL()
       
   130      */
       
   131     void InternalizeL( RReadStream& aStream );
       
   132 
       
   133     /**  
       
   134      * @see MNcdSendable::ExternalizeL()
       
   135      */
       
   136     void ExternalizeL( RWriteStream& aStream ) const;        
       
   137 
       
   138 
       
   139     /**
       
   140      * Externalizes the info without filenames
       
   141      *
       
   142      * @param aStream Target stream
       
   143      */    
       
   144     void ExternalizeWithoutFilenamesL( 
       
   145         RWriteStream& aStream ) const;
       
   146     
       
   147 protected:
       
   148 
       
   149     CNcdInstallInfo( TNcdInstallType aType );
       
   150     void ConstructL( CNcdFileInfo* aInfo );
       
   151 
       
   152     CNcdInstallInfo( const CNcdInstallInfo& );
       
   153     CNcdInstallInfo& operator=( const CNcdInstallInfo& );
       
   154         
       
   155 private:
       
   156 
       
   157     RPointerArray<CNcdFileInfo> iFiles;
       
   158     TNcdInstallType iType;
       
   159     TInt32 iIndex; 
       
   160     };
       
   161 
       
   162 #endif // C_NCDINSTALLINFO_H