|
1 /* |
|
2 * Copyright (c) 2005 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: A converter representation of the operation class. It provides an interface |
|
15 * for operations that are performed in small synchronous steps. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CPOSLMCONVERTEROPERATION_H |
|
21 #define CPOSLMCONVERTEROPERATION_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <EPos_CPosLmOperation.h> |
|
25 #include "EPos_TPosLmConvOperationStatus.h" |
|
26 |
|
27 // FORWARD DECLARATION |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 /** |
|
32 * A converter representation of the operation class. It provides an interface |
|
33 * for operations that are performed in small synchronous steps. |
|
34 */ |
|
35 class CPosLmConverterOperation : public CPosLmOperation |
|
36 { |
|
37 |
|
38 public: // Constructors and destructor |
|
39 |
|
40 /** |
|
41 * Destructor. |
|
42 */ |
|
43 virtual ~CPosLmConverterOperation(); |
|
44 |
|
45 public: // From base classes |
|
46 |
|
47 /** |
|
48 * From CPosLmOperation. |
|
49 * |
|
50 * Performs one step of the operation asynchronously. |
|
51 * |
|
52 * @param aStatus The request status. Will be completed when the step |
|
53 * has been performed. The request status will be @p KRequestPending |
|
54 * if the step has not completed. It will be |
|
55 * @p KPosLmOperationNotComplete if the step has completed but more |
|
56 * steps are needed before the operation has finished. The request |
|
57 * status will be @p KErrNone if the operation has finished |
|
58 * successfully. The status will be set to an error code if the |
|
59 * operation has failed. |
|
60 * @param aProgress Will be set to the progress of the operation when the |
|
61 * step has finished. |
|
62 */ |
|
63 void NextStep( |
|
64 /* OUT */ TRequestStatus& aStatus, |
|
65 /* OUT */ TReal32& aProgress |
|
66 ); |
|
67 |
|
68 /** |
|
69 * From CPosLmOperation. |
|
70 * |
|
71 * Synchronous execution of the operation. Performs calls to NextStepL |
|
72 * until the operation is completed. |
|
73 * |
|
74 * When this function returns, the operation has finished. |
|
75 */ |
|
76 void ExecuteL(); |
|
77 |
|
78 /** |
|
79 * Synchronous incremental execution of the operation. Performs a single |
|
80 * step of the operation synchronously. |
|
81 * |
|
82 * Leaves with an error code if something goes wrong. |
|
83 * |
|
84 * @param aProgress Will be set to the progress of the operation when |
|
85 * the step has finished. |
|
86 * @return @p KPosLmOperationNotComplete if the step has completed but |
|
87 * more steps are needed before the operation has finished, |
|
88 * @p KErrNone if the operation has finished successfully. |
|
89 */ |
|
90 virtual TInt NextStepL( |
|
91 /* OUT */ TReal32& aProgress |
|
92 ) = 0; |
|
93 |
|
94 /** |
|
95 * Handles any error generated by NextStepL. Will be called when |
|
96 * NextStepL leaves. The error code is allowed to be changed, if |
|
97 * necessary. |
|
98 * |
|
99 * @param aError An error code generated by NextStepL. |
|
100 */ |
|
101 virtual void HandleError( |
|
102 /* IN/OUT */ TInt& aError |
|
103 ) = 0; |
|
104 |
|
105 /** |
|
106 * Handles a completed operation that has been successfully completed. |
|
107 * Will be called when NextStepL returns with KErrNone. |
|
108 * |
|
109 * For CPosLmConverterOperation this function is empty. |
|
110 */ |
|
111 virtual void HandleOperationCompleted(); |
|
112 |
|
113 protected: |
|
114 |
|
115 /** |
|
116 * C++ default constructor. |
|
117 */ |
|
118 CPosLmConverterOperation(); |
|
119 |
|
120 /** |
|
121 * Symbian 2nd phase constructor. |
|
122 */ |
|
123 void BaseConstructL(); |
|
124 |
|
125 /** |
|
126 * Retrieves the current progress of the operation. |
|
127 * Note: if called from the @p NextStepL function, this function returns |
|
128 * the progress of the previous step. |
|
129 * @return The progress of the operation. |
|
130 */ |
|
131 TReal32 Progress(); |
|
132 |
|
133 private: |
|
134 |
|
135 // By default, prohibit copy constructor |
|
136 CPosLmConverterOperation( const CPosLmConverterOperation& ); |
|
137 // Prohibit assigment operator |
|
138 CPosLmConverterOperation& operator= ( const CPosLmConverterOperation& ); |
|
139 |
|
140 private: |
|
141 |
|
142 TPosLmConvOperationStatus iOperationStatus; |
|
143 |
|
144 TReal32 iProgress; |
|
145 |
|
146 }; |
|
147 |
|
148 #endif // CPOSLMCONVERTEROPERATION_H |
|
149 |
|
150 // End of File |