videofeeds/omaprovisioning/inc/CIptvOmaProvisioningAdapter.h
changeset 0 96612d01cf9f
child 2 dec420019252
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 CIPTVOMAPROVISIONINGADAPTER_H
       
    22 #define CIPTVOMAPROVISIONINGADAPTER_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <CWPAdapter.h>
       
    26 #include <MWPContextExtension.h>
       
    27 
       
    28 #include "CIptvService.h"
       
    29 #include "CIptvServices.h"
       
    30 #include "CIptvServiceManagementClient.h"
       
    31 
       
    32 // CONSTANTS
       
    33 const TInt KIptvOcpMaxSummaryTitleLength = 100;
       
    34 
       
    35 // MACROS
       
    36 
       
    37 // DATA TYPES
       
    38 
       
    39 // FUNCTION PROTOTYPES
       
    40 
       
    41 // FORWARD DECLARATIONS
       
    42 class CWPCharacteristic;
       
    43 
       
    44 // CLASS DECLARATION
       
    45 
       
    46 /**
       
    47 *  Realizes IPTV OMA provisioning adapter.
       
    48 *
       
    49 *  @lib IptvOmaProvisioningAdapter.lib
       
    50 */
       
    51 class CIptvOmaProvisioningAdapter :  public CWPAdapter,
       
    52                                      public MWPContextExtension,
       
    53                                      public MIptvServiceManagementClientObserver
       
    54     {
       
    55     public:  // Constructors and destructor
       
    56         
       
    57         /**
       
    58         * Two-phased constructor.
       
    59         */
       
    60         static CIptvOmaProvisioningAdapter* NewL();
       
    61         
       
    62         /**
       
    63         * Destructor.
       
    64         */
       
    65         virtual ~CIptvOmaProvisioningAdapter();
       
    66        
       
    67     public: // Methods from base classes 
       
    68   
       
    69         // From CWPAdapter
       
    70         /**
       
    71         * Returns the number of the summary lines to be shown in 
       
    72         * BIO control.
       
    73         * @since Series60 3.0.
       
    74         * @return TInt. Quantity of items.
       
    75         */
       
    76         TInt  ItemCount() const;
       
    77 
       
    78        /**
       
    79         * Getter for the summary text of the service item. 
       
    80         * located in the array. Text is shown to the user in 
       
    81         * opened configuration message.
       
    82         * @since Series60 3.0.
       
    83         * @param TInt aIndex. Location of the service item.
       
    84         * @return TDesC16&. Summary title.
       
    85         */
       
    86         const TDesC16& SummaryTitle( TInt aIndex ) const;
       
    87 
       
    88        /**
       
    89         * Getter for the summary text of the service item. 
       
    90         * located in the array. Text is shown to the user in 
       
    91         * opened configuration message.
       
    92         * @since Series60 3.0.
       
    93         * @param TInt aIndex. Location of the service item.
       
    94         * @return TDesC16&. Summary text.
       
    95         */
       
    96         const TDesC16& SummaryText( TInt aIndex ) const;
       
    97 
       
    98        /**
       
    99         * Saves service item located in array.
       
   100         * @since Series60 3.0.
       
   101         * @param TInt aIndex. Location of the service item to be saved.
       
   102         */
       
   103         void SaveL( TInt aIndex );
       
   104 
       
   105        /**
       
   106         * Query if the service item on place pointed by parameter can 
       
   107         * be set as default.
       
   108         * @since Series60 3.0.
       
   109         * @param TInt aIndex. Location of the service item to be queried.
       
   110         * @return TBool.
       
   111         */
       
   112         TBool CanSetAsDefault( TInt aIndex ) const;
       
   113     
       
   114        /**
       
   115         * Sets the service item on place pointed by parameter as default.
       
   116         * @since Series60 3.0.
       
   117         * @param TInt aIndex. Location of the VoIP item to be queried.
       
   118         */
       
   119         void  SetAsDefaultL( TInt aIndex );
       
   120 
       
   121        /**
       
   122         * Query for the detail information about the service settings. 
       
   123         * MWPPairVisitor is used for retrieving the details of a single 
       
   124         * setting entry. This is not supported feature as in the other 
       
   125         * adapters in the framework.
       
   126         * @since Series60 3.0.
       
   127         * @param TInt aItem.
       
   128         * @param MWPPairVisitor aVisitor.
       
   129         * @return TInt. 
       
   130         */
       
   131         TInt  DetailsL( TInt aItem, MWPPairVisitor& aVisitor );
       
   132 
       
   133        /**
       
   134         * Visit method. Visits the adapter. Adapter then checks from the 
       
   135         * aCharacteristic if the data is targetet to it and acts according to 
       
   136         * that.
       
   137         * @since Series60 3.0.
       
   138         * @param CWPCharacteristic& aCharacteristic.
       
   139         */
       
   140         void  VisitL( CWPCharacteristic& aCharacteristic );		
       
   141 
       
   142        /**
       
   143         * Visit method. Visits the adapter. Method set the iAppId value.
       
   144         * @since Series60.
       
   145         * @param CWPParameter& aParameter.
       
   146         */
       
   147         void  VisitL( CWPParameter& aParameter );		
       
   148 
       
   149        /**
       
   150         * Visit method. Not needed, but here because of inheritation.
       
   151         * @since Series60.
       
   152         * @param CWPCharacteristic& aLink.
       
   153         */
       
   154         void  VisitLinkL( CWPCharacteristic& /*aLink*/ )
       
   155             {
       
   156             };
       
   157             
       
   158         /**
       
   159         * Informs the adapters of the saved settings.
       
   160         * @since 3.0.
       
   161         * @param TDesC8& aAppIdOfSavingItem. UID of the adapter component. 
       
   162         * @param HBufC8& aAppRef. APPREF of the saved settings.
       
   163         * @param TAny& aStorageIdValue. Value that identifies the settings in 
       
   164         *        its storage.
       
   165         * @param TBool aIsLastOfItsType. If the settings saved is the last of 
       
   166         *        its kind, the value of the parameter is ETrue (or 1, because 
       
   167         *        the TBool type does not work correctly via interface class 
       
   168         *        definition (based on information from MVC documentation).
       
   169         */
       
   170         void SettingsSavedL (const TDesC8& aAppIdOfSavingItem,
       
   171         const TDesC8& aAppRef, const TDesC8& aStorageIdValue );
       
   172 
       
   173         /**
       
   174         * Lets the adapters know when the saving has been finalized in 
       
   175         * viewpoint of the provisioning framework. The adapters can make 
       
   176         * finalization of saving the settings after receiving this call.
       
   177         * @since Series60 3.0
       
   178         */
       
   179         void SavingFinalizedL();
       
   180 
       
   181     // From MWPContextExtension.
       
   182 
       
   183         /**
       
   184         * Returns a pointer to a context extension.
       
   185         * @param aExtension Contains a pointer to MWPContextExtension if supported
       
   186         * @return KErrNotSupported if not supported, KErrNone otherwise
       
   187         */
       
   188         TInt ContextExtension(MWPContextExtension*& aExtension);
       
   189 
       
   190         /**
       
   191         * Returns the data used for saving.
       
   192         * @param aIndex The index of the data
       
   193         * @return The data. Ownership is transferred.
       
   194         */
       
   195         const TDesC8& SaveDataL(TInt aIndex) const;
       
   196 
       
   197         /**
       
   198         * Deletes a saved item.
       
   199         * @param aSaveData The data used for saving
       
   200         */
       
   201         void DeleteL(const TDesC8& aSaveData);
       
   202 
       
   203         /**
       
   204         * Returns the UID of the adapter.
       
   205         * @return UID
       
   206         */
       
   207         TUint32 Uid() const;
       
   208     
       
   209     public:
       
   210         /**
       
   211         * From MServiceManagementClientObserver.h see comments from there.
       
   212         * These implementations are empty.
       
   213         */
       
   214         void AddServiceResp( TRespStatus aRespStatus );
       
   215         void UpdateServiceResp( TRespStatus aRespStatus );
       
   216         void DeleteServiceResp( TRespStatus aRespStatus );
       
   217         void GetServicesResp( TRespStatus aRespStatus, 
       
   218                               CDesC8ArraySeg* aServicesArray );
       
   219         void GetUsedIapResp( TUint32 aIapId,
       
   220                              const TDesC& aIapName,
       
   221                              CIptvNetworkSelection::TConnectionPermission aConnectionPermission,
       
   222                              TBool aWlanWhenGPRS,
       
   223                              CIptvNetworkSelection::TRespStatus aRespStatus );
       
   224         void ServerShutdownResp( TRespStatus aRespStatus );
       
   225         void HandleSmEvent( CIptvSmEvent& aEvent );
       
   226            
       
   227     private:
       
   228 
       
   229         /**
       
   230         * C++ default constructor.
       
   231         */
       
   232         CIptvOmaProvisioningAdapter();
       
   233 
       
   234         /**
       
   235         * By default Symbian 2nd phase constructor is private.
       
   236         */
       
   237         void ConstructL();
       
   238         
       
   239         /**
       
   240         * Loads localized texts from resource file.
       
   241         * @param aResourceId Resource ID.
       
   242         */
       
   243         HBufC* LoadResourceTextL( TInt aResourceId ) const;
       
   244 
       
   245         /**
       
   246         * Set given icon path. Whether it is drive independent filepath,
       
   247         * searches correct drive and fix it
       
   248         *
       
   249         * @param aIconPath Icon path.
       
   250         */
       
   251         void SetIconPathL( const TDesC& aIconPath );
       
   252 
       
   253     private: // Data
       
   254         
       
   255         /**
       
   256         * Stores application ID when receiving provisioning data.
       
   257         */
       
   258         TPtrC                               iAppId;
       
   259         
       
   260         /**
       
   261         * iCurrentService is added to this when it has fully constructed.
       
   262         * iServices will contain all provisioned services once the processing is finished.
       
   263         */
       
   264         CIptvServices*                      iServices;
       
   265         
       
   266         /**
       
   267         * The current provision item being parsed is stored here.
       
   268         */
       
   269         CIptvService*                       iCurrentService;
       
   270                 
       
   271         /**
       
   272         * Localized summary title is stored here.
       
   273         */
       
   274         TBuf<KIptvOcpMaxSummaryTitleLength> iSummaryTitle;
       
   275 
       
   276         /**
       
   277 	    * File server session
       
   278 	    */
       
   279 	    RFs iFs;
       
   280 
       
   281     };
       
   282 
       
   283 #endif      // CIPTVOMAPROVISIONINGADAPTER_H
       
   284             
       
   285 // End of File