epoc32/include/mw/msenservicepolicy.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 msenservicepolicy.h
     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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: Service policy interface for serene   
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef M_SEN_SERVICE_POLICY_H
       
    19 #define M_SEN_SERVICE_POLICY_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <e32base.h> // for CActive
       
    23 #include <badesca.h>
       
    24 
       
    25 #include "SenDomFragment.h"
       
    26 
       
    27 typedef RPointerArray<CSenElement> RPolicyArray;
       
    28 
       
    29 // FORWARD DECLARATION
       
    30 
       
    31 // CLASS DECLARATION
       
    32 /*
       
    33 *   <ServicePolicy>
       
    34 *       <ClientPolicy>
       
    35 *			<MetadataEndpoint>uri.1</MetadataEndpoint>
       
    36 *			<MetadataEndpoint>uri.2</MetadataEndpoint>
       
    37 *			<MetadataEndpoint>uri.3</MetadataEndpoint>
       
    38 *           <PolicyValue1/>				
       
    39 *           <PolicyValue2/>				
       
    40 *       </ClientPolicy>
       
    41 *       <PolicyArrray>
       
    42 *			<wsp:Policy1/>
       
    43 *			<wsp:Policy2/>
       
    44 *       </PolicyArrray>
       
    45 *   </ServicePolicy>
       
    46 */
       
    47 class MSenServicePolicy
       
    48     {
       
    49     public: // New functions
       
    50 
       
    51         /**
       
    52         * Adds a policy in SD
       
    53         * Method is used to add a RAW policy obtained 
       
    54         * by Network or some dynamic means
       
    55         * @since Series60 4.0
       
    56         * @param aPolicy is the Policy Element
       
    57         */ 
       
    58         virtual TInt AddPolicyL(CSenElement* aPolicy) = 0;
       
    59 
       
    60         /**
       
    61         * Remove  a Policy from SD
       
    62         * @param aPolicyName , Policy with this name will be removed from SD
       
    63         * @return
       
    64         *  - KErrNone 
       
    65         
       
    66         */ 
       
    67         virtual TInt RemovePolicyL(TDesC8& aPolicyName) = 0;
       
    68 
       
    69         /**
       
    70         * Method reads provider policy class instance values from given
       
    71         * template. 
       
    72         * @since Series60 4.0
       
    73         * @param aTemplate from which the values are read.
       
    74         * @return   
       
    75         *           
       
    76         */ 
       
    77         virtual TInt RebuildServicePolicyFrom(MSenServicePolicy& aTemplate) = 0;
       
    78         
       
    79         /**
       
    80         * Checks if policies match.
       
    81         * @return ETrue if policies match, EFalse if not.
       
    82         */
       
    83         virtual TBool Accepts(MSenServicePolicy& aPolicyPattern) = 0;
       
    84        
       
    85         /**
       
    86         * Getter for ServicePolicies
       
    87         * @since Series60 4.0
       
    88         * @return 
       
    89         *           
       
    90         */ 
       
    91 
       
    92 		/**
       
    93 		* Return all of the Services polices from SD only <wsp:Policy> tags
       
    94 		* @param aPolicies
       
    95 		* @return KErrNone
       
    96 		*		  KErrNotFound	
       
    97 		*/
       
    98         virtual TInt ServicePolicies(RPolicyArray& aPolicies) = 0;
       
    99         /**
       
   100         * Gets the Client Policy
       
   101         */
       
   102         virtual CSenElement* ClientPolicy() = 0;
       
   103         /**
       
   104         * Searches for the Client Policy with the given key value
       
   105         * @param aKey
       
   106         * @return ETrue If the Client Policy is present with the given key value
       
   107         *		  EFalse If the Client Policy is not present with the given key value  
       
   108         */
       
   109         virtual TBool ClientPolicy(const TDesC8& aKey) = 0;
       
   110         /**
       
   111         * Gets the Client Policy with the given key value
       
   112         * @param aKey
       
   113         * @return Client Policy Value is returned
       
   114         */
       
   115         virtual HBufC8* ClientPolicyValue(const TDesC8& aKey) = 0;
       
   116     };
       
   117 
       
   118 #endif //M_SEN_POLICY_H
       
   119 
       
   120 // End of File