63
|
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: An implementation for operations that needs to do a big task
|
|
15 |
* and report steps to observers. Can be used e.g
|
|
16 |
* in store domain implementation to handle multiple store
|
|
17 |
* operations
|
|
18 |
*
|
|
19 |
*/
|
|
20 |
|
|
21 |
|
|
22 |
#ifndef CVPBKBATCHOPERATION_H
|
|
23 |
#define CVPBKBATCHOPERATION_H
|
|
24 |
|
|
25 |
// INCLUDE FILES
|
|
26 |
#include <CVPbkMultiContactOperationBase.h>
|
|
27 |
#include <MVPbkBatchOperationObserver.h>
|
|
28 |
|
|
29 |
// CLASS DECLARATION
|
|
30 |
|
|
31 |
/**
|
|
32 |
* An implementation for batch operations
|
|
33 |
*
|
|
34 |
* @lib VPbkEng.lib
|
|
35 |
*/
|
|
36 |
class CVPbkBatchOperation :
|
|
37 |
public CVPbkMultiContactOperationBase,
|
|
38 |
public MVPbkBatchOperationObserver
|
|
39 |
{
|
|
40 |
public:
|
|
41 |
/**
|
|
42 |
* @param aObserver the observer that is called after
|
|
43 |
* all suboperations have completed or
|
|
44 |
* there are zero suboperations.
|
|
45 |
* @return A new instance of this class
|
|
46 |
*/
|
|
47 |
IMPORT_C static CVPbkBatchOperation* NewLC(
|
|
48 |
MVPbkBatchOperationObserver& aObserver );
|
|
49 |
~CVPbkBatchOperation();
|
|
50 |
|
|
51 |
// from base class CVPbkMultiContactOperationBase
|
|
52 |
private:
|
|
53 |
void HandleZeroSuboperations();
|
|
54 |
|
|
55 |
// from base class MVPbkBatchOperationObserver
|
|
56 |
void StepComplete( MVPbkContactOperationBase& aOperation, TInt aStepSize );
|
|
57 |
TBool StepFailed( MVPbkContactOperationBase& aOperation, TInt aStepSize,
|
|
58 |
TInt aError );
|
|
59 |
void OperationComplete( MVPbkContactOperationBase& aOperation );
|
|
60 |
|
|
61 |
private: // Implementation
|
|
62 |
CVPbkBatchOperation( MVPbkBatchOperationObserver& aObserver );
|
|
63 |
|
|
64 |
private: // Data
|
|
65 |
/// Ref: Operation observer
|
|
66 |
MVPbkBatchOperationObserver& iObserver;
|
|
67 |
/// Own: A counter for completed suboperations
|
|
68 |
TInt iCompleteCount;
|
|
69 |
};
|
|
70 |
|
|
71 |
#endif // CVPBKBATCHOPERATION_H
|
|
72 |
|
|
73 |
// End of file
|