menucontentsrv/srvinc/mcsinstallstrategy.h
branchRCL_3
changeset 31 8baec10861af
equal deleted inserted replaced
30:a5a39a295112 31:8baec10861af
       
     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 MCSINSTALLSTRATEGY_H
       
    19 #define MCSINSTALLSTRATEGY_H
       
    20 
       
    21 #include "mcsinstallnotifier.h"
       
    22 #include <e32base.h>
       
    23 
       
    24 namespace Swi
       
    25     {
       
    26     class RSisRegistryEntry;
       
    27     }
       
    28 
       
    29 /**
       
    30  * Strategy interface.
       
    31  *
       
    32  * @since S60 v5.0
       
    33  */
       
    34 class CMcsNotifierStrategy: public CBase
       
    35     {
       
    36 public:
       
    37 
       
    38     /**
       
    39      * Notifies listener with changes in property.
       
    40      */
       
    41     virtual void NotifyListenerL() = 0;
       
    42 
       
    43 protected:
       
    44 
       
    45     /**
       
    46      * Constructor.
       
    47      * @param aProperty to read values from.
       
    48      * @param aListener listener to notify.
       
    49      */
       
    50     CMcsNotifierStrategy(
       
    51             RProperty& aProperty,
       
    52             MMcsInstallListener& aListener );
       
    53 
       
    54 protected:
       
    55 
       
    56     /**
       
    57      * Property. Not own.
       
    58      */
       
    59     RProperty& iProperty;
       
    60 
       
    61     /**
       
    62      * Listener. Not own.
       
    63      */
       
    64     MMcsInstallListener& iListener;
       
    65 
       
    66     };
       
    67 
       
    68 /**
       
    69  *  Swi Install strategy.
       
    70  *
       
    71  *  @since S60 v5.0
       
    72  */
       
    73 NONSHARABLE_CLASS( CMcsSwiInstallStrategy ): public CMcsNotifierStrategy
       
    74     {
       
    75 public:
       
    76 
       
    77     /**
       
    78      * Creates an instance of CCaInstallStrategy.
       
    79      * @param aProperty to read values from.
       
    80      * @param aListener listener to notify.
       
    81      */
       
    82     static CMcsSwiInstallStrategy* NewL(
       
    83             RProperty& aProperty,
       
    84             MMcsInstallListener& aListener );
       
    85 
       
    86     /**
       
    87      * Notifies listener with changes in property.
       
    88      */
       
    89     void NotifyListenerL();
       
    90 
       
    91 private:
       
    92 
       
    93     /**
       
    94      * Constructor.
       
    95      * @param aProperty to read values from.
       
    96      * @param aListener listener to notify.
       
    97      */
       
    98     CMcsSwiInstallStrategy(
       
    99             RProperty& aProperty,
       
   100             MMcsInstallListener& aListener );
       
   101 
       
   102     /**
       
   103      * Symbian 2nd phase constructor.
       
   104      */
       
   105     void ConstructL();
       
   106 
       
   107     /**
       
   108      * Handle Install Event.
       
   109      * @param aUid installed/uninstalled app uid.
       
   110      */
       
   111     void HandleInstallNotifyL( TInt aUid );
       
   112 
       
   113     /**
       
   114      * Notifies storage abaut change for aPackageEntry related app.
       
   115      * @param aPackageEntry application package entry.
       
   116      */
       
   117     void NotifyL( Swi::RSisRegistryEntry & aPackageEntry );
       
   118 
       
   119     };
       
   120 
       
   121 /**
       
   122  *  Mcs Java install strategy.
       
   123  *
       
   124  *  @since S60 v5.0
       
   125  */
       
   126 NONSHARABLE_CLASS( CMcsJavaInstallStrategy ): public CMcsNotifierStrategy
       
   127     {
       
   128 public:
       
   129 
       
   130     /**
       
   131      * Creates an instance of CCaInstallStrategy.
       
   132      * @param aProperty to read values from.
       
   133      * @param aListener listener to notify.
       
   134      */
       
   135     static CMcsJavaInstallStrategy* NewL(
       
   136             RProperty& aProperty,
       
   137             MMcsInstallListener& aListener );
       
   138 
       
   139     /**
       
   140      * Notifies listener with changes in property.
       
   141      */
       
   142     void NotifyListenerL();
       
   143 
       
   144 private:
       
   145 
       
   146     /**
       
   147      * Constructor.
       
   148      * @param aProperty to read values from.
       
   149      * @param aListener listener to notify.
       
   150      */
       
   151     CMcsJavaInstallStrategy(
       
   152             RProperty& aProperty,
       
   153             MMcsInstallListener& aListener );
       
   154 
       
   155     /**
       
   156      * Symbian 2nd phase constructor.
       
   157      */
       
   158     void ConstructL();
       
   159 
       
   160     /**
       
   161      * Handle Install Event.
       
   162      * @param aUid installed/uninstalled app uid.
       
   163      */
       
   164     void HandleInstallNotifyL( TUid aPackageUid );
       
   165 
       
   166     };
       
   167 
       
   168 #endif /* MCSINSTALLSTRATEGY_H */
       
   169 // End of File