XDMEngine/XdmProvisioning/inc/xdmprovitem.h
changeset 0 c8caa15ef882
child 25 e53c01f160bc
equal deleted inserted replaced
-1:000000000000 0:c8caa15ef882
       
     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 "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:    Provisioning item for parsing and saving XDM settings
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __XDMPROVITEM_H__
       
    22 #define __XDMPROVITEM_H__
       
    23 
       
    24 // INCLUDES
       
    25 #include <CWPAdapter.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CWPCharacteristic;
       
    29 class CWPParameter;
       
    30 
       
    31 _LIT( KXdmProvAppId,            "ap0003" );
       
    32 _LIT( KXdmProvAppRef,           "APPREF" );
       
    33 _LIT( KXdmProvToAppRef,         "TO-APPREF" );
       
    34 _LIT( KXdmProvStartBracket,     "(" );
       
    35 _LIT( KXdmProvCloseBracket,     ")" );
       
    36 
       
    37 const TInt KXdmProvIdLength     = 10;
       
    38 const TInt KXdmProvNameLength   = 40;
       
    39 const TInt KXdmProvBufLength    = 512;
       
    40 
       
    41 /**
       
    42 * Xdm settings item for provisioning.
       
    43 *
       
    44 * @since S60 3.2
       
    45 */
       
    46 class CXdmProvItem : public CBase, public MWPVisitor
       
    47     {
       
    48     public: 
       
    49         
       
    50         /**
       
    51         * Two-phased constructor.
       
    52         */
       
    53         static CXdmProvItem* NewL();
       
    54 
       
    55         /**
       
    56         * Destructor.
       
    57         */
       
    58         virtual ~CXdmProvItem();                
       
    59 
       
    60 
       
    61     private: // From MWPVisitor
       
    62 
       
    63         void VisitL( CWPCharacteristic& aCharacteristic );
       
    64         
       
    65         void VisitL( CWPParameter& aParameter );
       
    66         
       
    67         void VisitLinkL( CWPCharacteristic& aLink );
       
    68             
       
    69     public: 
       
    70             
       
    71         /**
       
    72         * Validates the provisioning item for mandatory fields
       
    73         * @return ETrue if correct item
       
    74         */
       
    75         TBool Validate() const;
       
    76         
       
    77         /**
       
    78         * Saves the provisioned settings
       
    79         * @return KErrNone if successfull
       
    80         */
       
    81         TInt SaveL();
       
    82         
       
    83         /**
       
    84         * Returns name of the provisioning item
       
    85         * @return Name or KNullDesC
       
    86         */
       
    87         const TDesC& Name() const;
       
    88         
       
    89         /**
       
    90         * Returns application id of the provisioning item
       
    91         * @return ApplicationId or KNullDesC
       
    92         */
       
    93         const TDesC& ApplicationId() const;
       
    94         
       
    95         /**
       
    96         * Returns id of the created settings
       
    97         * @return The id or KErrNotFound if not yet saved
       
    98         */
       
    99         TInt XdmSettingsId() const;
       
   100         
       
   101         /**
       
   102         * Returns value of the APPREF of the provisioning item
       
   103         * @return iAppRef or KNullDesC
       
   104         */
       
   105         const TDesC& AppReference() const;
       
   106         
       
   107         /**
       
   108         * Returns the application references from this item to other
       
   109         * applications
       
   110         * @return Array of references
       
   111         */
       
   112         const RArray<TPtrC>& ToAppReferences() const;
       
   113                   
       
   114                 
       
   115         /**
       
   116         * Set SIP settings id
       
   117         * @param aStorageIdValue Settings id
       
   118         */
       
   119         void SetSipSettingsIdL( const TDesC8& aStorageIdValue );
       
   120         
       
   121         /**
       
   122         * Set name of the access point
       
   123         * @param aLink
       
   124         */
       
   125        void SetNapDefL ( CWPCharacteristic& aLink );      
       
   126                   
       
   127     private:
       
   128     
       
   129 
       
   130         /**
       
   131         * C++ default constructor.
       
   132         */
       
   133         CXdmProvItem();
       
   134         
       
   135         /**
       
   136         * Determines and saves named parameter
       
   137         * @param aName Name of the parameter
       
   138         * @param aValue Value of the parameter
       
   139         */
       
   140         void DetermineNamedParameter( const TDesC& aName, 
       
   141                                       const TDesC& aValue );
       
   142         
       
   143         /**
       
   144         * Finds the access point id from CommsDb
       
   145         * based on access poin name
       
   146         */
       
   147         void FindAccessPointIdL ();
       
   148                 
       
   149         /**
       
   150         * Checks that the settings name is not in use.
       
   151         * Creates new name with index if needed.
       
   152         */
       
   153         void CheckExistingNamesL( );
       
   154 
       
   155     private:
       
   156 
       
   157         
       
   158         // The allocated id for the saved settings 
       
   159         TInt iXdmSettingsId;    
       
   160         
       
   161         // APPID
       
   162         TPtrC  iAppId;
       
   163         
       
   164         // APPNAME
       
   165         TPtrC   iAppName;
       
   166         
       
   167         // PROVIDER-ID
       
   168         TPtrC  iProviderId;
       
   169         
       
   170         // TO-APPREF
       
   171         HBufC*  iSipReference;
       
   172         
       
   173         // TO-NAPID
       
   174         TPtrC  iToNapId;
       
   175         
       
   176         // Access point id
       
   177         HBufC*  iNapId;
       
   178         
       
   179         // Name of the access point
       
   180         TPtrC  iNapName;
       
   181         
       
   182         // APPREF
       
   183         TPtrC  iAppRef;
       
   184 
       
   185         // URI
       
   186         TPtrC  iXcapRootUri;
       
   187         
       
   188         // AAUTHNAME
       
   189         TPtrC  iUserName;
       
   190         
       
   191         // AAUTHSECRET
       
   192         TPtrC iPassword;
       
   193     
       
   194         // AAUTHTYPE
       
   195         TPtrC iAuthType;
       
   196         
       
   197         // Flag indicating wheather settings are saved
       
   198         TBool iSettingsSaved;
       
   199         
       
   200         // Application references
       
   201         RArray<TPtrC> iToAppReferences;
       
   202         
       
   203 
       
   204     };
       
   205 
       
   206 #endif // __XDMPROVITEM_H__   
       
   207             
       
   208 // End of File
       
   209 
       
   210 
       
   211 
       
   212