contentstorage/cahandler/app/inc/cauninstalloperation.h
author hgs
Wed, 24 Mar 2010 13:06:03 +0200
changeset 90 0e41c72311af
parent 88 7f0462e8c3da
permissions -rw-r--r--
201011_02
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
88
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
 * All rights reserved.
hgs
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
 * under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
 *
hgs
parents:
diff changeset
     9
 * Initial Contributors:
hgs
parents:
diff changeset
    10
 * Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
 *
hgs
parents:
diff changeset
    12
 * Contributors:
hgs
parents:
diff changeset
    13
 *
hgs
parents:
diff changeset
    14
 * Description:  ?Description
hgs
parents:
diff changeset
    15
 *
hgs
parents:
diff changeset
    16
 */
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
#ifndef C_CAUNINSTALLOPERATION_H
hgs
parents:
diff changeset
    19
#define C_CAUNINSTALLOPERATION_H
hgs
parents:
diff changeset
    20
hgs
parents:
diff changeset
    21
#include <e32base.h>
hgs
parents:
diff changeset
    22
#include <SWInstApi.h>
hgs
parents:
diff changeset
    23
hgs
parents:
diff changeset
    24
/**
hgs
parents:
diff changeset
    25
 * Uninstall CMenuOperation
hgs
parents:
diff changeset
    26
 * Encapsulates the functionality of uninstalling an application.
hgs
parents:
diff changeset
    27
 *
hgs
parents:
diff changeset
    28
 *  @lib caclient.lib
hgs
parents:
diff changeset
    29
 */
hgs
parents:
diff changeset
    30
NONSHARABLE_CLASS(CCaUninstallOperation): public CActive {
hgs
parents:
diff changeset
    31
hgs
parents:
diff changeset
    32
public:
hgs
parents:
diff changeset
    33
    /**
hgs
parents:
diff changeset
    34
    * Destructor
hgs
parents:
diff changeset
    35
    */
hgs
parents:
diff changeset
    36
    virtual ~CCaUninstallOperation();
hgs
parents:
diff changeset
    37
    
hgs
parents:
diff changeset
    38
    /**
hgs
parents:
diff changeset
    39
     * Two-phased constructor. Leaves on failure.
hgs
parents:
diff changeset
    40
     * Allocates memory for and constructs an uninstaller object. After that
hgs
parents:
diff changeset
    41
     * starts asynchronous uninnstallation of the requested entry
hgs
parents:
diff changeset
    42
     * @param aEntry entry to be uninstalled
hgs
parents:
diff changeset
    43
     * @param aPriority priority of the active scheduler responsible for handling
hgs
parents:
diff changeset
    44
     * asynchronous installation operation
hgs
parents:
diff changeset
    45
     * @return The constructed object.
hgs
parents:
diff changeset
    46
     */
hgs
parents:
diff changeset
    47
    static CCaUninstallOperation *NewL(CCaInnerEntry &aEntry,
hgs
parents:
diff changeset
    48
    TInt aPriority = CActive::EPriorityStandard);
hgs
parents:
diff changeset
    49
hgs
parents:
diff changeset
    50
private:
hgs
parents:
diff changeset
    51
    // construction
hgs
parents:
diff changeset
    52
    /**
hgs
parents:
diff changeset
    53
     * Constructor.
hgs
parents:
diff changeset
    54
     * Starts active scheduler.
hgs
parents:
diff changeset
    55
     * @param aEntry entry to be uninstalle
hgs
parents:
diff changeset
    56
     * @param aPriority priority of the active scheduler responsible for handling
hgs
parents:
diff changeset
    57
     * asynchronous installation operation
hgs
parents:
diff changeset
    58
     */
hgs
parents:
diff changeset
    59
    CCaUninstallOperation(CCaInnerEntry &aEntry, TInt aPriority);
hgs
parents:
diff changeset
    60
    
hgs
parents:
diff changeset
    61
    /**
hgs
parents:
diff changeset
    62
     * Initializes the object and starts asynchronous uninstallation process.
hgs
parents:
diff changeset
    63
     * @param aEntry entry to be uninstalle
hgs
parents:
diff changeset
    64
     * asynchronous installation operation
hgs
parents:
diff changeset
    65
     */
hgs
parents:
diff changeset
    66
    void ConstructL(CCaInnerEntry &aEntry);
hgs
parents:
diff changeset
    67
    
hgs
parents:
diff changeset
    68
    /**
hgs
parents:
diff changeset
    69
     * Retrieves package information for requested application uid
hgs
parents:
diff changeset
    70
     * @param aAppUid application uid
hgs
parents:
diff changeset
    71
       @param aMimeType placeholder for resulting mime type of the package
hgs
parents:
diff changeset
    72
     * @param aPackageUid placeholder for resulting package uid of the application 
hgs
parents:
diff changeset
    73
     */
hgs
parents:
diff changeset
    74
    void AppInfoL(const TUid &aAppUid, TPtrC8 &aMimeType, TUid &aPackageUid);
hgs
parents:
diff changeset
    75
    
hgs
parents:
diff changeset
    76
    /**
hgs
parents:
diff changeset
    77
     * Retrieves package uid 
hgs
parents:
diff changeset
    78
     * @param aAppFullName application full name
hgs
parents:
diff changeset
    79
       @param aPackageUid placeholder for resulting package uid of the application
hgs
parents:
diff changeset
    80
       @return true if package uid was found
hgs
parents:
diff changeset
    81
     */
hgs
parents:
diff changeset
    82
    TBool GetInstallPkgUidL(const TDesC &aAppFullName, TUid &aPackageUid);
hgs
parents:
diff changeset
    83
hgs
parents:
diff changeset
    84
private:
hgs
parents:
diff changeset
    85
    // from CActive
hgs
parents:
diff changeset
    86
hgs
parents:
diff changeset
    87
    void RunL();
hgs
parents:
diff changeset
    88
    void DoCancel();
hgs
parents:
diff changeset
    89
    TInt RunError(TInt aError);
hgs
parents:
diff changeset
    90
hgs
parents:
diff changeset
    91
private:
hgs
parents:
diff changeset
    92
hgs
parents:
diff changeset
    93
    CCaInnerEntry &iEntry;
hgs
parents:
diff changeset
    94
    SwiUI::RSWInstLauncher iUninstaller;
hgs
parents:
diff changeset
    95
    TInt iId;
hgs
parents:
diff changeset
    96
};
hgs
parents:
diff changeset
    97
hgs
parents:
diff changeset
    98
#endif // C_CAUNINSTALLOPERATION_H