videofeeds/provisioningappui/Inc/IptvProvisioningAppUi.h
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     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 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 IPTVPROVISIONINGAPPUI_H
       
    22 #define IPTVPROVISIONINGAPPUI_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <aknappui.h>
       
    26 
       
    27 #include "MIptvServiceManagementClientObserver.h"
       
    28 
       
    29 const TUid KRssPluginInterfaceUid = { 0x102750E0 }; // RSS Plugin interface UID
       
    30 const TUid KXmlTvPluginInterfaceUid = { 0x1028242B }; // XML TV plugin interface UID
       
    31 static const TInt KMaxNumberOfServices = 20;
       
    32 
       
    33 class CIptvServiceManagementClient;
       
    34 class CIptvServices;
       
    35 
       
    36 //CLASS DECLARATION
       
    37 /**
       
    38 *	CIptvProvisioningAppUi class.
       
    39 *	This class handles the operation betweed provisioning processor,
       
    40 *	notifier framework (asks if user want to install parsed service)
       
    41 *	and service api (used to add service to the database if user has
       
    42 *	decided so)
       
    43 */
       
    44 class CIptvProvisioningAppUi : public CAknAppUi,
       
    45 							   public MIptvServiceManagementClientObserver
       
    46 	{
       
    47     public:
       
    48         /**
       
    49         * C++ default constructor.
       
    50         * @param None
       
    51         * @return void
       
    52         */
       
    53         CIptvProvisioningAppUi();
       
    54 
       
    55         /**
       
    56         * Destructor
       
    57         * @param None
       
    58         * @return void
       
    59         */
       
    60         virtual ~CIptvProvisioningAppUi();
       
    61 
       
    62         // New methods
       
    63         /**
       
    64         *	Method to be called for CIptvProvisioningDocument when
       
    65         *	that classes OpenFileL method has been called and file
       
    66         *	containing the data to be parsed is received.
       
    67         *	@param	aFile	A handle to the file opened by framework
       
    68         *					to be used to parse contents of the service by¨
       
    69         *					provisioning processor.
       
    70         *	@return	None
       
    71         */
       
    72         void HandleFileL( RFile& aFile );
       
    73 
       
    74 		/**
       
    75 		*	Overwritten method from CEikAppUi. This method gets called
       
    76 		*	when application is started by framework when file, which has
       
    77 		*	mime type this applicaion knows, has been selected to be
       
    78 		*	opened.
       
    79 		*	@param	aCommand		Type of the command
       
    80 		*	@param	aDocumentName	Name of the document to be opened
       
    81 		*							When starting up application this value
       
    82 		*							is empty
       
    83 		*	@param	aTail			Command line's tail. Not used in this
       
    84 		*							implementation.
       
    85 		*	@return	ETrue if aDocument represents an existing file, otherwise
       
    86 		*			EFalse.
       
    87 		*/
       
    88     	TBool ProcessCommandParametersL( TApaCommand aCommand,
       
    89                                          TFileName& aDocumentName,
       
    90                                          const TDesC8& aTail );
       
    91 
       
    92 
       
    93 		// From inherited MIptvServiceManagementClientObserver class
       
    94 		// These methods are here because CIptvServiceManagementClient::NewL
       
    95 		// requires a MIptvServiceManagementClientObserver type class to be
       
    96 		// passed as a parameter. These methods are callbacks for the async
       
    97 		// versions of the methods in the service management client and since
       
    98 		// we use only sync versions, these are not used in here.
       
    99 
       
   100 		/**
       
   101 		*	See functionality of this method from the
       
   102 		*	MIptvServiceManagementClientObserver class.
       
   103 		*/
       
   104         void AddServiceResp(TRespStatus aRespStatus);
       
   105 
       
   106 		/**
       
   107 		*	See functionality of this method from the
       
   108 		*	MIptvServiceManagementClientObserver class.
       
   109 		*/
       
   110         void UpdateServiceResp(TRespStatus aRespStatus);
       
   111 
       
   112 
       
   113 		/**
       
   114 		*	See functionality of this method from the
       
   115 		*	MIptvServiceManagementClientObserver class.
       
   116 		*/
       
   117         void DeleteServiceResp(TRespStatus aRespStatus);
       
   118 
       
   119 		/**
       
   120 		*	See functionality of this method from the
       
   121 		*	MIptvServiceManagementClientObserver class.
       
   122 		*/
       
   123         void GetServicesResp(TRespStatus aRespStatus,
       
   124                                      CDesC8ArraySeg* aServicesArray);
       
   125 
       
   126 		/**
       
   127 		*	See functionality of this method from the
       
   128 		*	MIptvServiceManagementClientObserver class.
       
   129 		*/
       
   130         void GetUsedIapResp( TUint32 aIapId,
       
   131                              const TDesC& aIapName,
       
   132                              CIptvNetworkSelection::TConnectionPermission aConnectionPermission,
       
   133                              TBool aWlanWhenGPRS,
       
   134                              CIptvNetworkSelection::TRespStatus aRespStatus );
       
   135 
       
   136 		/**
       
   137 		*	See functionality of this method from the
       
   138 		*	MIptvServiceManagementClientObserver class.
       
   139 		*/
       
   140         void ServerShutdownResp(TRespStatus aRespStatus);
       
   141 
       
   142         /**
       
   143         * Not used yet.
       
   144         */
       
   145         void HandleSmEvent(CIptvSmEvent& /*aEvent*/) { };
       
   146 
       
   147     private:
       
   148         /**
       
   149         * EPOC default constructor.
       
   150         * @param None
       
   151         * @return void
       
   152         */
       
   153         void ConstructL();
       
   154 
       
   155 	// New private methods
       
   156 	private:
       
   157 
       
   158 	    /**
       
   159 	    *   Utility method that goes through existing services and checks
       
   160 	    *   what IAPs they are using. These IAPs can be used for new service
       
   161 	    *   if it doesn't define any IAPs of its own.
       
   162 	    *
       
   163 	    *   @param aClient  Client session for Service Manager.
       
   164 	    *   @param aIapList On return, list of IAPs from other services.
       
   165 	    *   @return KErrNone if successfull.
       
   166 	    */
       
   167 	    TInt GetIapListForNewServiceL(
       
   168 	        CIptvServiceManagementClient* aClient,
       
   169 	        CIptvIapList& aIapList ) const;
       
   170 
       
   171 		/**
       
   172 		*	Utility method to be used to ask from user is parsed service
       
   173 		*	is to be installed to the service database or not.
       
   174 		*	This method launches the notifier on top of everything to ask
       
   175 		*	user wish considering the installation.
       
   176 		*	@param	aService	Reference to the object containing data
       
   177 		*						for the parsed service
       
   178 		*	@return	ETrue if user has selected service to be installed,
       
   179 		*			otherwise EFalse
       
   180 		*/
       
   181 		TBool DoesUserWantToInstallServiceL( CIptvService& aService ) const;
       
   182 
       
   183 		/**
       
   184 		*	Utility method to be used to ask from user if service that
       
   185 		*	has already exists in service database is to be overwritten.
       
   186 		*	This method launches the notifier on top of everything to ask
       
   187 		*	user wish considering the installation.
       
   188 		*   @param aServiceName Name of the service to install
       
   189 		*
       
   190 		*	@return	ETrue if user has selected service to be installed,
       
   191 		*			otherwise EFalse
       
   192 		*/
       
   193         TBool OverwriteExistingServiceL( const TDesC& aServiceName ) const;
       
   194 
       
   195 		/**
       
   196 		*	Method to handle logics of the service installation after prosessor
       
   197 		*	has done it's parsing and we are making a decision whether service
       
   198 		*	is valid for installation and user wants to install service.
       
   199 		*	@param	aServices	Array of services prosessor found
       
   200 		*	@return	None
       
   201 		*/
       
   202 		void HandleServicesAdditionL( CIptvServices* aServices );
       
   203 
       
   204 		/**
       
   205 		*	Method to check if a single service is valid. This checks the
       
   206 		*	service type and plugin availability in the ECom. Also Live tv
       
   207 		*	compilation flag is checked.
       
   208 		*	@param	aService Service which validity is checked
       
   209 		*	@return	ETrue if service is valid, otherwise EFalse
       
   210 		*/
       
   211 		TBool IsServiceValidL( CIptvService& aService );
       
   212 
       
   213         /**
       
   214         *   Method to find existing service group items.
       
   215         *   @param aClient Client session for Service Manager.
       
   216         *   @param aExistingGroupIds a array of existing ids.
       
   217         *   @return none
       
   218         */
       
   219         void FindExistingGroupedIdsL( CIptvServiceManagementClient* aClient,
       
   220                                       RArray<TUint32>& aExistingGroupIds );
       
   221 
       
   222         /**
       
   223         *   Method to delete existing left over service group items.
       
   224         *   @param aClient Client session for Service Manager.
       
   225         *   @param aExistingGroupIds a array of existing ids.
       
   226         *   @param aReceivedGroup a received group id.
       
   227         *   @return none
       
   228         */
       
   229         void DeleteExistingGroupedIdsL( CIptvServiceManagementClient* aClient,
       
   230                                         RArray<TUint32>& aExistingGroupIds,
       
   231                                         const TUint32 aReceivedGroup );
       
   232 
       
   233         /**
       
   234         *   Method to sort existing service group items.
       
   235         *   @param aClient Client session for Service Manager.
       
   236         *   @param aServices Array of services prosessor found.
       
   237         *   @param aGroupItemsOrder a array of order in incoming vcfg.
       
   238         *   @return none
       
   239         */
       
   240         void ForceOrderOfGroupedServicesL( CIptvServiceManagementClient* aClient,
       
   241                                            RArray<TUint32>& aGroupItemsOrder );
       
   242 
       
   243         /**
       
   244         *   Method to check if a service group belongs to existing feed.
       
   245         *   @param aClient  Client session for Service Manager.
       
   246         *   @param aService Service which validity is checked.
       
   247         *   @param aGroupId Group id where this service belongs.
       
   248         *   @param aLauchId Servce group id for lauch.
       
   249         *   @return ETrue if service is valid, otherwise EFalse
       
   250         */
       
   251         TBool VerifyServiceGroupL( CIptvServiceManagementClient* aClient,
       
   252                                    CIptvService& aService,
       
   253                                    TUint32& aGroupId,
       
   254                                    TUint32& aLauchId );
       
   255 
       
   256         /**
       
   257         *   Sets 'Received' flag if group items received.
       
   258         *   @param aClient  Client session for Service Manager.
       
   259         *   @param aGroupId Group id where this service belongs.
       
   260         *   @return None
       
   261         */
       
   262         void SetGroupReceivedL( CIptvServiceManagementClient* aClient,
       
   263                                 const TUint32& aGroupId );
       
   264 
       
   265         /**
       
   266 		*	Show invalid data note.
       
   267 		*	@param	None
       
   268 		*	@return	None
       
   269 		*/
       
   270         void ShowInvalidDataNoteL() const;
       
   271 
       
   272         /**
       
   273 		*	Show invalid service type note.
       
   274 		*	@param	None
       
   275 		*	@return	None
       
   276 		*/
       
   277         void ShowInvalidServiceTypeNoteL() const;
       
   278 
       
   279         /**
       
   280 		*	Show done note.
       
   281 		*	@param	aFeed Indicates service was installed to Video Feeds folder
       
   282 		*	@return	None
       
   283 		*/
       
   284         void ShowDoneNoteL( TBool aFeed ) const;
       
   285 
       
   286         /**
       
   287         * Query added/updated service id by provider id.
       
   288         * @param aProviderId a provider id of wanted service.
       
   289         * @return service id of found service
       
   290         */
       
   291         TUint32 GetServiceIdByProviderIdL( CIptvServiceManagementClient* aClient,
       
   292                                            const TDesC& aProviderId );
       
   293 
       
   294         /**
       
   295         * Query added/updated service to open.
       
   296         * @param aServiceId Service id.
       
   297         * @param aGroupId Service group id.
       
   298         * @return None
       
   299         */
       
   300         void QueryAddedServiceOpenL( TUint32 aServiceId, TUint32 aGroupId );
       
   301 
       
   302     private:
       
   303         /**
       
   304         * Takes care of command handling.
       
   305         * @param aCommand command to be handled
       
   306         * @return void
       
   307         */
       
   308         void HandleCommandL( TInt aCommand);
       
   309 
       
   310         /**
       
   311         * handles key events
       
   312         * @param TKeyEvent& aKeyEvent
       
   313         * @param TEventCode aType
       
   314         * @return TKeyResponse
       
   315         */
       
   316         TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   317 
       
   318     private:
       
   319 
       
   320     	/** Handle to EComSession */
       
   321     	REComSession iEcomSession;
       
   322 
       
   323     };
       
   324 
       
   325 #endif      // IPTVPROVISIONINGAPPUI_H
       
   326 
       
   327 // End of File