CTzRules Class Reference

#include <vtzrules.h>

Link against: tzclient.lib

class CTzRules : public CBase

Inherits from

Detailed Description

Encapsulates a collection of time zone rules, and includes the period covered by the rules and the standard time offset at the start of that period.

Constructor & Destructor Documentation

~CTzRules ( )

IMPORT_C~CTzRules()

Destructor.

Member Function Documentation

AddRuleL ( TTzRule )

IMPORT_C voidAddRuleL(TTzRuleaRule)

Adds a time zone rule to this set.

Parameters
aRuleThe rule to be added.

CloneL ( )

IMPORT_C CTzRules *CloneL()const

Creates a copy of these timezone rules.

Return Value
A pointer to the CTzRules copy.
Capability
None

ConvertTime ( CVTzActualisedRules &, TTime &, TTzTimeReference )

IMPORT_C TIntConvertTime(CVTzActualisedRules &aRules,
TTime &aTime,
TTzTimeReferenceaTimerRef
)const

Converts between local (wall-clock) and UTC times.

Parameters
aRulesThe actualised rules to use.
aTimeThe time to convert, specified by aTimerRef if the time is in UTC or local time. On return, it will contain the converted time from UTC to local time or vice versa, depending on aTimerRef's value.
aTimerRefWhat aTime is expressed in.
Return Value
KErrNone if successful, otherwise KErrNotSupported or KErrNotFound

ConvertToLocalL ( TTime & )

IMPORT_C voidConvertToLocalL(TTime &aUtcTime)const

Converts the received UTC time to local time.

Parameters
aUtcTimeThe time to convert. On return, this contains the converted time.

ConvertToUtcL ( TTime & )

IMPORT_C voidConvertToUtcL(TTime &aLocalTime)const

Converts the received local time to UTC time.

Parameters
aLocalTimeThe time to convert. On return, this contains the converted time.

CopyL ( const CTzRules & )

IMPORT_C voidCopyL(const CTzRules &aTzRule)

Copy a time zone rule to this time zone rule.

Parameters
aTzRuleA rule to copy from.
Capability
None

Count ( )

IMPORT_C TIntCount()const

Gets the number of time zone rules (TTzRules) in this set.

Return Value
The number of rules.

EndYear ( )

IMPORT_C TIntEndYear()const

Gets the last year in which the time zone rules apply.

Return Value
The year.

ExternalizeL ( RWriteStream & )

IMPORT_C voidExternalizeL(RWriteStream &aStream)const

Externalises time zone rules to a write stream.

Parameters
aStreamStream to which the object should be externalised.
Leave Codes
KErrArgumentif the output stream size is invalid

GetActualisedRulesL ( CVTzActualisedRules & )

IMPORT_C voidGetActualisedRulesL(CVTzActualisedRules &aActRules)const

Get actualised rules for time zone rules.

Parameters
aActRulesActualised rules for time zone rules.

GetOffsetL ( const TTime &, TTzTimeReference )

IMPORT_C TIntGetOffsetL(const TTime &aTime,
TTzTimeReferenceaTimeRef
)const

Calculate the local time offset at the supplied time.

Return Value
local time offset

InitialStdTimeOffset ( )

IMPORT_C TIntInitialStdTimeOffset()const

Gets the initial UTC offset for this set of time zone rules.

Return Value
The offset in minutes.

InternalizeL ( RReadStream & )

IMPORT_C voidInternalizeL(RReadStream &aStream)

Internalizes time zone rules from a read stream.

Parameters
aStreamStream from which the object should be internalised.

IsEqualTo ( const CTzRules & )

IMPORT_C TBoolIsEqualTo(const CTzRules &aRules)const

Compares two sets of timezone rules.

Parameters
aRulesThe timezone rules to compare with.
Return Value
ETrue if the rules are identical. EFalse if not.
Capability
None

NewL ( )

IMPORT_C CTzRules *NewL()[static]

Creates a new time zone rules object.

Return Value
Pointer to the time zone rules.

NewL ( TInt, TInt )

IMPORT_C CTzRules *NewL(TIntaStartYear,
TIntaEndYear
)[static]

Creates a new time zone rules object.

Parameters
aStartYearThe first year in which these time zone rules apply.
aEndYearThe last year in which these time zone rules apply.
Return Value
Pointer to the time zone rules.

NewL ( RReadStream & )

IMPORT_C CTzRules *NewL(RReadStream &aStream)[static]

Creates a new time zone rules object from a stream.

Parameters
aStreamStream with the time zone rules to be used to create a CTzRules object.
Return Value
Pointer to the time zone rules.

RemoveRule ( TInt )

IMPORT_C voidRemoveRule(TIntaIndex)

Removes a time zone rule from this set.

Parameters
aIndexThe index of the rule to be removed.

RulesApply ( const TTime & )

IMPORT_C TBoolRulesApply(const TTime &aTime)const

Queries the time zone rule set to see if they apply to a specified time.

Parameters
aTimeThe time to be checked, using the same time reference used when constructing CTzRules.
Return Value
ETrue if the time zone rules apply to the specified time. EFalse if not.

SetEndYear ( TInt )

IMPORT_C voidSetEndYear(TIntaYear)

Sets the last year in which the time zone rules apply.

Parameters
aYearThe year.

SetInitialStdTimeOffset ( TInt )

IMPORT_C voidSetInitialStdTimeOffset(TIntaOffset)

Sets the initial UTC offset for this set of time zone rules.

Parameters
aOffsetThe offset in minutes.

SetStartYear ( TInt )

IMPORT_C voidSetStartYear(TIntaYear)

Sets the first year in which the time zone rules apply.

Parameters
aYearThe year.

SizeOfObject ( )

IMPORT_C TIntSizeOfObject()const

Get the object size when it is internalize and externalised.

Return Value
the size of thisobject

StartYear ( )

IMPORT_C TIntStartYear()const

Gets the first year in which the time zone rules apply.

Return Value
The year.

operator[] ( TInt )

IMPORT_C TTzRule &operator[](TIntaIndex)

Gets a time zone rule from this set.

Parameters
aIndexThe index of the rule to be fetched.
Return Value
Reference to the time zone rule.