webservices/wsdescription/inc/msenpolicy.h
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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: Header declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef M_SEN_POLICY_H
       
    26 #define M_SEN_POLICY_H
       
    27 
       
    28 //  INCLUDES
       
    29 #include <e32base.h> // for CActive
       
    30 #include <badesca.h>
       
    31 
       
    32 #include "SenDomFragment.h"
       
    33 
       
    34 // FORWARD DECLARATION
       
    35 class CSenIdentityProviderIdArray8;
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 /**
       
    40 * Example structure of Policy XML fragment:
       
    41 *
       
    42 *   <Policy>
       
    43 *       <Transport>
       
    44 *           <IapId>
       
    45 *               1234567890
       
    46 *           </IapId>
       
    47 *       </Transport>
       
    48 *       <IdentityProviderIDs strict="true">
       
    49 *           <IdentityProviderID>
       
    50 *             urn:first.id.example.com
       
    51 *           </IdentityProviderID>
       
    52 *           <IdentityProviderID>
       
    53 *             urn:second.id.example.com
       
    54 *           </IdentityProviderID>
       
    55 *       </IdentityProviderIDs>
       
    56 *   </Policy>
       
    57 */
       
    58 class MSenPolicy
       
    59     {
       
    60     public: // New functions
       
    61 
       
    62         /**
       
    63         * Setter for Internet Access Point (IAP) ID.
       
    64         * Method is used to define default access point
       
    65         * to avoid IAP selection dialog prompt.
       
    66         * @since Series60 3.0
       
    67         * @param aIapId is the ID found from CommDB.
       
    68         */ 
       
    69         virtual void SetIapIdL(TUint32 aIapId) = 0;
       
    70 
       
    71         /**
       
    72         * Getter for IAP ID.
       
    73         * @param aCurrentIapId will contain the current Internet Access Point ID
       
    74         * Max value for IAP ID is 2147483647
       
    75         * @return
       
    76         *  - KErrNone if <IapId> element is found and has valid content
       
    77         *  - KErrNotFound if no <IapId> element has been found or it has
       
    78         *       no content
       
    79         *  - TLex error codes, if <IapId> element has non-numeric value,
       
    80         *    which cannot be resolved
       
    81         */ 
       
    82         virtual TInt IapId(TUint32& aCurrentIapId) = 0;
       
    83 
       
    84         /**
       
    85         * Setter for IdentityProvider IDs. Overrides 
       
    86         * current values with the given values from the array.
       
    87         * When initiating a new service connection, this list of
       
    88         * ProviderIDs define, which IdentityProviders are preferred
       
    89         * OR which are strictly acceptable ones.
       
    90         * @since Series60 3.0
       
    91         * @param aList  list of IdentityProvider IDs.
       
    92         */ 
       
    93         virtual void SetIdentityProviderIdsL(
       
    94                                     CSenIdentityProviderIdArray8& aList) = 0;
       
    95 
       
    96         /**
       
    97         * Adds a new Identity provider ID value at the end of the current list 
       
    98         * values
       
    99         * Checks for duplicate (does not insert new ID elements with equal
       
   100         * content)
       
   101         * @return   KErrAlreadyExists, if a duplicate is tried to add
       
   102         *           KErrArgument if a zero-length descriptor is tried to add
       
   103         *           (aProviderId.Length() == 0)
       
   104         */
       
   105         virtual TInt AddIdentityProviderIdL(const TDesC8& aProviderId) = 0;
       
   106 
       
   107         /**
       
   108         * Method reads provider policy class instance values from given
       
   109         * template. Values may include an IAP ID, preferred IdentityProvider
       
   110         * IDs etc.
       
   111         * @since Series60 3.0
       
   112         * @param aTemplate from which the values are read.
       
   113         * @return       KErrNone            Everything went ok.
       
   114         *               KErrAlreadyExists   Duplicates were found
       
   115         *               KErrArgument        Invalid providerIds were found
       
   116         *               Other error codes are system-wide Symbian error codes.
       
   117         */ 
       
   118         virtual TInt RebuildFrom(MSenPolicy& aTemplate) = 0;
       
   119 
       
   120         /**
       
   121         * Getter for IdentityProvider IDs.
       
   122         * @since Series60 3.0
       
   123         * @return a list of IDP arrays if such value(s) have been set
       
   124         *           or an empty array if no IDP:s have been specified.
       
   125         */ 
       
   126         virtual const CSenIdentityProviderIdArray8& IdentityProviderIds8L() = 0;
       
   127 
       
   128         /**
       
   129         * Checks if policies match.
       
   130         * @return ETrue if policies match, EFalse if not.
       
   131         */
       
   132         virtual TBool Accepts(MSenPolicy& aPolicyPattern) = 0;
       
   133         
       
   134         virtual void SetSnapIdL(TUint32 aSnapId) = 0;
       
   135         
       
   136         virtual TInt SnapId(TUint32& aCurrentSnapId) = 0;
       
   137     };
       
   138 
       
   139 #endif //M_SEN_POLICY_H
       
   140 
       
   141 // End of File