williamr@2: /* williamr@2: * Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * 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: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: Mount configuration entry williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef CRSFWMOUNTENTRY_H williamr@2: #define CRSFWMOUNTENTRY_H williamr@2: williamr@2: // INCLUDES williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@2: williamr@2: // Drive entry constants williamr@2: // these come from UI specification williamr@2: const TInt KMaxMountNameLength = 20; williamr@2: const TInt KMaxMountUriLength = 200; williamr@2: const TInt KMaxMountUserNameLength = 50; williamr@2: const TInt KMaxMountPasswordLength = 50; williamr@2: const TInt KMaxMountAuxDataLength = 64; williamr@2: const TInt KMaxMountConfItemLength = 200; // Longest possible conf item value. williamr@2: const TInt KMaxMountConfLength = 512; // Buffer for sending all drive williamr@2: // configuration values williamr@2: const TInt KIndexAsStringLength = 4; // how wide string for index williamr@2: williamr@2: williamr@2: // CLASS DECLARATION williamr@2: /** williamr@2: * Remote drive (configuration) entry williamr@2: * williamr@2: * Drive configuration entry consists of the following values: williamr@2: * - Index of the entry. Optional. williamr@2: * - Friendly name. Mandatory. williamr@2: * - Drive letter. Optional. williamr@2: * - Drive URL. Mandatory. williamr@2: * - User name. Optional. williamr@2: * - Password. Optional williamr@2: * - Internet Access point. Optional. williamr@2: * williamr@2: * Maximum lengths for the strings: williamr@2: * - Friendly name 20 characters williamr@2: * - Drive URL 200 characters williamr@2: * - User name 50 characters williamr@2: * - Password 50 characters williamr@2: * Setter functions leave with KErrArgument, if longer values are attempted williamr@2: * williamr@2: * Drive Letter must be between J: and Y: williamr@2: * (see also RFs::DriveList() documentation)¨ williamr@2: * williamr@2: * Drive Url must begin with a valid scheme (e.g. https:// or upnp://) williamr@2: * williamr@2: * @lib mountstore.dll williamr@2: * @since Series 60 3.1 williamr@2: */ williamr@2: class CRsfwMountEntry: public CBase williamr@2: { williamr@2: public: // Constructors and destructor williamr@2: /** williamr@2: * Two-phased constructor. williamr@2: */ williamr@2: IMPORT_C static CRsfwMountEntry* NewL(); williamr@2: williamr@2: /** williamr@2: * Two-phased constructor williamr@2: */ williamr@2: IMPORT_C static CRsfwMountEntry* NewLC(); williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: IMPORT_C virtual ~CRsfwMountEntry(); williamr@2: williamr@2: /** williamr@2: * Sets an item value williamr@2: * @param aIndex item index williamr@2: * @param aValue string value williamr@2: * @leave KErrArgument, incorrect index or value williamr@2: */ williamr@2: IMPORT_C void SetItemL(TInt aIndex, const TDesC8& aValue); williamr@2: williamr@2: /** williamr@2: * Sets an item value williamr@2: * @param aIndex item index williamr@2: * @param aValue string value williamr@2: * @leave KErrArgument, incorrect index or value williamr@2: */ williamr@2: IMPORT_C void SetItemL(TInt aIndex, const TDesC& aValue); williamr@2: williamr@2: /** williamr@2: * Sets all item values williamr@2: * @param aIndex index (only used for positioning the entry - not stored) williamr@2: * @param aName name williamr@2: * @param aDriveLetter drive letter williamr@2: * @param aUri URI williamr@2: * @param aUserName user name williamr@2: * @param aPassword password williamr@2: * @param aIap IAP name williamr@2: * @leave KErrArgument, one or more parameters incorrect williamr@2: */ williamr@2: IMPORT_C void SetEntryL(TInt aIndex, williamr@2: const TDesC& aName, williamr@2: TChar aDriveLetter, williamr@2: const TDesC& aUrl, williamr@2: const TDesC& aUserName, williamr@2: const TDesC& aPassword, williamr@2: const TDesC& aIap); williamr@2: williamr@2: /** williamr@2: * Returns an item value williamr@2: * An empty value may be an empty string or NULL williamr@2: */ williamr@2: IMPORT_C const HBufC* Item(TInt aIndex) const; williamr@2: williamr@2: /** williamr@2: * Clear the entry - the items are set to NULL williamr@2: */ williamr@2: IMPORT_C void Clear(); williamr@2: williamr@2: /** williamr@2: * Clone the entry - the items are are copied to the newly created entry williamr@2: * @return cloned entry williamr@2: */ williamr@2: IMPORT_C CRsfwMountEntry* CloneL() const; williamr@2: williamr@2: private: williamr@2: CRsfwMountEntry(); williamr@2: void ConstructL(); williamr@2: williamr@2: private: // Data williamr@2: RFs iFs; williamr@2: HBufC* iMountEntryItems[EMountEntryItemCount]; williamr@2: }; williamr@2: williamr@2: #endif // CRSFWMOUNTENTRY_H williamr@2: williamr@2: // End of File