1 /* |
|
2 * Copyright (c) 2005-2006 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: State machine for closing a file |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_RSFW_CLOSESTATEMACHINE_H |
|
20 #define C_RSFW_CLOSESTATEMACHINE_H |
|
21 |
|
22 |
|
23 #include "rsfwwaitnotestatemachine.h" |
|
24 #include "rsfwsavetodlgrequest.h" |
|
25 |
|
26 /** |
|
27 * State machine for closing a file |
|
28 * |
|
29 * Consists of following states: |
|
30 * - File is written to the server |
|
31 * - Possible lock is released |
|
32 * - If writing fails, file becomes "dirty" and |
|
33 * is saved locally. |
|
34 * |
|
35 */ |
|
36 |
|
37 class CRsfwCloseStateMachine : public CRsfwWaitNoteStateMachine |
|
38 { |
|
39 public: |
|
40 CRsfwCloseStateMachine(); |
|
41 ~CRsfwCloseStateMachine(); |
|
42 |
|
43 public: |
|
44 // STATES |
|
45 class TReleaseLockState : public CRsfwCloseStateMachine::TState |
|
46 { |
|
47 public: |
|
48 TReleaseLockState(CRsfwCloseStateMachine *aOperation); |
|
49 void EnterL(); |
|
50 TState* CompleteL(); |
|
51 TState* ErrorL(TInt aCode); |
|
52 private: |
|
53 CRsfwCloseStateMachine* iOperation; |
|
54 }; |
|
55 |
|
56 class TSaveLocallyState : public CRsfwCloseStateMachine::TState |
|
57 { |
|
58 public: |
|
59 TSaveLocallyState(CRsfwCloseStateMachine *aOperation); |
|
60 void EnterL(); |
|
61 TState* CompleteL(); |
|
62 TState* ErrorL(TInt aCode); |
|
63 private: |
|
64 CRsfwCloseStateMachine* iOperation; |
|
65 TRsfwSaveToDlgRequest iSaveToRequest; |
|
66 TBuf<KRsfwMaxFileSizeString> iFileSizeString; |
|
67 }; |
|
68 |
|
69 public: |
|
70 TState* CompleteRequestL(TInt aError); |
|
71 TState* ErrorOnStateEntry(TInt aError); |
|
72 |
|
73 public: |
|
74 TInt iFlags; |
|
75 }; |
|
76 |
|
77 |
|
78 |
|
79 #endif // C_RSFW_CLOSESTATEMACHINE_H |
|