|
1 /* |
|
2 * Copyright (c) 2004 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: Control step interface. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __MCNUICNTRLSTEP_H |
|
19 #define __MCNUICNTRLSTEP_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <E32Base.h> |
|
23 |
|
24 |
|
25 //MACROS |
|
26 /** |
|
27 * Macro for return value error handling. |
|
28 * If returned value is something else than KErrNone, |
|
29 * returns it. Else continues the execution. |
|
30 */ |
|
31 #define RETURN_IF_ERROR( op ) \ |
|
32 { \ |
|
33 TInt __err = op; \ |
|
34 if( __err != KErrNone ) \ |
|
35 { \ |
|
36 return __err;\ |
|
37 } \ |
|
38 } \ |
|
39 |
|
40 /** |
|
41 * Completion codes for |
|
42 * HandleCompleteL() |
|
43 * @since 2.1 |
|
44 */ |
|
45 enum TCnUiHandleCompleteStatus |
|
46 { |
|
47 ///<No special requirements from step. Teardown can be |
|
48 ///<continued to next step. |
|
49 ECnUiStepContinueTeardown = 0, |
|
50 |
|
51 ///<Step wishes to restart processing from this |
|
52 ///<step's RunStepL(). |
|
53 ECnUiRestartStep = 1 |
|
54 }; |
|
55 |
|
56 |
|
57 |
|
58 // CLASS DECLARATION |
|
59 /** |
|
60 * Control step interface. |
|
61 * |
|
62 * @since 2.1 |
|
63 */ |
|
64 NONSHARABLE_CLASS( MCnUiCntrlStep ) |
|
65 { |
|
66 public: // New abstract operation step methods |
|
67 |
|
68 /** |
|
69 * Run step. |
|
70 * |
|
71 * Here the concrete step may do what so ever |
|
72 * operations the step running needs. |
|
73 * |
|
74 * @since 2.1 |
|
75 */ |
|
76 virtual TInt RunStepL() = 0; |
|
77 |
|
78 |
|
79 /** |
|
80 * Called to handle failure in step execution. |
|
81 * |
|
82 * Failed step might have been either this same step |
|
83 * or one of the subsequent ones. |
|
84 * |
|
85 * @since 2.1 |
|
86 */ |
|
87 virtual void UndoStepL() = 0; |
|
88 |
|
89 |
|
90 /** |
|
91 * Called to handle step running completion. |
|
92 * This is called when the all steps have been |
|
93 * processed successfully. |
|
94 * |
|
95 * If step wishes, it can restart the step execution |
|
96 * from this step forward by returning the ECnUiRestartStep. |
|
97 * Else the teardown is coninued to previous step. |
|
98 * |
|
99 * @since 2.1 |
|
100 * @return Completion status from TCnUiHandleCompleteStatus. |
|
101 */ |
|
102 virtual TCnUiHandleCompleteStatus HandleCompleteL() = 0; |
|
103 |
|
104 |
|
105 public: //Destructor |
|
106 |
|
107 /** |
|
108 * Inline destructor. |
|
109 * |
|
110 * Destroy trough this |
|
111 * interface is possible. |
|
112 */ |
|
113 virtual ~MCnUiCntrlStep() {}; |
|
114 }; |
|
115 |
|
116 |
|
117 #endif // __MCNUICNTRLSTEP_H |
|
118 |
|
119 // End of File |
|
120 |