Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <vtzrules.h>
Link against: tzclient.lib

Class CVTzActualisedRules

class CVTzActualisedRules : public CBase;

Description

Encapsulates a collection of the local time changes occurring during a range of years.

Derivation

Members

Defined in CVTzActualisedRules:

Inherited from CBase:


Construction and destruction


NewL(TInt,TInt)

IMPORT_C static CVTzActualisedRules* NewL(TInt aStartYear, TInt aEndYear);

Description

Factory method for CVTzActualisedRules objects. Creates a new instance of CVTzActualizedRules - an array of actualised rules (TVTzActualisedRule).

The array of rules can be populated later by invoking CTzRules::GetActualisedRulesL(CVTzActualisedRules &)const method.

Rules in the array are sorted ascending by rule's start time (TVTzActualisedRule::iTimeOfChange); The very first rule in the array, if present, defines "default standard rule" for the time zone indicating the STD time offset from UTC, in effect from the start of the first year (aStartYear).

Parameters

TInt aStartYear

TInt aEndYear

Return value

CVTzActualisedRules *

A pointer to the newly created rules.

Panic codes

RTz

10 if aStartYear is larger than aEndYear.


~CVTzActualisedRules()

IMPORT_C ~CVTzActualisedRules();

Description

Destructor.

[Top]


Member functions


AddRuleL(const TVTzActualisedRule &)

IMPORT_C void AddRuleL(const TVTzActualisedRule &aRule);

Description

Add an actualised rule to the collection.

Parameters

const TVTzActualisedRule &aRule

An actualised rule to be added into the collection.


Count()const

IMPORT_C TInt Count() const;

Description

Returns number of rules currently held in array of rules.

Return value

TInt

Number of rules.


operator[](TInt)const

IMPORT_C TVTzActualisedRule& operator[](TInt aIndex) const;

Description

Returns specified TVTzActualisedRule.

Parameters

TInt aIndex

Index of a rule

Return value

TVTzActualisedRule &

A reference to TVTzActualised rule at index aIndex.

Panic codes

RTz

4 if aIndex is out of bounds.


StartYear()const

IMPORT_C TInt StartYear() const;

Description

Returns min year of the year range the CVTzActualisedRules object describes the rules for. It is guaranteed that the array of rules does not contain any rules for years before that min year.

Return value

TInt

Start year (e.g. 1998).


EndYear()const

IMPORT_C TInt EndYear() const;

Description

Returns max year of the year range the CVTzActualisedRules object describes the rules for.

Return value

TInt

End year (e.g. 2005).


IsDaylightSavingOn(TTime &)const

IMPORT_C TBool IsDaylightSavingOn(TTime &aTime) const;

Description

Tells if Daylight Savings Applies for the current time zone at the current time

Parameters

TTime &aTime

The time of interest given in UTC.

Return value

TBool

EFalse if Daylight Savings does not apply (winter time) and ETrue if Daylight Savings does apply

Panic codes

RTz

5 if aTime is not covered by the current set of time zone rules.

RTz

7 if one of the time zone rules uses standard time reference.


GetOffsetFromRuleL(const TTime &,TTzTimeReference)const

IMPORT_C TInt GetOffsetFromRuleL(const TTime &aTime, TTzTimeReference aTimeRef) const;

Description

Receives a time. Finds out which of these rules applies at the received time and returns the offset in effect at the specified time.

Leaves with KErrNotFound, if it doesn't find the rule (i.e. aTime is earlier than the very first time in CVTzActualisedRules).

Parameters

const TTime &aTime

- time of interest

TTzTimeReference aTimeRef

- time reference for the aUserTime (UTC or wall-time) note: ETzStdTimeReference for aTimeRef is not supported, will panic with RTz::EPanicUnsupportedTimeReference.

Return value

TInt

TInt - offset from UTC (in minutes).