1.1 --- a/epoc32/include/sdptypedtime.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/sdptypedtime.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,143 @@
1.4 -sdptypedtime.h
1.5 +/*
1.6 +* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description:
1.19 +* Name : SdpTypedTime.h
1.20 +* Part of : SDP Codec
1.21 +* Interface : SDK API, SDP Codec API
1.22 +* Version : 1.0
1.23 +*
1.24 +*/
1.25 +
1.26 +
1.27 +
1.28 +#ifndef TSDPTYPEDTIME_H
1.29 +#define TSDPTYPEDTIME_H
1.30 +
1.31 +// INCLUDES
1.32 +#include <e32std.h>
1.33 +#include "_sdpdefs.h"
1.34 +
1.35 +// FORWARD DECLARATIONS
1.36 +class RReadStream;
1.37 +class RWriteStream;
1.38 +
1.39 +// CLASS DECLARATION
1.40 +/**
1.41 + * @publishedAll
1.42 + * @released
1.43 + *
1.44 + * This class implements the typed time element of the Session
1.45 + * Description Protocol.
1.46 + *
1.47 + * The normative reference for correct formatting and values is
1.48 + * draft-ietf-mmusic-sdp-new-14 unless specified otherwise in
1.49 + * member documentation. The implementation supports this normative
1.50 + * reference, but does not enforce it fully.
1.51 + *
1.52 + * @lib sdpcodec.lib
1.53 + */
1.54 +class TSdpTypedTime
1.55 + {
1.56 + public: // enums
1.57 +
1.58 + /** Time units. */
1.59 + enum TUnit
1.60 + {
1.61 + ETimeUnitDays, /** d */
1.62 + ETimeUnitHours, /** h */
1.63 + ETimeUnitMinutes, /** m */
1.64 + ETimeUnitSeconds, /** s */
1.65 + ETimeUnitNone,
1.66 + };
1.67 +
1.68 + public: // Constructors and destructor
1.69 + /**
1.70 + * Constructs a typed time equal to zero and with no time unit set.
1.71 + */
1.72 + IMPORT_C TSdpTypedTime();
1.73 +
1.74 + /**
1.75 + * Constructs a typed time equal to specified value and time unit.
1.76 + *
1.77 + * @param aValue Time value.
1.78 + * @param aUnit Time unit.
1.79 + */
1.80 + IMPORT_C TSdpTypedTime(TInt64 aValue, TUnit aUnit);
1.81 +
1.82 + public: // New functions
1.83 + /**
1.84 + * Compares this instance to another for equality.
1.85 + *
1.86 + * @param aObj Another instance to compare with.
1.87 + * @return ETrue if equal, EFalse if not.
1.88 + */
1.89 + IMPORT_C TBool operator == (const TSdpTypedTime& aObj) const;
1.90 +
1.91 + /**
1.92 + * Sets the typed time value.
1.93 + *
1.94 + * @param aValue Time value.
1.95 + * @param aUnit Time unit.
1.96 + */
1.97 + IMPORT_C void SetValue(TInt64 aValue, TUnit aUnit);
1.98 +
1.99 + public:
1.100 +
1.101 + /**
1.102 + * Externalizes the object to stream
1.103 + *
1.104 + * @param aStream Stream where the object's state will be stored
1.105 + */
1.106 + void ExternalizeL(RWriteStream& aStream) const;
1.107 +
1.108 + /**
1.109 + * Creates object from the stream data
1.110 + *
1.111 + * @param aStream Stream where the object's state will be read
1.112 + * @return Initialized object
1.113 + */
1.114 + static TSdpTypedTime InternalizeL(RReadStream& aStream);
1.115 +
1.116 + /**
1.117 + * Output the field formatted according to SDP syntax and including
1.118 + * the terminating CRLF.
1.119 + *
1.120 + * @param aStream Stream used for output.
1.121 + */
1.122 + void EncodeL(RWriteStream& aStream) const;
1.123 +
1.124 + /**
1.125 + * Construct a new origin field.
1.126 + *
1.127 + * @param aText A string containing a correctly formatted field value
1.128 + * terminated by a CRLF.
1.129 + * @return The new instance.
1.130 + */
1.131 + static TSdpTypedTime DecodeL(const TDesC8& aText);
1.132 +
1.133 + public: // Data
1.134 +
1.135 + /**
1.136 + * @internalComponent
1.137 + */
1.138 + TInt64 iValue;
1.139 +
1.140 + /**
1.141 + * @internalComponent
1.142 + */
1.143 + TInt iUnit;
1.144 +
1.145 + };
1.146 +
1.147 +#endif // TSDPTYPEDTIME_H