|
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: Delete a file or directory |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_RSFW_DELETESTATEMACHINE_H |
|
20 #define C_RSFW_DELETESTATEMACHINE_H |
|
21 |
|
22 #include "rsfwrfestatemachine.h" |
|
23 |
|
24 /** |
|
25 * Deletes a file or directory |
|
26 * |
|
27 * State machine for deleting a file or directory. |
|
28 * |
|
29 */ |
|
30 class CRsfwDeleteStateMachine : public CRsfwRfeStateMachine |
|
31 { |
|
32 public: |
|
33 CRsfwDeleteStateMachine(TUint iNodeType); |
|
34 ~CRsfwDeleteStateMachine(); |
|
35 |
|
36 public: |
|
37 // STATES |
|
38 // TCheckIfCanBeDeleted: |
|
39 // If a directory is not empty, it must not be deleted |
|
40 class TCheckIfCanBeDeleted : public CRsfwDeleteStateMachine::TState |
|
41 { |
|
42 public: |
|
43 TCheckIfCanBeDeleted(CRsfwDeleteStateMachine *aOperation); |
|
44 void EnterL(); |
|
45 TState* CompleteL(); |
|
46 TState* ErrorL(TInt aCode); |
|
47 private: |
|
48 CRsfwDeleteStateMachine* iOperation; |
|
49 }; |
|
50 |
|
51 class TDeleteNodeState : public CRsfwDeleteStateMachine::TState |
|
52 { |
|
53 public: |
|
54 TDeleteNodeState(CRsfwDeleteStateMachine *aOperation); |
|
55 void EnterL(); |
|
56 TState* CompleteL(); |
|
57 TState* ErrorL(TInt aCode); |
|
58 private: |
|
59 CRsfwDeleteStateMachine* iOperation; |
|
60 }; |
|
61 |
|
62 public: |
|
63 TState* CompleteRequestL(TInt aError); |
|
64 |
|
65 TBool iKidCreated; |
|
66 HBufC* iKidPath; |
|
67 CRsfwFileEntry* iKidFep; |
|
68 |
|
69 TUint iNodeType; // are we removing file or directory... |
|
70 |
|
71 // directory entries |
|
72 // used to fetch directory contents in TCheckIfCanBeDeleted |
|
73 RPointerArray<CRsfwDirEnt> iDirEnts; |
|
74 }; |
|
75 |
|
76 |
|
77 #endif // C_RSFW_DELETESTATEMACHINE_H |