epoc32/include/mw/msenproviderpolicy.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:        This abstract class defines provider policy interface.
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
williamr@2
    19
williamr@2
    20
williamr@2
    21
williamr@2
    22
williamr@2
    23
williamr@2
    24
williamr@2
    25
#ifndef M_SEN_PROVIDER_POLICY_H
williamr@2
    26
#define M_SEN_PROVIDER_POLICY_H
williamr@2
    27
williamr@2
    28
//  INCLUDES
williamr@2
    29
#include <e32base.h> // for CActive
williamr@2
    30
#include <badesca.h>
williamr@2
    31
#include <SenDomFragment.h>
williamr@2
    32
williamr@2
    33
// FORWARD DECLARATIONS
williamr@2
    34
class CSenIdentityProviderIdArray8;
williamr@2
    35
williamr@2
    36
// CLASS DECLARATION
williamr@2
    37
williamr@2
    38
/**
williamr@2
    39
*  This abstract class defines provider policy interface.
williamr@2
    40
*  The provider policy sets the conditions in which some service provider 
williamr@2
    41
*  is capable to operate in. It is defining context, through which these
williamr@2
    42
*  (possibly remote) services may be contacted and used.
williamr@2
    43
*  The actual properties may include transport layer settings, like 
williamr@2
    44
*  predefined Internet Access Point (IAP) ID. In addition, provider policy
williamr@2
    45
*  may declare, that certain service should only be contacted using certain
williamr@2
    46
*  identity provider (in ID-WSF). This can be achieved by mapping certain 
williamr@2
    47
*  list of IDP IDs to a provider policy. 
williamr@2
    48
*  Provider Policies are WSF wide settings, which are stored in WSF
williamr@2
    49
*  databases, and thus they are shared with all the actual Web Service
williamr@2
    50
*  Consumers (WSCs) accessing same services.
williamr@2
    51
*
williamr@2
    52
*   Example structure of ProviderPolicy XML fragment:
williamr@2
    53
*
williamr@2
    54
*   <ProviderPolicy>
williamr@2
    55
*       <Transport>
williamr@2
    56
*           <IapId>
williamr@2
    57
*               1
williamr@2
    58
*           </IapId>
williamr@2
    59
*       </Transport>
williamr@2
    60
*       <IdentityProviderIDs strict="true">
williamr@2
    61
*           <IdentityProviderID>
williamr@2
    62
*             urn:first.id.example.com
williamr@2
    63
*           </IdentityProviderID>
williamr@2
    64
*           <IdentityProviderID>
williamr@2
    65
*             urn:second.id.example.com
williamr@2
    66
*           </IdentityProviderID>
williamr@2
    67
*       </IdentityProviderIDs>
williamr@2
    68
*   </ProviderPolicy>
williamr@2
    69
*  @lib SenServDesc.lib
williamr@2
    70
*  @since Series60 3.0
williamr@2
    71
*/
williamr@2
    72
class MSenProviderPolicy
williamr@2
    73
    {
williamr@2
    74
    public: // New functions
williamr@2
    75
        /**
williamr@2
    76
        * Setter for Internet Access Point (IAP) ID.
williamr@2
    77
        * Method is used to define default access point
williamr@2
    78
        * to avoid IAP selection dialog prompt.
williamr@2
    79
        * @since Series60 3.0
williamr@2
    80
        * @param aIapId is the ID found from CommDB.
williamr@2
    81
        */ 
williamr@2
    82
        virtual void SetIapIdL(TUint32 aIapId) = 0;
williamr@2
    83
williamr@2
    84
        /**
williamr@2
    85
        * Getter for IAP ID
williamr@2
    86
        * @since Series60 3.0
williamr@2
    87
        * @param aCurrentIapId will contain the current 
williamr@2
    88
        *        Internet Access Point ID
williamr@2
    89
        * @return
williamr@2
    90
        *  - KErrNone if <IapId> element is found and has valid content
williamr@2
    91
        *  - KErrNotFound if no <IapId> element has been found or it has
williamr@2
    92
        *       no content
williamr@2
    93
        *  - TLex error codes, if <IapId> element has non-numeric value,
williamr@2
    94
        *    which cannot be resolved
williamr@2
    95
        */ 
williamr@2
    96
        virtual TInt IapId(TUint32& aCurrentIapId) = 0;
williamr@2
    97
williamr@2
    98
        /**
williamr@2
    99
        * Setter for IdentityProvider IDs. Overrides 
williamr@2
   100
        * current values with the given values from the array.
williamr@2
   101
        * When initiating a new service connection, this list of
williamr@2
   102
        * ProviderIDs define, which IdentityProviders are preferred
williamr@2
   103
        * OR which are strictly acceptable ones.
williamr@2
   104
        * @since Series60 3.0
williamr@2
   105
        * @param aList  list of IdentityProvider IDs.
williamr@2
   106
        */ 
williamr@2
   107
        virtual void SetIdentityProviderIdsL(
williamr@2
   108
                                        CSenIdentityProviderIdArray8& aList) = 0;
williamr@2
   109
williamr@2
   110
        /**
williamr@2
   111
        * Adds a new IdentityProviderID value at the end of the current list 
williamr@2
   112
        * values.
williamr@2
   113
        * @since Series60 3.0
williamr@2
   114
        * @param aProviderID defines, which IdentityProvider is preferred
williamr@2
   115
        * OR which is strictly acceptable one, when initiating a new 
williamr@2
   116
        * service connection.
williamr@2
   117
        * @return   KErrAlreadyExists, if a duplicate is tried to add
williamr@2
   118
        *           KErrArgument if a zero-length descriptor is tried to add
williamr@2
   119
        *           (aProviderId.Length() == 0)
williamr@2
   120
        */
williamr@2
   121
        virtual TInt AddIdentityProviderIdL(TDesC8& aProviderId) = 0;
williamr@2
   122
williamr@2
   123
        /**
williamr@2
   124
        * Method reads provider policy class instance values from given
williamr@2
   125
        * template. Values may include an IAP ID, preferred IdentityProvider
williamr@2
   126
        * IDs etc.
williamr@2
   127
        * @since Series60 3.0
williamr@2
   128
        * @param aTemplate from which the values are read.
williamr@2
   129
        * @return       KErrNone            Everything went ok.
williamr@2
   130
        *               KErrAlreadyExists   Duplicates were found
williamr@2
   131
        *               KErrArgument        Invalid providerIds were found
williamr@2
   132
        *               Other error codes are system-wide Symbian error codes.
williamr@2
   133
        */ 
williamr@2
   134
        virtual TInt RebuildFrom(MSenProviderPolicy& aTemplate) = 0;
williamr@2
   135
williamr@2
   136
        /**
williamr@2
   137
        * Getter for IdentityProvider IDs.
williamr@2
   138
        * @since Series60 3.0
williamr@2
   139
        * @return a list of IDP arrays if such value(s) have been set
williamr@2
   140
        *           or an empty array if no IDP:s have been specified.
williamr@2
   141
        */ 
williamr@2
   142
        virtual const CSenIdentityProviderIdArray8& IdentityProviderIds8L() = 0;
williamr@2
   143
williamr@2
   144
        /**
williamr@2
   145
        * Checks if some policy is accepted by current policy.
williamr@2
   146
        * @since    Series60 3.0
williamr@2
   147
        * @param    aPolicyPattern is the policy being compared 
williamr@2
   148
        *           with this instance.
williamr@2
   149
        * @return   ETrue if policy candidate is accepted by current policy
williamr@2
   150
        *           definition, EFalse if not.
williamr@2
   151
        */
williamr@2
   152
        virtual TBool Accepts(MSenProviderPolicy& aPolicyPattern) = 0;
williamr@2
   153
        
williamr@2
   154
        void SetSnapIdL(TUint32 /*aSnapId*/)
williamr@2
   155
        {
williamr@2
   156
        }
williamr@2
   157
        TInt SnapId(TUint32& /*aCurrentSnapId*/)
williamr@2
   158
        {
williamr@2
   159
        	return KErrNotFound;
williamr@2
   160
        }
williamr@2
   161
    };
williamr@2
   162
williamr@2
   163
#endif //M_SEN_PROVIDER_POLICY_H
williamr@2
   164
williamr@2
   165
// End of File