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