videofeeds/vcnsuiengine/inc/vcxnsservicesettings.h
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2008 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 
       
    22 #ifndef VCXNSSERVICESETTINGS_H
       
    23 #define VCXNSSERVICESETTINGS_H
       
    24 
       
    25 // INCLUDES
       
    26 #include <e32std.h>
       
    27 #include <e32base.h>
       
    28 
       
    29 #include "CIptvNetworkSelection.h"
       
    30 #include "CIptvService.h"
       
    31 #include "MIptvServiceManagementClientObserver.h"
       
    32 #include "CIptvIapList.h"
       
    33 #include "iptvvodscheduleddownloaddefinitions.h"
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class CIptvServiceManagementClient;
       
    37 class CDesC8ArraySeg;
       
    38 
       
    39 // CLASS DECLARATION
       
    40 
       
    41 /**
       
    42  *  CVcxNsServiceSettings
       
    43  * 
       
    44  */
       
    45 class CVcxNsServiceSettings : public CBase, public MIptvServiceManagementClientObserver
       
    46     {
       
    47 public:
       
    48 
       
    49 // Helper class
       
    50 
       
    51     class TVodcastService
       
    52         {
       
    53         public:
       
    54         
       
    55         TUint32                                  iId;
       
    56         TBuf<KIptvSmServicesDbNameMaxLength>     iName;
       
    57         TTime                                    iUpdateTime;
       
    58         TBuf<KIptvSmServicesDbIconPathMaxLength> iIconPath;
       
    59         TUint32                                  iDisplayOrder;
       
    60         };
       
    61 
       
    62 // Constructors and destructor
       
    63 
       
    64     virtual ~CVcxNsServiceSettings( );
       
    65     
       
    66     IMPORT_C static CVcxNsServiceSettings* NewL( );
       
    67     
       
    68 // New functions
       
    69        
       
    70     /**
       
    71      * Returns all services.
       
    72      *
       
    73      * @return Array of services if successful, NULL otherwise.
       
    74      */
       
    75     IMPORT_C CDesC8ArraySeg* GetAllServicesL();
       
    76     
       
    77     /**
       
    78      * Returns all selected services.
       
    79      *
       
    80      * @param aError On return, error code from server.
       
    81      * @return Array of services if successfull, NULL otherwise.
       
    82      */
       
    83     IMPORT_C CDesC8ArraySeg* GetAllSelectedServicesL( TInt& aError );
       
    84     
       
    85     
       
    86     /**
       
    87      * Returns all services that match given type.
       
    88      *
       
    89      * @param aServiceType Type of requested services as CIptvService::TServiceType enumeration.
       
    90      * @return Array of services if successfull, NULL otherwise.
       
    91      */
       
    92     IMPORT_C CDesC8ArraySeg* GetServicesByTypeL( CIptvService::TServiceType aServiceType );
       
    93     /**
       
    94      * Gets IAP list for new service. List is created from existing services.
       
    95      *
       
    96      * @param aIapList On return, IAP list for new service.
       
    97      * @return KErrNone or one of the system wide error codes.
       
    98      */
       
    99     IMPORT_C TInt GetIapListForNewServiceL( CIptvIapList& aIapList );
       
   100     
       
   101     /**
       
   102       * Adds a new service to Service DB.
       
   103       *
       
   104       * @param aServiceName Name for service.
       
   105       * @param aAddress     Address of service.
       
   106       * @param aDescription Description of service.
       
   107       * @param aIapList     IAP list for service.
       
   108       * @param aServiceType Type of service as CIptvService::TServiceType enumeration.
       
   109       * @param aEpgPluginUid   Service EPG plugin Uid.
       
   110       * @param aIptvPluginUid  Service IPTV plugin Uid.
       
   111       * @param aVodPluginUid   Service VOD plugin Uid.
       
   112       * @return KErrNone or one of the system wide error codes.
       
   113       */
       
   114      IMPORT_C TInt AddServiceL( const TDesC& aServiceName,
       
   115                                 const TDesC& aAddress,
       
   116                                 const TDesC& aDescription,
       
   117                                 CIptvIapList& aIapList,
       
   118                                 CIptvService::TServiceType aServiceType,
       
   119                                 const TUid& aEpgPluginUid,
       
   120                                 const TUid& aIptvPluginUid,
       
   121                                 const TUid& aVodPluginUid  );
       
   122     
       
   123      /**
       
   124       * Updates existing service.
       
   125       *
       
   126       * @param aIptvService New service information. Includes ID to identify
       
   127       *                     which service to update.
       
   128       */         
       
   129      IMPORT_C void UpdateServiceL( CIptvService& aIptvService );
       
   130     
       
   131      /**
       
   132       * Deletes a service.
       
   133       *
       
   134       * @param aItemId Service ID of service to delete.
       
   135       */
       
   136      IMPORT_C void DeleteServiceL( TUint32 aItemId );
       
   137     
       
   138      /**
       
   139       * Returns a single service based on service Id.
       
   140       * Note: Method is not efficient, so use only if absolutely necessary.         
       
   141       *
       
   142       * @param aServiceId   Service ID of service to get.
       
   143       * @param aIptvService On return, the requested service.
       
   144       * @return KErrNone or one of the system wide error codes.
       
   145       */
       
   146     IMPORT_C TInt GetServiceL( TUint32 aServiceId, CIptvService& aIptvService );
       
   147     
       
   148     // Schedule settings stuff
       
   149     
       
   150     /**
       
   151     * Get the scheduled download settings.
       
   152     * 
       
   153     * @param aServiceId The service id.
       
   154     * @param aDownloadTime The download time.
       
   155     * @param aCondition The download condition.
       
   156     * @param aType The download type.
       
   157     * @return KErrNone if successful,
       
   158     *           otherwise one of the other system-wide error codes.
       
   159     */
       
   160     IMPORT_C TInt GetScheduledDownloadSettingsL(
       
   161         TIptvServiceId aServiceId,
       
   162         TIptvVodScheduleDownloadtimeCombination& aDownloadTime,
       
   163         TIptvVodScheduleConnectionCondition& aCondition,
       
   164         TIptvVodScheduleDownloadTypeCombination& aType );
       
   165 
       
   166     /**
       
   167     * Set the scheduled download settings and reschedule.
       
   168     * 
       
   169     * @param aServiceId The service id.
       
   170     * @param aDownloadTime The download time.
       
   171     * @param aCondition The download condition.
       
   172     * @param aType The download type.
       
   173     * @return KErrNone if successful,
       
   174     *           otherwise one of the other system-wide error codes.
       
   175     */
       
   176     IMPORT_C TInt SetScheduledDownloadSettingsL(
       
   177         TIptvServiceId aServiceId,
       
   178         TIptvVodScheduleDownloadtimeCombination aDownloadTime,
       
   179         TIptvVodScheduleConnectionCondition aCondition,
       
   180         TIptvVodScheduleDownloadTypeCombination aType );
       
   181     
       
   182 // From MIptvServiceManagementClientObserver
       
   183 
       
   184     /**
       
   185      * Not used
       
   186      */
       
   187     void AddServiceResp( TRespStatus ) { ; }
       
   188 
       
   189     /**
       
   190      * Not used
       
   191      */
       
   192     void UpdateServiceResp( TRespStatus  ) { ; }
       
   193 
       
   194     /**
       
   195      * Not used
       
   196      */
       
   197     void DeleteServiceResp( TRespStatus ) { ; }
       
   198 
       
   199     /**
       
   200      * Not used
       
   201      */
       
   202     void GetServicesResp( TRespStatus, CDesC8ArraySeg* ) { ; }
       
   203 
       
   204     /**
       
   205      * Not used
       
   206      */
       
   207     void GetUsedIapResp( TUint32,
       
   208                          const TDesC&,
       
   209                          CIptvNetworkSelection::TConnectionPermission,
       
   210                          TBool,
       
   211                          CIptvNetworkSelection::TRespStatus ){ ; }
       
   212 
       
   213     /**
       
   214      * Not used
       
   215      */
       
   216     void ServerShutdownResp( TRespStatus ) { ; }
       
   217 
       
   218     /**
       
   219      * Not used
       
   220      */
       
   221     void HandleSmEvent( CIptvSmEvent& ) { ; }
       
   222     
       
   223 private:
       
   224     
       
   225     CVcxNsServiceSettings( );  
       
   226 
       
   227     /**
       
   228      * GetServiceManagementClientL
       
   229      */    
       
   230     CIptvServiceManagementClient* CVcxNsServiceSettings::GetServiceManagementClientL();
       
   231 
       
   232  // Data
       
   233 
       
   234     /**
       
   235      * CIptvServiceManagementClient
       
   236      */ 
       
   237     CIptvServiceManagementClient* iIptvServiceManagementClient;
       
   238 
       
   239     };
       
   240 
       
   241 #endif // VCXNSSERVICESETTINGS_H