natfw/natfwunsaf_protocols/unsaf_codec/inc/natfwunsaftimervalattribute.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 CNATFWUNSAFTIMERVALATTRIBUTE_H
       
    22 #define CNATFWUNSAFTIMERVALATTRIBUTE_H
       
    23 
       
    24 // INCLUDES
       
    25 #include "natfwunsafattribute.h"
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 
       
    29 // CLASS DECLARATION
       
    30 /**
       
    31  * Class for NATFWUNSAF TIMER_VAL attribute.
       
    32  */
       
    33 class CNATFWUNSAFTimerValAttribute : public CNATFWUNSAFAttribute
       
    34     {
       
    35 public: // Constructors and destructor
       
    36     /**
       
    37     * Creates a new instance of CNATFWUNSAFTimerValAttribute
       
    38     * @param aTimerVal TimerVal in milliseconds
       
    39     * @return A new instance of CNATFWUNSAFTimerValAttribute
       
    40     *          ownership is transferred.
       
    41     */
       
    42     IMPORT_C static CNATFWUNSAFTimerValAttribute*
       
    43         NewL(TUint aTimerVal);
       
    44 
       
    45     /**
       
    46     * Creates a new instance of CNATFWUNSAFTimerValAttribute and
       
    47     * pushes it to the CleanupStack.
       
    48     * @param aTimerVal TimerVal in milliseconds
       
    49     * @return A new instance of CNATFWUNSAFTimerValAttribute,
       
    50     *          ownership is transferred.
       
    51     */
       
    52     IMPORT_C static CNATFWUNSAFTimerValAttribute*
       
    53         NewLC(TUint aTimerVal);
       
    54 
       
    55     /**
       
    56     * Decodes a UNSAF attribute from a byte stream.
       
    57     * This version is for lookup table.
       
    58     * @param aByteStream Byte stream, containing attribute type, length and
       
    59     *    value.
       
    60     * @return Decoded UNSAF attribute, ownership is transferred.
       
    61     */
       
    62     static CNATFWUNSAFAttribute* DecodeAttributeL(
       
    63         const TDesC8& aByteStream);
       
    64 
       
    65     /**
       
    66     * Destructor, deletes the resources of CNATFWUNSAFTimerValAttribute.
       
    67     */
       
    68     ~CNATFWUNSAFTimerValAttribute();
       
    69 
       
    70 public: // From CNATFWUNSAFAttribute
       
    71 
       
    72     CNATFWUNSAFAttribute::TType Type() const;
       
    73 
       
    74     HBufC8* EncodeValueL() const;
       
    75 
       
    76 public: // New functions
       
    77 
       
    78     /**
       
    79     * Returns the TimerVal.
       
    80     * @return TimerVal
       
    81     */
       
    82     IMPORT_C TUint TimerVal() const;
       
    83 
       
    84 
       
    85 private:
       
    86 
       
    87     enum TEncodedValue
       
    88         {
       
    89         //Size in bytes of the attribute value
       
    90         EAttributeValueSize = 4
       
    91         };
       
    92 
       
    93 private: // Constructors
       
    94 
       
    95     CNATFWUNSAFTimerValAttribute(TUint aTimerVal);
       
    96 
       
    97 private: // Data
       
    98 
       
    99     TUint iTimerVal;
       
   100 
       
   101     };
       
   102 
       
   103 #endif // CNATFWUNSAFTIMERVALATTRIBUTE_H
       
   104 
       
   105