contentstorage/srvinc/caprogressnotifier.h
changeset 98 d2f833ab7940
child 99 7aaf39b772ac
equal deleted inserted replaced
97:1e962b12a8db 98:d2f833ab7940
       
     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 CAPROGRESSNOTIFIER_H
       
    19 #define CAPROGRESSNOTIFIER_H
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <usif/sif/sifnotification.h>
       
    23 #include "castorage_global.h"
       
    24 using namespace Usif; 
       
    25 
       
    26 class CCaStorageProxy;
       
    27 
       
    28 // needed for fake notifier
       
    29 #include "cainstallnotifier.h"
       
    30 
       
    31 /**
       
    32  * Interface for updating after installer events.
       
    33  */
       
    34 class MCaFakeProgressListener
       
    35     {
       
    36 public:
       
    37     /**
       
    38      * Pure virtual method.
       
    39      * @param aEvent event type.
       
    40      */
       
    41     virtual void HandleFakeProgressNotifyL(TInt aCurrentProgress) = 0;
       
    42     };
       
    43 
       
    44 /**
       
    45  *  Fake Install notifier.
       
    46  *
       
    47  *  @since S60 v5.0
       
    48  */
       
    49 NONSHARABLE_CLASS( CCaFakeProgressNotifier ) : public CActive
       
    50     {
       
    51 public:
       
    52 
       
    53 /**
       
    54      * Creates an instance of CCaFakeProgressNotifier.
       
    55      * @param aListener Reference to notifier interface.
       
    56      */
       
    57 IMPORT_C static CCaFakeProgressNotifier* NewL( MCaFakeProgressListener& aListener);
       
    58 
       
    59     /**
       
    60      * Destructor.
       
    61      */
       
    62     virtual ~CCaFakeProgressNotifier();
       
    63 
       
    64     /**
       
    65      * Starts fake progress notifications.
       
    66      */
       
    67     void StartNotifying();
       
    68     
       
    69 private:
       
    70 
       
    71     /**
       
    72      * Constructor.
       
    73      * @param aListener Reference to notifier interface.
       
    74      */
       
    75     CCaFakeProgressNotifier( MCaFakeProgressListener& aListener );
       
    76 
       
    77     /**
       
    78      * Symbian 2nd phase constructor.
       
    79     */
       
    80     void ConstructL( );
       
    81 
       
    82     /**
       
    83      * From CActive.
       
    84      */ 
       
    85     void DoCancel();
       
    86 
       
    87     /**
       
    88      * From CActive.
       
    89      */ 
       
    90     void RunL();
       
    91 
       
    92     /**
       
    93      * From CActive.
       
    94      */ 
       
    95     TInt RunError( TInt aError );
       
    96 
       
    97 private:
       
    98 
       
    99     /**
       
   100      * Interface for fake notifications
       
   101      * Not Own.
       
   102      */
       
   103     MCaFakeProgressListener& iListener;
       
   104     
       
   105     /**
       
   106      * Timer
       
   107      */
       
   108     RTimer iTimer;
       
   109     
       
   110     /**
       
   111      * Counter for fake notifications
       
   112      */
       
   113     TInt iCount;
       
   114 
       
   115     };
       
   116 
       
   117 
       
   118 /**
       
   119  *  Uninstall Progress notifier.
       
   120  *
       
   121  *  @since S60 v5.0
       
   122  */
       
   123 NONSHARABLE_CLASS( CCaProgressNotifier ) : public CBase, 
       
   124         //public MSifOperationsHandler, // USIF not working yet
       
   125         public MCaInstallListener,      //needed for fake
       
   126         public MCaFakeProgressListener  //needed for fake
       
   127     {
       
   128 
       
   129 public:
       
   130     /**
       
   131      * Creates an instance of CCaProgressNotifier.
       
   132      * @param aCaStorageProxy Reference to storage.
       
   133      */
       
   134 IMPORT_C static CCaProgressNotifier* NewL( CCaStorageProxy& aCaStorageProxy);
       
   135 
       
   136     /**
       
   137      * Destructor.
       
   138      */
       
   139     virtual ~CCaProgressNotifier();
       
   140 
       
   141 private:
       
   142 
       
   143     /**
       
   144      * Constructor.
       
   145      */
       
   146     CCaProgressNotifier( );
       
   147 
       
   148     /**
       
   149      * Symbian 2nd phase constructor.
       
   150      * @param aCaStorageProxy Reference to storage.
       
   151      */
       
   152     void ConstructL( CCaStorageProxy& aCaStorageProxy );
       
   153 
       
   154 public:
       
   155     /**
       
   156      * From MSifOperationsHandler
       
   157      */
       
   158     void StartOperationHandler(TUint aKey, const CSifOperationStartData& aStartData);
       
   159 
       
   160     /**
       
   161      * From MSifOperationsHandler
       
   162      */
       
   163     void EndOperationHandler(const CSifOperationEndData& aEndData);
       
   164 
       
   165     /**
       
   166      * From MSifOperationsHandler
       
   167      */
       
   168     void ProgressOperationHandler(const CSifOperationProgressData& aProgressData);
       
   169     
       
   170 public:
       
   171 
       
   172     /**
       
   173      * From MCaInstallListener, needed for fake
       
   174      */
       
   175     void HandleInstallNotifyL( TInt aUid );
       
   176      
       
   177     /**
       
   178      * From MCaFakeProgressListener, needed for fake
       
   179      */
       
   180     void HandleFakeProgressNotifyL(TInt aCurrentProgress);
       
   181     
       
   182 private:
       
   183 
       
   184     /**
       
   185      * USIF notifier
       
   186      * Own.
       
   187      * 
       
   188      * Commented out since USIF notifications do not
       
   189      * work on MCL wk20
       
   190      */
       
   191     //CSifOperationsNotifier* iNotifier;
       
   192     
       
   193     /**
       
   194      * Not Own.
       
   195      * Reference to the Storage Proxy.
       
   196      */
       
   197     CCaStorageProxy* iStorageProxy;
       
   198 
       
   199     /**
       
   200      * Uninstall notifier. Own. Needed for fake
       
   201      */
       
   202     CCaInstallNotifier *iUsifUninstallNotifier;
       
   203 
       
   204     /**
       
   205      * Install and uninstall notifier. Own. Needed for fake
       
   206      */
       
   207     CCaInstallNotifier *iJavaInstallNotifier;
       
   208     
       
   209     /**
       
   210      * Fake uninstall progress notifier. Own. Needed for fake
       
   211      */
       
   212     CCaFakeProgressNotifier *iFakeProgressNotifier;
       
   213     
       
   214     };
       
   215 
       
   216 
       
   217 #endif /* CAPROGRESSNOTIFIER_H */
       
   218 
       
   219 // End of File
       
   220