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 opening a file or directory |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_RSFW_OPENBYPATHSTATEMACHINE_H |
|
20 #define C_RSFW_OPENBYPATHSTATEMACHINE_H |
|
21 |
|
22 #include "rsfwattributerefreshingstatemachine.h" |
|
23 |
|
24 class TDirEntAttr; |
|
25 |
|
26 /** |
|
27 * State machine for OpenByPath operation. |
|
28 * |
|
29 * Assumes FID is not yet cached. Note that here we know FID <-> pathname |
|
30 * association and in principle the file with that pathname should exist |
|
31 * as this call has been preceded by a call to Entry() |
|
32 * - of course, there is a possibility that the file has been deleted from |
|
33 * the server |
|
34 * |
|
35 */ |
|
36 class CRsfwOpenByPathStateMachine : public CRsfwAttributeRefreshingStateMachine |
|
37 { |
|
38 public: |
|
39 CRsfwOpenByPathStateMachine(); |
|
40 ~CRsfwOpenByPathStateMachine(); |
|
41 |
|
42 public: |
|
43 //STATES |
|
44 // requiring opening in the relevant mode - e.g. obtain a write lock |
|
45 class TRequestOpenModeState : public CRsfwOpenByPathStateMachine::TState |
|
46 { |
|
47 public: |
|
48 TRequestOpenModeState(CRsfwOpenByPathStateMachine* aOperation); |
|
49 void EnterL(); |
|
50 TState* CompleteL(); |
|
51 TState* ErrorL(TInt aCode); |
|
52 private: |
|
53 CRsfwOpenByPathStateMachine* iOperation; |
|
54 TBool iRequestedLock; |
|
55 }; |
|
56 |
|
57 public: |
|
58 TState* CompleteRequestL(TInt aError); |
|
59 |
|
60 public: |
|
61 // input parameters; |
|
62 TBool iRealOpen; |
|
63 // file open mode |
|
64 TUint iFlags; |
|
65 |
|
66 //output params: |
|
67 TDesC* iCacheName; |
|
68 TDirEntAttr* iAttrp; |
|
69 TDesC8* iLockToken; |
|
70 }; |
|
71 |
|
72 |
|
73 #endif // C_RSFW_OPENBYPATHSTATEMACHINE_H |
|