Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
calDuration Class Reference

#include <calDuration.h>

Inheritance diagram for calDuration:
Inheritance graph
[legend]
Collaboration diagram for calDuration:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 calDuration ()
 calDuration (const calDuration &cdt)
 calDuration (const struct icaldurationtype *const aDurationPtr)
void makeImmutable ()
 Make this calIDuration instance immutable.
calIDuration clone ()
 Clone this calIDuration instance into a new mutable object.
void addDuration (in calIDuration aDuration)
 Add a duration.
long compare (in calIDuration aOther)
 Compare with another duration.
void reset ()
 Reset this duration to 0.
void normalize ()
 Normalize the duration.
AUTF8String toString ()
 Return a string representation of this instance.
void toIcalDuration (in icaldurationtypeptr idt)

Public Attributes

readonly attribute boolean isMutable
 isMutable is true if this instance is modifiable.
attribute boolean isNegative
 Is Negative.
attribute short weeks
 Weeks.
attribute short days
 Days.
attribute short hours
 Hours.
attribute short minutes
 Minutes.
attribute short seconds
 Seconds.
attribute long inSeconds
 total duration in seconds
attribute ACString icalString
 This object as an iCalendar DURATION string.

Protected Member Functions

void FromIcalDuration (const struct icaldurationtype *const icald)

Protected Attributes

PRBool mImmutable

Detailed Description

Definition at line 47 of file calDuration.h.


Constructor & Destructor Documentation

Definition at line 58 of file calDuration.cpp.

    : mImmutable(PR_FALSE)
{
    Reset();
}

Definition at line 64 of file calDuration.cpp.

{
    mDuration.is_neg = cdt.mDuration.is_neg;
    mDuration.weeks = cdt.mDuration.weeks;
    mDuration.days = cdt.mDuration.days;
    mDuration.hours = cdt.mDuration.hours;
    mDuration.minutes = cdt.mDuration.minutes;
    mDuration.seconds = cdt.mDuration.seconds;

    // copies are always mutable
    mImmutable = PR_FALSE;
}

Definition at line 77 of file calDuration.cpp.

    : mImmutable(PR_FALSE)
{
    FromIcalDuration(aDurationPtr);
}

Here is the call graph for this function:


Member Function Documentation

void calIDuration::addDuration ( in calIDuration  aDuration) [inherited]

Add a duration.

Clone this calIDuration instance into a new mutable object.

long calIDuration::compare ( in calIDuration  aOther) [inherited]

Compare with another duration.

Parameters:
aOtherto be compared with this object
Returns:
-1, 0, 1 if this < aOther, this == aOther, or this > aOther, respectively.

Definition at line 302 of file calDuration.cpp.

{
    mDuration.is_neg  = icald->is_neg;
    mDuration.weeks   = icald->weeks;
    mDuration.days    = icald->days;
    mDuration.hours   = icald->hours;
    mDuration.minutes = icald->minutes;
    mDuration.seconds = icald->seconds;
    return;
}

Here is the caller graph for this function:

Make this calIDuration instance immutable.

void calIDuration::normalize ( ) [inherited]

Normalize the duration.

void calIDuration::reset ( ) [inherited]

Reset this duration to 0.

AUTF8String calIDuration::toString ( ) [inherited]

Return a string representation of this instance.


Member Data Documentation

attribute short calIDuration::days [inherited]

Days.

Definition at line 77 of file calIDuration.idl.

attribute short calIDuration::hours [inherited]

Hours.

Definition at line 82 of file calIDuration.idl.

attribute ACString calIDuration::icalString [inherited]

This object as an iCalendar DURATION string.

Definition at line 138 of file calIDuration.idl.

total duration in seconds

Definition at line 97 of file calIDuration.idl.

isMutable is true if this instance is modifiable.

If isMutable is false, any attempts to modify the object will throw CAL_ERROR_ITEM_IS_MUTABLE.

Definition at line 51 of file calIDuration.idl.

Is Negative.

Definition at line 67 of file calIDuration.idl.

Definition at line 61 of file calDuration.h.

attribute short calIDuration::minutes [inherited]

Minutes.

Definition at line 87 of file calIDuration.idl.

attribute short calIDuration::seconds [inherited]

Seconds.

Definition at line 92 of file calIDuration.idl.

attribute short calIDuration::weeks [inherited]

Weeks.

Definition at line 72 of file calIDuration.idl.


The documentation for this class was generated from the following files: