|
1 /* |
|
2 * Copyright (c) 2005-2007 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: Phonebook 2 compress policy manager. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBK2COMPRESSPOLICYMANAGER_H |
|
20 #define CPBK2COMPRESSPOLICYMANAGER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include "MPbk2CompressPolicyManager.h" |
|
25 #include <MVPbkBatchOperationObserver.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class MPbk2StoreObservationRegister; |
|
29 class MPbk2CompressPolicy; |
|
30 class MVPbkContactOperationBase; |
|
31 class CVPbkContactManager; |
|
32 |
|
33 // CLASS DECLARATIONS |
|
34 |
|
35 /** |
|
36 * Phonebook 2 compress policy manager. |
|
37 * Responsible for owning and managing compress policies. |
|
38 */ |
|
39 NONSHARABLE_CLASS(CPbk2CompressPolicyManager) : |
|
40 public CBase, |
|
41 public MPbk2CompressPolicyManager, |
|
42 public MVPbkBatchOperationObserver |
|
43 { |
|
44 public: // Construction and destruction |
|
45 |
|
46 /** |
|
47 * Creates a new instance of this class. |
|
48 * |
|
49 * @param aStoreObservationRegister Store manager. |
|
50 * @param aContactManager Virtual Phonebook |
|
51 * contact manager. |
|
52 * @return A new instance of this class. |
|
53 */ |
|
54 static CPbk2CompressPolicyManager* NewL( |
|
55 MPbk2StoreObservationRegister& aStoreObservationRegister, |
|
56 CVPbkContactManager& aContactManager ); |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 ~CPbk2CompressPolicyManager(); |
|
62 |
|
63 public: // From MPbk2CompressPolicyManager |
|
64 void CompressStores(); |
|
65 void CancelCompress(); |
|
66 void StartAllPolicies(); |
|
67 void StopAllPolicies(); |
|
68 |
|
69 private: // From MVPbkBatchOperationObserver |
|
70 void StepComplete( |
|
71 MVPbkContactOperationBase& aOperation, |
|
72 TInt aStepSize ); |
|
73 TBool StepFailed( |
|
74 MVPbkContactOperationBase& aOperation, |
|
75 TInt aStepSize, |
|
76 TInt aError ); |
|
77 void OperationComplete( |
|
78 MVPbkContactOperationBase& aOperation ); |
|
79 |
|
80 private: // Implementation |
|
81 CPbk2CompressPolicyManager( |
|
82 MPbk2StoreObservationRegister& aStoreObservationRegister, |
|
83 CVPbkContactManager& aContactManager ); |
|
84 void ConstructL(); |
|
85 void ConstructPoliciesL(); |
|
86 |
|
87 private: // Data |
|
88 /// Ref: Store observation register |
|
89 MPbk2StoreObservationRegister& iStoreObservationRegister; |
|
90 /// Own: Array of compress policies |
|
91 RPointerArray<MPbk2CompressPolicy> iPolicyArray; |
|
92 /// Own: Compress operation |
|
93 MVPbkContactOperationBase* iCompressOperation; |
|
94 /// Ref: Virtual Phonebook contact manager |
|
95 CVPbkContactManager& iContactManager; |
|
96 }; |
|
97 |
|
98 #endif // CPBK2COMPRESSPOLICYMANAGER_H |
|
99 |
|
100 // End of File |