webservices/wsstar/wsstarplugin/inc/wsstarpolicyrequest.h
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 2009 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 #include <e32std.h>
       
    24 #include <flogger.h>
       
    25 #include "sensessionhandler.h"
       
    26 #include "wsstarhandlercontext.h"
       
    27 #include "wsstarsessioncontext.h"
       
    28 #include "wsstartrustclient.h"
       
    29 #include "wsstarcons.h"
       
    30 #include "wspolicy.h"
       
    31 #include "wspolicyregistry.h"
       
    32 
       
    33 class CPolicyReq;
       
    34 
       
    35 class CPolicyRequest : public CBase
       
    36 {
       
    37 
       
    38 public:
       
    39 
       
    40     static CPolicyRequest* NewL(const TDesC8& aContract);
       
    41      static CPolicyRequest* NewLC(const TDesC8& aContract);
       
    42     virtual ~CPolicyRequest();
       
    43 
       
    44     TPtrC8  Contract();
       
    45     CSenWSDescription* ServiceDescription();
       
    46     CSenElement* PolicyL();	//codescannerwarnings
       
    47     CSenElement* PolicyL(const TDesC8& aUri);	//codescannerwarnings
       
    48     CSenElement* OriginalPolicyL(const TDesC8& aUri);	//codescannerwarnings
       
    49     
       
    50     TInt AddMetadataUriL(const TDesC8& aUri);
       
    51     TInt AddMetadataUriL(const TDesC8& aUri, const TDesC8& aName);
       
    52     TInt AddMetadataUriL(const TDesC8& aUri, const TDesC8& aName, const TDesC8& aContents );
       
    53     
       
    54     TInt SetContentsL(const TDesC8& aUri, const TDesC8& aContent);
       
    55     TInt SetPolicyL(const TDesC8& aUri, CWSPolicy* aPolicy);
       
    56     void URIs(RArray<TPtrC8>& aURI);
       
    57         
       
    58     TInt SetSD(CSenWSDescription* aSD);    
       
    59     
       
    60 private:
       
    61     TInt LookForUri(const TDesC8& aUri);
       
    62 
       
    63     CPolicyRequest();
       
    64     void ConstructL(const TDesC8& aContract);
       
    65 
       
    66     CSenWSDescription* iSD; //not owned        
       
    67     HBufC8* iContract; //service contract representing the policy    
       
    68     RPointerArray<CPolicyReq> iPolicies;
       
    69 };  
       
    70   
       
    71 class CPolicyReq : public CBase
       
    72 {
       
    73     public:
       
    74     
       
    75     static CPolicyReq* NewL(const TDesC8& aUri);
       
    76     static CPolicyReq* NewLC(const TDesC8& aUri);
       
    77     virtual ~CPolicyReq();
       
    78 
       
    79 
       
    80     TPtrC8  Name();
       
    81     TPtrC8  URI();
       
    82     TPtrC8  Contents();
       
    83     CWSPolicy* Policy();
       
    84 
       
    85     TInt    SetNameL(const TDesC8& aName);
       
    86     TInt    SetContentsL(const TDesC8& aContent);
       
    87     TInt    SetPolicy(CWSPolicy* aPolicy);
       
    88     
       
    89     private:
       
    90     CPolicyReq();
       
    91     void ConstructL(const TDesC8& aUri);
       
    92     
       
    93     private:
       
    94     CWSPolicy* iPolicy;
       
    95     HBufC8* iName; //policy name
       
    96     HBufC8* iURI; //uri to download
       
    97     HBufC8* iContents; //contents
       
    98     
       
    99     
       
   100     
       
   101 };    
       
   102 class CPolicyReqMap : public CBase
       
   103 {
       
   104 
       
   105 public:
       
   106     static CPolicyReqMap* NewL(const TDesC8& aContract);
       
   107     static CPolicyReqMap* NewLC(const TDesC8& aContract);
       
   108     virtual ~CPolicyReqMap();
       
   109 
       
   110 
       
   111     TPtrC8  Contract();
       
   112     TPtrC8  Uri();
       
   113     TPtrC8  Contents();
       
   114     CSenWSDescription*    ServiceDescription();
       
   115 
       
   116     TInt    SetUriL(const TDesC8& aUri);
       
   117     TInt    SetContentsL(const TDesC8& aContent);
       
   118     TInt    SetSD(CSenWSDescription* aSD);
       
   119     
       
   120 private:
       
   121     CPolicyReqMap();
       
   122     void ConstructL(const TDesC8& aUri);
       
   123     
       
   124 private:
       
   125     HBufC8* iContract; //service contract
       
   126     HBufC8* iURI; //uri to download
       
   127     HBufC8* iContents; //contents
       
   128     CSenWSDescription* iSD; //not owned
       
   129 };