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