1.1 --- a/epoc32/include/vprop.h Tue Mar 16 16:12:26 2010 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,697 +0,0 @@
1.4 -// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 -// All rights reserved.
1.6 -// This component and the accompanying materials are made available
1.7 -// 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.8 -// which accompanies this distribution, and is available
1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 -//
1.11 -// Initial Contributors:
1.12 -// Nokia Corporation - initial contribution.
1.13 -//
1.14 -// Contributors:
1.15 -//
1.16 -// Description:
1.17 -//
1.18 -
1.19 -#ifndef __VPROP_H__
1.20 -#define __VPROP_H__
1.21 -
1.22 -#ifndef __E32BASE_H__
1.23 -#include <e32base.h>
1.24 -#endif
1.25 -
1.26 -#ifndef __BADESCA_H__
1.27 -#include <badesca.h>
1.28 -#endif
1.29 -
1.30 -#ifndef __S32STRM_H__
1.31 -#include <s32strm.h>
1.32 -#endif
1.33 -
1.34 -#ifndef __E32MATH_H__
1.35 -#include <e32math.h>
1.36 -#endif
1.37 -
1.38 -
1.39 -#ifndef __VUID_H__
1.40 -#include <vuid.h>
1.41 -#endif
1.42 -
1.43 -#ifndef __VTOKEN_H__
1.44 -#include <vtoken.h>
1.45 -#endif
1.46 -
1.47 -#ifndef __VUTIL_H__
1.48 -#include <vutil.h>
1.49 -#endif
1.50 -
1.51 -#ifndef __S32FILE_H__
1.52 -#include <s32file.h>
1.53 -#endif
1.54 -//
1.55 -
1.56 -class CParserProperty;
1.57 -class CVersitParser;
1.58 -class MVersitPlugIn;
1.59 -class CParserPropertyValueCDesCArray;
1.60 -
1.61 -const TInt KRandomnumberlen = 5;
1.62 -const TInt KMaxGeneratedfilenamelen =16;
1.63 -//
1.64 -// CParserParam
1.65 -//
1.66 -
1.67 -class CParserParam : public CBase
1.68 -/** A Versit property parameter.
1.69 -
1.70 -A property parameter consists of a name and optionally a value, both in descriptor
1.71 -form. Parser properties (class CParserProperty) may own one or more property
1.72 -parameters.
1.73 -
1.74 -Note:
1.75 -
1.76 -The private parameter name and value members are stored as narrow (8-bit)
1.77 -rather than 16-bit Unicode descriptors.
1.78 -
1.79 -However, certain member functions take or return a Unicode value,
1.80 -for the purpose of backwards compatibility. In this case a simple conversion
1.81 -takes place: this ignores the top 8 bits (for Unicode -> Narrow) or adds zero
1.82 -for the top 8-bits (for Narrow->Unicode).
1.83 -@publishedAll
1.84 -@released
1.85 -*/
1.86 - {
1.87 -public:
1.88 - IMPORT_C static CParserParam* NewL(const TDesC8& aName, const TDesC8& aValue);
1.89 - IMPORT_C static CParserParam* NewL(const TDesC8& aName, const TDesC& aValue);
1.90 - IMPORT_C ~CParserParam();
1.91 - IMPORT_C void SetValueL(const TDesC8& aValue);
1.92 - IMPORT_C void SetValueL(HBufC8* aValue);
1.93 - IMPORT_C TInt ExternalizeL(RWriteStream& aStream) const;
1.94 - IMPORT_C TPtrC8 Name() const;
1.95 - IMPORT_C TPtrC8 Value() const;
1.96 - IMPORT_C HBufC* ValueL() const;
1.97 - IMPORT_C TInt ExternalizeL(RWriteStream& aStream, TInt& aLengthOutput, CVersitParser* aVersitParser) const;
1.98 -private:
1.99 - CParserParam(HBufC8* aName, HBufC8* aValue);
1.100 -private:
1.101 - HBufC8* iParamName;
1.102 - HBufC8* iValue;
1.103 - };
1.104 -
1.105 -//
1.106 -// TVersitDateTime
1.107 -//
1.108 -
1.109 -class TVersitDateTime
1.110 -/** Defines a Versit date and time.
1.111 -
1.112 -This class is used throughout Versit to represent the date and time. It uses
1.113 -a TDateTime object to store the date/time value and records whether this value
1.114 -is local to the machine which originated the vCard, local to the machine on
1.115 -which the code is running, or universal time (UTC).
1.116 -
1.117 -The Year(), Month() and Day() member functions of class TDateTime may be used
1.118 -to extract the date and time components from the TVersitDateTime::iDateTime.
1.119 -@publishedAll
1.120 -@released */
1.121 - {
1.122 -public:
1.123 - /** Relative time flags. */
1.124 - enum TRelativeTime
1.125 - {
1.126 - /** Time is stored in UTC. */
1.127 - EIsUTC,
1.128 - /** Time is local to the machine which originated the vCard. */
1.129 - EIsVCardLocal,
1.130 - /** Time is local to the machine on which the code is running. */
1.131 - EIsMachineLocal,
1.132 - /** Unused. */
1.133 - EIsCorrect
1.134 - };
1.135 - IMPORT_C TVersitDateTime(const TDateTime& aDateTime,TRelativeTime aRelativeTime);
1.136 -
1.137 - /** Date/time flags.
1.138 - @publishedAll
1.139 - @deprecated since 9.1*/
1.140 - enum TVersitDateTimeFlags
1.141 - {
1.142 - EExportNullFlag=0,
1.143 - /** Indicates whether the relative time is to be externalized along with the date/time
1.144 - value.
1.145 -
1.146 - The flag is set to 'EExportNullFlag' by default.
1.147 -
1.148 - This is only implemented (by CParserTimePropertyValue::EncodeVersitDateTimeL())
1.149 - if the date/time is universal. When the flag is set, the externalised value
1.150 - is followed by the token, KVersitTokenUniversalTime. */
1.151 - EExportTimeZoneDesignator=0x01,
1.152 - EExportLeaveAsLocalTime=0x02
1.153 - };
1.154 - /**
1.155 - @deprecated since 9.1
1.156 - */
1.157 - inline void SetFlag(TVersitDateTimeFlags aFlag) { iFlags |= aFlag; }
1.158 - /**
1.159 - @deprecated since 9.1
1.160 - */
1.161 - inline TBool IsFlagSet(TVersitDateTimeFlags aFlag) const { return iFlags & aFlag; }
1.162 - /**
1.163 - @deprecated since 9.1
1.164 - */
1.165 - inline void ClearFlag(TVersitDateTimeFlags aFlag) { iFlags &= ~aFlag; }
1.166 -public:
1.167 - /** The date/time value. */
1.168 - TDateTime iDateTime;
1.169 - /** Specifies whether the time value is local to the machine which originated the
1.170 - vCard, local to the machine on which the code is running, or universal. */
1.171 - TRelativeTime iRelativeTime;
1.172 -private:
1.173 - TInt iFlags;
1.174 - };
1.175 -
1.176 -//
1.177 -// CParserPropertyValue
1.178 -//
1.179 -class CParserPropertyValue : public CBase
1.180 -/** Abstract base class for all property values.
1.181 -
1.182 -Defines a pure virtual ExternalizeL() function which should write out the
1.183 -property value to a stream.
1.184 -
1.185 -The type of derived class is returned by the Uid() function; the UID value is
1.186 -specified on construction.
1.187 -
1.188 -The other functions relate to the character set, encoding format and plug-in
1.189 -used during externalising.
1.190 -@publishedAll
1.191 -@released
1.192 -*/
1.193 - {
1.194 -public:
1.195 - /** Externalises the property value to a write stream.
1.196 -
1.197 - Implementations of this function are invoked by the parser's ExternalizeL()
1.198 - function.
1.199 -
1.200 - @param aStream Stream to which the property value is externalised.
1.201 - @param aEncodingCharset The character set and encoding information.
1.202 - @param aLengthOutput The amount of text that has been outputted so far on the
1.203 - line (for the property name), which may need to be taken into account when
1.204 - calculating if and where any line break should occur. */
1.205 - virtual void ExternalizeL(RWriteStream& aStream,const Versit::TEncodingAndCharset& aEncodingCharset,TInt aLengthOutput)=0;
1.206 - IMPORT_C virtual TBool IsAsciiCharacterSetSufficient();
1.207 - IMPORT_C virtual void EncodeL(CBufBase* aTarget,const TDesC8& aSource,const TUid& aEncoding) const;
1.208 - IMPORT_C virtual TBool SupportsInterface(const TUid& /*aInterfaceUid*/) const;
1.209 - inline TUid Uid() const;
1.210 - inline void SetPlugIn(MVersitPlugIn* aPlugIn);
1.211 -protected:
1.212 - IMPORT_C CParserPropertyValue(const TUid& aPropertyValueUid);
1.213 - IMPORT_C void FoldEncodeAndWriteValueToStreamL(RWriteStream& aStream, const TDesC& aValue
1.214 - ,const Versit::TEncodingAndCharset& aEncodingCharset,TInt& aLengthOutput) const;
1.215 - IMPORT_C void FoldEncodeAndWriteValueToStreamL(RWriteStream& aStream, const CDesCArray* aValueArray
1.216 - ,const Versit::TEncodingAndCharset& aEncodingCharset,TInt& aLengthOutput) const;
1.217 - IMPORT_C void FoldAndWriteValueToStreamL(RWriteStream& aStream, const TDesC& aValue
1.218 - ,const Versit::TEncodingAndCharset& aEncodingCharset,TInt& aLengthOutput) const;
1.219 - IMPORT_C static void Append(TDes16& aTarget,TDesC8& aSource);
1.220 -protected:
1.221 - inline MVersitPlugIn* PlugIn();
1.222 -
1.223 -private:
1.224 - TUid iPropertyValueTypeUid;
1.225 - MVersitPlugIn* iPlugIn;
1.226 - };
1.227 -
1.228 -//
1.229 -// CParserTimePropertyValue
1.230 -//
1.231 -
1.232 -class CVersitDaylight;
1.233 -
1.234 -class CParserTimePropertyValue : public CParserPropertyValue
1.235 -/** Abstract base class for all of the date/time property value classes.
1.236 -
1.237 -Provides date/time conversion functions between machine-local and universal
1.238 -time.
1.239 -
1.240 -The date/time property value classes are CParserPropertyValueAlarm,
1.241 -CParserPropertyValueDate, CParserPropertyValueDateTime,
1.242 -CParserPropertyValueMultiDateTime, CParserPropertyValueDaylight and
1.243 -CParserPropertyValueRecurrence.
1.244 -@publishedAll
1.245 -@released
1.246 -*/
1.247 - {
1.248 -public:
1.249 - /** This is implemented, where applicable, to convert date/time
1.250 - values into universal time.
1.251 -
1.252 - The date/time is checked against the daylight saving information provided
1.253 - in aDaylight. If it falls inside the daylight saving period then the daylight
1.254 - saving offset is subtracted from the time to convert it to universal time.
1.255 - Otherwise aIncrement is added to the date/time of the alarm to convert it
1.256 - to universal time.
1.257 -
1.258 - Note that the daylight savings offset will adjust the time both for the daylight
1.259 - saving and for the time zone.
1.260 -
1.261 - The function has no effect if it date/times are already stored in universal
1.262 - time.
1.263 -
1.264 - If aDaylight is a NULL pointer then aIncrement is used.
1.265 -
1.266 - @param aIncrement A time interval in seconds which represents the time zone's
1.267 - offset from universal time.
1.268 - @param aDaylight Pointer to the specification for daylight saving. If the alarm's
1.269 - time value is within the period for daylight saving, the value is modified
1.270 - by the daylight saving offset (which accounts for both the time zone and daylight
1.271 - saving rule).
1.272 - @deprecated since 9.1
1.273 - */
1.274 - IMPORT_C virtual void ConvertAllDateTimesToUTCL(const TTimeIntervalSeconds& aIncrement,const CVersitDaylight* aDaylight)=0;
1.275 - /** Pure virtual function which is implemented, where applicable, to convert the
1.276 - date/time property value into machine-local time.
1.277 -
1.278 - This process involves adjusting the date/time value by the offset in aIncrement.
1.279 -
1.280 - The function has no effect if the value is already stored as machine-local
1.281 - time.
1.282 -
1.283 - The universal date/times are assumed to have been corrected for any daylight saving
1.284 - rule in effect.
1.285 -
1.286 - @param aIncrement A time interval which represents the number of seconds which
1.287 - is to be added to the date/time value. This should normally be the universal
1.288 - time offset for the machine's locale.
1.289 - @deprecated since 9.1 */
1.290 - IMPORT_C virtual void ConvertAllUTCDateTimesToMachineLocalL(const TTimeIntervalSeconds& aIncrement)=0;
1.291 - static void ConvertDateTime(TDateTime& aDateTime,const TTimeIntervalSeconds& aIncrement,const CVersitDaylight* aDaylight,TBool aTo);
1.292 -public: //from CParserPropertyValue
1.293 - IMPORT_C virtual TBool SupportsInterface(const TUid& aInterfaceUid) const;
1.294 -protected:
1.295 - IMPORT_C CParserTimePropertyValue(const TUid& aPropertyValueUid);
1.296 - IMPORT_C void ConvertDateTime(TDateTime* aDateTime,const TTimeIntervalSeconds& aIncrement,const CVersitDaylight* aDaylight);
1.297 - IMPORT_C void EncodeVersitDateTimeL(TDes8& aBuf,const TVersitDateTime& aDateTime,TBool aEncodeTime=ETrue) const;
1.298 - IMPORT_C void EncodeTimePeriodL(TDes8& aBuf,const TTime& aTimePeriod) const;
1.299 - };
1.300 -
1.301 -//
1.302 -// CParserPropertyValueHBufC
1.303 -//
1.304 -class CParserPropertyValueHBufC : public CParserPropertyValue
1.305 -/** A heap descriptor property value parser.
1.306 -
1.307 -Many properties are stored using this class. Examples are vCard e-mails and
1.308 -vCalendar locations.
1.309 -
1.310 -The UID for a heap descriptor property value is KVersitPropertyHBufCUid.
1.311 -@publishedAll
1.312 -@released
1.313 -*/
1.314 - {
1.315 -public:
1.316 - IMPORT_C static CParserPropertyValueHBufC* NewL(const TDesC& aValue);
1.317 - IMPORT_C CParserPropertyValueHBufC(HBufC16* aValue);
1.318 - IMPORT_C ~CParserPropertyValueHBufC();
1.319 - IMPORT_C TPtrC Value() const;
1.320 - IMPORT_C HBufC* TakeValueOwnership();
1.321 - IMPORT_C CParserPropertyValueCDesCArray* TreatAsArrayPropertyLC(const CParserProperty& aOwningProperty) const;
1.322 -public: // from CParserPropertyValue
1.323 - IMPORT_C TBool IsAsciiCharacterSetSufficient();
1.324 - IMPORT_C void ExternalizeL(RWriteStream& aStream,const Versit::TEncodingAndCharset& aEncodingCharset,TInt aLengthOutput);
1.325 -private:
1.326 - CParserPropertyValueHBufC();
1.327 - void ConstructL(const TDesC& aValue);
1.328 -protected:
1.329 - HBufC* iValue;
1.330 - };
1.331 -
1.332 -//
1.333 -// CParserPropertyValueBinary
1.334 -//
1.335 -
1.336 -class CParserPropertyValueBinary : public CParserPropertyValue
1.337 -/** A binary property value parser.
1.338 -
1.339 -It is used to store logos, photos, alarm content and binary attachment as binary values.
1.340 -
1.341 -The UID for a binary property value is KVersitPropertyBinaryUid.
1.342 -@publishedAll
1.343 -@released
1.344 -*/
1.345 - {
1.346 -public:
1.347 - IMPORT_C static CParserPropertyValueBinary* NewL(const TDesC8& aValue);
1.348 - IMPORT_C static CParserPropertyValueBinary* NewLC(const TDesC8& aValue);
1.349 -
1.350 - inline CParserPropertyValueBinary(CBufSeg& aValue);
1.351 - IMPORT_C ~CParserPropertyValueBinary();
1.352 - IMPORT_C const CBufSeg* Value() const;
1.353 -public: // from CParserPropertyValue
1.354 - IMPORT_C void ExternalizeL(RWriteStream& aStream,const Versit::TEncodingAndCharset& aEncodingCharset,TInt /*aLengthOutput*/);
1.355 -protected:
1.356 - inline CParserPropertyValueBinary();
1.357 - void ConstructL(const TDesC8& aValue);
1.358 - void ExternalizeL(RWriteStream& aStream, const Versit::TEncodingAndCharset& aEncodingCharset, TInt aLengthOutput, RReadStream& aReadStream);
1.359 -
1.360 -protected:
1.361 - CBufSeg* iValue;
1.362 - };//
1.363 -
1.364 -NONSHARABLE_CLASS(CParserPropertyValueBinaryFile) : public CParserPropertyValueBinary
1.365 -/** A file property value parser.
1.366 -
1.367 -It is used to store a file handle so that the binary data can be read through the handle when exporting.
1.368 -It is not used when importing.
1.369 -The UID for a binary property value is KVersitPropertyBinaryUid.
1.370 -@publishedPartner
1.371 -@prototype
1.372 -*/
1.373 - {
1.374 -public:
1.375 - IMPORT_C static CParserPropertyValueBinaryFile* NewL(const RFile& aFileHandle);
1.376 - IMPORT_C ~CParserPropertyValueBinaryFile();
1.377 -public: // from CParserPropertyValue
1.378 - void ExternalizeL(RWriteStream& aStream,const Versit::TEncodingAndCharset& aEncodingCharset,TInt aLengthOutput);
1.379 -
1.380 -private:
1.381 - void ConstructL(const RFile& aFileHandle);
1.382 -private:
1.383 - RFileReadStream iFileStream;
1.384 - };
1.385 -
1.386 -// CParserPropertyValueCDesCArray
1.387 -//
1.388 -class CParserPropertyValueCDesCArray : public CParserPropertyValue
1.389 -/** A property value parser which stores an array of descriptors.
1.390 -
1.391 -Can be used by both vCards and vCalendars, for example to store a postal address
1.392 -or information about an organisation.
1.393 -
1.394 -The UID for a descriptor array property value is KVersitPropertyCDesCArrayUid.
1.395 -@publishedAll
1.396 -@released
1.397 -*/
1.398 - {
1.399 -public:
1.400 - IMPORT_C CParserPropertyValueCDesCArray(CDesCArray* aValue);
1.401 - IMPORT_C ~CParserPropertyValueCDesCArray();
1.402 - inline CDesCArray* Value() const;
1.403 - IMPORT_C TBool IsPresent(const TDesC& aValue) const;
1.404 -public: // from CParserPropertyValue
1.405 - IMPORT_C TBool IsAsciiCharacterSetSufficient();
1.406 - IMPORT_C void ExternalizeL(RWriteStream& aStream,const Versit::TEncodingAndCharset& aEncodingCharset,TInt aLengthOutput);
1.407 -protected:
1.408 - CDesCArray* iValue;
1.409 - };
1.410 -
1.411 -//
1.412 -// CParserPropertyValueTimeZone
1.413 -//
1.414 -
1.415 -class CParserPropertyValueTimeZone: public CParserPropertyValue
1.416 -/** A time zone property value parser.
1.417 -
1.418 -Stores and externalises a property value which represents the time zone information
1.419 -for a vCard or vCalendar.
1.420 -
1.421 -The time zone is specified as the universal time offset. This is a time interval
1.422 -which is a positive or negative number of seconds from universal time. Time
1.423 -zones east of universal time have positive numbers. Time zones west of universal
1.424 -time have negative numbers.
1.425 -
1.426 -The UID for a time zone property value is KVersitPropertyTimeZoneUid.
1.427 -@publishedAll
1.428 -@released
1.429 -*/
1.430 - {
1.431 -public:
1.432 - static void EncodeTimeZone(TDes8& aBuf,TTimeIntervalSeconds iValue);
1.433 - IMPORT_C CParserPropertyValueTimeZone(TTimeIntervalSeconds aValue);
1.434 - inline TTimeIntervalSeconds Value() const;
1.435 -public: // from CParserPropertyValue
1.436 - IMPORT_C void ExternalizeL(RWriteStream& aStream,const Versit::TEncodingAndCharset& aEncodingCharset,TInt /*aLengthOutput*/);
1.437 -protected:
1.438 - TTimeIntervalSeconds iValue;
1.439 - };
1.440 -
1.441 -//
1.442 -// CVersitDaylight
1.443 -//
1.444 -class CVersitDaylight : public CBase
1.445 -/** Universal time offset information, including the daylight savings offset.
1.446 -
1.447 -This class deals with the daylight saving offset: a one hour offset that occurs
1.448 -in many countries during part of the year. This offset needs to be taken into
1.449 -account when converting Versit times (TVersitDateTimes) between universal
1.450 -and machine-local times.
1.451 -
1.452 -This class stores information about the offset, including its length in seconds,
1.453 -when it takes effect and the standard time designations.
1.454 -
1.455 -Note that the universal offset (iOffset) is the sum of the daylight saving
1.456 -offset and any time zone offset, as it is the absolute offset from GMT.
1.457 -
1.458 -An instance of this class is owned by the CParserPropertyValueDaylight class.
1.459 -@publishedAll
1.460 -@released
1.461 -*/
1.462 - {
1.463 -public:
1.464 - IMPORT_C static CVersitDaylight* NewL(TBool aSavings, TTimeIntervalSeconds aOffset, TVersitDateTime* aStartTime, TVersitDateTime* aEndTime, const TDesC& aStandardDesignation, const TDesC& aDaylightDesignation);
1.465 - IMPORT_C ~CVersitDaylight();
1.466 -private:
1.467 - CVersitDaylight(TBool aSavings, TTimeIntervalSeconds aOffset, TVersitDateTime* aStartTime, TVersitDateTime* aEndTime);
1.468 - void ConstructL(const TDesC& aStandardDesignation, const TDesC& aDaylightDesignation);
1.469 -public:
1.470 - /** A sort key than can be used when sorting an array of properties by start date/time. */
1.471 - TInt64 iStartTimeSortKey;
1.472 - /** The daylight savings flag: this is ETrue if daylight saving is in effect
1.473 - in the locale and EFalse if not. */
1.474 - TBool iSavings;
1.475 - /** The absolute offset from GMT, which is the sum of the time zone and daylight
1.476 - saving offsets (in seconds). */
1.477 - TTimeIntervalSeconds iOffset;
1.478 - /** The date/time at which the period for daylight saving begins. */
1.479 - TVersitDateTime* iStartTime;
1.480 - /** The date/time at which the period for daylight saving ends. */
1.481 - TVersitDateTime* iEndTime;
1.482 - /** The standard time designation, e.g. GMT, EST. */
1.483 - HBufC* iStandardDesignation;
1.484 - /** The daylight saving time designation, e.g. BST, EDT. */
1.485 - HBufC* iDaylightDesignation;
1.486 - };
1.487 -
1.488 -//
1.489 -// CParserPropertyValueDaylight
1.490 -//
1.491 -class CParserPropertyValueDaylight : public CParserTimePropertyValue
1.492 -/** A property value parser which contains the daylight savings rule for a vCalendar.
1.493 -
1.494 -The property value is stored using an instance of the CVersitDaylight class.
1.495 -
1.496 -The UID for a daylight savings rule property value is KVersitPropertyDaylightUid.
1.497 -@publishedAll
1.498 -@released
1.499 -*/
1.500 - {
1.501 -public:
1.502 - IMPORT_C CParserPropertyValueDaylight(CVersitDaylight* aValue);
1.503 - IMPORT_C ~CParserPropertyValueDaylight();
1.504 - inline CVersitDaylight* Value() const;
1.505 -public: // from CParserTimePropertyValue
1.506 - IMPORT_C void ConvertAllDateTimesToUTCL(const TTimeIntervalSeconds& aIncrement,const CVersitDaylight* aDaylight);
1.507 - IMPORT_C void ConvertAllUTCDateTimesToMachineLocalL(const TTimeIntervalSeconds& aIncrement);
1.508 -public: // from CParserPropertyValue
1.509 - IMPORT_C void ExternalizeL(RWriteStream& aStream,const Versit::TEncodingAndCharset& aEncodingCharset,TInt aLengthOutput);
1.510 -private:
1.511 - CVersitDaylight* iValue;
1.512 - };
1.513 -
1.514 -//
1.515 -// CParserPropertyValueDateTime
1.516 -//
1.517 -class CParserPropertyValueDateTime : public CParserTimePropertyValue
1.518 -/** A date/time property value parser.
1.519 -
1.520 -The date/time value is contained in a TVersitDateTime object.
1.521 -
1.522 -The UID for a date/time property value is KVersitPropertyDateTimeUid.
1.523 -@publishedAll
1.524 -@released
1.525 -*/
1.526 - {
1.527 -public:
1.528 - IMPORT_C CParserPropertyValueDateTime(TVersitDateTime* aValue);
1.529 - IMPORT_C ~CParserPropertyValueDateTime();
1.530 - inline TVersitDateTime* Value() const;
1.531 -public: // from CParserTimePropertyValue
1.532 - IMPORT_C void ConvertAllDateTimesToUTCL(const TTimeIntervalSeconds& aIncrement,const CVersitDaylight* aDaylight);
1.533 - IMPORT_C void ConvertAllUTCDateTimesToMachineLocalL(const TTimeIntervalSeconds& aIncrement);
1.534 -public: // from CParserPropertyValue
1.535 - IMPORT_C void ExternalizeL(RWriteStream& aStream,const Versit::TEncodingAndCharset& /*aEncodingCharset*/,TInt /*aLengthOutput*/);
1.536 -protected:
1.537 - TVersitDateTime* iValue;
1.538 - };
1.539 -
1.540 -//
1.541 -// CParserPropertyValueDate
1.542 -//
1.543 -class CParserPropertyValueDate : public CParserTimePropertyValue
1.544 -/** A date property value parser.
1.545 -
1.546 -The date value is contained in a TVersitDateTime object.
1.547 -
1.548 -The UID for a date property value is KVersitPropertyDateUid.
1.549 -@publishedAll
1.550 -@released
1.551 -*/
1.552 - {
1.553 -public:
1.554 - IMPORT_C CParserPropertyValueDate(TVersitDateTime* aValue);
1.555 - IMPORT_C ~CParserPropertyValueDate();
1.556 - inline TVersitDateTime* Value() const;
1.557 -public: // from CParserTimePropertyValue
1.558 - IMPORT_C void ConvertAllDateTimesToUTCL(const TTimeIntervalSeconds& /*aIncrement*/,const CVersitDaylight* /*aDaylight*/);
1.559 - IMPORT_C void ConvertAllUTCDateTimesToMachineLocalL(const TTimeIntervalSeconds& /*aIncrement*/);
1.560 -public: // from CParserPropertyValue
1.561 - IMPORT_C void ExternalizeL(RWriteStream& aStream,const Versit::TEncodingAndCharset& aEncodingCharset,TInt /*aLengthOutput*/);
1.562 -private:
1.563 - TVersitDateTime* iValue;
1.564 - };
1.565 -
1.566 -//
1.567 -// CParserPropertyValueMultiDateTime
1.568 -//
1.569 -class CParserPropertyValueMultiDateTime : public CParserTimePropertyValue
1.570 -/** A property value parser which stores a list of date/time values using an array
1.571 -of TVersitDateTime objects.
1.572 -
1.573 -The UID for a multiple date/time property value is KVersitPropertyMultiDateTimeUid.
1.574 -@publishedAll
1.575 -@released
1.576 -*/
1.577 - {
1.578 -public:
1.579 - IMPORT_C CParserPropertyValueMultiDateTime(CArrayPtr<TVersitDateTime>* aValue);
1.580 - IMPORT_C ~CParserPropertyValueMultiDateTime();
1.581 - inline CArrayPtr<TVersitDateTime>* Value() const;
1.582 -public: // from CParserTimePropertyValue
1.583 - IMPORT_C void ConvertAllDateTimesToUTCL(const TTimeIntervalSeconds& aIncrement,const CVersitDaylight* aDaylight);
1.584 - IMPORT_C void ConvertAllUTCDateTimesToMachineLocalL(const TTimeIntervalSeconds& aIncrement);
1.585 -public: // from CParserPropertyValue
1.586 - IMPORT_C void ExternalizeL(RWriteStream& aStream,const Versit::TEncodingAndCharset& /*aEncodingCharset*/,TInt aLengthOutput);
1.587 -protected:
1.588 - CArrayPtr<TVersitDateTime>* iValue;
1.589 - };
1.590 -
1.591 -//
1.592 -// CParserPropertyValueInt
1.593 -//
1.594 -class CParserPropertyValueInt : public CParserPropertyValue
1.595 -/** An integer property value parser.
1.596 -
1.597 -This stores a property value as a signed integer. For example, an employee
1.598 -ID number might be stored using this class.
1.599 -
1.600 -The UID for an integer property value is KVersitPropertyIntUid.
1.601 -@publishedAll
1.602 -@released
1.603 -*/
1.604 - {
1.605 -public:
1.606 - IMPORT_C CParserPropertyValueInt(TInt aValue);
1.607 - inline TInt Value() const;
1.608 -public: // from CParserPropertyValue
1.609 - IMPORT_C void ExternalizeL(RWriteStream& aStream,const Versit::TEncodingAndCharset& aEncodingCharset,TInt /*aLengthOutput*/);
1.610 -protected:
1.611 - TInt iValue;
1.612 - };
1.613 -
1.614 -//
1.615 -// CParserProperty
1.616 -//
1.617 -
1.618 -class CParserProperty : public CBase
1.619 -/** A vCard or vCalendar property.
1.620 -
1.621 -A property consists of a name, an optional value and one or more optional
1.622 -parameters.
1.623 -
1.624 -The name, value and parameters are initialised on construction.
1.625 -
1.626 -Versit properties have the general form:
1.627 -
1.628 -Property Name (; Property Parameter Name(=Property Parameter Value)* : Property
1.629 -Value)
1.630 -
1.631 -where items in brackets are optional and * indicates that the item may be
1.632 -repeated.
1.633 -
1.634 -For instance, TEL; HOME; ENCODING=QUOTED-PRINTABLE; CHARSET=US-ASCII : 01234 567890
1.635 -
1.636 -Here, TEL is the property name; HOME, ENCODING and CHARSET are property parameter
1.637 -names; QUOTED-PRINTABLE and US-ASCII are property parameter values. The component
1.638 -following the colon is the property value.
1.639 -
1.640 -Properties also have a name UID, which set during internalisation of a property
1.641 -and used only during internalisation. It is set by SetNameUid() and is used
1.642 -to allow number comparisons during internalisation. This provides a faster
1.643 -alternative to string comparisons when checking a property to see if it is
1.644 -a significant one (e.g. a begin or binary property). This is the only use
1.645 -of the name UID: it is not used during externalisation of a property.
1.646 -
1.647 -Note that grouped properties are supported by the derived class, CParserGroupedProperty.
1.648 -The vCalender parser does not have property groups, and so stores all properties
1.649 -using this base class, whereas the vCard parser stores all properties using
1.650 -CParserGroupedProperty.
1.651 -@publishedAll
1.652 -@released
1.653 -*/
1.654 - {
1.655 -public:
1.656 - IMPORT_C static CParserProperty* NewL(CParserPropertyValue& aPropertyValue, const TDesC8& aName, CArrayPtr<CParserParam>* aArrayOfParams);
1.657 - IMPORT_C CParserProperty(CArrayPtr<CParserParam>* aArrayOfParams);
1.658 - IMPORT_C ~CParserProperty();
1.659 - IMPORT_C virtual void ExternalizeL(RWriteStream& aStream, CVersitParser* aVersitParser = NULL);
1.660 - IMPORT_C CParserParam* Param(const TDesC8& aParamName) const; // note params can only appear once
1.661 - IMPORT_C void AddParamL(CParserParam* aParam);
1.662 - IMPORT_C void DeleteParam(TDesC8& aParamName);
1.663 - IMPORT_C void SetNameL(const TDesC8& aName);
1.664 - IMPORT_C virtual TBool SupportsInterface(const TUid& /*aInterfaceUid*/) const;
1.665 - IMPORT_C TPtrC8 Name() const;
1.666 - inline void SetValue(CParserPropertyValue* aPropertyValue);
1.667 - inline CParserPropertyValue* Value() const;
1.668 - inline TUid Uid() const;
1.669 - inline void SetNameUid(TUid aUid);
1.670 - inline TUid NameUid() const;
1.671 - inline void SetParamArray(CArrayPtr<CParserParam>* aArrayOfParams);
1.672 -
1.673 -
1.674 - IMPORT_C TBool LoadBinaryValuesFromFilesL(RFs& aFileSession);
1.675 - IMPORT_C TBool SaveBinaryValuesToFilesL(TInt aSizeThreshold,const TDesC& aPath,RFs& aFileSession);
1.676 -protected:
1.677 - IMPORT_C CParserProperty(CParserPropertyValue& aPropertyValue, CArrayPtr<CParserParam>* aArrayOfParams);
1.678 - IMPORT_C static void ConstructSelfL(CParserProperty& aSelf,const TDesC8& aName);
1.679 -
1.680 -public:
1.681 - IMPORT_C CArrayPtr<CParserParam>* ParamArray()const;
1.682 -
1.683 -protected:
1.684 - CParserPropertyValue* iPropertyValue;
1.685 - HBufC8* iPropertyName;
1.686 - TUid iPropertyNameUid;
1.687 - CArrayPtr<CParserParam>* iArrayOfParams;
1.688 -
1.689 -private:
1.690 - friend class CVersitParser;
1.691 - inline HBufC8*& NameBuf();
1.692 - IMPORT_C virtual void Reserved();
1.693 - void ReadBinaryDataL(const CBufSeg* aBufseg_ptr,HBufC8** aBuffer);
1.694 - void GenerateNameAndCreateFileL(RFs& aFileSession,TPtr8 aPropertyName,RFile& aFile,TDes& aFileName);
1.695 -
1.696 - };
1.697 -
1.698 -#include <vprop.inl>
1.699 -
1.700 -#endif