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: Wraps remote drive functionality |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_FILEMANAGERREMOTEDRIVEHANDLER_H |
|
20 #define C_FILEMANAGERREMOTEDRIVEHANDLER_H |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include "MFileManagerPropertyObserver.h" |
|
26 |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CRsfwMountMan; |
|
30 class CFileManagerEngine; |
|
31 class CFileManagerPropertySubscriber; |
|
32 class CFileManagerUtils; |
|
33 |
|
34 |
|
35 // CLASS DECLARATION |
|
36 /** |
|
37 * This class wraps remote drive functionality |
|
38 * |
|
39 * @lib FileManagerEngine.lib |
|
40 * @since S60 3.1 |
|
41 */ |
|
42 NONSHARABLE_CLASS(CFileManagerRemoteDriveHandler) : |
|
43 public CBase, |
|
44 MFileManagerPropertyObserver |
|
45 { |
|
46 |
|
47 public: |
|
48 /** |
|
49 * Two-phased constructor. |
|
50 */ |
|
51 static CFileManagerRemoteDriveHandler* NewL( |
|
52 CFileManagerEngine& aEngine, |
|
53 CFileManagerUtils& aUtils ); |
|
54 |
|
55 /** |
|
56 * Destructor |
|
57 */ |
|
58 ~CFileManagerRemoteDriveHandler(); |
|
59 |
|
60 public: // New functions |
|
61 /** |
|
62 * Gets remote drive connection state |
|
63 * @param aDrive Drive number EDriveA...EDriveZ |
|
64 * @return ETrue if connected. Otherwise EFalse. |
|
65 */ |
|
66 TBool IsConnected( const TInt aDrive ); |
|
67 |
|
68 /** |
|
69 * Connects or disconnects remote drive |
|
70 * @param aDrive Drive number EDriveA...EDriveZ |
|
71 * @return System wide error code. |
|
72 */ |
|
73 TInt SetConnection( TInt aDrive, TBool aConnect ); |
|
74 |
|
75 /** |
|
76 * Deletes remote drive settings |
|
77 * @param aDrive Drive number EDriveA...EDriveZ |
|
78 * @return System wide error code. |
|
79 */ |
|
80 TInt DeleteSettings( const TInt aDrive ); |
|
81 |
|
82 /** |
|
83 * Ensures that contents of a remote directory are up to date |
|
84 * when directory is refreshed |
|
85 * @param aFullPath Full path to remote directory |
|
86 * @return error code. |
|
87 */ |
|
88 TInt RefreshDirectory( const TDesC& aFullPath ); |
|
89 |
|
90 /** |
|
91 * Checks does application have support for remote drives |
|
92 * @param aUid Application uid |
|
93 * @return ETrue if the app has support. Otherwise EFalse. |
|
94 */ |
|
95 TBool HasAppRemoteDriveSupport( TUid aUid ); |
|
96 |
|
97 /** |
|
98 * Cancels incoming or outgoing remote drive transfer |
|
99 * @param aFullPath Full path to remote file or directory |
|
100 */ |
|
101 void CancelTransfer( const TDesC& aFullPath ); |
|
102 |
|
103 public: // From MFileManagerPropertyObserver |
|
104 void PropertyChangedL( const TUid& aCategory, const TUint aKey ); |
|
105 |
|
106 private: |
|
107 /** |
|
108 * Constructors |
|
109 */ |
|
110 CFileManagerRemoteDriveHandler( |
|
111 CFileManagerEngine& aEngine, |
|
112 CFileManagerUtils& aUtils ); |
|
113 |
|
114 void ConstructL(); |
|
115 |
|
116 private: // Data |
|
117 /** |
|
118 * For remote drive mounting and state handling |
|
119 * Own. |
|
120 */ |
|
121 CRsfwMountMan* iMountMan; |
|
122 |
|
123 /** |
|
124 * Reference to file manager engine |
|
125 * Not own. |
|
126 */ |
|
127 CFileManagerEngine& iEngine; |
|
128 |
|
129 /** |
|
130 * Reference to utils |
|
131 * Not own. |
|
132 */ |
|
133 CFileManagerUtils& iUtils; |
|
134 |
|
135 /** |
|
136 * For PS subscribing |
|
137 * Own. |
|
138 */ |
|
139 CFileManagerPropertySubscriber* iSubscriber; |
|
140 |
|
141 /** |
|
142 * Indicates if remote drives are supported or not |
|
143 */ |
|
144 TBool iRemoteStorageFwSupported; |
|
145 |
|
146 }; |
|
147 |
|
148 #endif // C_FILEMANAGERREMOTEDRIVEHANDLER_H |
|
149 |
|
150 // End of File |
|