pnpmobileservices/pnpms/PnP/PnpProvisioningAppInc/PnpProvisioningSaver.h
changeset 0 3ce708148e4d
child 2 a5fecba4b1e4
equal deleted inserted replaced
-1:000000000000 0:3ce708148e4d
       
     1 /*
       
     2 * Copyright (c) 2002-2006 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:  Settings saver with progress note.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CPNPPROVISIONINGSAVER_H
       
    21 #define CPNPPROVISIONINGSAVER_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <msgbiocontrol.h>                // for CMsgBioControl
       
    25 #include <ActiveApDb.h>
       
    26 #include <FavouritesDbObserver.h>
       
    27 #include "mwaitdialogstatusnotifier.h"  // for MWaitDialogStatusNotifier
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CWPEngine;
       
    31 class CActiveFavouritesDbNotifier;
       
    32 class CBookmarkDb;
       
    33 class CWaitDialogMonitor;
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37  * Helper class for saving Provisioning settings. Provides a progress note.
       
    38  */
       
    39 class CPnpProvisioningSaver :
       
    40     public CActive,
       
    41     private MActiveApDbObserver,
       
    42     private MFavouritesDbObserver,
       
    43     private MWaitDialogStatusNotifier
       
    44     {
       
    45     public:
       
    46         /**
       
    47         * C++ default constructor.
       
    48         * @param aEngine Engine to be used for saving
       
    49         */
       
    50         CPnpProvisioningSaver( CWPEngine& aEngine, TBool aSetAsDefault );
       
    51 
       
    52         /**
       
    53         * Destructor.
       
    54         */
       
    55         ~CPnpProvisioningSaver();
       
    56 
       
    57     public:
       
    58         /**
       
    59         * Prepares the object for saving.
       
    60         */
       
    61         void PrepareLC();
       
    62 
       
    63         /**
       
    64         * Executes save with a progress note. Ownership of the
       
    65         * CPnpProvisioningSaver object is transferred.
       
    66         * @param aNumSaved When returns, contains number of settings saved.
       
    67         * @return Status code. >= 0 if saving was completed
       
    68         */
       
    69         TInt ExecuteLD( TInt& aNumSaved );
       
    70 
       
    71     protected: // From CActive
       
    72 
       
    73         void DoCancel();
       
    74         void RunL();
       
    75         TInt RunError( TInt aError );
       
    76 
       
    77     private: // from MActiveApDbObserver
       
    78 
       
    79         void HandleApDbEventL( TEvent anEvent );
       
    80 
       
    81     private: // from MFavouritesDbObserver
       
    82 
       
    83         void HandleFavouritesDbEventL( RDbNotifier::TEvent aEvent );
       
    84         
       
    85     private: // from MCMDialogStatusNotifier
       
    86         void WaitDialogDismissedL( const TInt aStatusCode );
       
    87     private:
       
    88         /**
       
    89         * Complete the request so that RunL() gets called.
       
    90         */
       
    91         void CompleteRequest();
       
    92 
       
    93         /**
       
    94         * Complete the request so that Timeout() gets called after
       
    95         * a delay.
       
    96         */
       
    97         void DelayedCompleteRequest();
       
    98 
       
    99         /**
       
   100         * Retry save now.
       
   101         */
       
   102         void Retry();
       
   103 
       
   104         /**
       
   105         * Timer timed-out.
       
   106         */
       
   107         static TInt Timeout(TAny* aSelf);
       
   108 
       
   109         /*
       
   110         * Process is finished. Deletes wait dialog.
       
   111         */
       
   112         void ProcessFinishedL();
       
   113         
       
   114         /*
       
   115         * Show wait note dialog
       
   116         */
       
   117         void ShowWaitNoteL();
       
   118 
       
   119     private:
       
   120         // The engine used for performing the save. Refs.
       
   121         CWPEngine& iEngine;
       
   122 
       
   123         // ETrue if setting as default
       
   124         TBool iSetAsDefault;
       
   125 
       
   126         // The item to be saved next
       
   127         TInt iCurrentItem;
       
   128 
       
   129         // Contains result to be passed to the called of ExecuteLD
       
   130         TInt iResult;
       
   131 
       
   132         // Active AP database
       
   133         CActiveApDb* iApDbNotifier;
       
   134 
       
   135         // Active Favourites Database
       
   136         CActiveFavouritesDbNotifier* iFavouritesNotifier;
       
   137 
       
   138         // Bookmarks database
       
   139         CBookmarkDb* iBookmarkDb;
       
   140 
       
   141         // Contains ETrue if commsdb is being waited on
       
   142         TBool iWaitCommsDb;
       
   143 
       
   144         // Contains ETrue if favourites db is being waited on
       
   145         TBool iWaitFavourites;
       
   146 
       
   147         // Active scheduler.
       
   148         CActiveSchedulerWait iWait;
       
   149 
       
   150         // Timer for retry
       
   151         CPeriodic* iRetryTimer;
       
   152         
       
   153         // wait note dialog monitor
       
   154         CWaitDialogMonitor* iWaitDialogMonitor;
       
   155         // wait note dialog
       
   156         CAknGlobalNote* iGlobalWaitNote;
       
   157         
       
   158         //End key pressed or not
       
   159         TBool iEndKeyPressed;
       
   160         
       
   161     };
       
   162 
       
   163 
       
   164 #endif // CPNPPROVISIONINGSAVER_H
       
   165 
       
   166 // End of File