remotestoragefw/mountmanager/inc/rsfwmountutils.h
branchRCL_3
changeset 19 88ee4cf65e19
parent 16 87c71b25c937
child 20 1aa8c82cb4cb
equal deleted inserted replaced
16:87c71b25c937 19:88ee4cf65e19
     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:  Mounting utilities
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef RSFWMOUNTUTILS_H
       
    20 #define RSFWMOUNTUTILS_H
       
    21 
       
    22 #include <e32std.h>
       
    23 
       
    24 // CONSTANTS
       
    25 
       
    26 /// BIO message UID
       
    27 const TUid KUidBIOMountConfMsg     = {0x1bdeff02};
       
    28 const TInt KMountMessagePrefixLength = 29; // length of "//vnd.nokia.s60.mount.config\n"
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class CRsfwMountEntry;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 /** ImportMountEntry is used from smart messaging bio control.
       
    35 ExportMountEntryL is used from general settings plugin.
       
    36 Both functions call GetKeyWord(), so only common thing
       
    37 are actually the keywords used 
       
    38 Note that because this is only used for smart messaging,
       
    39 currently exports and imports only mount name and address
       
    40 */
       
    41 
       
    42 
       
    43 class RsfwMountUtils
       
    44     {
       
    45 public: // New functions
       
    46      /**
       
    47      * Imports a mount configuration from a descriptor
       
    48      *
       
    49      * @param aMsg descriptor to be imported
       
    50      *		memory is reserved by this function, but ownership transferred to the caller
       
    51      * @param aEntry returned mount entry
       
    52      * @return nothing
       
    53      */
       
    54     IMPORT_C static void ImportMountEntryL(const TDesC& aMsg,
       
    55                                            CRsfwMountEntry** aEntry);
       
    56      /**
       
    57      * Imports a mount configuration from a stream
       
    58      *
       
    59      * @param aReadStream stream data to be imported
       
    60      *  function assumes that the stream contains 8-bit data
       
    61      * @param aSize data size
       
    62      * @param aEntry returned mount entry
       
    63       *		memory is reserved by this function, but ownership transferred to the caller
       
    64      * @return nothing
       
    65      */
       
    66     IMPORT_C static void ImportMountEntryFromStreamL(RReadStream& aReadStream,
       
    67                                                     TInt aSize,
       
    68                                                    CRsfwMountEntry** aEntry);
       
    69      /**
       
    70      * Exports a mount configuration to a descriptor.
       
    71      *
       
    72      * @param aEntry mount entry to be exported
       
    73      * @param aSendCredentials controls whether username/passwd is exported
       
    74      * @param aBuf returned descriptor     
       
    75      * @return nothing
       
    76      */
       
    77     IMPORT_C static void ExportMountEntryL(const CRsfwMountEntry& aEntry,
       
    78                                            TBool aSendCredentials,
       
    79                                            TDes& aBuf);
       
    80      /**
       
    81      * Returns ETrue if the friendly name for a remote drive is valid
       
    82      * Used from MountEntry and the General Settings plugin
       
    83      * Currently just calls RFs::IsDriveNameValid() as 
       
    84      * the friendly name is stored to RFs::DriveName()
       
    85      * @since S60 3.2
       
    86      * @param aFriendlyName remote drive friendly name
       
    87      */
       
    88     IMPORT_C static TBool IsFriendlyNameValid(const TDesC& aFriendlyName);       
       
    89     
       
    90      /**
       
    91      * Returns ETrue if the address (URL) for a remote drive is valid
       
    92      * Used from MountEntry and the General Settings plugin
       
    93      * @since S60 3.2
       
    94      * @param aFriendlyName remote drive friendly name
       
    95      */
       
    96     IMPORT_C static TBool IsDriveAddressValid(const TDesC8& aDriveAddress);                                
       
    97    
       
    98     
       
    99 private:
       
   100     static void ParseLineL(const TDesC& aLine, CRsfwMountEntry& aEntry);
       
   101     static const TDesC& GetKeyWord(TInt aIndex);
       
   102     };
       
   103 
       
   104 #endif // RSFWMOUNTUTILS_H
       
   105 
       
   106 // End of File