epoc32/include/mw/rsfwmountentry.h
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/mw/rsfwmountentry.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,150 @@
     1.4 +/*
     1.5 +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* 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
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:  Mount configuration entry
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef CRSFWMOUNTENTRY_H
    1.23 +#define CRSFWMOUNTENTRY_H
    1.24 +
    1.25 +// INCLUDES
    1.26 +#include <e32base.h>
    1.27 +#include <f32file.h>
    1.28 +#include <rsfwmountentryitem.h>
    1.29 +
    1.30 +
    1.31 +// Drive entry constants
    1.32 +// these come from UI specification
    1.33 +const TInt KMaxMountNameLength = 20;
    1.34 +const TInt KMaxMountUriLength = 200;
    1.35 +const TInt KMaxMountUserNameLength = 50;
    1.36 +const TInt KMaxMountPasswordLength = 50;
    1.37 +const TInt KMaxMountAuxDataLength  = 64;
    1.38 +const TInt KMaxMountConfItemLength = 200; // Longest possible conf item value.
    1.39 +const TInt KMaxMountConfLength     = 512; // Buffer for sending all drive 
    1.40 +                                          // configuration values
    1.41 +const TInt KIndexAsStringLength = 4; // how wide string for index
    1.42 +
    1.43 +
    1.44 +// CLASS DECLARATION
    1.45 +/**
    1.46 +*  Remote drive (configuration) entry
    1.47 +*
    1.48 +*  Drive configuration entry consists of the following values:
    1.49 +*  - Index of the entry. Optional.
    1.50 +*  - Friendly name. Mandatory.
    1.51 +*  - Drive letter. Optional.
    1.52 +*  - Drive URL. Mandatory.
    1.53 +*  - User name. Optional.
    1.54 +*  - Password. Optional
    1.55 +*  - Internet Access point. Optional.
    1.56 +*
    1.57 +*  Maximum lengths for the strings:
    1.58 +*   - Friendly name 20 characters
    1.59 +*   - Drive URL 200 characters
    1.60 +*   - User name 50 characters
    1.61 +*   - Password 50 characters
    1.62 +*  Setter functions leave with KErrArgument, if longer values are attempted
    1.63 +*
    1.64 +*  Drive Letter must be between J: and Y:
    1.65 +*  (see also RFs::DriveList() documentation)ยจ
    1.66 +*
    1.67 +*  Drive Url must begin with a valid scheme (e.g. https:// or upnp://)
    1.68 +*
    1.69 +*  @lib mountstore.dll
    1.70 +*  @since Series 60 3.1
    1.71 +*/
    1.72 +class CRsfwMountEntry: public CBase
    1.73 +    {
    1.74 +public: // Constructors and destructor
    1.75 +    /**
    1.76 +     * Two-phased constructor.
    1.77 +     */
    1.78 +    IMPORT_C static CRsfwMountEntry* NewL();
    1.79 +
    1.80 +    /**
    1.81 +     * Two-phased constructor
    1.82 +     */
    1.83 +    IMPORT_C static CRsfwMountEntry* NewLC();
    1.84 +
    1.85 +    /**
    1.86 +     * Destructor.
    1.87 +     */
    1.88 +    IMPORT_C virtual ~CRsfwMountEntry();
    1.89 +
    1.90 +    /**
    1.91 +     * Sets an item value
    1.92 +     * @param aIndex item index
    1.93 +     * @param aValue string value
    1.94 +     * @leave KErrArgument, incorrect index or value
    1.95 +     */
    1.96 +    IMPORT_C void SetItemL(TInt aIndex, const TDesC8& aValue);
    1.97 +
    1.98 +    /**
    1.99 +     * Sets an item value
   1.100 +     * @param aIndex item index
   1.101 +     * @param aValue string value
   1.102 +     * @leave KErrArgument, incorrect index or value
   1.103 +     */
   1.104 +    IMPORT_C void SetItemL(TInt aIndex, const TDesC& aValue);
   1.105 +
   1.106 +    /**
   1.107 +     * Sets all item values 
   1.108 +     * @param aIndex index (only used for positioning the entry - not stored)
   1.109 +     * @param aName name
   1.110 +     * @param aDriveLetter drive letter
   1.111 +     * @param aUri URI
   1.112 +     * @param aUserName user name
   1.113 +     * @param aPassword password
   1.114 +     * @param aIap IAP name
   1.115 +     * @leave KErrArgument, one or more parameters incorrect
   1.116 +     */
   1.117 +    IMPORT_C void SetEntryL(TInt aIndex,
   1.118 +                            const TDesC& aName,
   1.119 +                            TChar aDriveLetter,
   1.120 +                            const TDesC& aUrl,
   1.121 +                            const TDesC& aUserName,
   1.122 +                            const TDesC& aPassword,
   1.123 +                            const TDesC& aIap);
   1.124 +
   1.125 +    /**
   1.126 +     * Returns an item value
   1.127 +     * An empty value may be an empty string or NULL
   1.128 +     */
   1.129 +    IMPORT_C const HBufC* Item(TInt aIndex) const;
   1.130 +    
   1.131 +    /**
   1.132 +     * Clear the entry - the items are set to NULL
   1.133 +     */
   1.134 +    IMPORT_C void Clear();
   1.135 +
   1.136 +    /**
   1.137 +     * Clone the entry - the items are are copied to the newly created entry
   1.138 +     * @return cloned entry
   1.139 +     */
   1.140 +    IMPORT_C CRsfwMountEntry* CloneL() const;
   1.141 +
   1.142 +private:
   1.143 +    CRsfwMountEntry();
   1.144 +    void ConstructL();
   1.145 +
   1.146 +private: // Data
   1.147 +    RFs iFs;
   1.148 +    HBufC* iMountEntryItems[EMountEntryItemCount];
   1.149 +    };
   1.150 +
   1.151 +#endif // CRSFWMOUNTENTRY_H
   1.152 +
   1.153 +// End of File