clientprovisioning/cpqtsp/inc/CWPSaver.h
author hgs
Tue, 13 Jul 2010 04:01:20 +0530
changeset 47 d316aecb87fd
parent 45 0f9fc722d255
permissions -rw-r--r--
201025_02
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
45
0f9fc722d255 201021_01
hgs
parents:
diff changeset
     1
/*
0f9fc722d255 201021_01
hgs
parents:
diff changeset
     2
* ============================================================================
0f9fc722d255 201021_01
hgs
parents:
diff changeset
     3
*  Name        : CWPSaver.h
0f9fc722d255 201021_01
hgs
parents:
diff changeset
     4
*  Part of     : Provisioning / ProvisioningBC
0f9fc722d255 201021_01
hgs
parents:
diff changeset
     5
*  Description : Settings saver with progress note.
47
d316aecb87fd 201025_02
hgs
parents: 45
diff changeset
     6
*  Version     : %version: 2 % << Don't touch! Updated by Synergy at check-out.
45
0f9fc722d255 201021_01
hgs
parents:
diff changeset
     7
*
0f9fc722d255 201021_01
hgs
parents:
diff changeset
     8
*  Copyright © 2002-2006 Nokia.  All rights reserved.
0f9fc722d255 201021_01
hgs
parents:
diff changeset
     9
*  This material, including documentation and any related computer
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    10
*  programs, is protected by copyright controlled by Nokia.  All
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    11
*  rights are reserved.  Copying, including reproducing, storing,
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    12
*  adapting or translating, any or all of this material requires the
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    13
*  prior written consent of Nokia.  This material also contains
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    14
*  confidential information which may not be disclosed to others
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    15
*  without the prior written consent of Nokia.
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    16
* ============================================================================
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    17
*/
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    18
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    19
#ifndef CWPSAVER_H
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    20
#define CWPSAVER_H
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    21
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    22
// INCLUDES
47
d316aecb87fd 201025_02
hgs
parents: 45
diff changeset
    23
45
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    24
#include <HbProgressDialog>
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    25
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    26
// FORWARD DECLARATIONS
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    27
class CWPEngine;
47
d316aecb87fd 201025_02
hgs
parents: 45
diff changeset
    28
//class CActiveFavouritesDbNotifier;
45
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    29
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    30
// CLASS DECLARATION
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    31
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    32
/**
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    33
 * Helper class for saving Provisioning settings. Provides a progress note.
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    34
 * @since 2.0
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    35
 */
47
d316aecb87fd 201025_02
hgs
parents: 45
diff changeset
    36
class CWPSaver : public CActive
d316aecb87fd 201025_02
hgs
parents: 45
diff changeset
    37
                 
45
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    38
    {
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    39
    public:
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    40
        /**
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    41
        * C++ default constructor.
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    42
        * @param aEngine Engine to be used for saving
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    43
        * @param aSetAsDefault EFalse => call CWPEngine::SaveL, ETrue
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    44
        *        => call CWPEngine::SetAsDefaultL
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    45
        */
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    46
        CWPSaver( CWPEngine& aEngine, TBool aSetAsDefault );
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    47
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    48
        /**
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    49
        * Destructor.
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    50
        */
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    51
        virtual ~CWPSaver();
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    52
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    53
    public:
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    54
        /**
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    55
        * Prepares the object for saving.
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    56
        */
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    57
        void PrepareLC();
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    58
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    59
        /**
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    60
        * Executes save with a progress note. Ownership of the
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    61
        * CWPSaver object is transferred.
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    62
        * @param aNumSaved When returns, contains number of settings saved.
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    63
        * @return Status code. >= 0 if saving was completed
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    64
        */
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    65
        TInt ExecuteLD( TInt& aNumSaved, TBufC<256>& value );
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    66
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    67
    protected: // From CActive
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    68
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    69
        void DoCancel();
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    70
        void RunL();
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    71
        TInt RunError( TInt aError );
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    72
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    73
    private:
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    74
        /**
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    75
        * Complete the request so that RunL() gets called.
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    76
        */
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    77
        void CompleteRequest();
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    78
        void Retry();
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    79
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    80
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    81
    private:
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    82
        /// The engine used for performing the save. Refs.
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    83
        CWPEngine& iEngine;
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    84
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    85
        /// ETrue if setting as default
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    86
        TBool iSetAsDefault;     
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    87
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    88
        /// The item to be saved next
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    89
        TInt iCurrentItem;
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    90
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    91
        /// Contains result to be passed to the called of ExecuteLD
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    92
        TInt iResult;
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    93
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    94
        /// Active scheduler.
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    95
        CActiveSchedulerWait iWait;
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    96
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    97
        /// Timer for retry. Owns.
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    98
        CPeriodic* iRetryTimer;
0f9fc722d255 201021_01
hgs
parents:
diff changeset
    99
0f9fc722d255 201021_01
hgs
parents:
diff changeset
   100
        /// Retry counter
0f9fc722d255 201021_01
hgs
parents:
diff changeset
   101
        TInt iRetryCount;
0f9fc722d255 201021_01
hgs
parents:
diff changeset
   102
        
0f9fc722d255 201021_01
hgs
parents:
diff changeset
   103
        HbProgressDialog *iProgress;
0f9fc722d255 201021_01
hgs
parents:
diff changeset
   104
        TBufC<200> iValue;
0f9fc722d255 201021_01
hgs
parents:
diff changeset
   105
    };
0f9fc722d255 201021_01
hgs
parents:
diff changeset
   106
0f9fc722d255 201021_01
hgs
parents:
diff changeset
   107
0f9fc722d255 201021_01
hgs
parents:
diff changeset
   108
#endif // CWPSAVER_H
0f9fc722d255 201021_01
hgs
parents:
diff changeset
   109
0f9fc722d255 201021_01
hgs
parents:
diff changeset
   110
// End of File