natfw/natfwunsaf_protocols/unsaf_codec/inc/natfwunsafconnectstatattribute.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 CNATFWUNSAFCONNECTSTATATTRIBUTE_H
       
    22 #define CNATFWUNSAFCONNECTSTATATTRIBUTE_H
       
    23 
       
    24 #include "natfwunsafattribute.h"
       
    25 
       
    26 /**
       
    27  * Class for CONNECT-STAT attribute.
       
    28  *
       
    29  *  @lib natfwunsafprotocols.lib
       
    30  *  @since S60 3.2
       
    31  */
       
    32 class CNATFWUNSAFConnectStatAttribute : public CNATFWUNSAFAttribute
       
    33     {
       
    34 
       
    35 public: // Enumerations
       
    36 
       
    37     enum TStatus
       
    38         {
       
    39         EListen           = 0x00000000,
       
    40         EEstablished      = 0x00000001,
       
    41         EClosed           = 0x00000002
       
    42         };
       
    43 
       
    44 public: // Constructors and destructor
       
    45     /**
       
    46     * Creates a new instance of CNATFWUNSAFConnectStatAttribute
       
    47     * @param aStatus Status of the connection
       
    48     * @return A new instance of CNATFWUNSAFConnectStatAttribute
       
    49     *          ownership is transferred.
       
    50     */
       
    51     IMPORT_C static CNATFWUNSAFConnectStatAttribute*
       
    52         NewL(TStatus aStatus);
       
    53 
       
    54     /**
       
    55     * Creates a new instance of CNATFWUNSAFConnectStatAttribute
       
    56     * @param aStatus Status of the connection
       
    57     * @return A new instance of CNATFWUNSAFConnectStatAttribute
       
    58     *          ownership is transferred.
       
    59     */
       
    60     IMPORT_C static CNATFWUNSAFConnectStatAttribute*
       
    61         NewLC(TStatus aStatus);
       
    62 
       
    63     /**
       
    64     * Decodes a UNSAF attribute from a byte stream.
       
    65     * This version is for lookup table.
       
    66     * @param aByteStream Byte stream, containing attribute type, length and
       
    67     *    value.
       
    68     * @return Decoded UNSAF attribute, ownership is transferred.
       
    69     */
       
    70     static CNATFWUNSAFAttribute* DecodeAttributeL(
       
    71         const TDesC8& aByteStream);
       
    72 
       
    73     /**
       
    74     * Destructor, deletes the resources of
       
    75     * CNATFWUNSAFConnectStatAttribute.
       
    76     */
       
    77     ~CNATFWUNSAFConnectStatAttribute();
       
    78 
       
    79 public: // From CNATFWUNSAFAttribute
       
    80 
       
    81     CNATFWUNSAFAttribute::TType Type() const;
       
    82     
       
    83     HBufC8* EncodeValueL() const;
       
    84 
       
    85 public: // New functions
       
    86 
       
    87     IMPORT_C CNATFWUNSAFConnectStatAttribute::TStatus 
       
    88         ConnectionStatus() const;
       
    89 
       
    90 private:
       
    91 
       
    92     enum TEncodedValue
       
    93         {
       
    94         //Size in bytes of the attribute value
       
    95         EAttributeValueSize = 4,
       
    96         };
       
    97 
       
    98 private: // Constructors
       
    99 
       
   100     CNATFWUNSAFConnectStatAttribute();
       
   101 
       
   102     void ConstructL(TStatus aStatus);
       
   103 
       
   104 private: // Data
       
   105 
       
   106     TStatus iStatus;
       
   107 
       
   108     };
       
   109 
       
   110 #endif // CNATFWUNSAFCONNECTSTATATTRIBUTE_H
       
   111 
       
   112