|
1 /* |
|
2 * Copyright (c) 2006, 2007 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: This class defines the dps script receiving function. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef DPSSCRIPTRECEIVER_H |
|
20 #define DPSSCRIPTRECEIVER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 class CDpsEngine; |
|
25 class CDpsStateMachine; |
|
26 |
|
27 /** |
|
28 * This class is an active object. It listens on the ptp server |
|
29 * object receiving notification. |
|
30 */ |
|
31 NONSHARABLE_CLASS(CDpsScriptReceiver) : public CActive |
|
32 { |
|
33 public: |
|
34 /** |
|
35 * Two phase constructor |
|
36 * |
|
37 * @param aOperator the pointer to the dps state machine |
|
38 * @return a CDpsScriptReceiver instance |
|
39 */ |
|
40 static CDpsScriptReceiver* NewL(CDpsStateMachine* aOperator); |
|
41 |
|
42 /** |
|
43 * Destructor |
|
44 */ |
|
45 ~CDpsScriptReceiver(); |
|
46 |
|
47 /** |
|
48 * Issues the request of receiving. |
|
49 */ |
|
50 void WaitForReceive(); |
|
51 |
|
52 /** |
|
53 * @return the file name of the object been received |
|
54 */ |
|
55 const TDesC& FileNameAndPath(); |
|
56 |
|
57 private: // Functions derived from CActive. |
|
58 /** |
|
59 * @see CActive |
|
60 */ |
|
61 void RunL(); |
|
62 |
|
63 /** |
|
64 * @see CActive |
|
65 */ |
|
66 void DoCancel(); |
|
67 |
|
68 /** |
|
69 * @see CActive |
|
70 */ |
|
71 TInt RunError(TInt aError); |
|
72 |
|
73 private: |
|
74 |
|
75 /** |
|
76 * Default constructor |
|
77 * |
|
78 * @param aOperator the pointer to the dps state machine |
|
79 */ |
|
80 CDpsScriptReceiver(CDpsStateMachine* aOperator); |
|
81 |
|
82 /** |
|
83 * Gets the file name from the full filename |
|
84 * @param aFileName the full filename including file path |
|
85 * @return KErrNone if Ok, otherwise the system wide error |
|
86 */ |
|
87 TInt GetFileName(TDes& aFileName); |
|
88 |
|
89 private: |
|
90 |
|
91 // not owned by this class |
|
92 CDpsStateMachine* iOperator; |
|
93 // file name of received script file |
|
94 TFileName iFileNameAndPath; |
|
95 }; |
|
96 |
|
97 #endif |