#include <vtzrules.h>
Link against:
tzclient.lib
class CTzRules : public CBase;
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.
Derivation
CBase
-
Base class for all classes to be instantiated on the heap.
CTzRules
- Encapsulates a collection of time zone rules, and includes the period covered by...
Members
Defined in CTzRules
:
Inherited from CBase
:
Construction and destruction
IMPORT_C static CTzRules* NewL();
Description
Creates a new time zone rules object.
Return value
CTzRules *
|
Pointer to the time zone rules.
|
|
IMPORT_C static CTzRules* NewL(TInt aStartYear, TInt aEndYear);
Description
Creates a new time zone rules object.
Parameters
TInt aStartYear |
The first year in which these time zone rules apply.
|
TInt aEndYear |
The last year in which these time zone rules apply.
|
|
Return value
CTzRules *
|
Pointer to the time zone rules.
|
|
IMPORT_C static CTzRules* NewL(RReadStream &aStream);
Description
Creates a new time zone rules object from a stream.
Parameters
RReadStream &aStream |
Stream with the time zone rules to be used to create a CTzRules object.
|
|
Return value
CTzRules *
|
Pointer to the time zone rules.
|
|
IMPORT_C ~CTzRules();
Description
Destructor.
RulesApply(const TTime &)const
IMPORT_C TBool RulesApply(const TTime &aTime) const;
Description
Queries the time zone rule set to see if they apply to a specified time.
Parameters
const TTime &aTime |
The time to be checked, using the same time reference used when constructing CTzRules.
|
|
Return value
TBool
|
ETrue if the time zone rules apply to the specified time. EFalse if not.
|
|
IMPORT_C void AddRuleL(TTzRule aRule);
Description
Adds a time zone rule to this set.
Parameters
TTzRule aRule |
The rule to be added.
|
|
IMPORT_C void RemoveRule(TInt aIndex);
Description
Removes a time zone rule from this set.
Parameters
TInt aIndex |
The index of the rule to be removed.
|
|
IMPORT_C TTzRule& operator[](TInt aIndex);
Description
Gets a time zone rule from this set.
Parameters
TInt aIndex |
The index of the rule to be fetched.
|
|
Return value
TTzRule &
|
Reference to the time zone rule.
|
|
IMPORT_C TInt Count() const;
Description
Gets the number of time zone rules (TTzRules) in this set.
Return value
TInt
|
The number of rules.
|
|
IMPORT_C TInt StartYear() const;
Description
Gets the first year in which the time zone rules apply.
Return value
IMPORT_C TInt EndYear() const;
Description
Gets the last year in which the time zone rules apply.
Return value
IMPORT_C void SetStartYear(TInt aYear);
Description
Sets the first year in which the time zone rules apply.
Parameters
IMPORT_C void SetEndYear(TInt aYear);
Description
Sets the last year in which the time zone rules apply.
Parameters
ExternalizeL(RWriteStream &)const
IMPORT_C void ExternalizeL(RWriteStream &aStream) const;
Description
Externalises time zone rules to a write stream.
Parameters
RWriteStream &aStream |
Stream to which the object should be externalised.
|
|
Leave codes
KErrArgument |
if the output stream size is invalid
|
|
InternalizeL(RReadStream &)
IMPORT_C void InternalizeL(RReadStream &aStream);
Description
Internalizes time zone rules from a read stream.
Parameters
RReadStream &aStream |
Stream from which the object should be internalised.
|
|
InitialStdTimeOffset()const
IMPORT_C TInt InitialStdTimeOffset() const;
Description
Gets the initial UTC offset for this set of time zone rules.
Return value
TInt
|
The offset in minutes.
|
|
SetInitialStdTimeOffset(TInt)
IMPORT_C void SetInitialStdTimeOffset(TInt aOffset);
Description
Sets the initial UTC offset for this set of time zone rules.
Parameters
TInt aOffset |
The offset in minutes.
|
|
ConvertToUtcL(TTime &)const
IMPORT_C void ConvertToUtcL(TTime &aLocalTime) const;
Description
Converts the received local time to UTC time.
Parameters
TTime &aLocalTime |
The time to convert. On return, this contains the converted time.
|
|
ConvertToLocalL(TTime &)const
IMPORT_C void ConvertToLocalL(TTime &aUtcTime) const;
Description
Converts the received UTC time to local time.
Parameters
TTime &aUtcTime |
The time to convert. On return, this contains the converted time.
|
|
IMPORT_C CTzRules* CloneL() const;
Description
Creates a copy of these timezone rules.
Return value
CTzRules *
|
A pointer to the CTzRules copy.
|
|
IsEqualTo(const CTzRules &)const
IMPORT_C TBool IsEqualTo(const CTzRules &aRules) const;
Description
Compares two sets of timezone rules.
Parameters
const CTzRules &aRules |
The timezone rules to compare with.
|
|
Return value
TBool
|
ETrue if the rules are identical. EFalse if not.
|
|
GetActualisedRulesL(CVTzActualisedRules &)const
IMPORT_C void GetActualisedRulesL(CVTzActualisedRules &aActRules) const;
Description
Get actualised rules for time zone rules.
Parameters
ConvertTime(CVTzActualisedRules &,TTime &,TTzTimeReference)const
IMPORT_C TInt ConvertTime(CVTzActualisedRules &aRules, TTime &aTime, TTzTimeReference aTimerRef) const;
Description
Converts between local (wall-clock) and UTC times.
Parameters
CVTzActualisedRules &aRules |
The actualised rules to use.
|
TTime &aTime |
The 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.
|
TTzTimeReference aTimerRef |
What aTime is expressed in.
|
|
Return value
TInt
|
KErrNone if successful, otherwise KErrNotSupported or KErrNotFound
|
|