contentstorage/cahandler/app/inc/cauninstalloperation.h
changeset 61 8e5041d13c84
equal deleted inserted replaced
60:f62f87b200ec 61:8e5041d13c84
       
     1 /*
       
     2  * Copyright (c) 2008 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 #ifndef C_CAUNINSTALLOPERATION_H
       
    19 #define C_CAUNINSTALLOPERATION_H
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <SWInstApi.h>
       
    23 
       
    24 /**
       
    25  * Uninstall CMenuOperation
       
    26  * Encapsulates the functionality of uninstalling an application.
       
    27  *
       
    28  *  @lib caclient.lib
       
    29  */
       
    30 NONSHARABLE_CLASS(CCaUninstallOperation): public CActive {
       
    31 
       
    32 public:
       
    33     /**
       
    34     * Destructor
       
    35     */
       
    36     virtual ~CCaUninstallOperation();
       
    37     
       
    38     /**
       
    39      * Two-phased constructor. Leaves on failure.
       
    40      * Allocates memory for and constructs an uninstaller object. After that
       
    41      * starts asynchronous uninnstallation of the requested entry
       
    42      * @param aEntry entry to be uninstalled
       
    43      * @param aPriority priority of the active scheduler responsible for handling
       
    44      * asynchronous installation operation
       
    45      * @return The constructed object.
       
    46      */
       
    47     static CCaUninstallOperation *NewL(CCaInnerEntry &aEntry,
       
    48     TInt aPriority = CActive::EPriorityStandard);
       
    49 
       
    50 private:
       
    51     // construction
       
    52     /**
       
    53      * Constructor.
       
    54      * Starts active scheduler.
       
    55      * @param aEntry entry to be uninstalle
       
    56      * @param aPriority priority of the active scheduler responsible for handling
       
    57      * asynchronous installation operation
       
    58      */
       
    59     CCaUninstallOperation(CCaInnerEntry &aEntry, TInt aPriority);
       
    60     
       
    61     /**
       
    62      * Initializes the object and starts asynchronous uninstallation process.
       
    63      * @param aEntry entry to be uninstalle
       
    64      * asynchronous installation operation
       
    65      */
       
    66     void ConstructL(CCaInnerEntry &aEntry);
       
    67     
       
    68     /**
       
    69      * Retrieves package information for requested application uid
       
    70      * @param aAppUid application uid
       
    71        @param aMimeType placeholder for resulting mime type of the package
       
    72      * @param aPackageUid placeholder for resulting package uid of the application 
       
    73      */
       
    74     void AppInfoL(const TUid &aAppUid, TPtrC8 &aMimeType, TUid &aPackageUid);
       
    75     
       
    76     /**
       
    77      * Retrieves package uid 
       
    78      * @param aAppFullName application full name
       
    79        @param aPackageUid placeholder for resulting package uid of the application
       
    80        @return true if package uid was found
       
    81      */
       
    82     TBool GetInstallPkgUidL(const TDesC &aAppFullName, TUid &aPackageUid);
       
    83 
       
    84 private:
       
    85     // from CActive
       
    86 
       
    87     void RunL();
       
    88     void DoCancel();
       
    89     TInt RunError(TInt aError);
       
    90 
       
    91 private:
       
    92 
       
    93     CCaInnerEntry &iEntry;
       
    94     SwiUI::RSWInstLauncher iUninstaller;
       
    95     TInt iId;
       
    96 };
       
    97 
       
    98 #endif // C_CAUNINSTALLOPERATION_H