ncdengine/engine/accesspointmanager/inc/catalogsclientaccesspointdata.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:   Class CCatalogsClientAccessPointData declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CATALOGSCLIENTACCESSPOINTDATA_H
       
    20 #define C_CATALOGSCLIENTACCESSPOINTDATA_H
       
    21 
       
    22 #include "ncdstoragedataitem.h"
       
    23 #include "catalogsaccesspointmanager.h"
       
    24 
       
    25 class CCatalogsAccessPoint;
       
    26 class CCatalogsAccessPointMap;
       
    27 
       
    28 class CCatalogsClientAccessPointData : public CBase,
       
    29                                        public MNcdStorageDataItem 
       
    30 {
       
    31 public:
       
    32     static CCatalogsClientAccessPointData* NewL();
       
    33     static CCatalogsClientAccessPointData* NewLC();
       
    34     virtual ~CCatalogsClientAccessPointData();
       
    35 
       
    36     /**
       
    37      * Add the given access point to the access point list.
       
    38      *
       
    39      * @param aAccessPoint The access point.
       
    40      */    
       
    41     void AddAccessPointL(CCatalogsAccessPoint* aAccessPoint);
       
    42 
       
    43     /**
       
    44      * Map the access point for the given namespace and action.
       
    45      *
       
    46      * @param aNameSpace The namespace.
       
    47      * @param aType The action.
       
    48      * @param aApId Id of the access point to be mapped.
       
    49      */
       
    50     void MapAccessPointL(
       
    51         const TDesC& aNameSpace,
       
    52         const MCatalogsAccessPointManager::TAction& aType,
       
    53         const TDesC& aApId);
       
    54         
       
    55     /**
       
    56      * Map the access point for the given namespace, catalog ID
       
    57      * and action.
       
    58      *
       
    59      * @param aNameSpace The namespace.
       
    60      * @param aCatalogId ID of the catalog.
       
    61      * @param aType The action.
       
    62      * @param aApId Id of the access point to be mapped.
       
    63      */
       
    64     void MapAccessPointL(
       
    65         const TDesC& aNameSpace,
       
    66         const TDesC& aCatalogId,
       
    67         const MCatalogsAccessPointManager::TAction& aAction,
       
    68         const TDesC& aApId);
       
    69 
       
    70     /**
       
    71      * Return the access point which is mapped for the given namespace
       
    72      * and action. The ownership is not returned. Returns NULL if
       
    73      * no access point is mapped.
       
    74      *
       
    75      * @param aNameSpace The namespace.
       
    76      * @param aAction The action.
       
    77      * @return The access point object or NULL.
       
    78      */
       
    79     CCatalogsAccessPoint* AccessPoint(
       
    80         const TDesC& aNameSpace,
       
    81         const MCatalogsAccessPointManager::TAction& aAction) const;
       
    82         
       
    83     /**
       
    84      * Return the access point which is mapped for the given namespace,
       
    85      * catalog ID and action. The ownership is not returned. 
       
    86      * Returns NULL if no access point is mapped.
       
    87      *
       
    88      * @param aNameSpace The namespace.
       
    89      * @param aCatalogId The catalog ID.
       
    90      * @param aAction The action.
       
    91      * @return The access point object or NULL.
       
    92      */
       
    93     CCatalogsAccessPoint* AccessPointL(
       
    94         const TDesC& aNameSpace,
       
    95         const TDesC& aCatalogId,
       
    96         const MCatalogsAccessPointManager::TAction& aAction) const;
       
    97 
       
    98     /**
       
    99      * Returns the number of access points in the list.
       
   100      *
       
   101      * @return The number of access points.
       
   102      */
       
   103     TInt AccessPointCount() const;
       
   104 
       
   105     /**
       
   106      * By the given index, returns an access point.
       
   107      *
       
   108      * @return An access point.
       
   109      */
       
   110     CCatalogsAccessPoint& AccessPoint(const TInt& aIndex);
       
   111 
       
   112     
       
   113 public: // MNcdStorageDataItem
       
   114     void ExternalizeL(RWriteStream& aStream);
       
   115     void InternalizeL(RReadStream& aStream);
       
   116         
       
   117 protected:
       
   118     CCatalogsClientAccessPointData();
       
   119     CCatalogsAccessPoint* AccessPointById(const TDesC& apId) const;
       
   120     
       
   121 private:
       
   122     
       
   123     RPointerArray<CCatalogsAccessPoint> iAccessPoints;
       
   124     RPointerArray<CCatalogsAccessPointMap> iAccessPointMaps;
       
   125 };
       
   126 
       
   127 #endif