CTzRules Class Reference

#include <mw/vtzrules.h>

Link against: tzclient.lib

class CTzRules : public CBase

Inherits from

  • CTzRules

    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.

    ParameterDescription
    aRuleThe rule to be added.

    CloneL ( )

    IMPORT_C CTzRules *CloneL()const

    Creates a copy of these timezone rules.

    capability
    None

    Returns: A pointer to the CTzRules copy.

    ConvertTime ( CVTzActualisedRules &, TTime &, TTzTimeReference )

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

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

    ParameterDescription
    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.

    Returns: KErrNone if successful, otherwise KErrNotSupported or KErrNotFound

    ConvertToLocalL ( TTime & )

    IMPORT_C voidConvertToLocalL(TTime &aUtcTime)const

    Converts the received UTC time to local time.

    ParameterDescription
    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.

    ParameterDescription
    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.

    capability
    None
    ParameterDescription
    aTzRuleA rule to copy from.

    Count ( )

    IMPORT_C TIntCount()const

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

    Returns: The number of rules.

    EndYear ( )

    IMPORT_C TIntEndYear()const

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

    Returns: The year.

    ExternalizeL ( RWriteStream & )

    IMPORT_C voidExternalizeL(RWriteStream &aStream)const

    Externalises time zone rules to a write stream.

    leave
    KErrArgument if the output stream size is invalid
    ParameterDescription
    aStreamStream to which the object should be externalised.

    GetActualisedRulesL ( CVTzActualisedRules & )

    IMPORT_C voidGetActualisedRulesL(CVTzActualisedRules &aActRules)const

    Get actualised rules for time zone rules.

    ParameterDescription
    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.

    Returns: local time offset

    InitialStdTimeOffset ( )

    IMPORT_C TIntInitialStdTimeOffset()const

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

    Returns: The offset in minutes.

    InternalizeL ( RReadStream & )

    IMPORT_C voidInternalizeL(RReadStream &aStream)

    Internalizes time zone rules from a read stream.

    ParameterDescription
    aStreamStream from which the object should be internalised.

    IsEqualTo ( const CTzRules & )

    IMPORT_C TBoolIsEqualTo(const CTzRules &aRules)const

    Compares two sets of timezone rules.

    capability
    None
    ParameterDescription
    aRulesThe timezone rules to compare with.

    Returns: ETrue if the rules are identical. EFalse if not.

    NewL ( )

    IMPORT_C CTzRules *NewL()[static]

    Creates a new time zone rules object.

    Returns: Pointer to the time zone rules.

    NewL ( TInt, TInt )

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

    Creates a new time zone rules object.

    ParameterDescription
    aStartYearThe first year in which these time zone rules apply.
    aEndYearThe last year in which these time zone rules apply.

    Returns: 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.

    ParameterDescription
    aStreamStream with the time zone rules to be used to create a CTzRules object.

    Returns: Pointer to the time zone rules.

    RemoveRule ( TInt )

    IMPORT_C voidRemoveRule(TIntaIndex)

    Removes a time zone rule from this set.

    ParameterDescription
    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.

    ParameterDescription
    aTimeThe time to be checked, using the same time reference used when constructing CTzRules.

    Returns: 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.

    ParameterDescription
    aYearThe year.

    SetInitialStdTimeOffset ( TInt )

    IMPORT_C voidSetInitialStdTimeOffset(TIntaOffset)

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

    ParameterDescription
    aOffsetThe offset in minutes.

    SetStartYear ( TInt )

    IMPORT_C voidSetStartYear(TIntaYear)

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

    ParameterDescription
    aYearThe year.

    SizeOfObject ( )

    IMPORT_C TIntSizeOfObject()const

    Get the object size when it is internalize and externalised.

    Returns: the size of thisobject

    StartYear ( )

    IMPORT_C TIntStartYear()const

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

    Returns: The year.

    operator[] ( TInt )

    IMPORT_C TTzRule &operator[](TIntaIndex)

    Gets a time zone rule from this set.

    ParameterDescription
    aIndexThe index of the rule to be fetched.

    Returns: Reference to the time zone rule.