sipplugins/sippsipadapter/inc/CWPSIPAdapter.h
changeset 0 307788aac0a8
child 4 dd3853b8dc3f
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     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 "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:  Handles SIP settings in provisioning.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CWPSIPADAPTER_H
       
    20 #define CWPSIPADAPTER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <CWPAdapter.h>
       
    24 #include <mwpcontextextension.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CWPCharacteristic;
       
    28 class CWPSIPItem;
       
    29 class CSIPProfileRegistryObserver;
       
    30 class CSIPManagedProfileRegistry;
       
    31 class CSIPManagedProfile;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36  * CWPSIPAdapter handles SIP settings.
       
    37  * @lib WPSIPAdapter
       
    38  * @since 3.0
       
    39  */ 
       
    40 class CWPSIPAdapter : public CWPAdapter, private MWPContextExtension
       
    41     {
       
    42 
       
    43     public: // Constructors and destructor
       
    44 
       
    45         static CWPSIPAdapter* NewL();
       
    46         virtual ~CWPSIPAdapter();
       
    47         
       
    48         // From MWPContextExtension:
       
    49         
       
    50         /**
       
    51          * Returns a pointer to a context extension.
       
    52          * @param aExtension Contains a pointer to MWPContextExtension if supported
       
    53          * @return KErrNotSupported if not supported, KErrNone otherwise
       
    54          */
       
    55         TInt ContextExtension( MWPContextExtension*& aExtension );
       
    56 
       
    57         /**
       
    58          * Returns the data used for saving.
       
    59          * @param aIndex The index of the data
       
    60          * @return The data. Ownership is transferred.
       
    61          */
       
    62         const TDesC8& SaveDataL( TInt aIndex ) const;
       
    63 
       
    64         /**
       
    65          * Deletes a saved item.
       
    66          * @param aSaveData The data used for saving
       
    67          */
       
    68         void DeleteL( const TDesC8& aSaveData );
       
    69 
       
    70         /**
       
    71          * Returns the UID of the adapter.
       
    72          * @return UID
       
    73          */
       
    74         TUint32 Uid() const;
       
    75 
       
    76         // From CWPAdapter:
       
    77 
       
    78         /**
       
    79          * Returns the number of the summary lines to be shown in 
       
    80          * BIO control.
       
    81          * @since 3.0.
       
    82          * @return TInt. Quantity of items (SIP profiles).
       
    83          */
       
    84         TInt ItemCount() const;
       
    85 
       
    86         /**
       
    87          * Getter for the summary text of the SIP item (SIP profile) 
       
    88          * located in the array. Text is shown to the user in 
       
    89          * opened configuration message.
       
    90          * @since 3.0.
       
    91          * @param TInt aIndex. Location of the SIP item.
       
    92          * @return TDesC16&. Summary title.
       
    93          */
       
    94         const TDesC16& SummaryTitle( TInt aIndex ) const;
       
    95 
       
    96         /**
       
    97          * Getter for the summary text of the SIP item (SIP profile) 
       
    98          * located in the array. Text is shown to the user in 
       
    99          * opened configuration message.
       
   100          * @since 3.0.
       
   101          * @param TInt aIndex. Location of the SIP item.
       
   102          * @return TDesC16&. Summary text.
       
   103          */
       
   104         const TDesC16& SummaryText( TInt aIndex ) const;
       
   105 
       
   106         /**
       
   107          * Saves SIP item (SIP profile) located in array.
       
   108          * @since 3.0.
       
   109          * @param TInt aIndex. Location of the SIP item to be saved.
       
   110          */
       
   111         void SaveL( TInt aIndex );
       
   112 
       
   113         /**
       
   114          * Query if the SIP item on place pointed by parameter can 
       
   115          * be set as default.
       
   116          * @since 3.0.
       
   117          * @param TInt aIndex. Location of the SIP item to be queried.
       
   118          * @return TBool.
       
   119          */
       
   120         TBool CanSetAsDefault( TInt aIndex ) const;
       
   121     
       
   122         /**
       
   123          * Sets the SIP item on place pointed by parameter as default.
       
   124          * @since 3.0.
       
   125          * @param TInt aIndex. Location of the SIP item to be queried.
       
   126          */
       
   127         void SetAsDefaultL( TInt aIndex );
       
   128 
       
   129         /**
       
   130          * Query for the detail information about the SIP profile. 
       
   131          * MWPPairVisitor is used for retrieving the details of a single 
       
   132          * setting entry. This is not supported feature as in the other 
       
   133          * adapters in the framework.
       
   134          * @since 3.0.
       
   135          * @param MWPPairVisitor aVisitor.
       
   136          * @param TInt aItem.
       
   137          * @return TInt. 
       
   138          */
       
   139         TInt  DetailsL( TInt aItem, MWPPairVisitor& aVisitor );
       
   140 
       
   141         /**
       
   142          * Visit method. Visits the adapter. Adapter then checks from the 
       
   143          * aCharacteristic if the data is targetet to it and acts according to 
       
   144          * that.
       
   145          * @since 3.0.
       
   146          * @param CWPCharacteristic& aCharacteristic.
       
   147          */
       
   148         void  VisitL( CWPCharacteristic& aCharacteristic );		
       
   149 
       
   150         /**
       
   151          * Visit method. Visits the adapter. Adapter checks from the 
       
   152          * aParameter if the data is targetet to it and acts according to 
       
   153          * that.
       
   154          * @since 3.0.
       
   155          * @param CWPParameter& aParameter.
       
   156          */
       
   157         void  VisitL( CWPParameter& aParameter );		
       
   158 
       
   159         /**
       
   160          * Visit method. Visits the adapter. Adapter checks from the 
       
   161          * aParameter if the link is targetet to it and acts according to 
       
   162          * that. IAP bound to the SIP profile is handled with help of this 
       
   163          * method.
       
   164          * @since 3.0.
       
   165          * @param CWPParameter& aParameter.
       
   166          */
       
   167         void VisitLinkL( CWPCharacteristic& aLink );
       
   168 
       
   169         /**
       
   170          * Gets the saving information from the adapter that has saved
       
   171          * settings.
       
   172          * @param TInt aIndex. Index of the previously saved item.
       
   173          * @param TUint32& aUidOfAdapter. UID of the adapter component. 
       
   174          * @param TAny& aStorageIdValue. Value that identifies the settings in
       
   175          *        its storage.
       
   176          * @param TBool& aIsLastOfItsType. Adapter can tell to the framework
       
   177          *        if the saved item was the last one of its type.
       
   178          * @return TDesC8&. REFID of the saved settings.
       
   179          */
       
   180 	    void GetSavingInfoL( TInt aIndex, 
       
   181 	        RPointerArray<HBufC8>& aSavingInfo );
       
   182 
       
   183         /**
       
   184          * Lets the adapters know when the saving has been finalized in 
       
   185          * viewpoint of the provisioning framework. The adapters can make 
       
   186          * finalization of saving the settings after receiving this call.
       
   187          * @since Series60 3.0
       
   188          */
       
   189         void SavingFinalizedL();
       
   190 
       
   191         /**
       
   192          * From CWPAdapter.
       
   193          * Informs the adapters of the saved settings.
       
   194          *
       
   195          * @since S60 3.2.
       
   196          * @param aAppIdOfSavingItem UID of the adapter component. 
       
   197          * @param aAppRef APPREF of the saved settings.
       
   198          * @param aStorageIdValue Value that identifies the settings in its
       
   199          *        storage.
       
   200          */
       
   201         void SettingsSavedL( const TDesC8& aAppIdOfSavingItem,
       
   202             const TDesC8& aAppRef, const TDesC8& aStorageIdValue );
       
   203 
       
   204     private:
       
   205 
       
   206         CWPSIPAdapter();
       
   207         void ConstructL();
       
   208 
       
   209         /**
       
   210          * Check whether we need to support setting as default
       
   211          * When there are no SIP profiles, query in UI is not needed
       
   212          * @since Series 60_3.0
       
   213          * @return TBool
       
   214          */
       
   215         TBool CheckSettingAsDefaultL() const;
       
   216 
       
   217         /**
       
   218          * Gets IAP ID according to WAP ID.
       
   219          * @since S60 3.2
       
   220          * @param aWapId WAP ID of access point.
       
   221          * @return IAP ID of access point
       
   222          */
       
   223         TUint32 IapIdFromWapIdL( TUint32 aWapId );
       
   224 
       
   225     private:
       
   226 
       
   227         // Holds the received SIP item data. Owns.
       
   228         RPointerArray<CWPSIPItem> iDatas;
       
   229 
       
   230 	    // Current SIP setting data. Owns.
       
   231 	    CWPSIPItem *iCurrentSIPItem;
       
   232 
       
   233         // The application id of the current characteristic
       
   234         TPtrC iAppID;
       
   235  
       
   236 	    // Default name for SIP settings. Owns.
       
   237 		HBufC* iDefaultName;
       
   238 
       
   239         // Default value for provider name. Owns.
       
   240         HBufC* iProviderIdDefault;
       
   241 
       
   242         // Title for SIP settings. Owns.
       
   243         HBufC*  iTitle;
       
   244 
       
   245         // Id of SIP item to be set as default
       
   246         TUint32 iSIPIdForDefault;
       
   247 
       
   248         // Holds the value of current characteristic type (state).
       
   249         TUint iCurrentCharacteristic;
       
   250 
       
   251 		// Descriptor containing uids of the saved items (as TUint32).
       
   252 		mutable HBufC8* iUids;
       
   253 
       
   254 		// SIPIds of stored SIPItems that are set as autoregistrable.
       
   255 		RArray<TUint32> iSIPIdArray;
       
   256 
       
   257     private:    // Friend classes
       
   258         //friend class UT_CWPSIPItem; // For testing purposes.
       
   259         //friend class UT_CWPSIPAdapter; // For testing purposes.
       
   260     };
       
   261 
       
   262 #endif	// CWPSIPADAPTER_H
       
   263             
       
   264 // End of File