installationservices/swinstallationfw/source/sifnotifierdata.cpp
changeset 60 245df5276b97
parent 33 8110bf1194d1
equal deleted inserted replaced
53:ae54820ef82c 60:245df5276b97
    57 
    57 
    58 EXPORT_C CSifOperationStartData* CSifOperationStartData::NewL(const TDesC& aGlobalComponentId, const TDesC& aComponentName,
    58 EXPORT_C CSifOperationStartData* CSifOperationStartData::NewL(const TDesC& aGlobalComponentId, const TDesC& aComponentName,
    59                                         const RPointerArray<HBufC>& aApplicationNames, const RPointerArray<HBufC>& aApplicationIcons, 
    59                                         const RPointerArray<HBufC>& aApplicationNames, const RPointerArray<HBufC>& aApplicationIcons, 
    60                                         TInt aComponentSize, const TDesC& aIconPath, const TDesC& aComponentIcon, const TDesC& aSoftwareType)
    60                                         TInt aComponentSize, const TDesC& aIconPath, const TDesC& aComponentIcon, const TDesC& aSoftwareType)
    61     {
    61     {
       
    62     return CSifOperationStartData::NewL(aGlobalComponentId, aComponentName, 
       
    63                                         aApplicationNames, aApplicationIcons, aComponentSize, aIconPath, aComponentIcon, aSoftwareType, EInstalling);
       
    64     }
       
    65 
       
    66 EXPORT_C CSifOperationStartData* CSifOperationStartData::NewL(const TDesC& aGlobalComponentId, const TDesC& aComponentName,
       
    67                                         const RPointerArray<HBufC>& aApplicationNames, const RPointerArray<HBufC>& aApplicationIcons, 
       
    68                                         TInt aComponentSize, const TDesC& aIconPath, const TDesC& aComponentIcon, const TDesC& aSoftwareType, 
       
    69                                         TSifOperationPhase aOperationPhase)
       
    70     {
    62     CSifOperationStartData *self = CSifOperationStartData::NewLC(aGlobalComponentId, aComponentName, 
    71     CSifOperationStartData *self = CSifOperationStartData::NewLC(aGlobalComponentId, aComponentName, 
    63                                         aApplicationNames, aApplicationIcons, aComponentSize, aIconPath, aComponentIcon,aSoftwareType);
    72                                         aApplicationNames, aApplicationIcons, aComponentSize, aIconPath, aComponentIcon, aSoftwareType, aOperationPhase);
    64     CleanupStack::Pop(self);
    73     CleanupStack::Pop(self);
    65     return self;
    74     return self;
       
    75     }
       
    76 
       
    77 
       
    78 EXPORT_C CSifOperationStartData* CSifOperationStartData::NewLC(const TDesC& aGlobalComponentId, const TDesC& aComponentName,
       
    79                                         const RPointerArray<HBufC>& aApplicationNames, const RPointerArray<HBufC>& aApplicationIcons, const TInt aComponentSize, 
       
    80                                         const TDesC& aIconPath, const TDesC& aComponentIcon, const TDesC& aSoftwareType)
       
    81     {
       
    82     return CSifOperationStartData::NewLC(aGlobalComponentId, aComponentName, 
       
    83                                         aApplicationNames, aApplicationIcons, aComponentSize, aIconPath, aComponentIcon, aSoftwareType, EInstalling);
    66     }
    84     }
    67 
    85 
    68 EXPORT_C CSifOperationStartData* CSifOperationStartData::NewLC(const TDesC& aGlobalComponentId, const TDesC& aComponentName,
    86 EXPORT_C CSifOperationStartData* CSifOperationStartData::NewLC(const TDesC& aGlobalComponentId, const TDesC& aComponentName,
    69 										const RPointerArray<HBufC>& aApplicationNames, const RPointerArray<HBufC>& aApplicationIcons, const TInt aComponentSize, 
    87 										const RPointerArray<HBufC>& aApplicationNames, const RPointerArray<HBufC>& aApplicationIcons, const TInt aComponentSize, 
    70                                         const TDesC& aIconPath, const TDesC& aComponentIcon, const TDesC& aSoftwareType)
    88                                         const TDesC& aIconPath, const TDesC& aComponentIcon, const TDesC& aSoftwareType, TSifOperationPhase aOperationPhase)
    71     {
    89     {
    72     CSifOperationStartData *self = new(ELeave) CSifOperationStartData();
    90     CSifOperationStartData *self = new(ELeave) CSifOperationStartData();
    73     CleanupStack::PushL(self);
    91     CleanupStack::PushL(self);
    74     self->ConstructL(aGlobalComponentId, aComponentName, aApplicationNames, aApplicationIcons, aComponentSize, aIconPath, aComponentIcon, aSoftwareType);
    92     self->ConstructL(aGlobalComponentId, aComponentName, aApplicationNames, aApplicationIcons, aComponentSize, aIconPath, aComponentIcon, aSoftwareType, aOperationPhase);
    75     return self;
    93     return self;
    76     }
    94     }
    77 
    95 
    78 void CSifOperationStartData::ConstructL(const TDesC& aGlobalComponentId, const TDesC& aComponentName, const RPointerArray<HBufC>& aApplicationNames,
    96 void CSifOperationStartData::ConstructL(const TDesC& aGlobalComponentId, const TDesC& aComponentName, const RPointerArray<HBufC>& aApplicationNames,
    79                                         const RPointerArray<HBufC>& aApplicationIcons, TInt aComponentSize, const TDesC& aIconPath, const TDesC& aComponentIcon, const TDesC& aSoftwareType)
    97                                         const RPointerArray<HBufC>& aApplicationIcons, TInt aComponentSize, const TDesC& aIconPath, const TDesC& aComponentIcon, 
       
    98                                         const TDesC& aSoftwareType, TSifOperationPhase aOperationPhase)
    80     {
    99     {
    81 	iGlobalComponentId = aGlobalComponentId.AllocL();
   100 	iGlobalComponentId = aGlobalComponentId.AllocL();
    82     iComponentName = aComponentName.AllocL();
   101     iComponentName = aComponentName.AllocL();
    83     iComponentIcon = aComponentIcon.AllocL();
   102     iComponentIcon = aComponentIcon.AllocL();
    84 
   103 
    97         }
   116         }
    98     
   117     
    99     iComponentSize = aComponentSize;
   118     iComponentSize = aComponentSize;
   100     iIconPath = aIconPath.AllocL();      
   119     iIconPath = aIconPath.AllocL();      
   101     iSoftwareType = aSoftwareType.AllocL();
   120     iSoftwareType = aSoftwareType.AllocL();
       
   121     iOperationPhase = aOperationPhase;
   102     }
   122     }
   103 
   123 
   104 EXPORT_C void CSifOperationStartData::ExternalizeL(RWriteStream& aStream) const
   124 EXPORT_C void CSifOperationStartData::ExternalizeL(RWriteStream& aStream) const
   105 	{
   125 	{
   106 	aStream.WriteUint32L(ESifOperationStart);
   126 	aStream.WriteUint32L(ESifOperationStart);
   110 	ExternalizePointersArrayL(iApplicationIcons, aStream);
   130 	ExternalizePointersArrayL(iApplicationIcons, aStream);
   111 	aStream.WriteUint16L(iComponentSize);
   131 	aStream.WriteUint16L(iComponentSize);
   112 	aStream << *iIconPath;
   132 	aStream << *iIconPath;
   113 	aStream << *iComponentIcon;
   133 	aStream << *iComponentIcon;
   114 	aStream << *iSoftwareType;
   134 	aStream << *iSoftwareType;
       
   135 	aStream << TCardinality(iOperationPhase);
   115 	}
   136 	}
   116 	
   137 	
   117 void CSifOperationStartData::InternalizeL(RReadStream& aStream)
   138 void CSifOperationStartData::InternalizeL(RReadStream& aStream)
   118     {
   139     {
   119     iOperationType = static_cast<TSifOperation>(aStream.ReadUint32L());
   140     iOperationType = static_cast<TSifOperation>(aStream.ReadUint32L());
   130     iIconPath = HBufC::NewL(aStream, KMaxTInt);
   151     iIconPath = HBufC::NewL(aStream, KMaxTInt);
   131     DeleteObjectZ(iComponentIcon);
   152     DeleteObjectZ(iComponentIcon);
   132     iComponentIcon = HBufC::NewL(aStream, KMaxTInt);
   153     iComponentIcon = HBufC::NewL(aStream, KMaxTInt);
   133     DeleteObjectZ(iSoftwareType);
   154     DeleteObjectZ(iSoftwareType);
   134     iSoftwareType = HBufC::NewL(aStream, KMaxTInt);
   155     iSoftwareType = HBufC::NewL(aStream, KMaxTInt);
       
   156     TCardinality c;
       
   157     aStream >> c;
       
   158     iOperationPhase = static_cast<TSifOperationPhase>(static_cast<TInt>(c));
   135     }
   159     }
   136 
   160 
   137 EXPORT_C const HBufC& CSifOperationStartData::GlobalComponentId() const
   161 EXPORT_C const HBufC& CSifOperationStartData::GlobalComponentId() const
   138     {
   162     {
   139     return *iGlobalComponentId;
   163     return *iGlobalComponentId;
   171 
   195 
   172 
   196 
   173 EXPORT_C TInt CSifOperationStartData::ComponentSize() const
   197 EXPORT_C TInt CSifOperationStartData::ComponentSize() const
   174     {
   198     {
   175     return iComponentSize;
   199     return iComponentSize;
       
   200     }
       
   201 
       
   202 EXPORT_C TSifOperationPhase CSifOperationStartData::OperationPhase() const
       
   203     {
       
   204     return iOperationPhase;
   176     }
   205     }
   177 
   206 
   178 ////////////////////////
   207 ////////////////////////
   179 // CSifOperationEndData
   208 // CSifOperationEndData
   180 ////////////////////////
   209 ////////////////////////
   351 EXPORT_C TSifOperationSubPhase CSifOperationProgressData::SubPhase() const
   380 EXPORT_C TSifOperationSubPhase CSifOperationProgressData::SubPhase() const
   352     {
   381     {
   353     return iSubPhase;
   382     return iSubPhase;
   354     }
   383     }
   355 
   384 
       
   385 EXPORT_C TInt CSifOperationProgressData::CurrentProgress() const
       
   386     {
       
   387     return iCurrentProgress;
       
   388     }
       
   389 
   356 EXPORT_C TInt CSifOperationProgressData::CurrentProgess() const
   390 EXPORT_C TInt CSifOperationProgressData::CurrentProgess() const
   357     {
   391     {
   358     return iCurrentProgress;
   392     return CurrentProgress();
   359     }
   393     }
   360 
   394 
   361 EXPORT_C TInt CSifOperationProgressData::Total() const
   395 EXPORT_C TInt CSifOperationProgressData::Total() const
   362     {
   396     {
   363     return iTotal;
   397     return iTotal;