ncdengine/provider/storage/inc/ncdstorageclient.h
changeset 4 32704c33136d
equal deleted inserted replaced
-1:000000000000 4:32704c33136d
       
     1 /*
       
     2 * Copyright (c) 2006 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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef M_NCDSTORAGECLIENT_H
       
    20 #define M_NCDSTORAGECLIENT_H
       
    21 
       
    22 
       
    23 class MNcdStorage;
       
    24 class RFs;
       
    25 class MDesCArray;
       
    26 
       
    27 /**
       
    28  *  Interface for storage clients
       
    29  *
       
    30  *
       
    31  */
       
    32 class MNcdStorageClient
       
    33     {
       
    34 public:
       
    35 
       
    36     /**
       
    37      * Creates a new storage for the client
       
    38      *
       
    39      * @param aNamespace Storage namespace. Must be unique in the client 
       
    40      * and also usable in a directory path.
       
    41      * @return A new storage
       
    42      * @throw KErrArgument if the namespace couldn't be used in a path or 
       
    43      * it was empty
       
    44      */
       
    45     virtual MNcdStorage& CreateStorageL( const TDesC& aNamespace ) = 0;
       
    46     
       
    47     
       
    48     /**
       
    49      * Client storage getter
       
    50      *
       
    51      * @param aNamespace Storage namespace
       
    52      * @return A reference to the storage
       
    53      * @throw KErrNotFound if the storage was not found
       
    54      * @throw KErrArgument if the namespace was empty
       
    55      */
       
    56     virtual MNcdStorage& StorageL( const TDesC& aNamespace ) = 0;
       
    57     
       
    58     
       
    59     /**
       
    60      * Client storage remover
       
    61      *
       
    62      * The storage is entirely deleted from disk.
       
    63      *
       
    64      * @param aNamespace Storage namespace
       
    65      * @throw KErrArgument if the namespace was empty    
       
    66      */    
       
    67     virtual void RemoveStorageL( const TDesC& aNamespace ) = 0;
       
    68     
       
    69     
       
    70     /**
       
    71      * Client UID getter
       
    72      *
       
    73      * @return Client's UID
       
    74      */
       
    75     virtual const TDesC& ClientUid() const = 0;
       
    76     
       
    77 
       
    78     /**
       
    79      * Lists client's namespaces
       
    80      *
       
    81      * @return An array of client's namespaces. Ownership is transferred
       
    82      * @note Namespaces are invalidated when a storage is removed
       
    83      */
       
    84     virtual MDesCArray* NamespacesLC() const = 0;
       
    85     
       
    86 
       
    87     /**
       
    88      * File session getter
       
    89      *
       
    90      * @return Client's filesession
       
    91      */
       
    92     virtual RFs& FileSession() = 0;
       
    93     
       
    94     
       
    95    
       
    96 protected:
       
    97 
       
    98     virtual ~MNcdStorageClient()
       
    99         {
       
   100         }
       
   101     };
       
   102 
       
   103 
       
   104 #endif // M_NCDSTORAGECLIENT_H