1.1 --- a/epoc32/include/sdptimefield.h Tue Mar 16 16:12:26 2010 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,230 +0,0 @@
1.4 -/*
1.5 -* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 -* All rights reserved.
1.7 -* This component and the accompanying materials are made available
1.8 -* 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.9 -* which accompanies this distribution, and is available
1.10 -* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 -*
1.12 -* Initial Contributors:
1.13 -* Nokia Corporation - initial contribution.
1.14 -*
1.15 -* Contributors:
1.16 -*
1.17 -* Description:
1.18 -* Name : SdpTimeField.h
1.19 -* Part of : SDP Codec
1.20 -* Interface : SDK API, SDP Codec API
1.21 -* Version : 1.0
1.22 -*
1.23 -*/
1.24 -
1.25 -
1.26 -
1.27 -#ifndef CSDPTIMESFIELD_H
1.28 -#define CSDPTIMESFIELD_H
1.29 -
1.30 -// INCLUDES
1.31 -#include <e32base.h>
1.32 -#include <stringpool.h>
1.33 -#include "_sdpdefs.h"
1.34 -
1.35 -// FORWARD DECLARATIONS
1.36 -class RReadStream;
1.37 -class RWriteStream;
1.38 -class CSdpRepeatField;
1.39 -
1.40 -// CLASS DECLARATION
1.41 -/**
1.42 - * @publishedAll
1.43 - * @released
1.44 - *
1.45 - * This class encapsulates the time field and the related zero or
1.46 - * more repeat times fields and an optional time zone adjustment
1.47 - * field of the Session Description Protocol.
1.48 - *
1.49 - * The normative reference for correct formatting and values is
1.50 - * draft-ietf-mmusic-sdp-new-14 unless specified otherwise in
1.51 - * member documentation. The implementation supports this normative
1.52 - * reference, but does not enforce it fully.
1.53 - *
1.54 - * @lib sdpcodec.lib
1.55 - */
1.56 -class CSdpTimeField : public CBase
1.57 - {
1.58 - public: // Constructors and destructor
1.59 - /**
1.60 - * Constructs a time field.
1.61 - *
1.62 - * @param aText A correctly formatted time field value
1.63 - * terminated by a CRLF followed by zero or more repeat
1.64 - * times and zero or one time zone adjustment fields
1.65 - * separeted by a CRLF.
1.66 - * @param aRecurse Flag to specify whether to decode subfields
1.67 - * also (ETrue) or only the time field (EFalse).
1.68 - * @return a new instance.
1.69 - */
1.70 - IMPORT_C static CSdpTimeField * DecodeL(const TDesC8& aText,
1.71 - TBool aRecurse = ETrue);
1.72 -
1.73 - /**
1.74 - * Constructs a time field and adds the pointer to the cleanup stack.
1.75 - *
1.76 - * @param aText A correctly formatted time field value
1.77 - * terminated by a CRLF followed by zero or more repeat
1.78 - * times and zero or one time zone adjustment fields
1.79 - * separeted by a CRLF.
1.80 - * @param aRecurse Flag to specify whether to decode subfields
1.81 - * also (ETrue) or only the time field (EFalse).
1.82 - * @return a new instance.
1.83 - */
1.84 - IMPORT_C static CSdpTimeField * DecodeLC(const TDesC8& aText,
1.85 - TBool aRecurse = ETrue);
1.86 -
1.87 - /**
1.88 - * Constructs a time field.
1.89 - *
1.90 - * @param aStartTime Session start time.
1.91 - * @param aStopTime Session end time that must be
1.92 - * greater than or equal to the start time.
1.93 - * @return a new instance.
1.94 - */
1.95 - IMPORT_C static CSdpTimeField * NewL(const TDesC8& aStartTime,
1.96 - const TDesC8& aStopTime);
1.97 -
1.98 - /**
1.99 - * Constructs a time field and adds the pointer to the cleanup stack.
1.100 - *
1.101 - * @param aStartTime Session start time.
1.102 - * @param aStopTime Session end time that must be
1.103 - * greater than or equal to the start time.
1.104 - * @return a new instance.
1.105 - */
1.106 - IMPORT_C static CSdpTimeField * NewLC(const TDesC8& aStartTime,
1.107 - const TDesC8& aStopTime);
1.108 -
1.109 - /**
1.110 - * Deletes the resources held by the instance.
1.111 - */
1.112 - IMPORT_C ~CSdpTimeField();
1.113 -
1.114 - public: // New functions
1.115 - /**
1.116 - * Outputs the field formatted according to SDP syntax and including
1.117 - * the terminating CRLF. Optionally output also the related repeat
1.118 - * times.
1.119 - *
1.120 - * @param aStream Stream used for output. On return
1.121 - * the stream includes correctly formatted time field with
1.122 - * repeat fields if aRecurse is ETrue.
1.123 - * @param aRecurse Flag to specify whether to output subfields
1.124 - * also (ETrue) or only the time field (EFalse).
1.125 - */
1.126 - IMPORT_C void EncodeL(RWriteStream& aStream, TBool aRecurse = ETrue) const;
1.127 -
1.128 - /**
1.129 - * Creates a new instance that is equal to the target.
1.130 - * Optionally also related repeat times are cloned.
1.131 - *
1.132 - * @param aRecurse Flag to specify whether to clone subfields
1.133 - * also (ETrue) or only the time field (EFalse).
1.134 - * @return a new instance.
1.135 - */
1.136 - IMPORT_C CSdpTimeField * CloneL(TBool aRecurse = ETrue) const;
1.137 -
1.138 - /**
1.139 - * Compares this instance to another for equality. Subfields are
1.140 - * included in comparison if present.
1.141 - *
1.142 - * @param aObj The instance to compare to.
1.143 - * @return ETrue if equal, EFalse if not.
1.144 - */
1.145 - IMPORT_C TBool operator == (const CSdpTimeField & aObj) const;
1.146 -
1.147 - /**
1.148 - * Checks the consistency of the time description and it's subfields.
1.149 - *.
1.150 - * @return ETrue if time description is valid and EFalse if not.
1.151 - */
1.152 - IMPORT_C TBool IsValid() const;
1.153 -
1.154 - /**
1.155 - * Gets the session start time.
1.156 - *
1.157 - * @return The session start time.
1.158 - */
1.159 - IMPORT_C const TDesC8& StartTime() const;
1.160 -
1.161 - /**
1.162 - * Gets the session stop time.
1.163 - *
1.164 - * @return The session stop time.
1.165 - */
1.166 - IMPORT_C const TDesC8& StopTime() const;
1.167 -
1.168 - /**
1.169 - * Sets the session start and stop times.
1.170 - *
1.171 - * @param aStartTime Session start time..
1.172 - * @param aStopTime Session end time that must be
1.173 - * greater than or equal to the start time.
1.174 - * @leave KErrSdpCodecTimeField if start time and stop time are not
1.175 - * correct as defined draft-ietf-mmusic-sdp-new-14.
1.176 - */
1.177 - IMPORT_C void SetTimesL(const TDesC8& aStartTime, const TDesC8& aStopTime);
1.178 -
1.179 - /**
1.180 - * Gets the set of repeat times fields related to this time field.
1.181 - * This array is used directly for element insertion and removal.
1.182 - *
1.183 - * The objects referenced from the array are owned by the media field
1.184 - * instance and must not be deleted. An object can be removed from the
1.185 - * media description by setting the corresponding element to zero. By
1.186 - * doing so, the calling party receives ownership of the removed object.
1.187 - *
1.188 - * @return The set of repeat fields.
1.189 - */
1.190 - IMPORT_C RPointerArray<CSdpRepeatField>& RepeatFields();
1.191 -
1.192 - public:
1.193 - /**
1.194 - * Externalizes the object to stream
1.195 - *
1.196 - * @param aStream Stream where the object's state will be stored
1.197 - */
1.198 - void ExternalizeL(RWriteStream& aStream) const;
1.199 -
1.200 - /**
1.201 - * Creates object from the stream data
1.202 - *
1.203 - * @param aStream Stream where the object's state will be read
1.204 - * @return Initialized object
1.205 - */
1.206 - static CSdpTimeField* InternalizeL(RReadStream& aStream);
1.207 -
1.208 - /**
1.209 - * Creates object from the stream data.
1.210 - * Does the "2nd phase construction" of internalization.
1.211 - *
1.212 - * @param aStream Stream where the object's state will be read
1.213 - */
1.214 - void DoInternalizeL(RReadStream& aStream);
1.215 -
1.216 - private:
1.217 - CSdpTimeField();
1.218 -
1.219 - void ConstructL(const TDesC8& aText, TBool aRecurse=ETrue);
1.220 - void ConstructL(const TDesC8& aStartTime, const TDesC8& aStopTime);
1.221 -
1.222 - TBool RepeatFieldsCompare(const CSdpTimeField& aObj) const;
1.223 -
1.224 - private: // Data
1.225 - HBufC8* iStartTime;
1.226 - HBufC8* iStopTime;
1.227 - RPointerArray<CSdpRepeatField> iRFields;
1.228 - RStringPool iStringPool;
1.229 -
1.230 - __DECLARE_TEST;
1.231 - };
1.232 -
1.233 -#endif // CSDPTIMESFIELD_H