appinstaller/AppinstUi/Server/Src/SWInstDocument.cpp
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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:   This file contains the implementation of CSWInstDocument
       
    15 *                class member functions.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 
       
    22 #include "SWInstDocument.h"
       
    23 #include "SWInstAppUi.h"
       
    24 #include "SWInstDefs.h"
       
    25 
       
    26 using namespace SwiUI;
       
    27 
       
    28 // ============================ MEMBER FUNCTIONS ===============================
       
    29 
       
    30 // -----------------------------------------------------------------------------
       
    31 // CSWInstDocument::CSWInstDocument
       
    32 // C++ default constructor can NOT contain any code, that
       
    33 // might leave.
       
    34 // -----------------------------------------------------------------------------
       
    35 //
       
    36 CSWInstDocument::CSWInstDocument( CEikApplication& aApp )
       
    37     : CAknDocument( aApp )
       
    38     {
       
    39     }
       
    40 
       
    41 // -----------------------------------------------------------------------------
       
    42 // CSWInstDocument::NewL
       
    43 // Two-phased constructor.
       
    44 // -----------------------------------------------------------------------------
       
    45 //
       
    46 CSWInstDocument* CSWInstDocument::NewL( CEikApplication& aApp )
       
    47     {
       
    48     return new(ELeave) CSWInstDocument( aApp );
       
    49     }
       
    50 
       
    51 // Destructor
       
    52 CSWInstDocument::~CSWInstDocument()
       
    53     {
       
    54     }
       
    55 
       
    56 // -----------------------------------------------------------------------------
       
    57 // CSWInstDocument::OpenFileL
       
    58 // Called by the framework to open a file.
       
    59 // (other items were commented in a header).
       
    60 // -----------------------------------------------------------------------------
       
    61 //
       
    62 CFileStore* CSWInstDocument::OpenFileL( TBool /*aDoOpen*/,
       
    63                                         const TDesC& aFilename,
       
    64                                         RFs& /*aFs*/ )
       
    65     {
       
    66     TRAPD( err, static_cast<CSWInstAppUi*>(iAppUi)->InstallL( aFilename ) );
       
    67     if ( err != KErrNone && err != KSWInstErrBusy )
       
    68         {
       
    69         static_cast<CSWInstAppUi*>(iAppUi)->RequestCompleted( err );        
       
    70         }
       
    71     
       
    72     return NULL;    
       
    73     }
       
    74 
       
    75 void CSWInstDocument::OpenFileL(CFileStore*& aFileStore, RFile& aFile)
       
    76     {
       
    77     aFileStore = NULL;    
       
    78     TRAPD( err, static_cast<CSWInstAppUi*>(iAppUi)->InstallL( aFile ) );
       
    79     if ( err != KErrNone && err != KSWInstErrBusy )
       
    80         {
       
    81         static_cast<CSWInstAppUi*>(iAppUi)->RequestCompleted( err );        
       
    82         }
       
    83     }
       
    84 
       
    85 // -----------------------------------------------------------------------------
       
    86 // CSWInstDocument::CreateAppUiL
       
    87 // Creates CSWInstAppUi object.
       
    88 // (other items were commented in a header).
       
    89 // -----------------------------------------------------------------------------
       
    90 //
       
    91 CEikAppUi* CSWInstDocument::CreateAppUiL()
       
    92     {
       
    93     return new( ELeave ) CSWInstAppUi;
       
    94     }
       
    95 
       
    96 
       
    97 //  End of File