videofeeds/server/tsrc/VCXServiceManagementApiTest/inc/CIptvTestServiceStore.h
branchRCL_3
changeset 23 befca0ec475f
parent 0 96612d01cf9f
equal deleted inserted replaced
22:839377eedc2b 23:befca0ec475f
       
     1 /*
       
     2 * Copyright (c) 2002-2007 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 the License "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 
       
    20 
       
    21 #ifndef CIPTVTESTSERVICESTORE_H
       
    22 #define CIPTVTESTSERVICESTORE_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <e32base.h>
       
    26 #include <e32std.h>
       
    27 #include "CIptvServiceManagementClient.h"
       
    28 
       
    29 // CONSTANTS
       
    30 
       
    31 // MACROS
       
    32 
       
    33 // DATA TYPES
       
    34 
       
    35 // FUNCTION PROTOTYPES
       
    36 
       
    37 // FORWARD DECLARATIONS
       
    38 class CIptvTestServiceStore;
       
    39 class CIptvService;
       
    40 class CIptvTestUtilities;
       
    41 
       
    42 // CLASS DECLARATION
       
    43 
       
    44 /**
       
    45 *
       
    46 *
       
    47 *
       
    48 *
       
    49 *  @since
       
    50 */
       
    51 class CIptvTestServiceStore : public CBase
       
    52     {
       
    53     public:  // Constructors and destructor
       
    54 
       
    55         /**
       
    56         * Two-phased constructor.
       
    57         */
       
    58         static CIptvTestServiceStore* NewL( CIptvTestServiceStore* aStore = NULL, CIptvTestUtilities* aTestUtil = NULL);
       
    59 
       
    60         /**
       
    61         * Two-phased constructor.
       
    62         */
       
    63         static CIptvTestServiceStore* NewL( CIptvServices* aServices );
       
    64 
       
    65         /**
       
    66         * C++ default constructor.
       
    67         */
       
    68         CIptvTestServiceStore( );
       
    69 
       
    70         /**
       
    71         * Destructor.
       
    72         */
       
    73         virtual ~CIptvTestServiceStore();
       
    74 
       
    75     public: // New functions
       
    76 
       
    77         /**
       
    78         * RefreshServicesFromDbL
       
    79         * Fetches services from service DB.
       
    80         * @param aFlagsFilter
       
    81         * @param aOrder
       
    82         * @return KErrNotReady if class was not instantiated with pointer of CIptvTestUtilities
       
    83         */
       
    84         void RefreshServicesFromDbL(TUint32 aFlagsFilter, CIptvServiceManagementClient::TOrder aOrder);
       
    85 
       
    86         /**
       
    87         * AddServiceL
       
    88         * @param aService
       
    89         */
       
    90         void AddServiceL(CIptvService& aService);
       
    91 
       
    92         /**
       
    93         * AddServicesL
       
    94         * @param aServiceArray
       
    95         * Ownership of the services does not move.
       
    96         */
       
    97         void AddServicesL(RPointerArray<CIptvService>& aServiceArray);
       
    98 
       
    99         /**
       
   100         * ReplaceServiceL
       
   101         * @param aServiceName Service which will be replaced
       
   102         * @param aService Service which will be used to replace
       
   103         */
       
   104         void ReplaceServiceL(TInt aId, CIptvService& aService);
       
   105 
       
   106         /**
       
   107         * DeleteService
       
   108         * param aServiceName
       
   109         * @return Symbian error code.
       
   110         */
       
   111         TInt DeleteService(TInt aId);
       
   112 
       
   113         /**
       
   114         * Compare
       
   115         * Compares services in this and aStore.
       
   116         * @param aStore
       
   117         * @return Symbian error code. KErrNone if all services match.
       
   118         */
       
   119         TInt Compare(CIptvTestServiceStore& aStore);
       
   120 
       
   121         /**
       
   122         * GetService
       
   123         * Ownership of the service does not move.
       
   124         * @param aIndex
       
   125         * @return Instance to the service, NULL if not found.
       
   126         */
       
   127         CIptvService* GetService(TInt aIndex);
       
   128 
       
   129         /**
       
   130         * GetServiceById
       
   131         * Ownership of the service does not move.
       
   132         * @param aId
       
   133         * @return Instance to the service, NULL if not found.
       
   134         */
       
   135         CIptvService* GetServiceById(TInt aId);
       
   136 
       
   137         /**
       
   138         * GetServices
       
   139         * Ownership of the services does not move.
       
   140         * @param aServicesArray
       
   141         * @return Symbian error code.
       
   142         */
       
   143         TInt GetServices(RPointerArray<CIptvService>& aServicesArray);
       
   144 
       
   145         /**
       
   146         * GetServicesByProviderId
       
   147         * Ownership of the services does not move.
       
   148         * @param aServicesArray
       
   149         * @param aProviderId
       
   150         * @return Symbian error code.
       
   151         */
       
   152         TInt GetServicesByProviderId(RPointerArray<CIptvService>& aServicesArray, TDes& aProviderId);
       
   153 
       
   154         /**
       
   155         * GetGroupedServicesByGroupId
       
   156         * Ownership of the services does not move.
       
   157         * @param aServicesArray
       
   158         * @param aGroupId
       
   159         * @return Symbian error code.
       
   160         */        
       
   161         TInt GetGroupedServicesByGroupId(RPointerArray<CIptvService>& aServicesArray, TInt aGroupId);
       
   162         
       
   163         /**
       
   164         * ServiceCount
       
   165         * @return Count of services.
       
   166         */
       
   167         TInt ServiceCount();
       
   168 
       
   169         /**
       
   170         * CompareServices
       
   171         * @aS1
       
   172         * @aS2
       
   173         * @return ETrue if services match, otherwise EFalse
       
   174         */
       
   175         TBool CompareServices(CIptvService& aS1, CIptvService& aS2);
       
   176 
       
   177         /**
       
   178         * PrintServices
       
   179         * @return Symbian error code.
       
   180         */
       
   181         TInt PrintServices();
       
   182 
       
   183         /**
       
   184         * DeleteAllServices
       
   185         */
       
   186         void DeleteAllServices();
       
   187 
       
   188         /**
       
   189         * CloneServiceL
       
   190         * @param aService
       
   191         * @return Copy of the service.
       
   192         */
       
   193         CIptvService* CloneServiceL(CIptvService& aService);
       
   194 
       
   195     protected: //from base classes
       
   196 
       
   197     private:
       
   198 
       
   199         /**
       
   200         * By default Symbian 2nd phase constructor is private.
       
   201         */
       
   202         void ConstructL( CIptvTestServiceStore* aStore, CIptvTestUtilities* aTestUtil, CIptvServices* aServices );
       
   203 
       
   204         /**
       
   205         * FindService
       
   206         * Searches the array for a service. Array is enumerated in reveresed order.
       
   207         * @param aServices Array to look for the service.
       
   208         * @param aId 
       
   209         * @return Index in the array if service was found, otherwise Symbian error code.
       
   210         */
       
   211         TInt FindService(RPointerArray<CIptvService>& aServices, TInt aId);
       
   212         
       
   213         /**
       
   214         * FindServiceByGroupId
       
   215         * Searches the array for a service. Array is enumerated in reveresed order.
       
   216         * @param aServices Array to look for the service.
       
   217         * @param aGroupId 
       
   218         * @return Index in the array if service was found, otherwise Symbian error code.
       
   219         */
       
   220         TInt FindServiceByGroupId(RPointerArray<CIptvService>& aServices, TInt aGroupId);
       
   221 
       
   222     private:    // Data
       
   223         // Array of services
       
   224         RPointerArray<CIptvService> iServices;
       
   225 
       
   226         // Instance of CIptvTestUtilities. Not owned by the class.
       
   227         CIptvTestUtilities* iIptvTestUtilities;
       
   228     };
       
   229 
       
   230 
       
   231 #endif      // CIPTVTESTSERVICESTORE_H
       
   232 
       
   233 // End of File