iaupdate/IAD/engine/controller/src/iaupdatespecialnode.cpp
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2009 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:   ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include <ncdnode.h>
       
    21 #include <ncdnodeinstall.h>
       
    22 
       
    23 #include "iaupdatespecialnode.h"
       
    24 #include "iaupdatedebug.h"
       
    25 
       
    26 
       
    27 // ---------------------------------------------------------------------------
       
    28 // CIAUpdateSpecialNode::NewLC
       
    29 // 
       
    30 // ---------------------------------------------------------------------------
       
    31 //
       
    32 CIAUpdateSpecialNode* CIAUpdateSpecialNode::NewLC( MNcdNode* aNode,
       
    33                                                    CIAUpdateController& aController )
       
    34     {
       
    35     CIAUpdateSpecialNode* self = 
       
    36         new( ELeave ) CIAUpdateSpecialNode( aController );
       
    37     CleanupStack::PushL( self );    
       
    38     self->ConstructL( aNode );
       
    39     return self;
       
    40     }
       
    41   
       
    42     
       
    43 // ---------------------------------------------------------------------------
       
    44 // CIAUpdateSpecialNode::NewL
       
    45 // 
       
    46 // ---------------------------------------------------------------------------
       
    47 //    
       
    48 CIAUpdateSpecialNode* CIAUpdateSpecialNode::NewL( MNcdNode* aNode,
       
    49                                                   CIAUpdateController& aController )
       
    50     {
       
    51     CIAUpdateSpecialNode* self = 
       
    52         CIAUpdateSpecialNode::NewLC( aNode, aController );
       
    53     CleanupStack::Pop( self );
       
    54     return self;
       
    55     }
       
    56 
       
    57 
       
    58 // ---------------------------------------------------------------------------
       
    59 // CIAUpdateSpecialNode::CIAUpdateSpecialNode
       
    60 // 
       
    61 // ---------------------------------------------------------------------------
       
    62 //
       
    63 CIAUpdateSpecialNode::CIAUpdateSpecialNode( CIAUpdateController& aController ) 
       
    64 : CIAUpdateNode( aController )
       
    65     {
       
    66     }
       
    67 
       
    68 
       
    69 // ---------------------------------------------------------------------------
       
    70 // CIAUpdateSpecialNode::ConstructL
       
    71 // 
       
    72 // ---------------------------------------------------------------------------
       
    73 //
       
    74 void CIAUpdateSpecialNode::ConstructL( MNcdNode* aNode )
       
    75     {
       
    76     CIAUpdateNode::ConstructL( aNode );
       
    77     }
       
    78 
       
    79     
       
    80 // ---------------------------------------------------------------------------
       
    81 // CIAUpdateSpecialNode::~CIAUpdateSpecialNode
       
    82 // 
       
    83 // ---------------------------------------------------------------------------
       
    84 //
       
    85 CIAUpdateSpecialNode::~CIAUpdateSpecialNode()
       
    86     {
       
    87     }
       
    88 
       
    89 
       
    90 // ---------------------------------------------------------------------------
       
    91 // CIAUpdateSpecialNode::IsSelfUpdate
       
    92 // 
       
    93 // ---------------------------------------------------------------------------
       
    94 //
       
    95 TBool CIAUpdateSpecialNode::IsSelfUpdate() const    
       
    96     {
       
    97     return ETrue;
       
    98     }        
       
    99 
       
   100 
       
   101 // ---------------------------------------------------------------------------
       
   102 // CIAUpdateSpecialNode::SetInstallStatusToPurchaseHistoryL
       
   103 // 
       
   104 // ---------------------------------------------------------------------------
       
   105 //
       
   106 void CIAUpdateSpecialNode::SetInstallStatusToPurchaseHistoryL( 
       
   107     TInt aErrorCode, TBool aForceVisibleInHistory )
       
   108     {
       
   109     IAUPDATE_TRACE_2("[IAUPDATE] CIAUpdateSpecialNode::SetInstallStatusToPurchaseHistoryL() begin: %d, %d",
       
   110                      aErrorCode, aForceVisibleInHistory);
       
   111 
       
   112     MNcdNodeInstall* install( Node().QueryInterfaceLC<MNcdNodeInstall>() );
       
   113     if ( !install )
       
   114         {
       
   115         User::Leave( KErrNotFound );
       
   116         }
       
   117 
       
   118     // This will update purchase history and do all the required settings.
       
   119     // Notice, that this will also handle report sending.
       
   120     install->SetApplicationInstalledL( aErrorCode );
       
   121 
       
   122     // Because in some cases the MIME type of the node should contain postfixes
       
   123     // that are not given from the server, use the IAD function just in case to
       
   124     // make sure that purchase history contains the correct MIME values. This
       
   125     // is not necessary in most cases but just to be sure.
       
   126     SetIdleErrorToPurchaseHistoryL( aErrorCode, aForceVisibleInHistory );
       
   127 
       
   128     CleanupStack::PopAndDestroy( install );
       
   129 
       
   130     IAUPDATE_TRACE("[IAUPDATE] CIAUpdateSpecialNode::SetInstallStatusToPurchaseHistoryL() end");
       
   131     }