webservices/wsdescription/inc/senconsumerpolicy.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 SenConsumerPolicy is a non-public implementation of
       
    15 *                a ConsumerPolicy, which offers functionality for classes
       
    16 *                implementing MSenConsumerPolicy interface. Those classes
       
    17 *                typically delegate their function calls to ready mehthods
       
    18 *                defined in this class.
       
    19 *
       
    20 */
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 #ifndef SEN_CONSUMER_POLICY_H
       
    30 #define SEN_CONSUMER_POLICY_H
       
    31 
       
    32 //  INCLUDES
       
    33 #include <e32base.h> // for CActive
       
    34 #include <badesca.h>
       
    35 
       
    36 #include "SenDomFragment.h"
       
    37 #include "MSenConsumerPolicy.h"
       
    38 #include "senpolicy.h"
       
    39 
       
    40 // FORWARD DECLARATION
       
    41 class CSenIdentityProviderIdArray8;
       
    42 
       
    43 // CLASS DECLARATION
       
    44 
       
    45 /**
       
    46 * Example structure of ConsumerPolicy> XML fragment:
       
    47 *
       
    48 *   <ConsumerPolicy>
       
    49 *       <Transport>
       
    50 *           <IapId>
       
    51 *               1234567890
       
    52 *           </IapId>
       
    53 *       </Transport>
       
    54 *
       
    55 *       <IdentityProviderIDs strict="true">
       
    56 *           <IdentityProviderID>
       
    57 *             urn:first.id.example.com
       
    58 *           </IdentityProviderID>
       
    59 *           <IdentityProviderID>
       
    60 *             urn:second.id.example.com
       
    61 *           </IdentityProviderID>
       
    62 *       </IdentityProviderIDs>
       
    63 *   </ConsumerPolicy>
       
    64 */
       
    65 class CSenConsumerPolicy : public CSenPolicy
       
    66     {
       
    67     public: // Constructors and destructor
       
    68 
       
    69         /**
       
    70         * Two-phased constructors.
       
    71         * These parameterless constructors are ment to be used
       
    72         * for example before parsing XML stream.
       
    73         */
       
    74         IMPORT_C static CSenConsumerPolicy* NewL();
       
    75         IMPORT_C static CSenConsumerPolicy* NewLC();
       
    76 
       
    77         /**
       
    78         * Two-phased constructor.
       
    79         */
       
    80         IMPORT_C static CSenConsumerPolicy* NewL(TUint32 aIapId);
       
    81         IMPORT_C static CSenConsumerPolicy* NewLC(TUint32 aIapId);
       
    82         
       
    83         IMPORT_C static CSenConsumerPolicy* NewL(TUint32 aId, TBool aIsSnapId);
       
    84         IMPORT_C static CSenConsumerPolicy* NewLC(TUint32 aId, TBool aIsSnapId);        
       
    85 
       
    86         // Functions from base classes
       
    87     
       
    88         // From MSenConsumerPolicy 
       
    89     
       
    90         /**
       
    91         * Method reads provider policy class instance values from given
       
    92         * template. Values may include an IAP ID, preferred IdentityProvider
       
    93         * IDs etc.
       
    94         * @since Series60 3.0
       
    95         * @param aTemplate from which the values are read.
       
    96         * @return       KErrNone            Everything went ok.
       
    97         *               KErrAlreadyExists   Duplicates were found
       
    98         *               KErrArgument        Invalid providerIds were found
       
    99         *               Other error codes are system-wide Symbian error codes.
       
   100         */ 
       
   101         IMPORT_C virtual TInt RebuildFrom(MSenConsumerPolicy& aTemplate);
       
   102 
       
   103         /**
       
   104         * Checks if service pattern accepts given policy.
       
   105         * @param aPolicyPattern the consumer policy to check.
       
   106         * @return ETrue if accepts, EFalse if not
       
   107         */
       
   108         IMPORT_C virtual TBool Accepts(MSenConsumerPolicy& aPolicyPattern);
       
   109 
       
   110         /**
       
   111         * Destructor
       
   112         */
       
   113         virtual ~CSenConsumerPolicy();
       
   114 
       
   115     private:
       
   116     
       
   117         /**
       
   118         * C++ default constructor.
       
   119         */
       
   120         CSenConsumerPolicy();
       
   121 
       
   122         /**
       
   123         * By default Symbian 2nd phase constructors are private.
       
   124         */
       
   125         IMPORT_C void BaseConstructL();
       
   126         IMPORT_C void BaseConstructL(TUint32 aIapId);
       
   127         IMPORT_C void BaseConstructL(TUint32 aId, TBool aIsSnapId);
       
   128         
       
   129         
       
   130         // New functions
       
   131         
       
   132         /**
       
   133         * Leaving variants of the functions.
       
   134         */
       
   135         TBool AcceptsL(MSenConsumerPolicy& aPolicyPattern);
       
   136         TInt RebuildFromL(MSenConsumerPolicy& aTemplate);
       
   137     };
       
   138 
       
   139 #endif //SEN_CONSUMER_POLICY_H
       
   140 
       
   141 // End of File