|
1 /* |
|
2 * Copyright (c) 2002-2004 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: Mount configuration entry |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CRSFWMOUNTENTRY_H |
|
20 #define CRSFWMOUNTENTRY_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <f32file.h> |
|
25 #include <rsfwmountentryitem.h> |
|
26 |
|
27 |
|
28 // Drive entry constants |
|
29 // these come from UI specification |
|
30 const TInt KMaxMountNameLength = 20; |
|
31 const TInt KMaxMountUriLength = 200; |
|
32 const TInt KMaxMountUserNameLength = 50; |
|
33 const TInt KMaxMountPasswordLength = 50; |
|
34 const TInt KMaxMountAuxDataLength = 64; |
|
35 const TInt KMaxMountConfItemLength = 200; // Longest possible conf item value. |
|
36 const TInt KMaxMountConfLength = 512; // Buffer for sending all drive |
|
37 // configuration values |
|
38 const TInt KIndexAsStringLength = 4; // how wide string for index |
|
39 |
|
40 |
|
41 // CLASS DECLARATION |
|
42 /** |
|
43 * Remote drive (configuration) entry |
|
44 * |
|
45 * Drive configuration entry consists of the following values: |
|
46 * - Index of the entry. Optional. |
|
47 * - Friendly name. Mandatory. |
|
48 * - Drive letter. Optional. |
|
49 * - Drive URL. Mandatory. |
|
50 * - User name. Optional. |
|
51 * - Password. Optional |
|
52 * - Internet Access point. Optional. |
|
53 * |
|
54 * Maximum lengths for the strings: |
|
55 * - Friendly name 20 characters |
|
56 * - Drive URL 200 characters |
|
57 * - User name 50 characters |
|
58 * - Password 50 characters |
|
59 * Setter functions leave with KErrArgument, if longer values are attempted |
|
60 * |
|
61 * Drive Letter must be between J: and Y: |
|
62 * (see also RFs::DriveList() documentation)¨ |
|
63 * |
|
64 * Drive Url must begin with a valid scheme (e.g. https:// or upnp://) |
|
65 * |
|
66 * @lib mountstore.dll |
|
67 * @since Series 60 3.1 |
|
68 */ |
|
69 class CRsfwMountEntry: public CBase |
|
70 { |
|
71 public: // Constructors and destructor |
|
72 /** |
|
73 * Two-phased constructor. |
|
74 */ |
|
75 IMPORT_C static CRsfwMountEntry* NewL(); |
|
76 |
|
77 /** |
|
78 * Two-phased constructor |
|
79 */ |
|
80 IMPORT_C static CRsfwMountEntry* NewLC(); |
|
81 |
|
82 /** |
|
83 * Destructor. |
|
84 */ |
|
85 IMPORT_C virtual ~CRsfwMountEntry(); |
|
86 |
|
87 /** |
|
88 * Sets an item value |
|
89 * @param aIndex item index |
|
90 * @param aValue string value |
|
91 * @leave KErrArgument, incorrect index or value |
|
92 */ |
|
93 IMPORT_C void SetItemL(TInt aIndex, const TDesC8& aValue); |
|
94 |
|
95 /** |
|
96 * Sets an item value |
|
97 * @param aIndex item index |
|
98 * @param aValue string value |
|
99 * @leave KErrArgument, incorrect index or value |
|
100 */ |
|
101 IMPORT_C void SetItemL(TInt aIndex, const TDesC& aValue); |
|
102 |
|
103 /** |
|
104 * Sets all item values |
|
105 * @param aIndex index (only used for positioning the entry - not stored) |
|
106 * @param aName name |
|
107 * @param aDriveLetter drive letter |
|
108 * @param aUri URI |
|
109 * @param aUserName user name |
|
110 * @param aPassword password |
|
111 * @param aIap IAP name |
|
112 * @leave KErrArgument, one or more parameters incorrect |
|
113 */ |
|
114 IMPORT_C void SetEntryL(TInt aIndex, |
|
115 const TDesC& aName, |
|
116 TChar aDriveLetter, |
|
117 const TDesC& aUrl, |
|
118 const TDesC& aUserName, |
|
119 const TDesC& aPassword, |
|
120 const TDesC& aIap); |
|
121 |
|
122 /** |
|
123 * Returns an item value |
|
124 * An empty value may be an empty string or NULL |
|
125 */ |
|
126 IMPORT_C const HBufC* Item(TInt aIndex) const; |
|
127 |
|
128 /** |
|
129 * Clear the entry - the items are set to NULL |
|
130 */ |
|
131 IMPORT_C void Clear(); |
|
132 |
|
133 /** |
|
134 * Clone the entry - the items are are copied to the newly created entry |
|
135 * @return cloned entry |
|
136 */ |
|
137 IMPORT_C CRsfwMountEntry* CloneL() const; |
|
138 |
|
139 private: |
|
140 CRsfwMountEntry(); |
|
141 void ConstructL(); |
|
142 |
|
143 private: // Data |
|
144 RFs iFs; |
|
145 HBufC* iMountEntryItems[EMountEntryItemCount]; |
|
146 }; |
|
147 |
|
148 #endif // CRSFWMOUNTENTRY_H |
|
149 |
|
150 // End of File |