PECengine/AttributeLibrary2/SrcWVAttributes/CPEngWVAttributeConstructBase.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2004 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:  Base class for WV attribute constructors.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CPENGWVATTRIBUTECONSTRUCTBASE_H
       
    19 #define CPENGWVATTRIBUTECONSTRUCTBASE_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <E32Base.h>
       
    23 #include "PEngWVCspVersion.h"
       
    24 #include "MPEngPresenceAttrConstructorTypeImp.h"
       
    25 
       
    26 
       
    27 //DATA TYPES
       
    28 
       
    29 /**
       
    30  * Attribute WV CSP name entry.
       
    31  *
       
    32  * @since 3.0
       
    33  */
       
    34 NONSHARABLE_CLASS( TWVCspAttributeNameEntry )
       
    35     {
       
    36 public: //Data
       
    37 
       
    38     //OWN: CSP version id
       
    39     TPEngWVCspVersion   iCspVersion;
       
    40 
       
    41     //OWN: Attribute name for CSP version
       
    42     const TDesC8*   iName;
       
    43 
       
    44     //OWN: Attribute namespace for CSP version
       
    45     const TDesC8*   iNameSpace;
       
    46     };
       
    47 
       
    48 
       
    49 /**
       
    50  * Helper macro for initializing
       
    51  * TWVCspAttributeNameEntry with standard _LIT8.
       
    52  *
       
    53  * @since 3.0
       
    54  */
       
    55 #define LIT_AS_DESC8_PTR(aLit) (reinterpret_cast<TDesC8 const*>(&aLit.iTypeLength))
       
    56 
       
    57 
       
    58 
       
    59 
       
    60 
       
    61 // Class definition
       
    62 
       
    63 /**
       
    64  * Base class for WV attribute constructors.
       
    65  *
       
    66  * @lib PEngAttrLib
       
    67  * @since 3.0
       
    68  */
       
    69 NONSHARABLE_CLASS( CPEngWVAttributeConstructBase ) : public CBase,
       
    70         public MPEngPresenceAttrConstructorTypeImp
       
    71     {
       
    72 public:  // Constructors and destructor
       
    73 
       
    74     /**
       
    75      * Destructor.
       
    76      */
       
    77     virtual ~CPEngWVAttributeConstructBase();
       
    78 
       
    79 
       
    80     /**
       
    81      * C++ default constructor.
       
    82      */
       
    83     CPEngWVAttributeConstructBase( TPEngWVCspVersion aCurrentCspVer,
       
    84                                    const TWVCspAttributeNameEntry* aNameTable,
       
    85                                    TInt aTableCount );
       
    86 
       
    87 
       
    88 
       
    89 public: // Functions from MPEngPresenceAttrConstructorTypeImp
       
    90 
       
    91     /**
       
    92      * From MPEngPresenceAttrConstructorTypeImp.
       
    93      *
       
    94      * @since 3.0
       
    95      */
       
    96     TInt GetProperty( TUint aPropertyName,
       
    97                       TUint aPropertyLevel,
       
    98                       TInt& aProperty ) const;
       
    99     TInt GetProperty( TUint aPropertyName,
       
   100                       TUint aPropertyLevel,
       
   101                       TDes8& aProperty ) const;
       
   102     TInt GetPropertyPtr( TUint aPropertyName,
       
   103                          TUint aPropertyLevel,
       
   104                          TPtrC16& aProperty ) const;
       
   105 
       
   106     TAny* TypeExtension( TUint32 aType );
       
   107 
       
   108     TInt GetCurrentCspName( TPtrC8& aAttributeName,
       
   109                             TPtrC8& aAttributeNameSpace ) const;
       
   110 
       
   111 
       
   112 private: // New helpers
       
   113 
       
   114     /**
       
   115      * Gets the CSP name table index for given protocol version.
       
   116      *
       
   117      * @since 3.0
       
   118      * @param aCspVer The CSP version to get.
       
   119      * @return Valid index or KErrNotFound if
       
   120      * requested protocol isn't supported.
       
   121      */
       
   122     TInt ProtocolNameTableIndex( TPEngWVCspVersion aCspVer ) const;
       
   123 
       
   124 
       
   125 
       
   126 private: //Data
       
   127 
       
   128     //OWN: Current WV CSP version.
       
   129     const TPEngWVCspVersion iCurrentCspVer;
       
   130 
       
   131     //OWN: CSP protocol name table
       
   132     const TWVCspAttributeNameEntry*    iCspNameTable;
       
   133 
       
   134     //OWN:CSP protocol name table entry count
       
   135     const TInt  iCspNameTableCount;
       
   136 
       
   137     };
       
   138 
       
   139 #endif      //CPENGWVATTRIBUTECONSTRUCTBASE_H
       
   140 
       
   141 //  End of File
       
   142