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 creating files |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_RSFW_CREATEFILESTATEMACHINE_H |
|
20 #define C_RSFW_CREATEFILESTATEMACHINE_H |
|
21 |
|
22 #include "rsfwrfestatemachine.h" |
|
23 |
|
24 /** |
|
25 * Creates a file |
|
26 * |
|
27 * State machine for creating a file. Possibly could be combined with |
|
28 * CRsfwMkDirStateMachine, the differences are not that big... |
|
29 * |
|
30 */ |
|
31 class CRsfwCreateFileStateMachine : public CRsfwRfeStateMachine |
|
32 { |
|
33 public: |
|
34 CRsfwCreateFileStateMachine(); |
|
35 ~CRsfwCreateFileStateMachine(); |
|
36 |
|
37 public: |
|
38 |
|
39 class TCheckIfExistsState : public CRsfwCreateFileStateMachine::TState |
|
40 { |
|
41 public: |
|
42 TCheckIfExistsState(CRsfwCreateFileStateMachine *aOperation); |
|
43 void EnterL(); |
|
44 TState* CompleteL(); |
|
45 TState* ErrorL(TInt aCode); |
|
46 private: |
|
47 CRsfwCreateFileStateMachine* iOperation; |
|
48 TInt iExclp; |
|
49 }; |
|
50 |
|
51 class TCreateNodeState : public CRsfwCreateFileStateMachine::TState |
|
52 { |
|
53 public: |
|
54 TCreateNodeState(CRsfwCreateFileStateMachine *aOperation); |
|
55 void EnterL(); |
|
56 TState* CompleteL(); |
|
57 TState* ErrorL(TInt aCode); |
|
58 private: |
|
59 CRsfwCreateFileStateMachine* iOperation; |
|
60 }; |
|
61 |
|
62 class TAcquireLockState : public CRsfwCreateFileStateMachine::TState |
|
63 { |
|
64 public: |
|
65 TAcquireLockState(CRsfwCreateFileStateMachine *aOperation); |
|
66 void EnterL(); |
|
67 TState* CompleteL(); |
|
68 TState* ErrorL(TInt aCode); |
|
69 private: |
|
70 CRsfwCreateFileStateMachine* iOperation; |
|
71 private: |
|
72 TBool iRequestedLock; |
|
73 }; |
|
74 |
|
75 public: |
|
76 TState* CompleteRequestL(TInt aError); |
|
77 |
|
78 CRsfwFileEntry* iKidFep; |
|
79 TBool iKidCreated; |
|
80 // file open mode |
|
81 TUint iFlags; |
|
82 |
|
83 // used in TCheckIfExistsState |
|
84 CRsfwDirEntAttr* iDirEntAttr; |
|
85 TDesC8* iLockToken; |
|
86 }; |
|
87 |
|
88 |
|
89 #endif // C_RSFW_CREATEFILESTATEMACHINE_H |
|