clientprovisioning/cpqtsp/inc/CWPSaver.h
changeset 42 aa33c2cb9a50
parent 30 d3981f4fe6a4
equal deleted inserted replaced
41:c742e1129640 42:aa33c2cb9a50
     1 /*
     1 /*
     2 * ============================================================================
     2 * ============================================================================
     3 *  Name        : CWPSaver.h
     3 *  Name        : CWPSaver.h
     4 *  Part of     : Provisioning / ProvisioningBC
     4 *  Part of     : Provisioning / ProvisioningBC
     5 *  Description : Settings saver with progress note.
     5 *  Description : Settings saver with progress note.
     6 *  Version     : %version: 1 % << Don't touch! Updated by Synergy at check-out.
     6 *  Version     : %version: 2 % << Don't touch! Updated by Synergy at check-out.
     7 *
     7 *
     8 *  Copyright © 2002-2006 Nokia.  All rights reserved.
     8 *  Copyright © 2002-2006 Nokia.  All rights reserved.
     9 *  This material, including documentation and any related computer
     9 *  This material, including documentation and any related computer
    10 *  programs, is protected by copyright controlled by Nokia.  All
    10 *  programs, is protected by copyright controlled by Nokia.  All
    11 *  rights are reserved.  Copying, including reproducing, storing,
    11 *  rights are reserved.  Copying, including reproducing, storing,
    18 
    18 
    19 #ifndef CWPSAVER_H
    19 #ifndef CWPSAVER_H
    20 #define CWPSAVER_H
    20 #define CWPSAVER_H
    21 
    21 
    22 // INCLUDES
    22 // INCLUDES
    23 #include <aknprogressdialog.h>
    23 
    24 #include <activeapdb.h>
       
    25 #include <favouritesdbobserver.h>
       
    26 #include <FavouritesDb.h>
       
    27 #include <HbProgressDialog>
    24 #include <HbProgressDialog>
    28 
    25 
    29 // FORWARD DECLARATIONS
    26 // FORWARD DECLARATIONS
    30 class CWPEngine;
    27 class CWPEngine;
    31 class CActiveFavouritesDbNotifier;
    28 //class CActiveFavouritesDbNotifier;
    32 
    29 
    33 // CLASS DECLARATION
    30 // CLASS DECLARATION
    34 
    31 
    35 /**
    32 /**
    36  * Helper class for saving Provisioning settings. Provides a progress note.
    33  * Helper class for saving Provisioning settings. Provides a progress note.
    37  * @since 2.0
    34  * @since 2.0
    38  */
    35  */
    39 class CWPSaver : public CActive, 
    36 class CWPSaver : public CActive
    40                  private MProgressDialogCallback,
    37                  
    41                  private MActiveApDbObserver, 
       
    42                  private MFavouritesDbObserver
       
    43     {
    38     {
    44     public:
    39     public:
    45         /**
    40         /**
    46         * C++ default constructor.
    41         * C++ default constructor.
    47         * @param aEngine Engine to be used for saving
    42         * @param aEngine Engine to be used for saving
    73 
    68 
    74         void DoCancel();
    69         void DoCancel();
    75         void RunL();
    70         void RunL();
    76         TInt RunError( TInt aError );
    71         TInt RunError( TInt aError );
    77 
    72 
    78     private: // From MProgressDialogCallback
       
    79 
       
    80         void DialogDismissedL( TInt aButtonId );
       
    81 
       
    82     private: // from MActiveApDbObserver
       
    83 
       
    84         void HandleApDbEventL( TEvent anEvent );
       
    85 
       
    86     private: // from MFavouritesDbObserver
       
    87 
       
    88         void HandleFavouritesDbEventL( RDbNotifier::TEvent aEvent );
       
    89 
       
    90     private:
    73     private:
    91         /**
    74         /**
    92         * Complete the request so that RunL() gets called.
    75         * Complete the request so that RunL() gets called.
    93         */
    76         */
    94         void CompleteRequest();
    77         void CompleteRequest();
    95 
       
    96         /**
       
    97         * Complete the request so that Timeout() gets called after
       
    98         * a delay. Leaves with KErrTimeout if retry count is 
       
    99         * exceeded.
       
   100         */
       
   101         void DelayedCompleteRequestL();
       
   102 
       
   103         /**
       
   104         * Retry save now.
       
   105         */
       
   106         void Retry();
    78         void Retry();
   107 
    79 
   108         /**
       
   109         * Timer timed-out.
       
   110         */
       
   111         static TInt Timeout(TAny* aSelf);
       
   112 
    80 
   113     private:
    81     private:
   114         /// The engine used for performing the save. Refs.
    82         /// The engine used for performing the save. Refs.
   115         CWPEngine& iEngine;
    83         CWPEngine& iEngine;
   116 
    84 
   121         TInt iCurrentItem;
    89         TInt iCurrentItem;
   122 
    90 
   123         /// Contains result to be passed to the called of ExecuteLD
    91         /// Contains result to be passed to the called of ExecuteLD
   124         TInt iResult;
    92         TInt iResult;
   125 
    93 
   126         /// Active AP database. Owns.
       
   127         CActiveApDb* iApDbNotifier;
       
   128 
       
   129         /// Active Favourites Database. Owns.
       
   130         CActiveFavouritesDbNotifier* iFavouritesNotifier;
       
   131 
       
   132         /// Contains ETrue if commsdb is being waited on
       
   133         TBool iWaitCommsDb;
       
   134 
       
   135         /// Contains ETrue if favourites db is being waited on
       
   136         TBool iWaitFavourites;
       
   137 
       
   138         /// Active scheduler.
    94         /// Active scheduler.
   139         CActiveSchedulerWait iWait;
    95         CActiveSchedulerWait iWait;
   140 
    96 
   141         /// Timer for retry. Owns.
    97         /// Timer for retry. Owns.
   142         CPeriodic* iRetryTimer;
    98         CPeriodic* iRetryTimer;
   143 
    99 
   144         /// Retry counter
   100         /// Retry counter
   145         TInt iRetryCount;
   101         TInt iRetryCount;
   146         
   102         
   147         RFavouritesDb       iBookmarkDb;
       
   148         RFavouritesSession  iSession;        
       
   149         HbProgressDialog *iProgress;
   103         HbProgressDialog *iProgress;
   150         TBufC<200> iValue;
   104         TBufC<200> iValue;
   151     };
   105     };
   152 
   106 
   153 
   107