natfw/natfwunsaf_protocols/unsaf_codec/inc/natfwunsafrealmattribute.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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:   
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef CNATFWUNSAFREALMATTRIBUTE_H
       
    22 #define CNATFWUNSAFREALMATTRIBUTE_H
       
    23 
       
    24 #include "natfwunsafattribute.h"
       
    25 
       
    26 /**
       
    27  * Class for REALM attribute.
       
    28  *
       
    29  *  @lib natfwunsafprotocols.lib
       
    30  *  @since S60 3.2
       
    31  */
       
    32 class CNATFWUNSAFRealmAttribute : public CNATFWUNSAFAttribute
       
    33     {
       
    34 public: // Constructors and destructor
       
    35 
       
    36     /**
       
    37     * Decodes a UNSAF attribute from a byte stream.
       
    38     * This version is for lookup table.
       
    39     * @param aByteStream Byte stream, containing attribute type, length and
       
    40     *    value.
       
    41     * @return Decoded UNSAF attribute, ownership is transferred.
       
    42     */
       
    43     static CNATFWUNSAFAttribute* DecodeAttributeL(
       
    44         const TDesC8& aByteStream);
       
    45 
       
    46     /**
       
    47     * Creates a new instance of CNATFWUNSAFRealmAttribute
       
    48     * @pre Realm's length has to be a multiple of 4
       
    49     * @param aRealm Realm
       
    50     * @return A new instance of CNATFWUNSAFRealmAttribute
       
    51     *          ownership is transferred.
       
    52     */
       
    53     IMPORT_C static CNATFWUNSAFRealmAttribute* NewL(
       
    54         const TDesC8& aRealm);
       
    55 
       
    56     /**
       
    57     * Creates a new instance of CNATFWUNSAFRealmAttribute and
       
    58     * pushes it to the CleanupStack.
       
    59     * @pre Realm's length has to be a multiple of 4
       
    60     * @param aRealm Realm
       
    61     * @return A new instance of CNATFWUNSAFRealmAttribute,
       
    62     *          ownership is transferred.
       
    63     */
       
    64     IMPORT_C static CNATFWUNSAFRealmAttribute* NewLC(
       
    65         const TDesC8& aRealm);
       
    66 
       
    67     /**
       
    68     * Destructor, deletes the resources of CNATFWUNSAFRealmAttribute.
       
    69     */
       
    70     ~CNATFWUNSAFRealmAttribute();
       
    71 
       
    72 public: // From CNATFWUNSAFAttribute
       
    73 
       
    74     CNATFWUNSAFAttribute::TType Type() const;
       
    75 
       
    76     HBufC8* EncodeValueL() const;
       
    77 
       
    78 public: // New function
       
    79 
       
    80     /**
       
    81     * Returns the attribute value
       
    82     * @return Attribute value
       
    83     */
       
    84     IMPORT_C const TDesC8& Value() const;
       
    85 
       
    86 private: // Constructors
       
    87 
       
    88     CNATFWUNSAFRealmAttribute();
       
    89 
       
    90     void ConstructL(const TDesC8& aRealm);
       
    91 
       
    92 private: // Data
       
    93 
       
    94     HBufC8* iRealm;
       
    95     };
       
    96 
       
    97 #endif // CNATFWUNSAFREALMATTRIBUTE_H
       
    98 
       
    99