ncdengine/provider/server/inc/ncduserconfiguration.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     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:   MNcdUserConfiguration declaration
       
    15 *
       
    16 */
       
    17 
       
    18  
       
    19 #ifndef M_NCDUSERCONFIGURATION_H
       
    20 #define M_NCDUSERCONFIGURATION_H 
       
    21  
       
    22 class MCatalogsContext;
       
    23 class CNcdKeyValuePair;
       
    24 class CNcdKeyValueMap;
       
    25  
       
    26 /**
       
    27  * Interface for user configuration manipulation
       
    28  */
       
    29 class MNcdUserConfiguration
       
    30     {
       
    31 public:
       
    32 
       
    33     enum TNcdConfigurationCategory
       
    34         {
       
    35         /**
       
    36          * General configuration: master-server address etc.
       
    37          */
       
    38         ENcdConfigurationGeneral,
       
    39         
       
    40         /**
       
    41          * Configuration used to fill the client info in protocol
       
    42          * requests
       
    43          */
       
    44         ENcdConfigurationClientInfo
       
    45         };
       
    46         
       
    47 public:    
       
    48     /**
       
    49      * Adds a configuration that will be sent to content providers
       
    50      *
       
    51      * @param aConfig Configuration to add. The ownership is transferred to
       
    52      * the protocol. If a leave occurs, aConfig is deleted.
       
    53      */
       
    54     virtual void AddConfigurationL( const MCatalogsContext& aContext, 
       
    55         CNcdKeyValuePair* aConfig ) = 0;
       
    56        
       
    57     /**
       
    58      * Removes a configuration.
       
    59      *
       
    60      * @return KErrNone if successful, KErrNotFound if the key was not
       
    61      * found
       
    62      */ 
       
    63     virtual TInt RemoveConfigurationL( const MCatalogsContext& aContext,
       
    64         const TDesC& aKey ) = 0;
       
    65        
       
    66     /**
       
    67      * Returns a list of all configurations for the context
       
    68      * 
       
    69      * @note Ownership of the configurations is transferred to the caller.
       
    70      * @return Current configuration for the context. 
       
    71      */         
       
    72     virtual CNcdKeyValueMap* ConfigurationsLC( 
       
    73         const MCatalogsContext& aContext ) = 0;    
       
    74     
       
    75     
       
    76     /**
       
    77      * Returns a list of configurations in a particular category
       
    78      *
       
    79      * @return Configurations
       
    80      */
       
    81     virtual CNcdKeyValueMap& ConfigurationsL(
       
    82         const MCatalogsContext& aContext, 
       
    83         TNcdConfigurationCategory aCategory ) = 0;
       
    84     
       
    85     
       
    86 protected:
       
    87     
       
    88     virtual ~MNcdUserConfiguration()
       
    89         {
       
    90         }
       
    91         
       
    92     };
       
    93     
       
    94     
       
    95 #endif // M_NCDUSERCONFIGURATION_H