sipplugins/sippsipadapter/inc/CWPSIPItem.h
changeset 0 307788aac0a8
child 37 0295359a7673
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2005-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:  Settings item for SIP settings, handles also the saving of
       
    15 *                settings item. 
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CWPSIPITEM_H
       
    21 #define CWPSIPITEM_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>                // CBase
       
    25 #include <sipprofiletypeinfo.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CWPCharacteristic;
       
    29 class CWPSIPAdapter;
       
    30 class CSIPProfileRegistryObserver;
       
    31 class CSIPManagedProfileRegistry;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36  * CWPSIPItem handles saving of SIP settings item.
       
    37  * @lib WPSIPAdapter.
       
    38  * @since 3.0.
       
    39  */ 
       
    40 class CWPSIPItem : public CBase
       
    41     {
       
    42     public:
       
    43 
       
    44         static CWPSIPItem* NewL();
       
    45 
       
    46         virtual ~CWPSIPItem();
       
    47 
       
    48         /**
       
    49          * Setter for profile type.
       
    50          * @since 3.0.
       
    51          * @param const TDesC8& aPTYPE.
       
    52          */
       
    53         void SetProfileTypeL( const TDesC8& aPTYPE );
       
    54 
       
    55         /**
       
    56          * Setter for APPREF.
       
    57          * @since .
       
    58          * @param const TDesC8& aAPPREF.
       
    59          */
       
    60         void SetAppRefL( const TDesC8& aAPPREF );
       
    61 
       
    62         /**
       
    63          * Setter for AOL/Public User Identity.
       
    64          * @since 3.0.
       
    65          * @param const TDesC8& aPUID.
       
    66          */
       
    67         void SetAORL( const TDesC8& aPUID );
       
    68 
       
    69         /**
       
    70          * Setter for provider.
       
    71          * @since 3.0.
       
    72          * @param const TDesC8& aPROVIDERID.
       
    73          */
       
    74         void SetProviderIdL( const TDesC8& aPROVIDERID );
       
    75 
       
    76         /**
       
    77          * Setter for user viewable name of the setting.
       
    78          * @since 3.0.
       
    79          * @param const TDesC& aNAME. Value is TCP or UDP.
       
    80          */
       
    81         void SetNameL( const TDesC& aNAME );
       
    82 
       
    83         /**
       
    84          * Setter for transport protocol between UE and outbound proxy/P-CSCF.
       
    85          * @since 3.0.
       
    86          * @param const TDesC8& aAPROTOCOL.
       
    87          */
       
    88         void SetProtocolForOutboundConnectionL( const TDesC8& aAPROTOCOL );
       
    89 
       
    90         /**
       
    91          * Setter for NAPDEF name. Name of IAP.
       
    92          * @since 3.0.
       
    93          * @param const TDesC8& aTONAPID.
       
    94          */
       
    95         void SetNapDefNameL( const TDesC8& aTONAPID );
       
    96 
       
    97         /**
       
    98          * Setter for signal compression usage.
       
    99          * @since 3.0.
       
   100          * @param TBool aEnabled.
       
   101          */
       
   102         void SetSignalCompressionEnabled( TBool aEnabled );
       
   103 
       
   104         /**
       
   105          * Setter for security negotiation usage.
       
   106          * @since 3.0.
       
   107          * @param TBool aEnabled.
       
   108          */
       
   109         void SetSecurityNegotiationEnabled( TBool aEnabled );
       
   110 
       
   111         /**
       
   112          * Setter for loose routing usage.
       
   113          * @since 3.0.
       
   114          * @param TBool aEnabled.
       
   115          */
       
   116         void SetLooseRoutingForOutboundConnectionEnabled( TBool aEnabled );
       
   117 
       
   118         /**
       
   119          * Setter for profile lock usage.
       
   120          * @since 3.1.
       
   121          * @param TBool aEnabled.
       
   122          */
       
   123         void SetProfileLockEnabled( TBool aEnabled );
       
   124 
       
   125         /**
       
   126          * Setter for outbound proxy/P-CSCF address.
       
   127          * @since 3.0.
       
   128          * @param const TDesC8& aOutboundAddr.
       
   129          */
       
   130         void SetOutboundAddrL( const TDesC8& aOutboundAddr );
       
   131 
       
   132         /**
       
   133          * Setter for port number to be used when connecting outbound
       
   134          * proxy/P-CSCF.
       
   135          * @since 3.0.
       
   136          * @param const TDesC8& aPORT.
       
   137          */
       
   138         void SetPortNumberForOutboundConnectionL( const TDesC8& aPORT );
       
   139 
       
   140         /**
       
   141          * Setter for authentication type when autenticating to outbound
       
   142          * proxy.
       
   143          * @since 3.0.
       
   144          * @param const TDesC8& aAAUTHTYPE.
       
   145          */
       
   146         void SetAuthenticationTypeForOutboundL( const TDesC8& aAAUTHTYPE );
       
   147 
       
   148         /**
       
   149          * Setter for username when autenticating to outbound proxy.
       
   150          * @since 3.0.
       
   151          * @param const TDesC8& aAAUTHNAME.
       
   152          */
       
   153         void SetUsernameForOutboundL( const TDesC8& aAAUTHNAME );
       
   154 
       
   155         /**
       
   156          * Setter for password when autenticating to outbound proxy.
       
   157          * @since 3.0.
       
   158          * @param const TDesC8& aAAUTHSECRET.
       
   159          */
       
   160         void SetPasswordForOutboundL( const TDesC8& aAAUTHSECRET );
       
   161 
       
   162         /**
       
   163          * Setter for realm when autenticating to outbound proxy.
       
   164          * @since 3.0.
       
   165          * @param const TDesC8& aAAUTHDATA.
       
   166          */
       
   167         void SetRealmForOutboundL( const TDesC8& aAAUTHDATA );
       
   168 
       
   169         /**
       
   170          * Setter for registrar/S-CSCF address.
       
   171          * @since 3.0.
       
   172          * @param const TDesC8& aRegistrarAddr.
       
   173          */
       
   174         void SetRegistrarAddrL( const TDesC8& aRegistrarAddr );
       
   175 
       
   176         /**
       
   177          * Setter for authentication type when autenticating to registrar
       
   178          * proxy/S-CSCF.
       
   179          * @since 3.0.
       
   180          * @param const TDesC8& aAAUTHTYPE.
       
   181          */
       
   182         void SetAuthenticationTypeForRegistrarL( const TDesC8& aAAUTHTYPE );
       
   183 
       
   184         /**
       
   185          * Setter for username when autenticating to registrar proxy/S-CSCF.
       
   186          * @since 3.0.
       
   187          * @param const TDesC8& aAAUTHNAME.
       
   188          */
       
   189         void SetUsernameForRegistrarL( const TDesC8& aAAUTHNAME );
       
   190 
       
   191         /**
       
   192          * Setter for password when autenticating to registrar proxy/S-CSCF.
       
   193          * @since 3.0.
       
   194          * @param const TDesC8& aAAUTHSECRET.
       
   195          */
       
   196         void SetPasswordForRegistrarL( const TDesC8& aAAUTHSECRET );
       
   197 
       
   198         /**
       
   199          * Setter for realm when autenticating to registrar proxy/S-CSCF.
       
   200          * @since 3.0.
       
   201          * @param const TDesC8& aAAUTHDATA.
       
   202          */
       
   203         void SetRealmForRegistrarL( const TDesC8& aAAUTHDATA );
       
   204 
       
   205         /**
       
   206          * Setter for NAPDEF (IAP settings).
       
   207          * @since 3.0.
       
   208          * @param CWPCharacteristic* aNapDef.
       
   209          */
       
   210         void SetNapDef( CWPCharacteristic* aNapDef );
       
   211 
       
   212         /**
       
   213          * Sets the id of IAP to save item.
       
   214          * @since 3.0.
       
   215          * @param aUid the uid of IAP.
       
   216          */
       
   217         void SetIAPId( TUint32 aUid );
       
   218 
       
   219         /**
       
   220          * Sets the SIP profile as default.
       
   221          * @since 3.0.
       
   222          */
       
   223         void SetAsDefaultL();
       
   224 
       
   225         /**
       
   226          * Sets automatic registration enabled.
       
   227          * @since 3.0.
       
   228          */
       
   229         void SetAutomaticRegistrationEnabled( 
       
   230             TBool aAutomaticRegistrationEnabled );
       
   231 
       
   232          /**
       
   233           * Gets SIP ID.
       
   234           * @since 3.0.
       
   235           */
       
   236         TDesC8& GetAppRef();
       
   237 
       
   238         /**
       
   239          * Getter for Address-Of-Record/Public User Identity.
       
   240          * @since 3.0.
       
   241          * @return TDesC8&.
       
   242          */
       
   243         TDesC8& GetAOR();
       
   244 
       
   245         /**
       
   246          * Getter for provider.
       
   247          * @since 3.0.
       
   248          * @return TDesC8&.
       
   249          */
       
   250         TDesC8& GetProviderId();
       
   251 
       
   252         /**
       
   253          * Getter for user viewable nema of SIP settings item.
       
   254          * @since 3.0.
       
   255          * @return TDesC8&.
       
   256          */
       
   257         TDesC& GetName();
       
   258 
       
   259         /**
       
   260          * Getter for protocol name for usage between UE and outbound proxy.
       
   261          * @since 3.0.
       
   262          * @return TDesC8&.
       
   263          */
       
   264         TDesC8& GetProtocolForOutboundConnection();
       
   265 
       
   266         /**
       
   267          * Getter for NAPDEF name (IAP settings name).
       
   268          * @since 3.0.
       
   269          * @return TDesC8&.
       
   270          */
       
   271         TDesC8& GetNapDefName();
       
   272 
       
   273         /**
       
   274          * Getter for signal compression usage.
       
   275          * @since 3.0.
       
   276          * @return TDesC8&.
       
   277          */
       
   278         TBool GetSignalCompressionEnabled();
       
   279 
       
   280         /**
       
   281          * Getter for security negotiation usage.
       
   282          * @since 3.0.
       
   283          * @return TBool.
       
   284          */
       
   285         TBool GetSecurityNegotiationEnabled();
       
   286 
       
   287         /**
       
   288          * Getter for loose routing usage.
       
   289          * @since 3.0.
       
   290          * @return TBool.
       
   291          */
       
   292         TBool GetLooseRoutingForOutboundConnectionEnabled();
       
   293 
       
   294         /**
       
   295          * Getter for profile lock.
       
   296          * @since 3.1.
       
   297          * @return TBool.
       
   298          */
       
   299         TBool GetProfileLockEnabled();
       
   300 
       
   301         /**
       
   302          * Getter for outbound proxy/P-CSCF address.
       
   303          * @since 3.0.
       
   304          * @return TDesC8&.
       
   305          */
       
   306         TDesC8& GetOutboundAddr();
       
   307 
       
   308         /**
       
   309          * Getter for port number of outbound proxy.
       
   310          * @since 3.0.
       
   311          * @return TDesC8&.
       
   312          */
       
   313         TDesC8& GetPortNumberForOutboundConnection();
       
   314 
       
   315         /**
       
   316          * Getter for authentication type of outbound proxy.
       
   317          * @since 3.0.
       
   318          * @return TDesC8&.
       
   319          */
       
   320         TDesC8& GetAuthenticationTypeForOutbound();
       
   321 
       
   322         /**
       
   323          * Getter for username of outbound proxy realm.
       
   324          * @since 3.0.
       
   325          * @return TDesC8&.
       
   326          */
       
   327         TDesC8& GetUsernameForOutbound();
       
   328 
       
   329         /**
       
   330          * Getter for password of outbound proxy realm.
       
   331          * @since 3.0.
       
   332          * @return TDesC8&.
       
   333          */
       
   334         TDesC8& GetPasswordForOutbound();
       
   335 
       
   336         /**
       
   337          * Getter for outbound proxy realm.
       
   338          * @since 3.0.
       
   339          * @return TDesC8&.
       
   340          */
       
   341         TDesC8& GetRealmForOutbound();
       
   342 
       
   343         /**
       
   344          * Getter for registrar proxy/S-CSCF address.
       
   345          * @since 3.0.
       
   346          * @return TDesC8&.
       
   347          */
       
   348         TDesC8& GetRegistrarAddr();
       
   349 
       
   350         /**
       
   351          * Getter for authentication type of registrar proxy/S-CSCF.
       
   352          * @since 3.0.
       
   353          * @return TDesC8&.
       
   354          */
       
   355         TDesC8& GetAuthenticationTypeForRegistrar();
       
   356 
       
   357         /**
       
   358          * Getter for username of registrar proxy/S-CSCF realm.
       
   359          * @since 3.0.
       
   360          * @return TDesC8&.
       
   361          */
       
   362         TDesC8& GetUsernameForRegistrar();
       
   363 
       
   364         /**
       
   365          * Getter for password of registrar proxy/S-CSCF realm.
       
   366          * @since 3.0.
       
   367          * @return TDesC8&.
       
   368          */
       
   369         TDesC8& GetPasswordForRegistrar();
       
   370 
       
   371         /**
       
   372          * Getter for registrar proxy/S-CSCF realm.
       
   373          * @since 3.0.
       
   374          * @return TDesC8&.
       
   375          */
       
   376         TDesC8& GetRealmForRegistrar();
       
   377 
       
   378         /**
       
   379          * Getter for automatic registration state
       
   380          * @since 3.0.
       
   381          * @return TBool.
       
   382          */
       
   383         TBool GetAutomaticRegistrationEnabled();
       
   384 
       
   385         /**
       
   386          * Getter for IAPId.
       
   387          * @since 3.0.
       
   388          * @return TUint32.
       
   389          */
       
   390         TUint32 GetIAPId();
       
   391 
       
   392         /**
       
   393          * Getter for NAPDEF (IAP settings).
       
   394          * @since 3.0.
       
   395          * @return CWPCharacteristic*.
       
   396          */
       
   397         CWPCharacteristic* GetNapDef();
       
   398 
       
   399         /**
       
   400          * Getter for SIP profile id.
       
   401          * @since 3.0.
       
   402          * @return TUint32. Uid of the SIP profile in SIP Profile Registry.
       
   403          */
       
   404         TUint32 GetProfileId();
       
   405 
       
   406         /**
       
   407          * Saves SIP settings point by using .
       
   408          * @since 3.0.
       
   409          * @return Id of saved service access point.
       
   410          */
       
   411         TUint32 StoreL();
       
   412 
       
   413         /**
       
   414          * Return profile id.
       
   415          * @since 3.0.
       
   416          * @return TDesC8&. Id of the SIP item.
       
   417          */
       
   418         const TDesC8& SaveData();
       
   419 
       
   420         /**
       
   421          * Check for duplicate providername and rename if same
       
   422          * @since Series 60_3.0
       
   423          * @param aProfile Profile to check.
       
   424          * @param aProfileId ProfileId to be skipped in check.
       
   425          */
       
   426         void CheckDuplicateNameL( CSIPManagedProfile& aProfile, 
       
   427             const TInt& aProfileId );
       
   428 
       
   429         /**
       
   430          * Set wlan availability switch
       
   431          * @since Series 60_3.0
       
   432          * @param aScanRate Scan rate to be set.
       
   433          */
       
   434         void SetAvailabilitySwitchL( const TUint32 aScanRate );
       
   435 
       
   436         /**
       
   437          * Cleanup method for array.
       
   438          *
       
   439          * @since S60 3.1
       
   440          * @param aParameter Parameter to be cleaned.
       
   441          */
       
   442         static void CleanupArrayItem( TAny* aArray );
       
   443 
       
   444         /**
       
   445          * Setter for TO-APPREF value.
       
   446          *
       
   447          * @since S60 3.2
       
   448          * @param aToAppRef TO-APPREF value to be set.
       
   449          */
       
   450         void SetToAppRefL( const TDesC8& aToAppRef );
       
   451 
       
   452         /**
       
   453          * Getter for TO-APPREF value.
       
   454          *
       
   455          * @since S60 3.2
       
   456          * @return TO-APPREF value.
       
   457          */
       
   458         const TDesC8& ToAppRef() const;
       
   459 
       
   460         /**
       
   461          * Setter for Destination network name.
       
   462          *
       
   463          * @since S60 3.2.
       
   464          * @param aDestination Destination name to be set.
       
   465          */
       
   466         void SetNetworkL( const TDesC& aNetwork );
       
   467 
       
   468         /**
       
   469          * Getter for Destination network name.
       
   470          *
       
   471          * @since S60 3.2.
       
   472          * @return Destination network name.
       
   473          */
       
   474         const TDesC& Network() const;
       
   475 
       
   476         /**
       
   477          * Setter for SNAP ID.
       
   478          *
       
   479          * @since S60 3.2.
       
   480          * @param aSnapId SNAP ID.
       
   481          */
       
   482         void SetSnapId( TInt aSnapId );
       
   483 
       
   484         /**
       
   485          * Setter for Signalling QoS value.
       
   486          *
       
   487          * @since S60 3.2.
       
   488          * @param aSigQos Signalling QoS value.
       
   489          */
       
   490         void SetSigQos( TUint32 aSigQos );
       
   491 
       
   492     private:
       
   493 
       
   494         void ConstructL();
       
   495         CWPSIPItem();
       
   496 
       
   497         /**
       
   498          * Getter for Destination Network ID.
       
   499          *
       
   500          * @since S60 3.2.
       
   501          * @param aName Destination Network name.
       
   502          * @return Destination Network ID.
       
   503          */
       
   504         TInt NetworkIdL( const TDesC& aName );
       
   505 
       
   506     private:
       
   507 
       
   508         /**
       
   509          * SIP Profile reference identity in provisioning document.
       
   510          * Own.
       
   511          */
       
   512         HBufC8* iAppRef;
       
   513 
       
   514         /**
       
   515          * Address-Of-Record/Public User Identity.
       
   516          * Own.
       
   517          */
       
   518         HBufC8* iAOR;
       
   519 
       
   520         /**
       
   521          * Protocol used between UE and outbound proxy/P-CSCF.
       
   522          * Own.
       
   523          */
       
   524         HBufC8* iProtocolForOutboundConnection;
       
   525 
       
   526         /**
       
   527          * Name of SIP settings visible to user when viewing the provisioning 
       
   528          * message.
       
   529          * Own.
       
   530          */
       
   531         HBufC* iName;
       
   532 
       
   533         /**
       
   534          * Provider of settings.
       
   535          * Own.
       
   536          */
       
   537         HBufC8* iProviderId;
       
   538 
       
   539         /** 
       
   540          * The access point name.
       
   541          * Own.
       
   542          */
       
   543         HBufC8* iNapDefName;        
       
   544 
       
   545         /**
       
   546          * Signal compression usage.
       
   547          */
       
   548         TBool iSignalCompressionEnabled;      
       
   549 
       
   550         /**
       
   551          * Security negotiation usage.
       
   552          */
       
   553         TBool iSecurityNegotiationEnabled;
       
   554 
       
   555         /**
       
   556          * Loose routing usage.
       
   557          */
       
   558         TBool iLooseRoutingForOutboundConnectionEnabled;
       
   559 
       
   560         /**
       
   561          * Registration mode (always on/when needed).
       
   562          */
       
   563         TBool iAutomaticRegistrationEnabled;
       
   564 
       
   565         /**
       
   566          * Profile Lock.
       
   567          */
       
   568         TBool iProfileLockEnabled;
       
   569 
       
   570         /**
       
   571          * Outbound proxy/P-CSCF address.
       
   572          * Own.
       
   573          */
       
   574         HBufC8* iOutboundAddr;
       
   575 
       
   576         /**
       
   577          * Port number of outbound proxy/P-CSCF.
       
   578          * Own.
       
   579          */
       
   580         HBufC8* iPortNumberForOutboundConnection;
       
   581 
       
   582         /**
       
   583          * Authentication type of outbound proxy.
       
   584          * Own.
       
   585          */
       
   586         HBufC8* iAuthenticationTypeForOutbound;
       
   587 
       
   588         /**
       
   589          * Username of outbound proxy realm.
       
   590          * Own.
       
   591          */
       
   592         HBufC8* iUsernameForOutbound;
       
   593 
       
   594         /**
       
   595          * Password of outbound proxy realm.
       
   596          * Own.
       
   597          */
       
   598         HBufC8* iPasswordForOutbound;
       
   599 
       
   600         /**
       
   601          * Outbound proxy realm.
       
   602          * Own.
       
   603          */
       
   604         HBufC8* iRealmForOutbound;
       
   605 
       
   606         /**
       
   607          * Registrar proxy/S-CSCF address.
       
   608          * Own.
       
   609          */
       
   610         HBufC8* iRegistrarAddr;
       
   611 
       
   612         /**
       
   613          * Authentication type of registrar proxy/S-CSCF.
       
   614          * Own.
       
   615          */
       
   616         HBufC8* iAuthenticationTypeForRegistrar;  
       
   617 
       
   618         /**
       
   619          * Username of registrar proxy/S-CSCF realm.
       
   620          * Own.
       
   621          */
       
   622         HBufC8* iUsernameForRegistrar;
       
   623 
       
   624         /**
       
   625          * Password of registrar proxy/S-CSCF realm.
       
   626          * Own.
       
   627          */
       
   628         HBufC8* iPasswordForRegistrar;
       
   629 
       
   630         /**
       
   631          * Registrar proxy/S-CSCF realm.
       
   632          * Own.
       
   633          */
       
   634         HBufC8* iRealmForRegistrar;
       
   635 
       
   636         /**
       
   637          * NAPDEF. Pointer to IAP settings.
       
   638          */
       
   639         CWPCharacteristic* iNapDef;
       
   640 
       
   641         /**
       
   642          * ID value of the referred IAP.
       
   643          */
       
   644         TUint32 iIAPId;
       
   645 
       
   646         /**
       
   647          * ID of the SIP profile in profile registry after saving.
       
   648          */
       
   649         TUint32 iProfileId;
       
   650 
       
   651         /**
       
   652          * Defaultness of the SIP profile.
       
   653          */
       
   654         TBool iSetAsDefault;
       
   655 
       
   656         /**
       
   657          * Type of profile + name of type.
       
   658          */
       
   659         TSIPProfileTypeInfo iSIPProfileTypeInfo;  
       
   660 
       
   661         /**
       
   662          * SIP ID as descriptor to be returned by the SaveData method to the
       
   663          * framework via adapter SaveDataL.
       
   664          * Own.
       
   665          */
       
   666         HBufC8* iSavedProfileId;
       
   667 
       
   668         /**
       
   669          * TO-APPREF value for linking SIP profile to a destination network.
       
   670          * Own.
       
   671          */
       
   672         HBufC8* iToAppRef;
       
   673 
       
   674         /**
       
   675          * Destination network name to be set.
       
   676          * Own.
       
   677          */
       
   678         HBufC* iNetwork;
       
   679 
       
   680         /**
       
   681          * SNAP ID.
       
   682          */
       
   683         TInt iSnapId;
       
   684 
       
   685         /**
       
   686          * Signalling QoS value.
       
   687          */
       
   688         TUint32 iSigQos;
       
   689 
       
   690     private:
       
   691         //friend class UT_CWPSIPItem; // For testing purposes.
       
   692         //friend class UT_CWPSIPAdapter; // For testing purposes.
       
   693 
       
   694 
       
   695     }; // class
       
   696 
       
   697 #endif // CWPSIPITEM_H