webservices/wsstar/wsstarpolicy/inc/primitiveassertion.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  
       
    24 #ifndef C_PRIMITIVE_ASSERTION_H
       
    25 #define C_PRIMITIVE_ASSERTION_H
       
    26 
       
    27 
       
    28 #include "assertion.h"
       
    29 #include "SenBaseAttribute.h"
       
    30 class CPolicyAssertion;
       
    31 class CAssertionAttrib;
       
    32 class CQName;
       
    33 
       
    34 typedef RSenPointerMap<TDesC8, TDesC8> RAttributeMap;
       
    35 
       
    36 class CPrimitiveAssertion : public CAssertion
       
    37 {
       
    38 public:
       
    39     static  CPrimitiveAssertion* NewL();
       
    40     static  CPrimitiveAssertion* NewLC();
       
    41 
       
    42     static  CPrimitiveAssertion* NewL(CPrimitiveAssertion* aValue);
       
    43     static  CPrimitiveAssertion* NewLC(CPrimitiveAssertion* aValue);
       
    44 
       
    45     static  CPrimitiveAssertion* NewL(TDesC8& aName, TDesC8& aPrefix, TDesC8& aUri);
       
    46     static  CPrimitiveAssertion* NewLC(TDesC8& aName, TDesC8& aPrefix, TDesC8& aUri);
       
    47 
       
    48     virtual ~CPrimitiveAssertion();
       
    49 //from CAssertion
       
    50     virtual  MAssertion* 	GetParent();
       
    51     virtual RPolicyTerms& 	GetTerms();
       
    52     virtual  TAssertionType Type();
       
    53     virtual  TBool 	HasParent();
       
    54     virtual  TBool 	IsEmpty();
       
    55     virtual  MAssertion* 	NormalizeL();         
       
    56     virtual  MAssertion* 	NormalizeL(CPolicyRegistry* aRegistry);         
       
    57     virtual  MAssertion* IntersectL(MAssertion* aAssertion);
       
    58     virtual  MAssertion* IntersectL(MAssertion* aAssertion, CPolicyRegistry* aRegistry);
       
    59     virtual  MAssertion* 	MergeL(MAssertion* aAssertion);
       
    60     virtual  MAssertion* 	MergeL(MAssertion* aAssertion, CPolicyRegistry* aRegistry);
       
    61     virtual TBool 	Remove(MAssertion* aAssertion);
       
    62     
       
    63     virtual  TInt 	Size();
       
    64 public:    
       
    65  
       
    66     void  AddAttributeL(TDesC8& aQname, TDesC8& aValue);
       
    67     TPtrC8 GetAttributeValue(const TDesC8& aQname);
       
    68     RAttributeMap&  Attributes();
       
    69     TInt SetAttributesL(RAttributeMap& aAttributes);
       
    70     TInt  RemoveAttribute(const TDesC8& aQname);
       
    71 
       
    72     CQName* QName();
       
    73     TPtrC8 Name();
       
    74     TPtrC8 StrValue();
       
    75     void SetStrValueL(TDesC8& aStrValue);
       
    76     TAny* Value(); 
       
    77 
       
    78     TBool IsOptional();
       
    79     TInt SetOptional(TBool aOptional);
       
    80     CQName* iQname;
       
    81 private:
       
    82     CPrimitiveAssertion();
       
    83     void ConstructL();
       
    84     void ConstructL(CPrimitiveAssertion* aValue);
       
    85     void ConstructL(TDesC8& aName, TDesC8& aPrefix, TDesC8& aUri);
       
    86     TInt SetTermsL(RPolicyTerms& aTerms);
       
    87     RPolicyTerms GetTerms(CPolicyAssertion* aPolicy); 
       
    88     TBool IsEmptyPolicy(CPolicyAssertion* aPolicy); 
       
    89     CPolicyAssertion* GetSinglePolicyL(RPolicyTerms aChildTerms);
       
    90     CPrimitiveAssertion* GetSelfWithoutTermsL();
       
    91 private:
       
    92     MAssertion* iOwner;
       
    93 	RAttributeMap* iAttr; 
       
    94 	TBool iIsOptional;
       
    95 	HBufC8* iStrValue;
       
    96 	TAny* iValue;
       
    97       
       
    98     
       
    99 };
       
   100 
       
   101 class CQName :public CBase
       
   102 {
       
   103 public:
       
   104     static  CQName* NewL(TDesC8& aName, TDesC8& aPrefix, TDesC8& aUri);
       
   105     static  CQName* NewLC(TDesC8& aName, TDesC8& aPrefix, TDesC8& aUri);
       
   106     ~CQName();
       
   107 public:
       
   108     TPtrC8 Name();
       
   109     TPtrC8 QName();
       
   110     TPtrC8 Prefix();
       
   111     TPtrC8 Uri();
       
   112 
       
   113 private:
       
   114     CQName();
       
   115     void ConstructL(TDesC8& aName, TDesC8& aPrefix, TDesC8& aUri);
       
   116     HBufC8* iName;
       
   117     HBufC8* iQName;
       
   118     HBufC8* iPrefix;
       
   119     HBufC8* iUri;
       
   120 };
       
   121 #endif //C_PRIMITIVE_ASSERTION_H