webservices/wsdescription/inc/senproviderpolicy.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:        The SenProviderPolicy is a non-public implementation of
       
    15 *                a "ProviderPolicy", which offers functionality for classes
       
    16 *                implementing MSenProviderPolicy interface. Those classes
       
    17 *                typically delegate their function calls to ready methods
       
    18 *                defined in this class.
       
    19 *
       
    20 */
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 #ifndef SEN_PROVIDER_POLICY_H
       
    30 #define SEN_PROVIDER_POLICY_H
       
    31 
       
    32 //  INCLUDES
       
    33 #include <e32base.h> // for CActive
       
    34 #include <badesca.h>
       
    35 
       
    36 #include "SenDomFragment.h"
       
    37 #include "MSenProviderPolicy.h"
       
    38 #include "senpolicy.h"
       
    39 
       
    40 // FORWARD DECLARATIONS
       
    41 class CSenIdentityProviderIdArray8;
       
    42 
       
    43 // CLASS DECLARATION
       
    44 
       
    45 /**
       
    46 * Example structure of ProviderPolicy XML fragment:
       
    47 *
       
    48 *   <ProviderPolicy>
       
    49 *
       
    50 *       <Transport>
       
    51 *           <IapId>
       
    52 *               1234567890
       
    53 *           </IapId>
       
    54 *       </Transport>
       
    55 *
       
    56 *       <IdentityProviderIDs strict="true">
       
    57 *           <IdentityProviderID>
       
    58 *             urn:first.id.example.com
       
    59 *           </IdentityProviderID>
       
    60 *           <IdentityProviderID>
       
    61 *             urn:second.id.example.com
       
    62 *           </IdentityProviderID>
       
    63 *       </IdentityProviderIDs>
       
    64 *
       
    65 *   </ProviderPolicy>
       
    66 */
       
    67 class CSenProviderPolicy : public CSenPolicy
       
    68     {
       
    69     public: // Constructors and destructor
       
    70 
       
    71         /**
       
    72         * Two-phased constructors.
       
    73         * These parameterless constructors are ment to be used
       
    74         * for example before parsing XML stream.
       
    75         */
       
    76         IMPORT_C static CSenProviderPolicy* NewL();
       
    77         IMPORT_C static CSenProviderPolicy* NewLC();
       
    78         IMPORT_C static CSenProviderPolicy* NewL(TUint32 aIapId);
       
    79         IMPORT_C static CSenProviderPolicy* NewLC(TUint32 aIapId);
       
    80         IMPORT_C static CSenProviderPolicy* NewL(TUint32 aId, TBool aIsSnapId);
       
    81         IMPORT_C static CSenProviderPolicy* NewLC(TUint32 aId, TBool aIsSnapId);        
       
    82 
       
    83         virtual ~CSenProviderPolicy();
       
    84         
       
    85         // New functions
       
    86         
       
    87         /**
       
    88         * Checks if policies match.
       
    89         * @since    Series60 3.0
       
    90         * @param    aPolicyPattern is the policy being compared 
       
    91         *           with this instance.
       
    92         * @return   ETrue if policy candidate is accepted by current policy
       
    93         *           definition, EFalse if not.
       
    94         */
       
    95         IMPORT_C virtual TBool Accepts(MSenProviderPolicy& aPolicyPattern);
       
    96 
       
    97         /**
       
    98         * Method reads provider policy class instance values from given
       
    99         * template. Values may include an IAP ID, preferred IdentityProvider
       
   100         * IDs etc.
       
   101         * @since Series60 3.0
       
   102         * @param aTemplate from which the values are read.
       
   103         * @return       KErrNone            Everything went ok.
       
   104         *               KErrAlreadyExists   Duplicates were found
       
   105         *               KErrArgument        Invalid providerIds were found
       
   106         *               Other error codes are system-wide Symbian error codes.
       
   107         */ 
       
   108         IMPORT_C virtual TInt RebuildFrom(MSenProviderPolicy& aTemplate);
       
   109        
       
   110         
       
   111         /**
       
   112         * Sets transport specific properties.
       
   113         * @param aProperties contains the transport properties in serialized (UTF-8) form.
       
   114         * With HTTP, this descriptor is typically created by utilizing CSenHttpProperties class.
       
   115         * @return KErrNone if successful or otherwise some system-wide error code.
       
   116         */
       
   117         IMPORT_C TInt SetTransportPropertiesL(const TDesC8& aProperties);
       
   118 
       
   119 
       
   120         /*
       
   121         * Method returns currently effective transport properties as a serialized
       
   122         * descriptor. With HTTP, one may utilize CSenHttpProperities class in
       
   123         * order to read this data into properties object. Note that returned 
       
   124         * list of properties also includes properties, which are defined as default
       
   125         * for certain transport in the webservice framework.
       
   126         */
       
   127         IMPORT_C TInt TransportPropertiesL(HBufC8*& aProperties);
       
   128     private: 
       
   129         
       
   130         /**
       
   131         * C++ default constructor.
       
   132         */
       
   133         CSenProviderPolicy();
       
   134         
       
   135         /**
       
   136         * By default Symbian 2nd phase constructors are private.
       
   137         */
       
   138         IMPORT_C void BaseConstructL();
       
   139         IMPORT_C void BaseConstructL(TUint32 aIapId);
       
   140         IMPORT_C void BaseConstructL(TUint32 aId, TBool aIsSnapId);
       
   141     
       
   142         // New functions
       
   143         
       
   144         /**
       
   145         * Leaving variants of the functions.
       
   146         */
       
   147         TBool AcceptsL(MSenProviderPolicy& aPolicyPattern);
       
   148         TInt RebuildFromL(MSenProviderPolicy& aTemplate);
       
   149     };
       
   150 
       
   151 #endif //SEN_PROVIDER_POLICY_H
       
   152 
       
   153 // End of File